Skip to content

Commit ae7099f

Browse files
fix(opencode): install plugin SDK at runtime (#2574)
The OpenCode plugin imports @opencode-ai/plugin/tool from its built dist entrypoint, so the package must be present in OpenCode's isolated plugin cache. Keeping it only as a peer dependency lets npm skip it during plugin installation, which can make the plugin fail to load with ERR_MODULE_NOT_FOUND. Move @opencode-ai/plugin into dependencies and remove the peer-only declaration. Keep @vectorize-io/hindsight-client as a runtime dependency, and sync package-lock.json so npm installs the cache tree needed by OpenCode. Verified with npm run build, npm pack --json, and a local opencode plugin install from the generated tarball. The generated cache contained both runtime dependencies and direct import of the plugin entrypoint succeeded.
1 parent 56db6d7 commit ae7099f

2 files changed

Lines changed: 2 additions & 11 deletions

File tree

hindsight-integrations/opencode/package-lock.json

Lines changed: 1 addition & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

hindsight-integrations/opencode/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,11 @@
4141
"test:e2e": "HINDSIGHT_LIVE_E2E=1 vitest run",
4242
"prepublishOnly": "npm run clean && npm run build"
4343
},
44-
"peerDependencies": {
45-
"@opencode-ai/plugin": ">=1.0.0"
46-
},
4744
"dependencies": {
45+
"@opencode-ai/plugin": "^1.3.13",
4846
"@vectorize-io/hindsight-client": "^0.4.19"
4947
},
5048
"devDependencies": {
51-
"@opencode-ai/plugin": "^1.3.13",
5249
"@types/node": "^22.0.0",
5350
"tsup": "^8.5.1",
5451
"typescript": "^5.7.0",

0 commit comments

Comments
 (0)