mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-26 23:28:43 +00:00
A step lists the browser tools only if its session holds the desktop's grant when the step selects its tools. After the server restarts or unloads a location, the desktop attaches again only once it sees the session run, about 100 ms after that step selected its tools, so the step ran without the browser and the model was told it was gone. - core: the experimental.step.before session hook runs before a step selects its agent, tools and instructions, as the MCP startup grace does for servers that are still connecting. - plugin-browser: a session whose attachment ended is expected. Its next step waits for the desktop, 2 s at most and once; a step also waits for an attach that is in flight. |
||
|---|---|---|
| .. | ||
| script | ||
| src | ||
| test | ||
| .gitignore | ||
| AGENTS.md | ||
| package.json | ||
| README.md | ||
| tsconfig.build.json | ||
| tsconfig.json | ||
@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@opencode/plugin/gui/browser- desktop pane contract, including experimental scoped tab handles
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 apeerDependency(anddevDependencyfor local type-checking and testing) rather than a bundled runtime dependency. - Do not bundle
effectinto published plugin files; if you build with a bundler, keepeffectandeffect/*external. Two copies ofeffectdo not share fiber, logger, orSchemainternals. - Plugins and their
node_modulesdependencies always receive OpenCode's hosteffectinstance. UseeffectAPIs and module paths compatible with the OpenCode release you target; dependencies built on anothereffectmajor (such as Effect 3) are not supported. - Only public
effectsubpaths are provided. A plugin that imports one of Effect's privateinternalmodules 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.