opencode/packages/plugin
Aiden Cline 1438073271
Some checks failed
check / typecheck (push) Waiting to run
deploy-files / deploy (push) Waiting to run
deploy-www / deploy (push) Waiting to run
deploy / deploy (push) Waiting to run
nix-eval / nix-eval (push) Waiting to run
nix-hashes / compute-hash (blacksmith-4vcpu-ubuntu-2404, x86_64-linux) (push) Waiting to run
nix-hashes / compute-hash (blacksmith-4vcpu-ubuntu-2404-arm, aarch64-linux) (push) Waiting to run
nix-hashes / compute-hash (macos-latest, aarch64-darwin) (push) Waiting to run
nix-hashes / update-hashes (push) Blocked by required conditions
publish / build-electron (map[bun_install_flags:--os=darwin --cpu=x64 host:macos-26-intel platform_flag:--mac --x64 target:x86_64-apple-darwin]) (push) Blocked by required conditions
publish / build-electron (map[host:blacksmith-4vcpu-ubuntu-2404 platform_flag:--linux target:x86_64-unknown-linux-gnu]) (push) Blocked by required conditions
publish / build-electron (map[host:blacksmith-4vcpu-ubuntu-2404-arm platform_flag:--linux --arm64 target:aarch64-unknown-linux-gnu]) (push) Blocked by required conditions
publish / build-electron (map[host:blacksmith-4vcpu-windows-2025 platform_flag:--win target:x86_64-pc-windows-msvc]) (push) Blocked by required conditions
publish / publish (push) Blocked by required conditions
publish / version (push) Waiting to run
publish / build-cli (push) Blocked by required conditions
publish / sign-cli-macos (push) Blocked by required conditions
publish / build-node-app-archive (push) Blocked by required conditions
publish / build-node-cli (map[bun_install_flags:--cpu=* host:blacksmith-4vcpu-windows-2025 target:windows-arm64]) (push) Blocked by required conditions
publish / build-node-cli (map[host:blacksmith-4vcpu-ubuntu-2404 target:linux-x64]) (push) Blocked by required conditions
publish / build-node-cli (map[host:blacksmith-4vcpu-ubuntu-2404-arm target:linux-arm64]) (push) Blocked by required conditions
publish / build-node-cli (map[host:blacksmith-4vcpu-windows-2025 target:windows-x64]) (push) Blocked by required conditions
publish / build-node-cli (map[host:macos-26 target:darwin-arm64]) (push) Blocked by required conditions
publish / sign-cli-windows (push) Blocked by required conditions
publish / build-electron (map[bun_install_flags:--cpu=* host:windows-2025 platform_flag:--win --arm64 target:aarch64-pc-windows-msvc]) (push) Blocked by required conditions
publish / build-electron (map[bun_install_flags:--os=darwin --cpu=arm64 host:macos-26 platform_flag:--mac --arm64 target:aarch64-apple-darwin]) (push) Blocked by required conditions
publish / notify-discord-v2 (push) Blocked by required conditions
storybook / storybook build (push) Waiting to run
test / affected packages (push) Waiting to run
test / unit (linux) (push) Waiting to run
test / unit (windows) (push) Waiting to run
test / e2e (linux) (push) Blocked by required conditions
test / e2e (windows) (push) Blocked by required conditions
deploy-changelog / deploy (push) Has been cancelled
fix(plugin): return Promise tool throws as tool failures (#54913)
2026-10-12 15:37:34 -05:00
..
script refactor(packages): migrate to the opencode npm scope (#47852) 2026-09-07 17:19:33 -04:00
src fix(plugin): return Promise tool throws as tool failures (#54913) 2026-10-12 15:37:34 -05:00
test fix(cli): give plugins the host's Effect (#53422) 2026-10-07 16:57:24 -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 sync release versions for v2.0.27 [skip ci] 2026-10-12 04:17:06 +00:00
README.md chore: upgrade Effect to 4.0.1 (#54198) 2026-10-10 00:55:24 -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

When the OpenCode CLI loads server or TUI plugins, it resolves imports of effect, exported effect/* subpaths, and @opencode/plugin entrypoints (including imports from dependencies inside a plugin's node_modules) to the host's runtime module instances so fibers, loggers, and Schema parsers share one copy.

  • Declare "effect": "^4.0.0" as a peerDependency (and devDependency for local type-checking and testing) rather than a bundled runtime dependency.
  • Do not bundle effect into published plugin files; if you build with a bundler, keep effect and effect/* external. Two copies of effect do not share fiber, logger, or Schema internals.
  • Plugins and their node_modules dependencies always receive OpenCode's host effect instance. Use effect APIs and module paths compatible with the OpenCode release you target; dependencies built on another effect major (such as Effect 3) are not supported.
  • Only public effect subpaths are provided. A plugin that imports one of Effect's private internal modules fails to load with an error naming the path.
  • The compiled OpenCode binary does not include the Scalar and Swagger UI assets used by Effect's HTTP API docs pages; serving those pages from a plugin shows a notice instead.