Skip to content

Commit 180d16b

Browse files
committed
fix: prevent plugin crash by removing non-function exports from barrel files
BREAKING: OpenCode plugin loader calls all exports as functions. Exporting non-function values (schemas, constants, types) causes TypeError. Changes: - Remove OhMyOpenCodeConfigSchema export from root index.ts - Replace 'export *' with explicit function exports in hooks/index.ts - Remove 'export *' from comment-checker/index.ts
1 parent eba89a6 commit 180d16b

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "oh-my-opencode",
3-
"version": "0.1.2",
3+
"version": "0.1.3",
44
"description": "OpenCode plugin - custom agents (oracle, librarian) and enhanced features",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/hooks/comment-checker/index.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,4 @@ export function createCommentCheckerHooks() {
9494
}
9595
}
9696

97-
export * from "./types"
98-
export * from "./constants"
99-
export * from "./detector"
100-
export * from "./filters"
101-
export * from "./output"
97+

src/hooks/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
export * from "./todo-continuation-enforcer"
2-
export * from "./context-window-monitor"
3-
export * from "./session-notification"
4-
export * from "./session-recovery"
5-
export * from "./comment-checker"
1+
export { createTodoContinuationEnforcer } from "./todo-continuation-enforcer"
2+
export { createContextWindowMonitorHook } from "./context-window-monitor"
3+
export { createSessionNotification } from "./session-notification"
4+
export { createSessionRecoveryHook } from "./session-recovery"
5+
export { createCommentCheckerHooks } from "./comment-checker"

src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
190190

191191
export default OhMyOpenCodePlugin
192192

193-
export { OhMyOpenCodeConfigSchema } from "./config"
194193
export type {
195194
OhMyOpenCodeConfig,
196195
AgentName,

0 commit comments

Comments
 (0)