chore: update opencode api to v2
Release / release (push) Failing after 5s

This commit is contained in:
2026-09-12 10:29:24 +02:00
parent 411cdd13ff
commit c48fe99b96
13 changed files with 740 additions and 37 deletions
+20 -2
View File
@@ -4,7 +4,7 @@ OpenCode V2 plugin providing a `coordinate` agent and fast/good/deep worker pair
## Install the latest release
Requires **OpenCode V2** (`opencode2`), **Bun 1.3.14+**, Bash, curl, jq, and `sha256sum` (Linux/WSL). The native plugin API is pinned to `@opencode/plugin@0.0.0-beta-19378`; use the matching OpenCode beta.
Requires **OpenCode V2 2.0.2** (`opencode2`), **Bun 1.3.14+**, Bash, curl, jq, and `sha256sum` (Linux/WSL). The native plugin API is pinned to `@opencode/plugin@2.0.2`; use the matching stable OpenCode release.
Run the installer without sudo:
@@ -26,6 +26,24 @@ The installer atomically replaces the package directory at `plugins/stanp-openco
Restart `opencode2` after installation (or `opencode2 service restart` for an existing service). Connect your provider, then select `coordinate` in the agent picker. The default configuration uses OpenAI GPT models; agents are only enabled when the required models are available.
## Install from a local checkout
To build and install the current checkout instead of downloading a release, install Bash, jq, and **Bun 1.3.14+**, then run:
```sh
bash /path/to/stanp-opencode/install-local.sh
```
The script may be invoked from any working directory. It runs `bun install --frozen-lockfile` (which may access the package registry) and `bun run build` in the checkout containing the script on every run. It validates the native V2 and TUI bundles, copies them into the same installed package layout as the release installer, and preserves existing plugin options, unrelated `opencode.json` settings, and `opencode.jsonc`. Dependency installation, build, validation, and configuration parsing failures leave the currently installed plugin and configuration untouched.
The configuration directory defaults to `~/.config/opencode`, respects `XDG_CONFIG_HOME`, and can be overridden explicitly:
```sh
OPENCODE_CONFIG_DIR=/path/to/opencode-config bash /path/to/stanp-opencode/install-local.sh
```
Restart `opencode2` after installation (or `opencode2 service restart`).
## Configure
See [GPT configuration](examples/gpt.opencode.jsonc) and [custom model assignments](examples/custom.opencode.jsonc). When using the installer, point the example's plugin package entry at the installed package directory rather than the unpublished npm package name. Configured local plugin paths must be directories; pointing at `plugins/stanp-opencode.js` causes OpenCode to reject that configured entry and auto-load the file without its options:
@@ -47,7 +65,7 @@ See [GPT configuration](examples/gpt.opencode.jsonc) and [custom model assignmen
This relative path assumes the configuration file is in the selected global config directory. Use an absolute path in project configuration. Remove any old V1 `plugin` entry when migrating; V2 uses `plugins`. `lunaPriority` requests priority service where supported and can increase cost; set it to `false` to use the provider default.
The plugin supplies session-local `todoread` and `todowrite` tools when no other plugin provides them. In this pinned V2 beta, custom tools cannot open permission prompts: an `ask` or `deny` rule blocks these todo tools rather than bypassing the rule. Explicitly allow them if you want to use them.
The plugin supplies session-local `todoread` and `todowrite` tools when no other plugin provides them. In OpenCode V2 2.0.2, custom tools cannot open permission prompts: an `ask` or `deny` rule blocks these todo tools rather than bypassing the rule. Explicitly allow them if you want to use them.
When an MCP server named `codegraph` is already configured, its tools are exposed directly to `coordinate` and retain the built-in `build` agent's matching allow, ask, and deny rules. The plugin does not configure or start a missing server, and no other MCP server is exposed this way.