opencode-claude-code-acpbridge 0.10.1 → 0.11.1
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/CHANGELOG.md +61 -0
- package/README.md +80 -46
- package/dist/acp/claude-config.d.ts +3 -2
- package/dist/acp/claude-config.d.ts.map +1 -1
- package/dist/acp/claude-config.js +5 -1
- package/dist/acp/claude-config.js.map +1 -1
- package/dist/plugin/compat.d.ts +1 -1
- package/dist/plugin/compat.d.ts.map +1 -1
- package/dist/plugin/compat.js +1 -1
- package/dist/plugin/compat.js.map +1 -1
- package/dist/plugin/discover.d.ts.map +1 -1
- package/dist/plugin/discover.js +9 -6
- package/dist/plugin/discover.js.map +1 -1
- package/dist/plugin/index.d.ts +8 -0
- package/dist/plugin/index.d.ts.map +1 -1
- package/dist/plugin/index.js +115 -27
- package/dist/plugin/index.js.map +1 -1
- package/dist/plugin/pairing.d.ts +66 -0
- package/dist/plugin/pairing.d.ts.map +1 -0
- package/dist/plugin/pairing.js +110 -0
- package/dist/plugin/pairing.js.map +1 -0
- package/dist/provider/factory.d.ts.map +1 -1
- package/dist/provider/factory.js +10 -1
- package/dist/provider/factory.js.map +1 -1
- package/dist/provider/model.d.ts +28 -0
- package/dist/provider/model.d.ts.map +1 -1
- package/dist/provider/model.js +215 -20
- package/dist/provider/model.js.map +1 -1
- package/docs/DEVELOPMENT.md +36 -13
- package/examples/01-minimal.jsonc +7 -5
- package/examples/02-per-agent-permissions.jsonc +2 -2
- package/examples/04-model-and-effort.jsonc +5 -4
- package/examples/05-custom-agents.jsonc +1 -1
- package/examples/08-permission-bridge.jsonc +2 -2
- package/examples/README.md +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,67 @@ All notable changes to `opencode-claude-code-acpbridge`. The format is based on
|
|
|
6
6
|
> **OpenCode V2 only since 0.9.0.** Versions 0.9.0 and later load only in OpenCode V2. If you
|
|
7
7
|
> are still on OpenCode V1, stay on 0.8.x. See [MIGRATION_V2.md](MIGRATION_V2.md).
|
|
8
8
|
|
|
9
|
+
## [0.11.1] — 2026-11-02
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **claude-agent-acp 0.99 support.** That release dropped `session/set_model` and the
|
|
14
|
+
`models` list: models are discovered from, and applied through, the `model` config option
|
|
15
|
+
(the method is still used on agents that have it). Its `_auth/status_update` notices are
|
|
16
|
+
ignored instead of printing an SDK error. On 0.99 discovery lists more models (aliases plus
|
|
17
|
+
full ids) and no `dontAsk` mode, so there is no `claude-dontask` agent.
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- **A turn no longer hangs after the usage limit.** A prompt that failed while OpenCode was
|
|
22
|
+
running a tool (the limit hit mid tool loop, or by a background subagent) was dropped, and
|
|
23
|
+
OpenCode stayed "working" forever. The error is now delivered to the next stream of the
|
|
24
|
+
turn, so OpenCode shows the limit message and the turn ends.
|
|
25
|
+
- **Turns after a failed one (limit, API/gateway error, failed compaction) run again.**
|
|
26
|
+
claude-agent-acp 0.31 leaves the failed turn's `idle` queued, so the next prompt returned at
|
|
27
|
+
once, empty, while Claude worked on it unread (its tool calls never reached OpenCode). After
|
|
28
|
+
any prompt error the session is now re-opened in a new agent process before the next
|
|
29
|
+
prompt: closed and resumed under the same id (context and prompt cache kept), or forked
|
|
30
|
+
when the resume fails.
|
|
31
|
+
- **A prompt the agent ends without running it** (`end_turn`, nothing streamed, zero usage)
|
|
32
|
+
is re-sent once on a re-opened session, on the same stream, instead of finishing empty.
|
|
33
|
+
- **Claude Code no longer compacts while idle** (`idleCompaction: false`): that compaction
|
|
34
|
+
runs as a turn no prompt reads, and desynchronised the next one the same way.
|
|
35
|
+
|
|
36
|
+
## [0.11.0] — 2026-10-26
|
|
37
|
+
|
|
38
|
+
### Changed — breaking
|
|
39
|
+
|
|
40
|
+
- **One agent per Claude Code mode.** The plugin injects a `claude-<mode>` agent for every
|
|
41
|
+
session mode the agent reports: `claude-default`, `claude-plan`, `claude-acceptedits`,
|
|
42
|
+
`claude-auto`, `claude-dontask`, `claude-bypasspermissions` (the six known modes when
|
|
43
|
+
discovery has none). They replace `claude-code` and `claude-code-plan`, with no aliases:
|
|
44
|
+
rename those agents in your `agents` section (`claude-code` → `claude-default`,
|
|
45
|
+
`claude-code-plan` → `claude-plan`). The mode only governs Claude's native tools; OpenCode's
|
|
46
|
+
tools keep the agent's OpenCode permissions. Effort stays a model variant; `claude-plan`
|
|
47
|
+
keeps `high`.
|
|
48
|
+
- **The `acp` models are paired with the Claude Code agents** (`pairModels`, default `true`).
|
|
49
|
+
OpenCode V2 offers every model to every agent, so the plugin enforces it:
|
|
50
|
+
- selecting an agent or model that breaks the pair moves the session back to a valid model
|
|
51
|
+
(the agent's own, the session's last non-`acp` model, or OpenCode's default `model`);
|
|
52
|
+
- an `acp` request from any other agent fails at once (HTTP 400, `x-should-retry: false`);
|
|
53
|
+
- OpenCode subagents launched from a `claude-*` agent get their own model or the default one
|
|
54
|
+
instead of inheriting `acp`.
|
|
55
|
+
|
|
56
|
+
Agents you declare with an `acp/…` model count as Claude Code agents. `pairModels: false`
|
|
57
|
+
restores the old behaviour.
|
|
58
|
+
- The usage-limit error now says to switch agent rather than model.
|
|
59
|
+
|
|
60
|
+
### Fixed
|
|
61
|
+
|
|
62
|
+
- **Each effort variant started its own agent process.** OpenCode V2 builds a new SDK instance
|
|
63
|
+
for every distinct model `settings`, and the effort variants are settings, so `#high`,
|
|
64
|
+
`#low` and the plain model each spawned a `claude-agent-acp` that resumed the same Claude
|
|
65
|
+
session apart from the others (cache partly cold; going back to a variant found a process
|
|
66
|
+
that had missed the turns in between). Provider instances built from the same agent config
|
|
67
|
+
now share one orchestrator: effort switches live with `setSessionConfigOption`, and the
|
|
68
|
+
model without a variant restores the session's own effort.
|
|
69
|
+
|
|
9
70
|
## [0.10.1] — 2026-10-23
|
|
10
71
|
|
|
11
72
|
### Fixed
|
package/README.md
CHANGED
|
@@ -13,8 +13,8 @@ subscription. Claude Code becomes one more model in OpenCode; Claude does the th
|
|
|
13
13
|
> [Upgrading from 0.8.x](#upgrading-from-08x-opencode-v1)).
|
|
14
14
|
> - **Tested with:**
|
|
15
15
|
> - OpenCode 2.1.1;
|
|
16
|
-
> - `@agentclientprotocol/claude-agent-acp` 0.31.x;
|
|
17
|
-
> - Claude Code CLI 2.1.
|
|
16
|
+
> - `@agentclientprotocol/claude-agent-acp` 0.31.x and 0.99.x;
|
|
17
|
+
> - Claude Code CLI 2.1.308.
|
|
18
18
|
>
|
|
19
19
|
> Check your version with `opencode --version`.
|
|
20
20
|
|
|
@@ -52,7 +52,7 @@ and as a **model provider** (`createACPModelProvider`).
|
|
|
52
52
|
| **OpenCode** | An open-source coding agent with a TUI, a desktop app and a CLI. They all talk to a local OpenCode **server**. |
|
|
53
53
|
| **Plugin** | A package the OpenCode server loads to add features. You list plugins in `opencode.json`, and OpenCode installs them from npm. |
|
|
54
54
|
| **Provider / model** | Where OpenCode sends prompts, e.g. `anthropic/claude-…`. This package adds a provider, `acp`, whose models (`acp/default`, `acp/sonnet`, …) are served by Claude Code. |
|
|
55
|
-
| **Agent** | A configured assistant in OpenCode (`build`, `plan`, …). This package adds
|
|
55
|
+
| **Agent** | A configured assistant in OpenCode (`build`, `plan`, …). This package adds one per Claude Code mode: `claude-default`, `claude-plan`, `claude-acceptedits`, `claude-auto`, `claude-dontask`, `claude-bypasspermissions`. |
|
|
56
56
|
| **Tool** | Something the model can call: `read`, `edit`, `bash`, MCP tools… |
|
|
57
57
|
| **Claude Code** | Anthropic's coding agent (the `claude` CLI). Running through it keeps usage on your Pro/Max **subscription**. |
|
|
58
58
|
| **ACP** | The [Agent Client Protocol](https://agentclientprotocol.com), a standard way for an editor or client to drive a coding agent. |
|
|
@@ -134,8 +134,8 @@ claude
|
|
|
134
134
|
On start, the plugin **asks the agent which models it offers**, using a short-lived ACP
|
|
135
135
|
connection. It fills in their metadata (context, cost, modalities) from
|
|
136
136
|
[models.dev](https://models.dev) and **registers the `acp` provider** at runtime. You'll see
|
|
137
|
-
`acp/default`, `acp/sonnet`, `acp/haiku`… in the model picker, and
|
|
138
|
-
`claude-
|
|
137
|
+
`acp/default`, `acp/sonnet`, `acp/haiku`… in the model picker, and one `claude-<mode>` agent per
|
|
138
|
+
Claude Code mode (`claude-default`, `claude-plan`…) in the agent picker. Check from a terminal with `opencode models | grep acp/`.
|
|
139
139
|
|
|
140
140
|
- **Discovery is cached for 1 hour** in `~/.acp-model-provider/`. Only the first start (or the
|
|
141
141
|
first after the cache expires) pays the 3–5 s it takes to start the agent. Force a refresh
|
|
@@ -162,8 +162,8 @@ The first request after that can take a few extra seconds while the package inst
|
|
|
162
162
|
|
|
163
163
|
## First use: agents, models and effort
|
|
164
164
|
|
|
165
|
-
Pick
|
|
166
|
-
|
|
165
|
+
Pick a **`claude-<mode>`** agent in OpenCode (`claude-default` to start). The `acp/…` models
|
|
166
|
+
belong to those agents only: see [Models are paired with the Claude Code agents](#models-are-paired-with-the-claude-code-agents).
|
|
167
167
|
|
|
168
168
|
**Models.** The list comes from **your account**, not from this package: it's whatever the
|
|
169
169
|
agent reports. At the time of writing, on a Max account:
|
|
@@ -178,13 +178,15 @@ agent reports. At the time of writing, on a Max account:
|
|
|
178
178
|
- `opus` works through `claudeCode.model` even though discovery doesn't list it.
|
|
179
179
|
- You can also use full ids such as `claude-sonnet-4-6`.
|
|
180
180
|
|
|
181
|
-
**All models share one agent process.** The model is applied per session
|
|
182
|
-
`session/set_model
|
|
183
|
-
|
|
181
|
+
**All models and effort levels share one agent process.** The model is applied per session
|
|
182
|
+
with `session/set_model` (the `model` config option on claude-agent-acp ≥ 0.99, which dropped
|
|
183
|
+
that method), so switching `opus` → `sonnet` mid-conversation keeps the session: no
|
|
184
|
+
replay, no new process. The same goes for the agent's mode (`session/set_mode`) and effort.
|
|
184
185
|
|
|
185
186
|
**Effort** (how hard Claude thinks) is exposed as model **variants**: `acp/sonnet#low` …
|
|
186
|
-
`#medium`, `#high`, `#xhigh`, `#max` (V2 syntax `provider/model#variant`).
|
|
187
|
-
|
|
187
|
+
`#medium`, `#high`, `#xhigh`, `#max` (V2 syntax `provider/model#variant`). It is applied live
|
|
188
|
+
(`setSessionConfigOption`); the model **without** a variant goes back to the session's own
|
|
189
|
+
effort. Pick one in the TUI, or set it per agent (see [Agents and subagents](#agents-and-subagents)) or for the whole
|
|
188
190
|
provider:
|
|
189
191
|
|
|
190
192
|
```jsonc
|
|
@@ -247,8 +249,9 @@ the provider.
|
|
|
247
249
|
| `streamCloseTimeoutMs` | `number` | `ACP_STREAM_CLOSE_TIMEOUT_MS` | `600000` | Sets `CLAUDE_CODE_STREAM_CLOSE_TIMEOUT` for older agents. `claude-agent-acp` ≥ 0.31 doesn't read it: a pending tool call is bounded by `MCP_TOOL_TIMEOUT` (~27 h by default), so waiting for you to approve a permission never cuts the turn. |
|
|
248
250
|
| `providerId` | `string` | — | `"acp"` | Provider id the models are registered under (see [below](#changing-the-provider-id)). |
|
|
249
251
|
| `name` | `string` | — | `"Claude Code (ACP)"` | Provider display name. |
|
|
250
|
-
| `agents` | `false \| Record` | — |
|
|
252
|
+
| `agents` | `false \| Record` | — | one per mode | `false` injects no agents. A `Record` **replaces** the default `claude-<mode>` definitions entirely, including their native toolset ([details](#agents-and-subagents)). |
|
|
251
253
|
| `agentModel` | `string` | — | `"default"` | Model of the injected agents. |
|
|
254
|
+
| `pairModels` | `boolean` | — | `true` | Reserve the provider's models for the injected agents, and those agents for the provider's models ([details](#models-are-paired-with-the-claude-code-agents)). `false` lets any agent use any model. |
|
|
252
255
|
| `titleFromModel` | `boolean` | — | `false` | Let the model title sessions. By default the plugin titles them from the first user message, with no model call. |
|
|
253
256
|
| `npm` | `string` | — | auto | Package spec the provider is loaded from. Only needed in unusual setups. |
|
|
254
257
|
| `claudeCode` | `object` | — | "clean brain" | How Claude Code runs: the table below. |
|
|
@@ -348,7 +351,7 @@ hand, so there is only one backend:
|
|
|
348
351
|
]
|
|
349
352
|
```
|
|
350
353
|
|
|
351
|
-
Auto-registration, resume, the permission bridge and the agents (`claude-
|
|
354
|
+
Auto-registration, resume, the permission bridge and the agents (`claude-default` →
|
|
352
355
|
`anthropic/default`) then all use that id.
|
|
353
356
|
|
|
354
357
|
> [!WARNING]
|
|
@@ -361,15 +364,23 @@ Auto-registration, resume, the permission bridge and the agents (`claude-code`
|
|
|
361
364
|
|
|
362
365
|
## Agents and subagents
|
|
363
366
|
|
|
364
|
-
The plugin **injects
|
|
367
|
+
The plugin **injects one agent per Claude Code session mode**, as the agent reports them on
|
|
368
|
+
start (model `acp/default`; `claude-default` comes first):
|
|
365
369
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
370
|
+
| Agent | Mode | Native tools (Skill, Task, WebSearch, NotebookEdit…) |
|
|
371
|
+
| --- | --- | --- |
|
|
372
|
+
| `claude-default` | `default` | Every one goes through the [permission bridge](#tools-and-the-permission-bridge): **OpenCode stays the only authority**. |
|
|
373
|
+
| `claude-plan` | `plan` | Claude **plans** (researches, reads, writes the plan) without making changes until you approve it. Effort variant `high`. |
|
|
374
|
+
| `claude-acceptedits` | `acceptEdits` | Native edits are accepted without asking. |
|
|
375
|
+
| `claude-auto` | `auto` | Claude Code's classifier approves or denies each native action. |
|
|
376
|
+
| `claude-dontask` | `dontAsk` | Native actions not pre-approved are denied, never asked. claude-agent-acp ≥ 0.99 no longer reports this mode, so the agent isn't created there. |
|
|
377
|
+
| `claude-bypasspermissions` | `bypassPermissions` | Never asks: the permission bridge is skipped. |
|
|
378
|
+
|
|
379
|
+
They share the same native toolset and differ only in their starting mode. **The mode only
|
|
380
|
+
governs Claude's native tools.** OpenCode's own tools (`bash`, `edit`, `write`, MCP…) always
|
|
381
|
+
run with the OpenCode permissions of the agent, whatever its mode: restrict or open those in
|
|
382
|
+
the `agents` section of your config (below). **Effort** is picked as usual, as a variant of the
|
|
383
|
+
`acp/…` model.
|
|
373
384
|
|
|
374
385
|
To **adjust** them (permissions, model, description), use the `agents` section of your
|
|
375
386
|
OpenCode config, shown just below. To **replace** them with your own agents, use the plugin's
|
|
@@ -379,15 +390,16 @@ OpenCode config, shown just below. To **replace** them with your own agents, use
|
|
|
379
390
|
"plugins": [{ "package": "opencode-claude-code-acpbridge",
|
|
380
391
|
"options": { "command": "claude-agent-acp",
|
|
381
392
|
"agents": { // or "agents": false to inject none
|
|
382
|
-
"claude-
|
|
383
|
-
"claude-
|
|
393
|
+
"claude-default": { "model": "default", "options": { "mode": "default" } },
|
|
394
|
+
"claude-plan": { "model": "default", "variant": "high", "options": { "mode": "plan" } }
|
|
384
395
|
}
|
|
385
396
|
}
|
|
386
397
|
}]
|
|
387
398
|
```
|
|
388
399
|
|
|
389
400
|
> [!WARNING]
|
|
390
|
-
> A plugin-level `agents` record **replaces** the built-in definitions
|
|
401
|
+
> A plugin-level `agents` record **replaces** the built-in definitions (and the pairing then
|
|
402
|
+
> covers exactly the agents you list). Your `options` are all
|
|
391
403
|
> those agents get, so the native toolset of the defaults is gone unless you list it:
|
|
392
404
|
> - `disallowedTools`;
|
|
393
405
|
> - `resourceSearch`, `nativeSubagents`;
|
|
@@ -407,7 +419,7 @@ through the plugin's `context` hook. They are applied **live** (`setSessionMode`
|
|
|
407
419
|
> plugin:
|
|
408
420
|
> ```jsonc
|
|
409
421
|
> "agents": {
|
|
410
|
-
> "claude-
|
|
422
|
+
> "claude-default": {
|
|
411
423
|
> "permissions": [
|
|
412
424
|
> { "action": "edit", "resource": "*", "effect": "deny" },
|
|
413
425
|
> { "action": "bash", "resource": "*", "effect": "ask" }
|
|
@@ -417,11 +429,11 @@ through the plugin's `context` hook. They are applied **live** (`setSessionMode`
|
|
|
417
429
|
> ```
|
|
418
430
|
> `"disabled": true` turns an injected agent off.
|
|
419
431
|
|
|
420
|
-
- **Modes.** OpenCode runs
|
|
421
|
-
modes don't change *who* authorises:
|
|
422
|
-
- `bypassPermissions` only skips the `requestPermission` round trip;
|
|
432
|
+
- **Modes.** OpenCode runs its tools with its own permissions, so Claude Code's permission
|
|
433
|
+
modes don't change *who* authorises them:
|
|
434
|
+
- `bypassPermissions` only skips the `requestPermission` round trip for native tools;
|
|
423
435
|
- `plan` is the one with a real effect of its own;
|
|
424
|
-
-
|
|
436
|
+
- `dontAsk` denies the native tools outright (skills, native subagents, web search).
|
|
425
437
|
- **Two ways to delegate.**
|
|
426
438
|
- **OpenCode's `subagent` tool** is preferred for real work. The child session is visible in
|
|
427
439
|
OpenCode, **any model** can continue it, and its result stays in the shared history.
|
|
@@ -430,8 +442,12 @@ through the plugin's `context` hook. They are applied **live** (`setSessionMode`
|
|
|
430
442
|
`nativeActivity`).
|
|
431
443
|
- Both tools' descriptions steer Claude. If one of your agents relies on native
|
|
432
444
|
`Bash`/`Edit`, it uses OpenCode's tools instead.
|
|
433
|
-
- **OpenCode subagents on
|
|
434
|
-
|
|
445
|
+
- **OpenCode subagents run on another model.** OpenCode gives a child session its parent's model
|
|
446
|
+
unless the subagent has its own, and the `acp` models are reserved for the `claude-*` agents.
|
|
447
|
+
So when a `claude-*` agent launches `general`, `explore`…, the plugin passes the subagent its
|
|
448
|
+
own model, or OpenCode's default `model` when it has none. Without either (or with
|
|
449
|
+
`model: "acp/…"` in the call), the call fails with a message saying what to set. With
|
|
450
|
+
`pairModels: false`, child sessions inherit `acp` as before and:
|
|
435
451
|
- get the base profile (`allowedTools: ["mcp__opencode"]`);
|
|
436
452
|
- get a native permission request denied with a reason if their agent can't use `question`
|
|
437
453
|
(OpenCode's `general` denies it), instead of hanging;
|
|
@@ -446,7 +462,7 @@ through the plugin's `context` hook. They are applied **live** (`setSessionMode`
|
|
|
446
462
|
- keep planning.
|
|
447
463
|
|
|
448
464
|
If you **type** an answer instead, the plan is rejected and your text reaches Claude as
|
|
449
|
-
feedback. The mode you chose survives switching from
|
|
465
|
+
feedback. The mode you chose survives switching from `claude-plan` to `claude-default`.
|
|
450
466
|
- **Resuming without resending history.** `~/.acp-model-provider/sessions.json` maps each
|
|
451
467
|
OpenCode session to its Claude Code session. On reopening, the provider resumes it
|
|
452
468
|
(`resumeSession`) instead of replaying the whole history. Entries older than 30 days are
|
|
@@ -455,11 +471,27 @@ through the plugin's `context` hook. They are applied **live** (`setSessionMode`
|
|
|
455
471
|
Claude, which would answer the message instead. So the plugin titles sessions from their
|
|
456
472
|
first message, with no model call. `titleFromModel: true` restores the model call.
|
|
457
473
|
|
|
474
|
+
|
|
475
|
+
### Models are paired with the Claude Code agents
|
|
476
|
+
|
|
477
|
+
The `acp/…` models are **only for the `claude-*` agents**, and those agents **only use `acp/…`
|
|
478
|
+
models** (`pairModels`, on by default):
|
|
479
|
+
|
|
480
|
+
- **Switching agent switches the model.** Picking a `claude-*` agent puts the session on that
|
|
481
|
+
agent's `acp` model; going back to `build` (or any other agent) puts it back on that agent's
|
|
482
|
+
model, or the last non-`acp` model the session used, or OpenCode's default `model`.
|
|
483
|
+
- **OpenCode's model picker still lists every model for every agent**: V2 has no per-agent model
|
|
484
|
+
list. If you pick a model that breaks the pair, the plugin moves the session back to a valid
|
|
485
|
+
one, and an `acp` request from another agent fails at once with
|
|
486
|
+
`Claude Code: the model … is reserved for the Claude Code agents (claude-*)…`.
|
|
487
|
+
- **Subagents** never inherit an `acp` model (see above).
|
|
488
|
+
- `pairModels: false` turns all of this off.
|
|
489
|
+
|
|
458
490
|
---
|
|
459
491
|
|
|
460
492
|
## Tools and the permission bridge
|
|
461
493
|
|
|
462
|
-
The `claude
|
|
494
|
+
The `claude-*` agents get Claude Code's native power without bypassing OpenCode:
|
|
463
495
|
|
|
464
496
|
- **Common tools → OpenCode runs them.** Claude reaches every tool OpenCode exposes through
|
|
465
497
|
MCP: OpenCode's own (`read`, `write`, `bash`, `edit`, `grep`…) and those of your MCP servers.
|
|
@@ -482,7 +514,7 @@ The `claude-code` agent gets Claude Code's native power without bypassing OpenCo
|
|
|
482
514
|
arrive while OpenCode is still running the previous step are queued for the next one, never
|
|
483
515
|
dropped; native subagents working in parallel do this, for example.
|
|
484
516
|
- **Context-pruning plugins** ([opencode-dcp](https://www.npmjs.com/package/@p4r4d0xb0x/opencode-dcp)).
|
|
485
|
-
The plugin denies `compress` to the `claude
|
|
517
|
+
The plugin denies `compress` to the `claude-*` agents. DCP rewrites OpenCode's copy of
|
|
486
518
|
the history, but the Claude Code session keeps its own context, so pruning only caused
|
|
487
519
|
divergences and replays. DCP keeps working for your other agents.
|
|
488
520
|
- **The permission bridge.** When Claude (or a native subagent) wants a **native** tool,
|
|
@@ -493,8 +525,8 @@ The `claude-code` agent gets Claude Code's native power without bypassing OpenCo
|
|
|
493
525
|
`agents.<name>.permissions`; `action: "*"` defaults are ignored.
|
|
494
526
|
- Anything not covered opens the dialog: the bridge **fails closed**.
|
|
495
527
|
- `Always allow` answers are stored in `~/.acp-model-provider/always.json`.
|
|
496
|
-
- The bridge needs the agent **not** to be in `bypassPermissions
|
|
497
|
-
|
|
528
|
+
- The bridge needs the agent **not** to be in `bypassPermissions`: `claude-bypasspermissions`
|
|
529
|
+
runs native tools without asking anyone.
|
|
498
530
|
- **The classic "clean brain"**, where OpenCode runs everything and there are no native tools:
|
|
499
531
|
use `mode: "bypassPermissions"` with no native toggles, or a manual provider with
|
|
500
532
|
`claudeCode.tools: []`.
|
|
@@ -506,8 +538,8 @@ The `claude-code` agent gets Claude Code's native power without bypassing OpenCo
|
|
|
506
538
|
OpenCode sends the **full** history on every call, while an ACP session keeps **state**. The
|
|
507
539
|
provider keeps one Claude Code session per conversation and sends it **only what it hasn't
|
|
508
540
|
seen**. Claude's prompt cache lives with that session, so the session is recreated as rarely
|
|
509
|
-
as possible. You can switch between `acp` and any other
|
|
510
|
-
conversation, in both directions, and carry on.
|
|
541
|
+
as possible. You can switch between a `claude-*` agent (on `acp`) and any other agent and
|
|
542
|
+
model in the same conversation, in both directions, and carry on.
|
|
511
543
|
|
|
512
544
|
- **Claude's own answer isn't sent back.** OpenCode stores Claude's reply and resends it on the
|
|
513
545
|
next turn. The provider recognises it (by the text it emitted and its own tool ids) and
|
|
@@ -520,14 +552,14 @@ conversation, in both directions, and carry on.
|
|
|
520
552
|
(`nativeActivity`), so the other model sees it.
|
|
521
553
|
- **Usage limit.** If your Claude quota runs out, the error says so plainly and isn't retried
|
|
522
554
|
in a loop:
|
|
523
|
-
`Claude Code: usage limit reached (resets: <when>). Switch to another
|
|
524
|
-
continue; the Claude Code session is kept for when you come back.`
|
|
555
|
+
`Claude Code: usage limit reached (resets: <when>). Switch to another agent in OpenCode (not
|
|
556
|
+
claude-*) to continue with its model; the Claude Code session is kept for when you come back.`
|
|
525
557
|
- **Typing while Claude works** (*steer*), or **interrupting and typing something else**, both
|
|
526
558
|
work:
|
|
527
559
|
- your message reaches Claude, through Claude Code's own queue or together with the pending
|
|
528
560
|
tool result;
|
|
529
561
|
- an interrupted turn is cancelled on the agent before the new one starts.
|
|
530
|
-
- **Changing agent** (`claude-
|
|
562
|
+
- **Changing agent** (`claude-default` ↔ `claude-plan` …) or **toolset** keeps the session,
|
|
531
563
|
live. Moving to an agent with **another native profile** forks the session.
|
|
532
564
|
- **Changing `acp` model** (opus ↔ sonnet) keeps the session (`session/set_model`).
|
|
533
565
|
- **Compaction.** Claude compacts its own session before OpenCode would (`autoCompactPct`). If
|
|
@@ -603,10 +635,11 @@ per turn decision.
|
|
|
603
635
|
| --- | --- |
|
|
604
636
|
| `Model not found: acp/…` | OpenCode didn't load your config, or auto-registration failed. Run `opencode debug config`: it must list your document with `plugins`. With `ACP_DEBUG=1`, look for `[acp-plugin] auto-registered provider 'acp' … — models: …` at startup. For a local directory plugin with no `loading plugin` line, the root `index.js` is missing: run `npm run build`. |
|
|
605
637
|
| Auto-registration adds no models | Run `npx opencode-claude-code-acpbridge sync claude-agent-acp` to see what the agent reports and to refresh the cache. If the agent can't find the `claude` binary, set `claudeExecutable`. |
|
|
606
|
-
| `API Error: 400 … extra usage` | The system prompt triggered Anthropic's classifier. Use `systemPromptMode: "preset"` (the default) or
|
|
638
|
+
| `API Error: 400 … extra usage` | The system prompt triggered Anthropic's classifier. Use `systemPromptMode: "preset"` (the default) or a `claude-*` agent. Typical causes: `append`/`replace`, or an agent from another plugin with an aggressive system prompt. See [Billing](#billing-subscription-vs-extra-usage). |
|
|
607
639
|
| `Authentication required` | Claude Code isn't logged in, or the isolated config dir has no credentials. Run `claude` and log in; with `configDir: "isolated"` the provider links `~/.claude/.credentials.json` automatically. |
|
|
608
640
|
| Claude says it has no `read` / doesn't use the tools | The internal MCP server must run with `node` (on the `PATH`). Override with `ACP_RUNTIME_NODE`. |
|
|
609
|
-
| `Claude Code: usage limit reached …` | Your subscription limit. Switch to another
|
|
641
|
+
| `Claude Code: usage limit reached …` | Your subscription limit. Switch to another agent (not `claude-*`) and come back later: the session is kept. |
|
|
642
|
+
| `Claude Code: the model … is reserved for the Claude Code agents` | An `acp` model was used by another agent. Pick a `claude-*` agent, or another model for that agent. See [pairing](#models-are-paired-with-the-claude-code-agents). |
|
|
610
643
|
| Many `shadow-diff` lines in the log | With `historyMode: "shadow"`, each one is a turn where the new fingerprint would have decided differently. If they're all `legacy: diverged` → `anchors: append`, `"v2"` would save those replays. |
|
|
611
644
|
| Token usage out of control / `cacheR` at 0 | With `ACP_DEBUG=1`, look for `dropping session … —` on every turn, which names the reason. See [Switching models](#switching-models-mid-session-and-token-cost). |
|
|
612
645
|
| Context keeps growing and OpenCode doesn't compact | Only the `[1m]` models advertise a 1M window, and OpenCode won't compact until close to it. Use the regular model for earlier compaction. |
|
|
@@ -684,7 +717,7 @@ npm test # tsc + node --test
|
|
|
684
717
|
- **Run your checkout in OpenCode**: point the plugin at the repository directory,
|
|
685
718
|
`"plugins": [{ "package": "/path/to/opencode-claude-code-acpbridge", "options": { "command": "claude-agent-acp" } }]`.
|
|
686
719
|
OpenCode loads `<dir>/index.*`, and the root `index.js` re-exports `dist/`, so build first.
|
|
687
|
-
- **Smoke test**: `opencode run --standalone --agent claude-
|
|
720
|
+
- **Smoke test**: `opencode run --standalone --agent claude-default -m acp/default "…"` in a test
|
|
688
721
|
project. The bridge's `question` dialog needs the interactive TUI.
|
|
689
722
|
- The package also exports `createACPProviderFromEnv`. It is the upstream
|
|
690
723
|
`@mcpc-tech/acp-ai-provider` without tool orchestration, if you only want plain chat.
|
|
@@ -720,8 +753,9 @@ src/
|
|
|
720
753
|
mcp-runtime.ts # stdio runtime the agent spawns (hand-written MCP, no deps) → TCP to the host
|
|
721
754
|
claude-config.ts # clean brain + isolated CLAUDE_CONFIG_DIR with credentials; mode/effort/system prompt
|
|
722
755
|
plugin/
|
|
723
|
-
index.ts # Plugin.define: provider.transform (acp), agent.transform (claude
|
|
756
|
+
index.ts # Plugin.define: provider.transform (acp), agent.transform (claude-<mode> + rules),
|
|
724
757
|
# context/compaction/generate hooks, title (no model), session.revert.* → clearLink
|
|
758
|
+
pairing.ts # one agent per mode; acp models ↔ claude-* agents (pairTarget, subagentDecision)
|
|
725
759
|
bridge-rules.ts # per-agent rule store + always.json; fail-closed evaluate() (ignores action:"*")
|
|
726
760
|
discover.ts # short-lived ACP connection → models / modes / capabilities
|
|
727
761
|
catalog.ts # models.dev metadata + effort variants → Model.Info[]
|
|
@@ -88,7 +88,7 @@ export interface ClaudeCodeControl {
|
|
|
88
88
|
* ACP session mode, applied at runtime via `setSessionMode` (e.g. `"plan"`,
|
|
89
89
|
* `"bypassPermissions"`). Unlike `permissionMode` (which the ACP agent ignores
|
|
90
90
|
* for the session mode), this actually switches the mode. Can be set per-call
|
|
91
|
-
* through `providerOptions.acp.mode` (e.g.
|
|
91
|
+
* through `providerOptions.acp.mode` (e.g. the `claude-plan` agent).
|
|
92
92
|
*/
|
|
93
93
|
mode?: ClaudePermissionMode;
|
|
94
94
|
/**
|
|
@@ -185,6 +185,7 @@ export declare function resolveConfigDir(ctrl: ClaudeCodeControl): string | unde
|
|
|
185
185
|
/** Build `_meta.claudeCode.options`: "clean brain" by default, plus any reactivated
|
|
186
186
|
* native features (skills/subagents/resource-search/memory/tools) composed in. A
|
|
187
187
|
* raw override (ctrl.tools / ctrl.settingSources) still wins; with every toggle off
|
|
188
|
-
* the result is the unchanged clean brain (`{tools:[], settingSources:[]}
|
|
188
|
+
* the result is the unchanged clean brain (`{tools:[], settingSources:[]}`, idle
|
|
189
|
+
* compaction off). */
|
|
189
190
|
export declare function buildClaudeCodeOptions(ctrl: ClaudeCodeControl): Record<string, unknown>;
|
|
190
191
|
//# sourceMappingURL=claude-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-config.d.ts","sourceRoot":"","sources":["../../src/acp/claude-config.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;AACvE,MAAM,MAAM,oBAAoB,GAC5B,SAAS,GAAG,aAAa,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,mBAAmB,CAAC;AAClF,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,OAAO,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;CAAE,GACxD;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;CAAE,GAC9E;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC;AAEzB;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,KAAK,CAAC;IACxC,6FAA6F;IAC7F,cAAc,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC;IACrD,mFAAmF;IACnF,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B;;;;;;OAMG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AoF;IACpF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IAEpB,8FAA8F;IAC9F,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAID,uFAAuF;AACvF,wBAAgB,wBAAwB,CAAC,GAAG,GAAE,MAAsB,GAAG,MAAM,CA0B5E;AAED;;;6CAG6C;AAC7C,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,GAAG,SAAS,CAI5E;AAeD;;;;uBAIuB;AACvB,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA4DvF"}
|
|
@@ -71,7 +71,8 @@ const DEFAULT_SUBAGENT = {
|
|
|
71
71
|
/** Build `_meta.claudeCode.options`: "clean brain" by default, plus any reactivated
|
|
72
72
|
* native features (skills/subagents/resource-search/memory/tools) composed in. A
|
|
73
73
|
* raw override (ctrl.tools / ctrl.settingSources) still wins; with every toggle off
|
|
74
|
-
* the result is the unchanged clean brain (`{tools:[], settingSources:[]}
|
|
74
|
+
* the result is the unchanged clean brain (`{tools:[], settingSources:[]}`, idle
|
|
75
|
+
* compaction off). */
|
|
75
76
|
export function buildClaudeCodeOptions(ctrl) {
|
|
76
77
|
const toolSet = new Set(ctrl.nativeTools ?? []);
|
|
77
78
|
const sourceSet = new Set();
|
|
@@ -103,6 +104,9 @@ export function buildClaudeCodeOptions(ctrl) {
|
|
|
103
104
|
}
|
|
104
105
|
if (ctrl.projectMemory)
|
|
105
106
|
sourceSet.add("project");
|
|
107
|
+
// No compaction while idle: Claude Code runs it as a turn of its own that no prompt
|
|
108
|
+
// reads, and claude-agent-acp then ends the NEXT prompt on that turn's `idle`.
|
|
109
|
+
settings = { ...(settings ?? {}), idleCompaction: false };
|
|
106
110
|
const o = {
|
|
107
111
|
tools: ctrl.tools ?? [...toolSet],
|
|
108
112
|
settingSources: ctrl.settingSources ?? [...sourceSet],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-config.js","sourceRoot":"","sources":["../../src/acp/claude-config.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,gFAAgF;AAChF,kFAAkF;AAClF,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC9F,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AA2LjC,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,qBAAqB,EAAE,eAAe,CAAC,CAAC;AAE9E,uFAAuF;AACvF,MAAM,UAAU,wBAAwB,CAAC,MAAc,aAAa;IAClE,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACpC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,mBAAmB,CAAC,CAAC;IAC7D,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;IAC9C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,GAAG,CAAC;IAClC,mFAAmF;IACnF,mFAAmF;IACnF,gFAAgF;IAChF,+EAA+E;IAC/E,8EAA8E;IAC9E,iEAAiE;IACjE,IAAI,CAAC;QACH,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC1B,OAAO,GAAG,CAAC;IACb,CAAC;IAAC,OAAO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,GAAG,CAAC,cAAc,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IACvC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACtB,IAAI,QAAQ;QAAE,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IACxC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IACzB,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACnC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC7B,OAAO,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,CAAC;AAC3C,CAAC"}
|
package/dist/plugin/compat.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Oldest `@agentclientprotocol/claude-agent-acp` the bridge is tested with: session
|
|
2
2
|
* fork (smart revert, profile switches), `session/close`, in-place model switching
|
|
3
|
-
* and prompt queueing all come from it. */
|
|
3
|
+
* and prompt queueing all come from it. Also tested with 0.99 (model as a config option). */
|
|
4
4
|
export declare const MIN_AGENT_VERSION = "0.31.0";
|
|
5
5
|
/** OpenCode V2 range the plugin supports (matches the `@opencode/plugin` peer range). */
|
|
6
6
|
export declare const MIN_OPENCODE_VERSION = "2.0.14";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compat.d.ts","sourceRoot":"","sources":["../../src/plugin/compat.ts"],"names":[],"mappings":"AAMA;;
|
|
1
|
+
{"version":3,"file":"compat.d.ts","sourceRoot":"","sources":["../../src/plugin/compat.ts"],"names":[],"mappings":"AAMA;;8FAE8F;AAC9F,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAC1C,yFAAyF;AACzF,eAAO,MAAM,oBAAoB,WAAW,CAAC;AAC7C,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAO1C,6DAA6D;AAC7D,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAM3F;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,EAAE,CAmB5F"}
|
package/dist/plugin/compat.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// instead of failing later with an opaque error.
|
|
6
6
|
/** Oldest `@agentclientprotocol/claude-agent-acp` the bridge is tested with: session
|
|
7
7
|
* fork (smart revert, profile switches), `session/close`, in-place model switching
|
|
8
|
-
* and prompt queueing all come from it. */
|
|
8
|
+
* and prompt queueing all come from it. Also tested with 0.99 (model as a config option). */
|
|
9
9
|
export const MIN_AGENT_VERSION = "0.31.0";
|
|
10
10
|
/** OpenCode V2 range the plugin supports (matches the `@opencode/plugin` peer range). */
|
|
11
11
|
export const MIN_OPENCODE_VERSION = "2.0.14";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../src/plugin/compat.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,yFAAyF;AACzF,wFAAwF;AACxF,iFAAiF;AACjF,iDAAiD;AAEjD;;
|
|
1
|
+
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../src/plugin/compat.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,yFAAyF;AACzF,wFAAwF;AACxF,iFAAiF;AACjF,iDAAiD;AAEjD;;8FAE8F;AAC9F,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AAC1C,yFAAyF;AACzF,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAQ,CAAC;AAC7C,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC;AAE1C,SAAS,KAAK,CAAC,OAA2B;IACxC,MAAM,KAAK,GAAG,wBAAwB,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AAe,GAAG,OAAO,CAAC,eAAe,CAAC,CA6EnF"}
|
package/dist/plugin/discover.js
CHANGED
|
@@ -49,6 +49,7 @@ export async function discoverAgent(opts) {
|
|
|
49
49
|
},
|
|
50
50
|
async writeTextFile() { return {}; },
|
|
51
51
|
async readTextFile() { return { content: "" }; },
|
|
52
|
+
async extNotification() { },
|
|
52
53
|
}), stream);
|
|
53
54
|
const init = await connection.initialize({
|
|
54
55
|
protocolVersion: PROTOCOL_VERSION,
|
|
@@ -61,14 +62,16 @@ export async function discoverAgent(opts) {
|
|
|
61
62
|
mcpServers: [],
|
|
62
63
|
_meta: { claudeCode: { options: buildClaudeCodeOptions(ctrl) } },
|
|
63
64
|
});
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
// claude-agent-acp ≥ 0.99 dropped `models` (and session/set_model): the model is a
|
|
66
|
+
// `model` config option like effort, with the same choices.
|
|
67
|
+
const modelOption = (session?.configOptions ?? []).find((o) => o?.id === "model");
|
|
68
|
+
const models = session?.models?.availableModels
|
|
69
|
+
? session.models.availableModels.map((m) => ({ id: m.modelId, name: m.name, description: m.description ?? undefined }))
|
|
70
|
+
: (modelOption?.options ?? []).map((o) => ({ id: o.value, name: o.name, description: o.description ?? undefined }));
|
|
69
71
|
const modes = (session?.modes?.availableModes ?? []).map((m) => ({ id: m.id, name: m.name }));
|
|
72
|
+
const currentModelId = session?.models?.currentModelId ?? modelOption?.currentValue;
|
|
70
73
|
dbg(`agent ${agentVersion} → models: ${models.map((m) => m.id).join(", ") || "(none)"} | caps: ${JSON.stringify(promptCaps)}`);
|
|
71
|
-
return { models, modes, promptCaps, currentModelId
|
|
74
|
+
return { models, modes, promptCaps, currentModelId, agentVersion };
|
|
72
75
|
})();
|
|
73
76
|
try {
|
|
74
77
|
return await Promise.race([run, timeout]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discover.js","sourceRoot":"","sources":["../../src/plugin/discover.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CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QACnG,MAAM,cAAc,GAAG,OAAO,EAAE,MAAM,EAAE,cAAc,IAAI,WAAW,EAAE,YAAY,CAAC;QAEpF,GAAG,CAAC,SAAS,YAAY,cAAc,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,QAAQ,YAAY,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QAC/H,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC;IACrE,CAAC,CAAC,EAAE,CAAC;IAEL,IAAI,CAAC;QACH,OAAO,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;IAC5C,CAAC;YAAS,CAAC;QACT,IAAI,KAAK;YAAE,YAAY,CAAC,KAAK,CAAC,CAAC;QAC/B,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
package/dist/plugin/index.d.ts
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { Plugin } from "@opencode/plugin";
|
|
2
|
+
/** Agent profiles: one per Claude Code session mode the agent reports (`claude-default`,
|
|
3
|
+
* `claude-plan`, …; the mode is the only difference) + Claude native options. V2's
|
|
4
|
+
* `Agent.Info` has no `options` field, so these travel to the provider per call through
|
|
5
|
+
* the `context` hook (merged with `options.agents.<name>.options`). */
|
|
6
|
+
export declare function agentDefs(opts: Record<string, any>, modes?: ReadonlyArray<{
|
|
7
|
+
id: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
}>): Record<string, any>;
|
|
2
10
|
/** A session title from the first user message: first meaningful line, quotes and
|
|
3
11
|
* markup stripped, cut on a word boundary. */
|
|
4
12
|
export declare function titleFrom(messages: readonly any[]): string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAY,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAY,MAAM,kBAAkB,CAAC;AA8FlE;;;wEAGwE;AACxE,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,KAAK,GAAE,aAAa,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAM9I;AAsCD;+CAC+C;AAC/C,wBAAgB,SAAS,CAAC,QAAQ,EAAE,SAAS,GAAG,EAAE,GAAG,MAAM,GAAG,SAAS,CAatE;AAED,eAAO,MAAM,SAAS,eAiSpB,CAAC;AAEH,eAAe,SAAS,CAAC"}
|