|
| 1 | +# COMMITS.md — chio-open-code-plugin |
| 2 | + |
| 3 | +Native OpenCode plugin (`@<NPM_SCOPE>/opencode-plugin`). Scaffolds, |
| 4 | +wraps, and ships bonded agents without leaving the TUI. OpenCode's |
| 5 | +plugin API has no slash-command surface — commands surface as |
| 6 | +first-class custom tools. Target first ship tag: `v0.2.0`. |
| 7 | + |
| 8 | +--- |
| 9 | + |
| 10 | +## 1. chore: scaffold OpenCode plugin package |
| 11 | + |
| 12 | +**Body.** `package.json` (`@chio/opencode-plugin`, exports the |
| 13 | +`ChioPlugin` default), `tsconfig.json`, `LICENSE`, `.gitignore`, |
| 14 | +`bun.lock`. Depends on `@chio/bridge` via workspace and |
| 15 | +`@opencode-ai/plugin` as the plugin API peer. Wave 1. |
| 16 | + |
| 17 | +**Files.** |
| 18 | + |
| 19 | +- `package.json`, `bun.lock` |
| 20 | +- `tsconfig.json` |
| 21 | +- `LICENSE`, `.gitignore` |
| 22 | + |
| 23 | +--- |
| 24 | + |
| 25 | +## 2. feat: eight custom tools backed by ChioBridge |
| 26 | + |
| 27 | +**Body.** Exposes eight `chio_*` tools via the OpenCode custom-tool |
| 28 | +API: `chio_init`, `chio_wrap` (wraps an MCP server via |
| 29 | +`chio mcp serve-http -- <cmd>`), `chio_guard_add`, `chio_policy_lint`, |
| 30 | +`chio_replay`, `chio_deploy`, `chio_doctor`, `chio_status`. Each |
| 31 | +maps to a real `ChioBridge` call or a real `chio` subprocess. |
| 32 | +`tool.execute.before` intercepts every tool invocation and calls |
| 33 | +`ChioBridge.check` — deny stamps args + surfaces through |
| 34 | +`tool.execute.after`. Bond status is prefixed into every mediated |
| 35 | +tool result's `title` (OpenCode's plugin API exposes no status-bar |
| 36 | +primitive). Wave 1 rewrite against the host schema. |
| 37 | + |
| 38 | +**Files.** |
| 39 | + |
| 40 | +- `src/index.ts` — plugin entry + lifecycle hooks. |
| 41 | +- `src/tools/*.ts` — one file per custom tool. |
| 42 | +- `src/hooks/*.ts` — `tool.execute.before`, `tool.execute.after`, |
| 43 | + `session.autobond`. |
| 44 | +- `src/lib/*.ts` — bridge construction, status-line renderer, |
| 45 | + receipts.db helper. |
| 46 | +- `templates/` — six preset policies (`tool-agent`, `code-agent`, |
| 47 | + `research-agent`, `support-agent`, `trader`, `release-engineer`). |
| 48 | + |
| 49 | +--- |
| 50 | + |
| 51 | +## 3. test: unit coverage and chio-backed smoke |
| 52 | + |
| 53 | +**Body.** Unit tests cover each tool's argument parsing, the |
| 54 | +`tool.execute.before` fail-closed path, status-line rendering, and |
| 55 | +preset-policy HushSpec parse. `smoke.sh` registers the plugin with |
| 56 | +a local `opencode.json`, bonds a session, drives `chio_init` → |
| 57 | +`chio_wrap` → `chio_replay` end-to-end against `chio-test-harness`. |
| 58 | +Wave 1 + ST.2.x. |
| 59 | + |
| 60 | +**Files.** |
| 61 | + |
| 62 | +- `test/*.test.ts` |
| 63 | +- `smoke/` — manual smoke fixtures. |
| 64 | +- `smoke.sh` |
| 65 | +- `SMOKE.md` |
| 66 | + |
| 67 | +--- |
| 68 | + |
| 69 | +## 4. feat: chio rename, CHIO_MODE env, extensions.chio presets |
| 70 | + |
| 71 | +**Body.** Imports + bridge construction switch to `ChioBridge` / |
| 72 | +`ChioClient`. Env var ladder `CHIO_MODE=daemon|cli` + |
| 73 | +`CHIO_MCP_EDGE_URL` + `CHIO_TRUST_URL` + `CHIO_TRUST_TOKEN`. |
| 74 | +Preset policies move `velocity`, `human_in_loop`, `market_hours`, |
| 75 | +`signing`, `k8s_namespaces`, `rollback`, `capability`, `budget` |
| 76 | +under `extensions.chio.*` until upstream chio accepts them as |
| 77 | +first-class rule keys (see `ARC_UPSTREAM_PROPOSAL.md`). Wave 5.0. |
| 78 | + |
| 79 | +**Files.** |
| 80 | + |
| 81 | +- `src/index.ts`, `src/lib/*.ts` — bridge construction rename. |
| 82 | +- `templates/*.yaml` — preset migration. |
| 83 | + |
| 84 | +--- |
| 85 | + |
| 86 | +## 5. ci: lint, typecheck, and chio-backed smoke |
| 87 | + |
| 88 | +**Body.** GitHub Actions workflow parallel to the other plugins' |
| 89 | +ci.yml. Wave 5.1. |
| 90 | + |
| 91 | +**Files.** |
| 92 | + |
| 93 | +- `.github/workflows/ci.yml` |
| 94 | + |
| 95 | +--- |
| 96 | + |
| 97 | +## 6. ci: add SLSA L3 release workflow |
| 98 | + |
| 99 | +**Body.** Tag-triggered `npm publish --provenance` to |
| 100 | +`@<NPM_SCOPE>/opencode-plugin` with SLSA L3 attestation via the |
| 101 | +`publish-chio` composite. Wave 5.5. |
| 102 | + |
| 103 | +**Files.** |
| 104 | + |
| 105 | +- `.github/workflows/release.yml` |
| 106 | + |
| 107 | +--- |
| 108 | + |
| 109 | +## 7. docs: README with plugin contract, custom-tool table, preset map |
| 110 | + |
| 111 | +**Body.** Documents the install flow (`cargo install --path |
| 112 | +crates/chio-cli` or `brew install chio-protocol/tap/chio` once the |
| 113 | +tap ships), the custom-tool table, the six presets, the status-line |
| 114 | +convention, and the real `Plugin` contract against |
| 115 | +`@opencode-ai/plugin@1.14.19`. Wave 5.2. |
| 116 | + |
| 117 | +**Files.** |
| 118 | + |
| 119 | +- `README.md` |
| 120 | +- `VERIFY.md` |
0 commit comments