From 180d16b9771e481ec13e654d86400e130665ad6e Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Fri, 5 Dec 2025 04:08:59 +0900 Subject: [PATCH] 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 --- package.json | 2 +- src/hooks/comment-checker/index.ts | 6 +----- src/hooks/index.ts | 10 +++++----- src/index.ts | 1 - 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index cff2f80..9fdfd3b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "oh-my-opencode", - "version": "0.1.2", + "version": "0.1.3", "description": "OpenCode plugin - custom agents (oracle, librarian) and enhanced features", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/hooks/comment-checker/index.ts b/src/hooks/comment-checker/index.ts index 33ef234..c40c444 100644 --- a/src/hooks/comment-checker/index.ts +++ b/src/hooks/comment-checker/index.ts @@ -94,8 +94,4 @@ export function createCommentCheckerHooks() { } } -export * from "./types" -export * from "./constants" -export * from "./detector" -export * from "./filters" -export * from "./output" + diff --git a/src/hooks/index.ts b/src/hooks/index.ts index 177ddd4..b0b2958 100644 --- a/src/hooks/index.ts +++ b/src/hooks/index.ts @@ -1,5 +1,5 @@ -export * from "./todo-continuation-enforcer" -export * from "./context-window-monitor" -export * from "./session-notification" -export * from "./session-recovery" -export * from "./comment-checker" +export { createTodoContinuationEnforcer } from "./todo-continuation-enforcer" +export { createContextWindowMonitorHook } from "./context-window-monitor" +export { createSessionNotification } from "./session-notification" +export { createSessionRecoveryHook } from "./session-recovery" +export { createCommentCheckerHooks } from "./comment-checker" diff --git a/src/index.ts b/src/index.ts index 7190233..04fe014 100644 --- a/src/index.ts +++ b/src/index.ts @@ -190,7 +190,6 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => { export default OhMyOpenCodePlugin -export { OhMyOpenCodeConfigSchema } from "./config" export type { OhMyOpenCodeConfig, AgentName,