From 231b3e5a2523092a7a66e154f690d2eb4a44e365 Mon Sep 17 00:00:00 2001 From: Gabriel Ribeiro Date: Thu, 25 Jun 2026 17:58:59 -0300 Subject: [PATCH 1/2] fix: export V1 PluginModule shape for OpenCode 1.17.x compatibility OpenCode 1.17.x loads plugins that conform to the V1 PluginModule contract: { id?: string; server: Plugin }. The previous bare-function default export was silently rejected by the loader, so oc-sync never ran. Wrap the existing OpencodeSyncPlugin in the expected object shape so the plugin is discovered and loaded on startup. --- src/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index dfd504c..04c234d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,5 +7,6 @@ import { OpencodeSyncPlugin } from './plugin/index.js'; -// Only export the plugin as default - OpenCode expects a single default export -export default OpencodeSyncPlugin; +// OpenCode 1.17.x expects a V1 PluginModule: { id?, server: Plugin } +// Wrap the bare plugin function so the loader recognizes it. +export default { id: 'oc-sync', server: OpencodeSyncPlugin }; From 496cca691b16f7aa880211ab283ad907c3100525 Mon Sep 17 00:00:00 2001 From: Gabriel Ribeiro Date: Thu, 25 Jun 2026 18:21:00 -0300 Subject: [PATCH 2/2] build: compile TypeScript during prepare for git installs npm runs prepare when installing from a Git URL. The previous prepare script only ran husky, so dist/ was never generated and git-based installs failed. Run the TypeScript compiler instead so the package is usable straight from a branch or fork. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0838c56..eb46557 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "typecheck": "tsc --noEmit", "check": "npm run typecheck && npm run lint && npm run format:check", "prepublishOnly": "npm run check && npm run clean && npm run build", - "prepare": "husky" + "prepare": "npm run build" }, "lint-staged": { "src/**/*.ts": [