opencode/packages/plugin
2026-10-04 23:14:49 -07:00
..
script refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
src fix(plugin): load Effect from the host for plugins 2026-10-04 23:14:49 -07:00
test fix(plugin): load Effect from the host for plugins 2026-10-04 23:14:49 -07:00
.gitignore wip: plugins 2025-08-02 18:50:19 -04:00
AGENTS.md refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
package.json fix(plugin): load Effect from the host for plugins 2026-10-04 23:14:49 -07:00
README.md fix(plugin): load Effect from the host for plugins 2026-10-04 23:14:49 -07:00
sst-env.d.ts zen: update sst version 2026-02-18 13:54:23 -05:00
tsconfig.build.json fix(plugin): restore package publishing 2026-07-09 22:18:58 -04:00
tsconfig.json chore: enable noUnusedLocals in already-clean packages (#52849) 2026-10-02 15:23:50 -07:00

@opencode/plugin

Authoring interfaces and runtime loader support for OpenCode V2 plugins:

  • @opencode/plugin — Promise plugin API
  • @opencode/plugin/effect — Effect plugin API
  • @opencode/plugin/rpc — portable RPC contract definitions
  • @opencode/plugin/tui — terminal UI plugin API

Packaging And Runtime effect

OpenCode resolves imports of effect, every exported effect/* subpath, and @opencode/plugin entrypoints (including transitive imports from dependencies inside a plugin's node_modules) to the host's runtime module instances.

  • Declare effect as a peerDependency (and devDependency for local type-checking/testing) rather than bundling it.
  • Do not bundle effect into published plugin files; if you build with a bundler, keep effect and effect/* external. OpenCode detects and rejects Effect plugins whose returned Effect comes from a bundled copy.
  • At runtime, plugins execute against the host OpenCode release's effect version, so plugins must use effect APIs and module paths compatible with the OpenCode release they target.