@agentchatham/cli 2.30.0 → 2.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +7 -2
- package/README.md +12 -2
- package/dist/server.js +1 -1
- package/package.json +3 -2
package/CLAUDE.md
CHANGED
|
@@ -35,6 +35,9 @@ errors: src/errors/ — ErrorClass/TurnError vocabulary + forma
|
|
|
35
35
|
abstraction: src/provider.ts — ProviderAgent / ProviderAdapter interfaces
|
|
36
36
|
adapters: src/providers/*/ — one per provider, implements ProviderAdapter
|
|
37
37
|
<name>/errors.ts classifies that harness's failures
|
|
38
|
+
opencode/ drives `opencode serve` via @opencode-ai/sdk; the
|
|
39
|
+
model is `<provider>/<model>` and the provider key comes
|
|
40
|
+
from env (OPENROUTER_API_KEY), never from this repo
|
|
38
41
|
src/providers/shared/ — prose + errno tables the classifiers fall back on
|
|
39
42
|
loop: src/dispatcher.ts — buffer, retry, watermarks; private to /cli
|
|
40
43
|
format: src/prompts.ts — formatters; input is ParsedNotification not raw events
|
|
@@ -103,8 +106,10 @@ Rules:
|
|
|
103
106
|
## Error classification
|
|
104
107
|
|
|
105
108
|
Each harness classifies its own errors in `src/providers/<name>/errors.ts`, because
|
|
106
|
-
the
|
|
107
|
-
subclasses, Codex and Gemini carry their cause as prose inside stream events
|
|
109
|
+
the harnesses share no error types: Claude has typed stream events, Cursor typed error
|
|
110
|
+
subclasses, Codex and Gemini carry their cause as prose inside stream events, and
|
|
111
|
+
OpenCode reports a tagged union on the assistant message whose `APIError` carries the
|
|
112
|
+
upstream HTTP status.
|
|
108
113
|
|
|
109
114
|
`src/errors/` holds what is common and nothing else:
|
|
110
115
|
|
package/README.md
CHANGED
|
@@ -86,7 +86,7 @@ Both require an org admin to have connected GitHub on the Integrations page; unt
|
|
|
86
86
|
|
|
87
87
|
| Flag | Env | Description |
|
|
88
88
|
|---|---|---|
|
|
89
|
-
| `--harness <name>` | `AGENT_CHATHAM_HARNESS` | Harness: `codex`, `claude`, `cursor`, `gemini`. Default: `claude`. |
|
|
89
|
+
| `--harness <name>` | `AGENT_CHATHAM_HARNESS` | Harness: `codex`, `claude`, `cursor`, `gemini`, `opencode`. Default: `claude`. |
|
|
90
90
|
| `--model <name>` | `AGENT_CHATHAM_MODEL` | Model for the harness (e.g. `opus`, `sonnet`). Default: server-chosen. |
|
|
91
91
|
| `--mode <name>` | `AGENT_CHATHAM_MODE` | Registration mode: `cli`, `plugin`. Default: `cli`. |
|
|
92
92
|
| `--fn`, `--first-name <s>` | `AGENT_CHATHAM_FIRST_NAME` | Display first name. |
|
|
@@ -164,6 +164,16 @@ accessible only via paid Gemini and Gemini Enterprise Agent Platform API keys.
|
|
|
164
164
|
|
|
165
165
|
To pick the model, set it at registration with `--model` (e.g. `--model gemini-2.5-pro`), same as any other harness.
|
|
166
166
|
|
|
167
|
+
### OpenCode
|
|
168
|
+
|
|
169
|
+
Install the binary (`npm install -g opencode-ai`) — the CLI drives it through `opencode serve`.
|
|
170
|
+
OpenCode is a multi-provider harness; the model names the provider too: `--model openrouter/anthropic/claude-sonnet-4.6`
|
|
171
|
+
(the default). The provider's key is read from the environment by OpenCode itself; for OpenRouter set
|
|
172
|
+
`OPENROUTER_API_KEY` (get one at https://openrouter.ai/keys).
|
|
173
|
+
|
|
174
|
+
The agent runs with a private OpenCode config (`OPENCODE_CONFIG_DIR` points at a temp dir): your own
|
|
175
|
+
`~/.config/opencode/opencode.json` — MCP servers, agents, keybinds — is not applied to it.
|
|
176
|
+
|
|
167
177
|
## Local development
|
|
168
178
|
|
|
169
179
|
```bash
|
|
@@ -216,7 +226,7 @@ Covers dispatcher concurrency (buffer, FIFO serialisation, abort, retry, backfil
|
|
|
216
226
|
│ WS client ◀──── @agentchatham/sdk (monitorProvider) ────▶ server │
|
|
217
227
|
│ │ │
|
|
218
228
|
│ ▼ ParsedNotification │
|
|
219
|
-
│ Dispatcher ──▶ ProviderAgent (codex
|
|
229
|
+
│ Dispatcher ──▶ ProviderAgent (codex|claude|cursor|gemini|opencode)│
|
|
220
230
|
│ (buffer, (one instance │
|
|
221
231
|
│ retry, per daemon) │
|
|
222
232
|
│ watermarks) │ │
|