From b0cd531a3ed406ebccf4ae399c3af83e047543bf Mon Sep 17 00:00:00 2001 From: van3hardy Date: Mon, 10 Aug 2026 23:13:50 -0400 Subject: [PATCH] fix(plugin): export only plugin function for opencode loader compatibility opencode's legacy plugin loader (getLegacyPlugins) iterates every module export and throws 'Plugin export is not a function' if any export is not a plugin function. The bundle exported VERSION (string) and metadata (object) alongside the plugin, breaking plugin loading. Export only the plugin function so opencode can load ecc-universal. --- .opencode/index.ts | 46 +++------------------------------------------- 1 file changed, 3 insertions(+), 43 deletions(-) diff --git a/.opencode/index.ts b/.opencode/index.ts index 9bb5bf0cb..fa6cadc58 100644 --- a/.opencode/index.ts +++ b/.opencode/index.ts @@ -35,46 +35,6 @@ */ // Export the main plugin -export { ECCHooksPlugin, default } from "./plugins/index.js" - -// Export individual components for selective use -export * from "./plugins/index.js" - -// Version export -export const VERSION = "1.6.0" - -// Plugin metadata -export const metadata = { - name: "ecc-universal", - version: VERSION, - description: "ECC plugin for OpenCode", - author: "affaan-m", - features: { - agents: 13, - commands: 31, - skills: 37, - configAssets: true, - hookEvents: [ - "file.edited", - "tool.execute.before", - "tool.execute.after", - "session.created", - "session.idle", - "session.deleted", - "file.watcher.updated", - "permission.ask", - "todo.updated", - "shell.env", - "experimental.session.compacting", - ], - customTools: [ - "run-tests", - "check-coverage", - "security-audit", - "format-code", - "lint-check", - "git-summary", - "changed-files", - ], - }, -} +// opencode's legacy plugin loader iterates every module export and throws if +// any is not a plugin function, so only the plugin function may be exported. +export { default } from "./plugins/index.js"