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.
This commit is contained in:
van3hardy
2026-08-29 13:40:56 -04:00
committed by haelyra
parent fcef85cb87
commit b0cd531a3e
+3 -43
View File
@@ -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"