Native OpenCode plugin (@<NPM_SCOPE>/opencode-plugin). Scaffolds,
wraps, and ships bonded agents without leaving the TUI. OpenCode's
plugin API has no slash-command surface — commands surface as
first-class custom tools. Target first ship tag: v0.2.0.
Body. package.json (@chio/opencode-plugin, exports the
ChioPlugin default), tsconfig.json, LICENSE, .gitignore,
bun.lock. Depends on @chio/bridge via workspace and
@opencode-ai/plugin as the plugin API peer. Wave 1.
Files.
package.json,bun.locktsconfig.jsonLICENSE,.gitignore
Body. Exposes eight chio_* tools via the OpenCode custom-tool
API: chio_init, chio_wrap (wraps an MCP server via
chio mcp serve-http -- <cmd>), chio_guard_add, chio_policy_lint,
chio_replay, chio_deploy, chio_doctor, chio_status. Each
maps to a real ChioBridge call or a real chio subprocess.
tool.execute.before intercepts every tool invocation and calls
ChioBridge.check — deny stamps args + surfaces through
tool.execute.after. Bond status is prefixed into every mediated
tool result's title (OpenCode's plugin API exposes no status-bar
primitive). Wave 1 rewrite against the host schema.
Files.
src/index.ts— plugin entry + lifecycle hooks.src/tools/*.ts— one file per custom tool.src/hooks/*.ts—tool.execute.before,tool.execute.after,session.autobond.src/lib/*.ts— bridge construction, status-line renderer, receipts.db helper.templates/— six preset policies (tool-agent,code-agent,research-agent,support-agent,trader,release-engineer).
Body. Unit tests cover each tool's argument parsing, the
tool.execute.before fail-closed path, status-line rendering, and
preset-policy HushSpec parse. smoke.sh registers the plugin with
a local opencode.json, bonds a session, drives chio_init →
chio_wrap → chio_replay end-to-end against chio-test-harness.
Wave 1 + ST.2.x.
Files.
test/*.test.tssmoke/— manual smoke fixtures.smoke.shSMOKE.md
Body. Imports + bridge construction switch to ChioBridge /
ChioClient. Env var ladder CHIO_MODE=daemon|cli +
CHIO_MCP_EDGE_URL + CHIO_TRUST_URL + CHIO_TRUST_TOKEN.
Preset policies move velocity, human_in_loop, market_hours,
signing, k8s_namespaces, rollback, capability, budget
under extensions.chio.* until upstream chio accepts them as
first-class rule keys (see ARC_UPSTREAM_PROPOSAL.md). Wave 5.0.
Files.
src/index.ts,src/lib/*.ts— bridge construction rename.templates/*.yaml— preset migration.
Body. GitHub Actions workflow parallel to the other plugins' ci.yml. Wave 5.1.
Files.
.github/workflows/ci.yml
Body. Tag-triggered npm publish --provenance to
@<NPM_SCOPE>/opencode-plugin with SLSA L3 attestation via the
publish-chio composite. Wave 5.5.
Files.
.github/workflows/release.yml
Body. Documents the install flow (cargo install --path crates/chio-cli or brew install chio-protocol/tap/chio once the
tap ships), the custom-tool table, the six presets, the status-line
convention, and the real Plugin contract against
@opencode-ai/plugin@1.14.19. Wave 5.2.
Files.
README.mdVERIFY.md