mirror of
https://github.com/agentclientprotocol/claude-agent-acp.git
synced 2026-11-22 17:21:45 +00:00
Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4af4581ad5 | ||
|
|
988a58b908 | ||
|
|
6d9e2766c7 | ||
|
|
85a0d6c6f1 | ||
|
|
b977017ed8 | ||
|
|
3304ca724c | ||
|
|
6a760cbca6 | ||
|
|
022ff53244 | ||
|
|
184b7df993 | ||
|
|
a4f0f78bb3 | ||
|
|
1c90fb959a | ||
|
|
80440d8b82 | ||
|
|
eb4c16f10a | ||
|
|
9f1ca6eb9c | ||
|
|
a768a9f50c | ||
|
|
6e307116d4 | ||
|
|
f31da7f9f5 | ||
|
|
f20ed1d96a | ||
|
|
8990c2441d | ||
|
|
5075d2e0df | ||
|
|
1c0792ea8c | ||
|
|
e62d084e9d | ||
|
|
253cd84ed8 | ||
|
|
b6167a82db | ||
|
|
c4b64f628d | ||
|
|
96dd2bb10d | ||
|
|
3205f0bf02 | ||
|
|
90070d6cbf | ||
|
|
a6ba98ff3c | ||
|
|
c4dd80d739 | ||
|
|
4a076397c6 | ||
|
|
451bc04ae0 | ||
|
|
20aeb46ece | ||
|
|
bcd3cdad35 | ||
|
|
9d71d12336 | ||
|
|
378e85d060 | ||
|
|
0073280b97 | ||
|
|
edab713502 |
@@ -1,3 +1,3 @@
|
||||
{
|
||||
".": "0.107.3"
|
||||
".": "0.109.1"
|
||||
}
|
||||
|
||||
66
CHANGELOG.md
66
CHANGELOG.md
@@ -1,5 +1,71 @@
|
||||
# Changelog
|
||||
|
||||
## [0.109.1](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.109.0...v0.109.1) (2026-11-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* announce a live subagent again when its session is loaded or resumed ([#1688](https://github.com/agentclientprotocol/claude-agent-acp/issues/1688)) ([b977017](https://github.com/agentclientprotocol/claude-agent-acp/commit/b977017ed88148fbbc8bdd6e24cd275313c546e6))
|
||||
* apply a provider's route to the running session ([#1691](https://github.com/agentclientprotocol/claude-agent-acp/issues/1691)) ([988a58b](https://github.com/agentclientprotocol/claude-agent-acp/commit/988a58b908d55a933e9d297c142e9040d478bd69))
|
||||
* give a forked skill's child session its tool calls and text ([#1677](https://github.com/agentclientprotocol/claude-agent-acp/issues/1677)) ([1c90fb9](https://github.com/agentclientprotocol/claude-agent-acp/commit/1c90fb959a003eba1eed1dac94400c9cdef63195))
|
||||
* keep built-in web-fetch and claude-code-guide agents out of the Agent picker ([#1672](https://github.com/agentclientprotocol/claude-agent-acp/issues/1672)) ([eb4c16f](https://github.com/agentclientprotocol/claude-agent-acp/commit/eb4c16f10a753925090289c21f2d95bd902a7b63))
|
||||
* match v1 session/options to resume when workspace roots change ([#1679](https://github.com/agentclientprotocol/claude-agent-acp/issues/1679)) ([184b7df](https://github.com/agentclientprotocol/claude-agent-acp/commit/184b7df993c0c64df593188f15bb0e5206f3e6fb))
|
||||
* reject requests that name a replayed subagent session with -32602 ([#1686](https://github.com/agentclientprotocol/claude-agent-acp/issues/1686)) ([3304ca7](https://github.com/agentclientprotocol/claude-agent-acp/commit/3304ca724c25c7258c837cc0394adb4111ea8987))
|
||||
* report unusable Claude subscriptions as unauthenticated ([#1678](https://github.com/agentclientprotocol/claude-agent-acp/issues/1678)) ([a4f0f78](https://github.com/agentclientprotocol/claude-agent-acp/commit/a4f0f78bb31539005d0d54ab69f7e28f91443b14))
|
||||
* send a replayed subagent's configuration after the replay, not inside it ([#1685](https://github.com/agentclientprotocol/claude-agent-acp/issues/1685)) ([6a760cb](https://github.com/agentclientprotocol/claude-agent-acp/commit/6a760cbca64adc72634274088914e99a51da084a))
|
||||
* show readable titles for MCP tool calls ([#1674](https://github.com/agentclientprotocol/claude-agent-acp/issues/1674)) ([80440d8](https://github.com/agentclientprotocol/claude-agent-acp/commit/80440d8b8294f9d4cd086d7cba39c716107657f0))
|
||||
* update to @agentclientprotocol/sdk 2.9.0 ([#1687](https://github.com/agentclientprotocol/claude-agent-acp/issues/1687)) ([022ff53](https://github.com/agentclientprotocol/claude-agent-acp/commit/022ff532449371198a0d715a921578e27c101532))
|
||||
* update to @agentclientprotocol/sdk 2.9.1 ([#1690](https://github.com/agentclientprotocol/claude-agent-acp/issues/1690)) ([85a0d6c](https://github.com/agentclientprotocol/claude-agent-acp/commit/85a0d6c6f111119855b0e199801a9f71b60f50bf))
|
||||
* update to @anthropic-ai/claude-agent-sdk 0.3.330 ([#1689](https://github.com/agentclientprotocol/claude-agent-acp/issues/1689)) ([6d9e276](https://github.com/agentclientprotocol/claude-agent-acp/commit/6d9e2766c74dcd9ccd5c5a83b8523b65c234041f))
|
||||
|
||||
## [0.109.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.108.1...v0.109.0) (2026-11-19)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* announce session cursors on v2 and fork at a cursor ([#1658](https://github.com/agentclientprotocol/claude-agent-acp/issues/1658)) ([5075d2e](https://github.com/agentclientprotocol/claude-agent-acp/commit/5075d2e0dffed68c4c1417d67c1c1e3ed43e6549))
|
||||
* insert one message per idempotencyKey on v2 session/prompt ([#1657](https://github.com/agentclientprotocol/claude-agent-acp/issues/1657)) ([1c0792e](https://github.com/agentclientprotocol/claude-agent-acp/commit/1c0792ea8cbdfb96ac2afb1f675e4309446d0e5c))
|
||||
* order config options as model, effort, fast, ultracode, mode, agent ([#1666](https://github.com/agentclientprotocol/claude-agent-acp/issues/1666)) ([f31da7f](https://github.com/agentclientprotocol/claude-agent-acp/commit/f31da7f9f5264eb2b57fbda577ac35141eb530c8))
|
||||
* report Fast mode in the speed config option category ([#1659](https://github.com/agentclientprotocol/claude-agent-acp/issues/1659)) ([8990c24](https://github.com/agentclientprotocol/claude-agent-acp/commit/8990c2441d3d45cb4781cd81316b3ffbafee85ee))
|
||||
* send the predicted next prompt as prompt_suggestions_update ([#1660](https://github.com/agentclientprotocol/claude-agent-acp/issues/1660)) ([f20ed1d](https://github.com/agentclientprotocol/claude-agent-acp/commit/f20ed1d96ac786af36b6bee3b4d5925a85b6d7ae))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* send a session's settings to Claude Code over stdin ([#1669](https://github.com/agentclientprotocol/claude-agent-acp/issues/1669)) ([a768a9f](https://github.com/agentclientprotocol/claude-agent-acp/commit/a768a9f50c65b66b9f2d5806909a1db643fe3b6e))
|
||||
* update to @anthropic-ai/claude-agent-sdk 0.3.328 ([#1668](https://github.com/agentclientprotocol/claude-agent-acp/issues/1668)) ([6e30711](https://github.com/agentclientprotocol/claude-agent-acp/commit/6e307116d461af22fb5d42eb4b8fbdb3643c6d6c))
|
||||
|
||||
## [0.108.1](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.108.0...v0.108.1) (2026-11-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* answer -32602 on v1 for a request that names a subagent's session ([#1656](https://github.com/agentclientprotocol/claude-agent-acp/issues/1656)) ([253cd84](https://github.com/agentclientprotocol/claude-agent-acp/commit/253cd84ed84efd38fd9d90faaf954690d1610677))
|
||||
* close a server tool call whose reply Claude Code gave up on, once its next reply starts ([#1604](https://github.com/agentclientprotocol/claude-agent-acp/issues/1604)) ([3205f0b](https://github.com/agentclientprotocol/claude-agent-acp/commit/3205f0bf0211f9346dad8583944f007bd0ef73c2))
|
||||
* end a v1 turn at its result for a client in the subagents RFD form ([#1603](https://github.com/agentclientprotocol/claude-agent-acp/issues/1603)) ([c4b64f6](https://github.com/agentclientprotocol/claude-agent-acp/commit/c4b64f628d1fad37ed1d56016b91eefc59df5052))
|
||||
* reject session setup for an incompatible model provider ([#1506](https://github.com/agentclientprotocol/claude-agent-acp/issues/1506)) ([90070d6](https://github.com/agentclientprotocol/claude-agent-acp/commit/90070d6cbf29f5425e4e08828552f91493dd3e59))
|
||||
* start a session without an MCP-over-ACP server whose local endpoint cannot open ([#1653](https://github.com/agentclientprotocol/claude-agent-acp/issues/1653)) ([96dd2bb](https://github.com/agentclientprotocol/claude-agent-acp/commit/96dd2bb10d838aeb39d75bb0cfde1c7b4eae958a)), closes [#1651](https://github.com/agentclientprotocol/claude-agent-acp/issues/1651)
|
||||
* update to @agentclientprotocol/sdk 2.8.0 ([#1655](https://github.com/agentclientprotocol/claude-agent-acp/issues/1655)) ([b6167a8](https://github.com/agentclientprotocol/claude-agent-acp/commit/b6167a82dba9864a13dad31a7cad151704badf5e))
|
||||
|
||||
## [0.108.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.107.3...v0.108.0) (2026-11-17)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* stream the output of foreground Bash commands ([#1587](https://github.com/agentclientprotocol/claude-agent-acp/issues/1587)) ([378e85d](https://github.com/agentclientprotocol/claude-agent-acp/commit/378e85d06027f5fa1802e94535548747a0feccc9))
|
||||
* support MCP servers that the client serves over the ACP connection (MCP-over-ACP) ([#1645](https://github.com/agentclientprotocol/claude-agent-acp/issues/1645)) ([20aeb46](https://github.com/agentclientprotocol/claude-agent-acp/commit/20aeb46ecedc60fef26ca8b1439b37e3bbd9b27a))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* an autonomous result naming the original prompt must not end a steered turn early ([#1451](https://github.com/agentclientprotocol/claude-agent-acp/issues/1451)) ([edab713](https://github.com/agentclientprotocol/claude-agent-acp/commit/edab7135028d83efaeaa38d0f8efe62ea7ddf203))
|
||||
* do not count a confirmWithUser question as an unfinished tool call ([#1644](https://github.com/agentclientprotocol/claude-agent-acp/issues/1644)) ([bcd3cda](https://github.com/agentclientprotocol/claude-agent-acp/commit/bcd3cdad35e4356247303870ac3137675e401227))
|
||||
* handle invalid file paths in tool reports ([#1419](https://github.com/agentclientprotocol/claude-agent-acp/issues/1419)) ([0073280](https://github.com/agentclientprotocol/claude-agent-acp/commit/0073280b977a69934fb56670943d1ef42e7b687e))
|
||||
* keep a workflow agent's tool call out of the turn's unfinished tools ([#1638](https://github.com/agentclientprotocol/claude-agent-acp/issues/1638)) ([451bc04](https://github.com/agentclientprotocol/claude-agent-acp/commit/451bc04ae022ef02473bdd92740cf19d8ceb5f3c))
|
||||
* offer clearing the context on plan approval only when Claude Code's setting is on ([#1627](https://github.com/agentclientprotocol/claude-agent-acp/issues/1627)) ([9d71d12](https://github.com/agentclientprotocol/claude-agent-acp/commit/9d71d12336c392c28967c600f8409841deaab7e0))
|
||||
* send MCP servers to Claude Code over stdin, not on its command line ([#1647](https://github.com/agentclientprotocol/claude-agent-acp/issues/1647)) ([c4dd80d](https://github.com/agentclientprotocol/claude-agent-acp/commit/c4dd80d7392b035f331b50bfdd802cfb3e144d37))
|
||||
* update to @anthropic-ai/claude-agent-sdk 0.3.326 ([#1646](https://github.com/agentclientprotocol/claude-agent-acp/issues/1646)) ([4a07639](https://github.com/agentclientprotocol/claude-agent-acp/commit/4a076397c6e785a8dd9166e8ea1df14fe17c52ed))
|
||||
|
||||
## [0.107.3](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.107.2...v0.107.3) (2026-11-16)
|
||||
|
||||
|
||||
|
||||
29
README.md
29
README.md
@@ -16,9 +16,10 @@ This tool implements an ACP agent by using the official [Claude Agent SDK](https
|
||||
- Nested subagent transcripts
|
||||
- Interactive (and background) terminals
|
||||
- Custom [Slash commands](https://docs.anthropic.com/en/docs/claude-code/slash-commands)
|
||||
- Client MCP servers
|
||||
- Client MCP servers, including the ones that the client serves over the ACP connection ([MCP-over-ACP](https://agentclientprotocol.com/rfds/mcp-over-acp), `"type": "acp"`)
|
||||
- An Ultracode session config option, which turns on Claude Code's dynamic workflows for every task. It appears when dynamic workflows are enabled and the model supports ultracode (any model with `xhigh` effort)
|
||||
- `/mcp` in the chat: the MCP server status as a list. The adapter runs `/mcp reconnect`, `/mcp enable`, and `/mcp disable` through the SDK control API, because Claude Code refuses them in SDK mode. A reconnect of an ACP server that needs authentication starts MCP OAuth through URL elicitation
|
||||
- Prompt suggestions: the prompt that Claude Code predicts the user sends next, as ACP's unstable `prompt_suggestions_update`, for a client that advertises `session.promptSuggestions`
|
||||
- Session-scoped long-running goals for AIR through the [goal extension](docs/air-extensions.md#goal) under `_meta.jetbrains.air.goal`
|
||||
- Structured errors, recovery, and warnings through the opt-in [session failure extension](docs/air-extensions.md#session-failure)
|
||||
- Concrete model and effort defaults through the opt-in [recommended config value extension](docs/air-extensions.md#recommended-config-values)
|
||||
@@ -46,6 +47,10 @@ Claude CLI (`claude`) it runs. Keep them in the same directory; a symlink to
|
||||
instead, set `CLAUDE_CODE_EXECUTABLE`. On Alpine, install `libgcc` and
|
||||
`libstdc++` first.
|
||||
|
||||
A CLI named with `CLAUDE_CODE_EXECUTABLE` gets a session's MCP servers on its
|
||||
command line, where other users of the machine can read their `env` and
|
||||
`headers`. The CLI that comes with the adapter gets them over stdin.
|
||||
|
||||
To build one for your machine (needs [Bun](https://bun.sh)) and check it:
|
||||
|
||||
```sh
|
||||
@@ -53,11 +58,11 @@ npm run build:binary
|
||||
npm run smoke:binary # add `-- --full` to drive a real session; needs a Claude login
|
||||
```
|
||||
|
||||
### Experimental ACP v2
|
||||
### ACP v2 (Preview)
|
||||
|
||||
The adapter also serves the [draft ACP v2](https://agentclientprotocol.com/protocol/v2/overview):
|
||||
a client that asks for protocol version 2 or later in `initialize` gets v2, and every other client
|
||||
gets v1. The draft can still change, and this surface changes with it.
|
||||
The adapter also serves [ACP v2](https://agentclientprotocol.com/protocol/v2/overview), which is in
|
||||
Preview: a client that asks for protocol version 2 or later in `initialize` gets v2, and every other
|
||||
client gets v1. v2 is not frozen yet, and this surface changes with it.
|
||||
|
||||
`CLAUDE_AGENT_ACP_PROTOCOL` limits the adapter to one version. With `v1`, a client that asks
|
||||
for v2 is negotiated down to v1. With `v2`, the adapter rejects the `initialize` of a v1 client.
|
||||
@@ -70,6 +75,20 @@ with replay, which `replay_complete` ends, `session/close`, `session/prompt`, `s
|
||||
compaction, display terminals for commands, permission requests, elicitation, providers, auth, and
|
||||
[subagents](docs/subagent-sessions.md). Steering is v1 only for now.
|
||||
|
||||
On v2, the `command` of a stdio MCP server must be an absolute path, such as `/usr/local/bin/npx`.
|
||||
`session/new`, `session/resume` and `session/fork` fail with `-32602` for a relative one, such as
|
||||
`npx`. A v1 client can still send one.
|
||||
|
||||
`session/prompt` takes an `idempotencyKey`: a prompt that a client sends again with the same key
|
||||
is inserted once, and the retry gets the first `messageId`. The key is known for as long as Claude
|
||||
Code stores the message, also after a restart. A prompt that Claude Code does not store, such as a
|
||||
local command, keeps its key until `session/close` or the end of the connection.
|
||||
|
||||
The adapter announces a session cursor (`cursor_update`) before each user message that follows
|
||||
another entry of the conversation, live and in a replay. `session/fork` with its `cursorId` copies
|
||||
the history before that message, and fails with `-32602` for any other `cursorId`. A v1 client gets
|
||||
no cursors yet.
|
||||
|
||||
v2 is served by the v2 agent in `src/v2/`, which runs straight on Claude
|
||||
Code instead of translating to v1. A v2 client that declares JetBrains AIR
|
||||
(`_meta.jetbrains.air`) also gets the AIR extensions that ACP v2 does not cover.
|
||||
|
||||
@@ -228,7 +228,9 @@ The adapter keeps them where they are.
|
||||
|
||||
## Auth source display
|
||||
|
||||
The connection-scoped `_auth/status_update` continues to report agent-owned authentication, not client-owned `providers/set` routing. The adapter also reports the same identity through the ACP `auth/status` method and `auth/status_update` notification (advertised as `auth.status`), with `kind`, `detail` and `plan` under the account's `_meta.claudeCode`. The account's `description` carries the `detail` too, e.g. `label: "Anthropic API key"` with `description: "ANTHROPIC_API_KEY"`. Each notification is sent when its own payload changed. `auth/status` answers with the identity last reported and starts a new read, whose change arrives as a notification. When the active key source is `apiKeyHelper`, the adapter reads the effective helper command through SDK `resolveSettings` / the session's `SettingsManager`, including programmatic settings overrides.
|
||||
The connection-scoped `_auth/status_update` reports agent-owned authentication, not client-owned `providers/set` routing. The adapter also reports that login through the ACP `auth/status` method and `auth/status_update` notification (advertised as `auth.status`). Under `--hide-claude-auth`, a subscription the integration cannot use is `unauthenticated`, with no active account; the legacy notification still describes the stored login. Enterprise subscriptions, API keys, and setup tokens remain usable.
|
||||
|
||||
For a reported account, `_meta.claudeCode` carries `kind`, `detail` and `plan`. The account's `description` carries the `detail` too, e.g. `label: "Anthropic API key"` with `description: "ANTHROPIC_API_KEY"`. Each notification is sent when its own payload changed. `auth/status` answers with the identity last reported and starts a new read, whose change arrives as a notification. When the active key source is `apiKeyHelper`, the adapter reads the effective helper command through SDK `resolveSettings` / the session's `SettingsManager`, including programmatic settings overrides.
|
||||
|
||||
A command containing the whole word `central` and the word sequence `proxy start` is displayed as:
|
||||
|
||||
@@ -344,11 +346,11 @@ For every tool, a client that is not AIR also gets these upstream fields:
|
||||
| `Skill` | `kind: other`, `title: "Load skill: <name>"`. | `_meta.jetbrains.air.skill`. | none |
|
||||
| `TodoWrite`, `TaskCreate`, `TaskUpdate`, `TaskList`, `TaskGet` | The stream reports them as a standard `plan` with entries. Only a permission request shows them as a tool call. | A plan that repeats the previous plan is not sent. | Every plan goes out. |
|
||||
| `ReportFindings` | `kind: think`, `title: "Report <n> findings"`. | With `rawInputRendering`, no copy of the findings in `content`. | none |
|
||||
| MCP tools (`mcp__*`) and other tools | `kind: other`, `title` is the tool name. The result text goes to `content`. | `_meta.is_mcp_tool_call` for MCP, and `_meta.jetbrains.air.mcp = {server, tool}`. | none |
|
||||
| MCP tools (`mcp__*`) and other tools | `kind: other`, `title` is `server: tool` for a complete MCP name, otherwise the tool name. Result text goes to `content`. | `_meta.is_mcp_tool_call` for MCP, and `_meta.jetbrains.air.mcp = {server, tool}`. | none |
|
||||
| Context compaction | `compaction_update` when the client declares `session.compaction`. Otherwise a synthetic tool call. | Both forms carry `_meta.jetbrains.air.contextCompaction`. | See [Context compaction](#context-compaction). |
|
||||
| Background work that is not a subagent | none | With `asyncTasks`, async task updates. | none |
|
||||
|
||||
`_meta.jetbrains.air.mcp` comes from the tool name `mcp__<server>__<tool>`, on `tool_call` and on a `tool_call_update` that changes it.
|
||||
The standard `name` stays `mcp__<server>__<tool>`. AIR also gets those parts in `_meta.jetbrains.air.mcp` on `tool_call` and on a `tool_call_update` that changes it.
|
||||
`server` is the part up to the next `__`. `tool` is the whole rest and can contain `__`, as in Claude Code.
|
||||
A name that does not split (`mcp__x`) gets no `mcp` key, and `_meta.is_mcp_tool_call` still marks it.
|
||||
|
||||
@@ -701,7 +703,7 @@ When `matchedAskRule` is present, the adapter offers no persistent choice. A con
|
||||
| WebFetch | One-time allow; a generated `domain:<hostname>` local rule; reject. |
|
||||
| Skill | One-time allow; exact skill and optional `prefix:*` local rules; reject. |
|
||||
| EnterPlanMode | Enter plan mode once, or reject and continue. |
|
||||
| ExitPlanMode | One keep-context and one clear-context elevated mode (`auto` before bypass before accept edits), manual approval, or reject. |
|
||||
| ExitPlanMode | One keep-context elevated mode, one clear-context mode (with `showClearContextOnPlanAccept` on), manual approval, or reject. |
|
||||
| SandboxNetworkAccess | One-time allow; the exact SDK host rule when representable; reject. |
|
||||
| Computer Use MCP | One-time allow; an exact representable SDK allow suggestion; reject. |
|
||||
| MCP | One-time allow; an exact representable SDK allow suggestion for that tool; reject. |
|
||||
@@ -726,7 +728,9 @@ A host removes `Bypass permissions` with `_meta.claudeCode.options.allowDangerou
|
||||
A `bypassPermissions` settings default then falls back to `default`.
|
||||
|
||||
`ExitPlanMode` offers one elevated keep-context choice by priority: `auto`, then `bypassPermissions`, then `acceptEdits`.
|
||||
A non-empty plan also gets one clear-context choice with the same priority.
|
||||
When Claude Code's `showClearContextOnPlanAccept` setting is on, a non-empty plan also gets one clear-context choice with the same priority.
|
||||
The setting is off by default, as in Claude Code.
|
||||
The adapter reads it as Claude Code does: managed settings first, then the `settings` option of the session, then the user, project, and local settings files.
|
||||
After that choice, the adapter stops the old private Claude query and hides that internal rejection.
|
||||
It starts a new private query under the same ACP session.
|
||||
It continues the turn with `Implement the following plan:` and the complete plan.
|
||||
@@ -857,8 +861,9 @@ A failed command restores the previous state.
|
||||
|
||||
After a turn, the Claude Code CLI can predict the prompt the user is likely to send next.
|
||||
The adapter asks for it with the SDK option `promptSuggestions: true` and forwards the one prediction of the turn.
|
||||
It asks only in a session of AIR or of a client that advertises `session.promptSuggestions`, on v1 and v2: a prediction costs a request per turn, and no other client would get it.
|
||||
|
||||
ACP has no field for a composer prefill, so the prediction travels outside the AIR namespace:
|
||||
AIR reads the prediction from a `_meta` key outside the AIR namespace, which the adapter used before ACP had an update for it:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -867,9 +872,20 @@ ACP has no field for a composer prefill, so the prediction travels outside the A
|
||||
}
|
||||
```
|
||||
|
||||
The key names no vendor, so another client can read it.
|
||||
The key names no vendor.
|
||||
The adapter sends it only to an AIR client; see the [compatibility rule](#compatibility-rule).
|
||||
|
||||
Any client that advertises `session.promptSuggestions` gets the same prediction as ACP's unstable `prompt_suggestions_update`, on v1 and v2:
|
||||
|
||||
```json
|
||||
{
|
||||
"sessionUpdate": "prompt_suggestions_update",
|
||||
"suggestions": [{ "prompt": [{ "type": "text", "text": "Run the tests" }] }]
|
||||
}
|
||||
```
|
||||
|
||||
An AIR client that advertises the capability gets both.
|
||||
|
||||
AIR shows the first non-blank `suggestions[].text` as gray text in an empty composer.
|
||||
Tab fills the composer with it and sends nothing.
|
||||
|
||||
@@ -880,6 +896,11 @@ Tab fills the composer with it and sends nothing.
|
||||
|
||||
A prediction the next prompt outran — the user sent it before the adapter read the prediction off the SDK stream — is dropped instead of published.
|
||||
|
||||
`prompt_suggestions_update` follows two more rules of ACP, which the `_meta` form does not:
|
||||
|
||||
- a prediction that arrives while Claude works, such as on a prompt that was queued before the turn's result, is dropped;
|
||||
- on v2, the list is withdrawn when foreground work starts without a prompt, such as a cycle that Claude Code starts after a background task ends.
|
||||
|
||||
The CLI predicts nothing on the first turn of a session, after an API error, in plan mode, and at the account's usage limit, so many turns end with no prediction.
|
||||
A client must treat a turn without one as normal.
|
||||
A caller can turn the whole feature off with `_meta.claudeCode.options.promptSuggestions: false` on `session/new`; a user can turn it off in Claude Code settings or with `CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION=false`.
|
||||
@@ -1279,7 +1300,7 @@ A client without the capability gets the original transcript and no typed record
|
||||
|
||||
## Native subagent sessions
|
||||
|
||||
The adapter implements the draft [ACP subagent RFD](https://github.com/agentclientprotocol/agent-client-protocol/pull/1992).
|
||||
The adapter implements ACP's [subagents](https://agentclientprotocol.com/protocol/v1/subagents).
|
||||
This section covers only the AIR bridge.
|
||||
|
||||
- The canonical client field is `clientCapabilities.subagents: {}`.
|
||||
@@ -1294,6 +1315,10 @@ This section covers only the AIR bridge.
|
||||
The source is the `task_started` prompt, else the Agent or Task input `prompt`.
|
||||
A resumed generation gets the SendMessage `message` text.
|
||||
The field is absent when the adapter has no prompt. The adapter does not truncate it.
|
||||
- A forked skill (`context: fork`, such as `/code-review`) is a child session too, without an Agent or Task call.
|
||||
The parent of one that Claude runs with the Skill tool is the session that made the Skill call, which stays a tool call.
|
||||
The parent of one that the user types is the root session.
|
||||
Claude Code sends the output of a typed one only when the command ends: its `subagent_state_update` follows that output.
|
||||
- Without either signal, Agent and Task stay ordinary tool calls. AIR gets `_meta.jetbrains.air.subagent: true` on them.
|
||||
Child interactions stay on the root session.
|
||||
- A client that uses the older `_meta["subagent-transcript"]` capability or the `forwardSubagentText` session option keeps the flat child transcript.
|
||||
@@ -1643,7 +1668,7 @@ Claude Code sends the result of the turn when the main agent stops, also while s
|
||||
|
||||
### Hold without the capability
|
||||
|
||||
A client that does not declare `backgroundSubagents` gets the hold of issues #864 and #866.
|
||||
A client that does not declare `backgroundSubagents` gets the hold of issues #864 and #866, unless it gets the RFD form of [subagent sessions](subagent-sessions.md).
|
||||
The adapter keeps the `session/prompt` request open while a subagent that the turn started or resumed runs.
|
||||
The subagent output, its permission requests and the followup summary of the model then go out inside the turn.
|
||||
The turn ends at the followup result, at an `idle` with no live subagent, at `session/cancel`, or when the next prompt starts.
|
||||
@@ -1672,7 +1697,7 @@ The request has no clear-context option, because the fresh query must continue a
|
||||
"No, keep planning" stops only the followup cycle. There is no turn to end.
|
||||
|
||||
A prompt turn owns the request when the turn is active, or when Claude Code asks before the echo of its prompt.
|
||||
Then the request has the clear-context option.
|
||||
Then the request has the clear-context option, when `showClearContextOnPlanAccept` is on.
|
||||
A turn that took over a followup cycle also owns the request of that cycle, and the accepted plan continues in that turn.
|
||||
|
||||
## Context compaction
|
||||
|
||||
@@ -64,4 +64,6 @@ When an ACP client routes the agent through a gateway with `providers/set`, the
|
||||
|
||||
The model picker then offers only the SDK models whose resolved model the gateway lists, matched without dates, version suffixes (`-v1:0`), `-fast`, `@` suffixes, context hints (`[1m]`) and provider prefixes, after the `availableModels` allowlist above. On Bedrock, a model the CLI resolved to another region prefix is dropped as well. When the gateway does not list the model a session runs, that is the default model or a resumed session's last model, the session switches to the first remaining picker row.
|
||||
|
||||
A 4xx answer means the gateway has no listing: `providers/set` succeeds and nothing is narrowed. A failed listing (network error, a status other than 2xx or 4xx, unexpected body, the 10 s timeout, an invalid header, or a base URL with credentials) fails `providers/set` with a JSON-RPC internal error, and the previous provider stays in effect. A listing that matches no SDK model leaves the session with no model to offer: there is no model config option. Gateways set through `authenticate`, `vertex` providers, and native routing are not listed. Setting the same gateway again (the same protocol, base URL and headers) reuses its listing, unless it answered 4xx; `providers/set` and `providers/disable` apply in the order they arrive, and logout clears the routing after `claude auth logout`, including a `providers/set` still listing; `providers/disable` and logout drop it.
|
||||
A 4xx answer means the gateway has no listing: `providers/set` succeeds and nothing is narrowed. A failed listing (network error, a status other than 2xx or 4xx, unexpected body, the 10 s timeout, an invalid header, or a base URL with credentials) fails `providers/set` with a JSON-RPC internal error, and the previous provider stays in effect. Gateways set through `authenticate`, `vertex` providers, and native routing are not listed. Setting the same gateway again (the same protocol, base URL and headers) reuses its listing, unless it answered 4xx; `providers/set` and `providers/disable` apply in the order they arrive, and logout clears the routing after `claude auth logout`, including a `providers/set` still listing; `providers/disable` and logout drop it.
|
||||
|
||||
If the listing matches none of the models Claude Code reports after the `availableModels` allowlist, session setup (`session/new`, `session/load`, `session/resume`, `session/fork`) fails with an internal error that says to choose a different provider. Open sessions also fail when they restart under that provider: v1 drops them and sends a session failure update to clients with AIR's `sessionFailure` capability; v2 stops their queries and answers later requests with that error and an instruction to resume the session. After choosing a compatible provider, use `session/resume` to continue a stopped v2 session. When no model matches, session setup still succeeds with no model config option if Claude Code reports no models or any allowed model row has no `resolvedModel` (for example an `availableModels` entry Claude Code does not report).
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Subagent sessions
|
||||
|
||||
A client that declares `clientCapabilities.subagents`, other than JetBrains AIR, gets each Agent or
|
||||
Task subagent as its own child session, following the [subagents RFD](https://github.com/agentclientprotocol/agent-client-protocol/blob/main/docs/rfds/subagents.mdx):
|
||||
Task subagent as its own child session, following ACP's [subagents](https://agentclientprotocol.com/protocol/v1/subagents):
|
||||
|
||||
- `subagent_update` on the parent announces the child before any of its traffic, with the
|
||||
parent's `title` and `description` for it, and reports its work state: `running`,
|
||||
@@ -20,8 +20,8 @@ Task subagent as its own child session, following the [subagents RFD](https://gi
|
||||
first model request. It sends `cwd: null` when the child is back in its parent's directory. A
|
||||
child in its parent's directory gets no `cwd`, and no child gets `additionalDirectories`: Claude
|
||||
Code gives a subagent the session's additional directories, so it inherits them. A replay
|
||||
announces a child with the `cwd` that its transcript recorded, and clears it after the response
|
||||
when that directory no longer exists.
|
||||
announces a child with the `cwd` that its transcript recorded, and clears it with the child's
|
||||
current state (see below) when that directory no longer exists.
|
||||
- Session messages replace the Agent or Task call that launches the child, which its parent is
|
||||
not shown:
|
||||
- The launch's prompt is a `session_message` in both transcripts: the parent's outgoing view and
|
||||
@@ -32,6 +32,30 @@ Task subagent as its own child session, following the [subagents RFD](https://gi
|
||||
message to the parent instead, in both transcripts and linked the same way.
|
||||
- A launch whose child is never exposed is shown as a tool call after all, with its final
|
||||
status.
|
||||
- A forked skill (a skill with `context: fork`, such as `/code-review`) is a child session too.
|
||||
Claude Code runs it as a subagent that no Agent or Task call launched:
|
||||
- When Claude runs it with the Skill tool, the child is announced on the session that made the
|
||||
Skill call, once Claude Code reports its task. The Skill call stays a tool call of that session,
|
||||
with the skill's result. The skill's prompt is a `session_message` in the child's transcript
|
||||
only, with the Skill call's tool use id.
|
||||
- When the user types it, there is no call: the child is announced on the root session, and the
|
||||
command's output is the root's message. Claude Code (2.1.328) sends such a child's messages
|
||||
only when the command ends, after it reports the task's end. The adapter keeps the child
|
||||
`running` until they came, so its `idle` follows its tool calls and text. They all arrive at
|
||||
once: the child's transcript is not live.
|
||||
- A subagent that a typed skill launches gets no session: Claude Code reports the end of its
|
||||
task before the Agent call that launched it. That call is a tool call of the skill's child,
|
||||
with its final status.
|
||||
- After a `session/cancel` of the root session, a typed skill's messages are the output of
|
||||
stopped work, which the adapter drops: the child reports `idle` with `cancelled` and no more.
|
||||
After a `session/cancel` of the child itself, they still go to the child, before its `idle`
|
||||
with `cancelled`.
|
||||
- A replay shows no child for a forked skill. The Skill call stays a tool call.
|
||||
- On v1, the parent's prompt turn ends at its result, also while a background child that it
|
||||
launched or resumed still runs. The child's updates and requests follow the prompt response: the
|
||||
RFD has a client keep receiving child events after it. The parent's summary when the child ends
|
||||
comes from a followup cycle out of a turn. Its result ends no turn, and a plan approval it asks
|
||||
for has no clear-context option.
|
||||
- A SendMessage call that resumes the child is not shown either. Its message is a
|
||||
`session_message` in both transcripts, the sender's outgoing view and the child's incoming one,
|
||||
linked like a launch's prompt. A SendMessage call whose message resumes no announced child,
|
||||
@@ -43,10 +67,11 @@ Task subagent as its own child session, following the [subagents RFD](https://gi
|
||||
carries the RFD's `session` content, `{ "type": "session", "sessionId": "<child>" }`, after its
|
||||
other content: a TaskStop call whose `task_id`, or a SendMessage call whose `to`, is the child's
|
||||
agent id; a SendMessage call that resumed the child and stays shown because a permission request
|
||||
showed it first; and, on v1, an Agent or Task call that stays shown for the same reason. A
|
||||
`tool_call_update` without content carries none, since it would replace the content the client
|
||||
holds. A call that names the child by its name gets no reference: Claude Code resolves the
|
||||
name, and the adapter cannot tell which agent it picked.
|
||||
showed it first; on v1, an Agent or Task call that stays shown for the same reason; and the
|
||||
Skill call that launched a forked skill's child. A `tool_call_update` without content carries
|
||||
none, since it would replace the content the client holds. A call that names the child by its
|
||||
name gets no reference: Claude Code resolves the name, and the adapter cannot tell which agent it
|
||||
picked.
|
||||
- `session/cancel` on the parent interrupts Claude Code, which stops the foreground children that
|
||||
the turn waits on. Background children keep running, as the RFD prefers; a client stops one with
|
||||
its own `cancel`. Each stopped child reports `idle` with `cancelled` from Claude Code's own
|
||||
@@ -65,9 +90,22 @@ Task subagent as its own child session, following the [subagents RFD](https://gi
|
||||
guessing its parent.
|
||||
- A replay restores each child under its live session id, from its own transcript, with the same
|
||||
session messages and `session` references as live, and its end is an `idle` before the response.
|
||||
Each replayed child's current state follows the response.
|
||||
Each replayed child's current state follows the response: on v1, the response is what separates
|
||||
a replayed child state from a current one.
|
||||
A replay sends no `config_option_update` of a child, since one that arrives before the response
|
||||
is a past value to the client. Each replayed child's configuration follows its current state:
|
||||
the configuration of a child that still runs, else its `model` option with the model of the
|
||||
latest response in its transcript, as the session's `model` option names it. A child that
|
||||
neither runs nor has a response gets none.
|
||||
A launch without Claude Code's metadata file for the child stays an ordinary tool call of the
|
||||
parent, and a notice, for a client that takes notices, says that subagent history is missing.
|
||||
- A session that is loaded or resumed with the same settings while it runs keeps its children's
|
||||
runs. After the response, each child that works and that no replay announced is announced
|
||||
again on its parent, with its labels, the `cancel` capability and its state, and then gets the
|
||||
configuration that the client last had for it: every working child after a `session/resume`,
|
||||
which replays nothing, and after a `session/load` a child whose launch the history does not
|
||||
have, such as a forked skill's. A child that no longer works but has a working child of its own
|
||||
is named first, with its labels only.
|
||||
- After a load or resume, with or without replay, a SendMessage that resumes an agent from before
|
||||
it runs that agent in its session from before. Before the agent's traffic, each of its ancestors
|
||||
that the client was not told about in this connection is announced, parent before child and
|
||||
@@ -78,13 +116,27 @@ Task subagent as its own child session, following the [subagents RFD](https://gi
|
||||
parent's: Claude Code also stops the foreground children it waits on, and the parent's turn goes
|
||||
on. Each stopped child reports `idle` with `cancelled` from Claude Code's own events, and its
|
||||
requests that the stop withdraws report no `running` first. A replayed child, which no longer
|
||||
runs, gets no capabilities. A client cannot prompt or otherwise change a child.
|
||||
runs, gets no capabilities, and a `session/cancel` of it does nothing. A client cannot prompt or
|
||||
otherwise change a child: any other request that names a child fails with `-32602` (Invalid
|
||||
params), `session/close` and `session/delete` too. That holds for every child that a
|
||||
`subagent_update` announced, while it ran or in a replay, until the client closes the child's
|
||||
root session: also after `/clear` and after a restart of the root's Claude Code process.
|
||||
|
||||
An [ACP v2](../README.md#experimental-acp-v2) client gets the same without declaring anything, since subagents
|
||||
An [ACP v2](../README.md#acp-v2-preview) client gets the same without declaring anything, since subagents
|
||||
are part of v2's baseline. Each child also reports its work state as its own `state_update`, right
|
||||
after the parent's copy. A replay ends each child's history with a `replay_complete` on the child's
|
||||
session, before the child's `idle`. The notice that subagent history is missing follows the
|
||||
parent's `replay_complete`.
|
||||
session. On v2, the parent's `replay_complete` is what separates a replayed child state from a
|
||||
current one, so each replayed child's current state follows the root session's `replay_complete`
|
||||
and comes before the response: on its parent, with the cleared `cwd`, and then as the child's own
|
||||
`idle`. The child's configuration follows it there, since v2 asks an agent not to replay a past
|
||||
`config_option_update`. The notice that subagent history is missing follows the root's
|
||||
`replay_complete` too.
|
||||
|
||||
On v2, a resume of the active session that replays can meet a child that the stored history does
|
||||
not launch: a forked skill's child, or a subagent that Claude launched after the history was written.
|
||||
Such a child is announced again right after the root's `replay_complete`, when it works, when its
|
||||
parent lists it, or when the replay held one of its updates. Its own `replay_complete` follows at
|
||||
once, since its replay is empty, and then come the updates that the replay held.
|
||||
|
||||
JetBrains AIR keeps the earlier draft of the RFD (`subagent_spawned`, `subagent_state_update`),
|
||||
which it enables with `nativeSubagentSessions` in `_meta.jetbrains.air.capabilities`. See
|
||||
|
||||
375
package-lock.json
generated
375
package-lock.json
generated
@@ -1,16 +1,16 @@
|
||||
{
|
||||
"name": "@agentclientprotocol/claude-agent-acp",
|
||||
"version": "0.107.3",
|
||||
"version": "0.109.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@agentclientprotocol/claude-agent-acp",
|
||||
"version": "0.107.3",
|
||||
"version": "0.109.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@agentclientprotocol/sdk": "2.7.0",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.3.325",
|
||||
"@agentclientprotocol/sdk": "2.9.1",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.3.330",
|
||||
"diff": "9.0.0",
|
||||
"zod": "4.6.7"
|
||||
},
|
||||
@@ -18,12 +18,12 @@
|
||||
"claude-agent-acp": "dist/index.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@anthropic-ai/sdk": "1.8.0",
|
||||
"@anthropic-ai/sdk": "1.12.0",
|
||||
"@eslint/js": "10.0.1",
|
||||
"@tsconfig/node22": "22.0.7",
|
||||
"@types/node": "26.6.6",
|
||||
"@typescript-eslint/eslint-plugin": "8.72.2",
|
||||
"@typescript-eslint/parser": "8.72.2",
|
||||
"@typescript-eslint/eslint-plugin": "8.73.0",
|
||||
"@typescript-eslint/parser": "8.73.0",
|
||||
"ajv": "8.20.0",
|
||||
"ajv-formats": "3.0.1",
|
||||
"eslint": "10.15.0",
|
||||
@@ -31,16 +31,16 @@
|
||||
"globals": "17.14.0",
|
||||
"prettier": "3.10.1",
|
||||
"typescript": "6.0.3",
|
||||
"vitest": "5.1.0"
|
||||
"vitest": "5.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22"
|
||||
}
|
||||
},
|
||||
"node_modules/@agentclientprotocol/sdk": {
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmjs.org/@agentclientprotocol/sdk/-/sdk-2.7.0.tgz",
|
||||
"integrity": "sha512-oXdQq0plWv3iOg01zJghNZRSuyWeMYxOgWIaSdwg1BZe2ZAC9LRhNDi023lNYxXq1zVIpQjIp8P6AfsxpvxF6g==",
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@agentclientprotocol/sdk/-/sdk-2.9.1.tgz",
|
||||
"integrity": "sha512-8iJdxGa3SunLfzqLLb3RfQFmr4hnmWeAyeAK6MbkJiXJbrRlMRgKsVnDl/7Hu48yu/30gAlytNDzh5W77rv5SA==",
|
||||
"license": "Apache-2.0",
|
||||
"peerDependencies": {
|
||||
"@modelcontextprotocol/server": "^2.4.0",
|
||||
@@ -53,22 +53,22 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk": {
|
||||
"version": "0.3.325",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk/-/claude-agent-sdk-0.3.325.tgz",
|
||||
"integrity": "sha512-MhSm2Fhk3DA/hhjdCKXDZWlnykpPWJjX42SogllAHMplY9ZKT+Ltb8QPtQxpe225Imfs4A8IKaNE4biivA+fHg==",
|
||||
"version": "0.3.330",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk/-/claude-agent-sdk-0.3.330.tgz",
|
||||
"integrity": "sha512-7om9Xus6tfkeCUCfzg6ilJuN6Z7okkEvJ0mx+ukXa/Id5U/6BGtPkOYni+3ebedwa3b9SVF7A05+ln+/9EoU/w==",
|
||||
"license": "SEE LICENSE IN README.md",
|
||||
"engines": {
|
||||
"node": ">=18.14.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.325",
|
||||
"@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.325",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.325",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.325",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-x64": "0.3.325",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.325",
|
||||
"@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.325",
|
||||
"@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.325"
|
||||
"@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.330",
|
||||
"@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.330",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.330",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.330",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-x64": "0.3.330",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.330",
|
||||
"@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.330",
|
||||
"@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.330"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@anthropic-ai/sdk": ">=0.93.0",
|
||||
@@ -77,9 +77,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-darwin-arm64": {
|
||||
"version": "0.3.325",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-arm64/-/claude-agent-sdk-darwin-arm64-0.3.325.tgz",
|
||||
"integrity": "sha512-0u8bTug2zH+zWE8CMiFrm/ldmH20uA9B/zhXpI7ATHFJnpPMdwTqE56CFM0m3LOwnNum0jpRn7XV1dn6Pf2pqA==",
|
||||
"version": "0.3.330",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-arm64/-/claude-agent-sdk-darwin-arm64-0.3.330.tgz",
|
||||
"integrity": "sha512-J9nqvcfD2V90O5uoR8At66R51VYtSMKnxSmPc0S4A4F5oX1VbokcpJLXU1yVCOuTtzr/OIHjRr9nn2vKi/S6rQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -90,9 +90,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-darwin-x64": {
|
||||
"version": "0.3.325",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-x64/-/claude-agent-sdk-darwin-x64-0.3.325.tgz",
|
||||
"integrity": "sha512-HD3YRFyM5H5QH2usS/WD6gobk3BEp2jq9dKyrkhAVdQIqFMlrcSrRhGA0i3R1IOLxtPAYkmDGepZ62k1kMOW9Q==",
|
||||
"version": "0.3.330",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-x64/-/claude-agent-sdk-darwin-x64-0.3.330.tgz",
|
||||
"integrity": "sha512-woe+f9qeZYWML5fACibNyth0xMDf22riNRNDryIYuhdteh7IoWrK6zC31cC2MrZRoqDZcPVtfOLND79+iZbrLA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -103,9 +103,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-linux-arm64": {
|
||||
"version": "0.3.325",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64/-/claude-agent-sdk-linux-arm64-0.3.325.tgz",
|
||||
"integrity": "sha512-28oVrCEN6M6MJP8Od4SK/scal1QdLbn5Sci+qL8j55l6csHtPeUYF9zdjWLniFKph43pejfZf5te/Vf/bwehkw==",
|
||||
"version": "0.3.330",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64/-/claude-agent-sdk-linux-arm64-0.3.330.tgz",
|
||||
"integrity": "sha512-2Q+kfzaoTvJv1rsyu+iR4UHDZ3nxiOfdXISk+2ydQShU9DqXNlgQAt3BdJMh0Yx4MrxB66TMphVvVQeRslwwhA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -119,9 +119,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-linux-arm64-musl": {
|
||||
"version": "0.3.325",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64-musl/-/claude-agent-sdk-linux-arm64-musl-0.3.325.tgz",
|
||||
"integrity": "sha512-72y6QNRZC4eMCxne/wNsuwNHsViSkgFKlYMCUVXxmiR9gpIMd3rf++oJMIsSuEAQqzqT7jwCrdtibv6R4bx5PA==",
|
||||
"version": "0.3.330",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64-musl/-/claude-agent-sdk-linux-arm64-musl-0.3.330.tgz",
|
||||
"integrity": "sha512-fXmuAEegw31v+kiBd51yn7RVhjs7Rz2lnhfx/+XJXqt5lyqR2v7Ul/U/9r1CQZKuIw8M3ms9jQqGpmKbgKndqQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -135,9 +135,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-linux-x64": {
|
||||
"version": "0.3.325",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64/-/claude-agent-sdk-linux-x64-0.3.325.tgz",
|
||||
"integrity": "sha512-wXEWbDmNYiorY5EKASYjvQct8zHShUPmAS9N/IAsgPA/cx2vsOFqPQw8jRQKeaW6AmFgx7k/Wf7THalNXbMEkQ==",
|
||||
"version": "0.3.330",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64/-/claude-agent-sdk-linux-x64-0.3.330.tgz",
|
||||
"integrity": "sha512-9w4uMdA3vNZXocwOUhivOGotXoRDxN/C/xPMkZMY9WPpKLAlj8upMZskNgPjQKlVRXhxPfNagcBijGPUH4WepA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -151,9 +151,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-linux-x64-musl": {
|
||||
"version": "0.3.325",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64-musl/-/claude-agent-sdk-linux-x64-musl-0.3.325.tgz",
|
||||
"integrity": "sha512-BHewYUTd7mDLR5iHTVt6Q28gJKLC5C24b1H3NM0qGt9dxnjVUh1Lza52GzHY2Rb9hAPQymLSXWuVh1OFoFQatA==",
|
||||
"version": "0.3.330",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64-musl/-/claude-agent-sdk-linux-x64-musl-0.3.330.tgz",
|
||||
"integrity": "sha512-kooZMdp6tFwNFkDXbGoNTZMgFcPQfJVfG+gZ2qAdkk11S6MFts9ybHRLQmzUK3VrqlahH7T9fmI2mNfzYgOXkw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -167,9 +167,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-win32-arm64": {
|
||||
"version": "0.3.325",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-arm64/-/claude-agent-sdk-win32-arm64-0.3.325.tgz",
|
||||
"integrity": "sha512-NH3I2o105oKK8lfJ5RlzCp+YTZn3qncwQ1xSzQ4jqn7LUddThIidpFU7B+TKQxh1X9eayAp7EtrBQ36mXflQwQ==",
|
||||
"version": "0.3.330",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-arm64/-/claude-agent-sdk-win32-arm64-0.3.330.tgz",
|
||||
"integrity": "sha512-6jscch7vk/XBSn7mm1i6zwTeiz05q98nKrQ3HdTavQEDGvXycMcB/QxIdMrs3vrdNEjWuoxwrL1qlT1lOyAWLg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -180,9 +180,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-win32-x64": {
|
||||
"version": "0.3.325",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-x64/-/claude-agent-sdk-win32-x64-0.3.325.tgz",
|
||||
"integrity": "sha512-pjqVL++V/2oMJ6u1HdB608bcTUvzts1e8hX93Q8khasy2JB+R823bnvpQapcOurOWB3+v1X2JXIjXyWcGPJCQQ==",
|
||||
"version": "0.3.330",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-x64/-/claude-agent-sdk-win32-x64-0.3.330.tgz",
|
||||
"integrity": "sha512-ooThWbUXlXKTDgj2VgWBXQ/6vSOTaAbBDWPvvCGNHi20haoSkw4uPX9gczkX+HJuVTslvvLiYIfe8zleVPzi7A==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -193,9 +193,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/sdk": {
|
||||
"version": "1.8.0",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-1.8.0.tgz",
|
||||
"integrity": "sha512-yDOArk2+Qpd/djEKmZjrv7JZ+pn5iBHARJ9PAdvfhGf4H5wNqTgY/2K0/yDKdQdm8G8hrNQchMlBAHpPK7yBfg==",
|
||||
"version": "1.12.0",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-1.12.0.tgz",
|
||||
"integrity": "sha512-0j9zwiQdkvr90LoiiBDUh7kae1lsNW2EqeE0vGceYne4BrmMDdDVoQ4KGOieUee0zWZbVJKsf/06JY8U5i63Xg==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@opentelemetry/api": "^1.4.1",
|
||||
@@ -215,9 +215,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/runtime": {
|
||||
"version": "7.29.14",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.14.tgz",
|
||||
"integrity": "sha512-Y5tqevQaUAZhhj82BpYMNC1ssvLQTVAfwKdm8iy8qwmhvC2/CpcAu8OC+QEtjM7pMk7knx83u1Qj8gzkicyelw==",
|
||||
"version": "7.29.15",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.15.tgz",
|
||||
"integrity": "sha512-304gsbbGVmQc+cNGHzwHBlqepYdWLKj3VXCQBGt/EGcV7PUPfKI7kAUNW1FZEOCwlQiLvQjg1JEaAlRQ616h+Q==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
@@ -328,23 +328,6 @@
|
||||
"node": "^20.19.0 || ^22.13.0 || >=24"
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/config-array/node_modules/minimatch": {
|
||||
"version": "11.0.8",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.8.tgz",
|
||||
"integrity": "sha512-nFQuYSTVrGvysVBps5Ih+0BdnYFN/Cj3C816r6+p7yK+FHrVLGE4O4N9AFwykrlNlvM2HYt+Rad1Uiro6h88Ig==",
|
||||
"dev": true,
|
||||
"license": "BlueOak-1.0.0",
|
||||
"dependencies": {
|
||||
"@isaacs/nonrecursive-glob-match": "^1.1.0",
|
||||
"brace-expansion": "^5.0.12"
|
||||
},
|
||||
"engines": {
|
||||
"node": "20 || >=22"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/config-helpers": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.7.0.tgz",
|
||||
@@ -417,9 +400,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@hono/node-server": {
|
||||
"version": "2.1.8",
|
||||
"resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-2.1.8.tgz",
|
||||
"integrity": "sha512-jdf7FHh6A1lzjpHHQUgxsg2GeER2vMetnAOfeActzcoli6jamlK+NAwL6Dsr5Fl3BS3tYUQzCdtZjU8Qxv7bEA==",
|
||||
"version": "2.1.11",
|
||||
"resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-2.1.11.tgz",
|
||||
"integrity": "sha512-KzKz9vl4vvr1vgLHamj+g5uonbrj5NwAdO3yzOS6cd2HjALVeOgTgeZOyAzNxejbkfOOPIcvuf/Tg8l1pEFLog==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
@@ -968,9 +951,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@tybys/wasm-util": {
|
||||
"version": "0.10.4",
|
||||
"resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.4.tgz",
|
||||
"integrity": "sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==",
|
||||
"version": "0.10.5",
|
||||
"resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.5.tgz",
|
||||
"integrity": "sha512-dOGOPxlaNV+G046mZzN+9C0dAcQZeSKcXiVaM0TYy/LM4ttTmgSBDxYfovcYI8Em3+eAbiAYpvWLOv8+ZVRJKA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
@@ -1029,17 +1012,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||
"version": "8.72.2",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.72.2.tgz",
|
||||
"integrity": "sha512-222PKFXKihmFpi/pS5njoBgdAqsPhj2/GBmFbrNw8Tq8gEG9Sv+kSlKFy4u2q+mJv9ZzJgM2Gkv/bUzRZwZw5g==",
|
||||
"version": "8.73.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.73.0.tgz",
|
||||
"integrity": "sha512-UkygMFer53Yzn29MCYFTHf34hGXf5KJhiDWfIm1tXtXRrym1CS6l5H9Y3yCtPWChpC0/f93H88gdj8tN0dd4kw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@eslint-community/regexpp": "^4.12.2",
|
||||
"@typescript-eslint/scope-manager": "8.72.2",
|
||||
"@typescript-eslint/type-utils": "8.72.2",
|
||||
"@typescript-eslint/utils": "8.72.2",
|
||||
"@typescript-eslint/visitor-keys": "8.72.2",
|
||||
"@typescript-eslint/scope-manager": "8.73.0",
|
||||
"@typescript-eslint/type-utils": "8.73.0",
|
||||
"@typescript-eslint/utils": "8.73.0",
|
||||
"@typescript-eslint/visitor-keys": "8.73.0",
|
||||
"ignore": "^7.0.5",
|
||||
"natural-compare": "^1.4.0",
|
||||
"ts-api-utils": "^2.5.0"
|
||||
@@ -1052,22 +1035,22 @@
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@typescript-eslint/parser": "^8.72.2",
|
||||
"@typescript-eslint/parser": "^8.73.0",
|
||||
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/parser": {
|
||||
"version": "8.72.2",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.72.2.tgz",
|
||||
"integrity": "sha512-llP+T1YuJOLlxEciP6OyQGtz5SMxyn+9LA2BvZw5RmToGVa1y4beEDVQL6Gje7T5WFYh19WREjDCN9Ev4gm5AA==",
|
||||
"version": "8.73.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.73.0.tgz",
|
||||
"integrity": "sha512-AuL45bVcmssHfZ3Di3cs9Q0l4gBm4ZFVrJOQEE7VpqW+PVgQaEwSwazz4TVIiFabXkk6U51EprYDwqw+HR8ePw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "8.72.2",
|
||||
"@typescript-eslint/types": "8.72.2",
|
||||
"@typescript-eslint/typescript-estree": "8.72.2",
|
||||
"@typescript-eslint/visitor-keys": "8.72.2",
|
||||
"@typescript-eslint/scope-manager": "8.73.0",
|
||||
"@typescript-eslint/types": "8.73.0",
|
||||
"@typescript-eslint/typescript-estree": "8.73.0",
|
||||
"@typescript-eslint/visitor-keys": "8.73.0",
|
||||
"debug": "^4.4.3"
|
||||
},
|
||||
"engines": {
|
||||
@@ -1083,14 +1066,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/project-service": {
|
||||
"version": "8.72.2",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.72.2.tgz",
|
||||
"integrity": "sha512-6y5dLTZdHhI8Eh3yIQ/bfQhRKwn5e+TpJj64o18Cngc0iW/BCrVvrr6zGYqXPnYH31u6YXAYiFh0+qxX5mybJw==",
|
||||
"version": "8.73.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.73.0.tgz",
|
||||
"integrity": "sha512-/pEf8Rc4Mjk+qJnY0uO1+Gadeal8uv50xpuic+srG2vIVatA0XxvWMUeMtFvs6OCHqftiQ7/+qH4aehG5stzIA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/tsconfig-utils": "^8.72.2",
|
||||
"@typescript-eslint/types": "^8.72.2",
|
||||
"@typescript-eslint/tsconfig-utils": "^8.73.0",
|
||||
"@typescript-eslint/types": "^8.73.0",
|
||||
"debug": "^4.4.3"
|
||||
},
|
||||
"engines": {
|
||||
@@ -1105,14 +1088,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/scope-manager": {
|
||||
"version": "8.72.2",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.72.2.tgz",
|
||||
"integrity": "sha512-iIoMJ6/8c1/QpFNyFjU0d1YzPco4MsZjQw0k3V+vfzNWAFmUmvhlyMoYEoYYDQZXc+J6Gi1X5XcxlzW2taIIGQ==",
|
||||
"version": "8.73.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.73.0.tgz",
|
||||
"integrity": "sha512-/TjD738Iq2rzj5z0ixVOi+TsvgjAzZPLPaH1yWdDBytR/HTR5gMpyYWZeCe5WTQZLwk3ho8AV7U3muoQCRtXBQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.72.2",
|
||||
"@typescript-eslint/visitor-keys": "8.72.2"
|
||||
"@typescript-eslint/types": "8.73.0",
|
||||
"@typescript-eslint/visitor-keys": "8.73.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
@@ -1123,9 +1106,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/tsconfig-utils": {
|
||||
"version": "8.72.2",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.72.2.tgz",
|
||||
"integrity": "sha512-+h3iCgZXuTNtoLXcnnjP12ZUHLMqoUcIHPfQrFEXTUqvb9dF8QK9b5nv5VtSo5fLkdHuks8ehbTzZj3rImAm9w==",
|
||||
"version": "8.73.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.73.0.tgz",
|
||||
"integrity": "sha512-lmtCFOfYaJfpqZywGuXi4FpNtE+NQ+YLe3T0K9rtEDcW8ZuGWvfI++pj8r05sYMI8vWT2CYK4rWyedmD6Rp4og==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -1140,15 +1123,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/type-utils": {
|
||||
"version": "8.72.2",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.72.2.tgz",
|
||||
"integrity": "sha512-STfkR38qIdhfkLpgtXnUjAzsNy4xouqiBO0lrVc/Wpk9Kem5/aHXUx1J8dGC16zpdYN1+yc2ILQ28er1kXX7ag==",
|
||||
"version": "8.73.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.73.0.tgz",
|
||||
"integrity": "sha512-MOC9i4xy1F7KcDde7Ip8jf1SrRiALb2Km4UWxGNjUE2YlhjIEo1ayE27GHIwIQyfWuHTmEonQT14uyurlyC6aA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.72.2",
|
||||
"@typescript-eslint/typescript-estree": "8.72.2",
|
||||
"@typescript-eslint/utils": "8.72.2",
|
||||
"@typescript-eslint/types": "8.73.0",
|
||||
"@typescript-eslint/typescript-estree": "8.73.0",
|
||||
"@typescript-eslint/utils": "8.73.0",
|
||||
"debug": "^4.4.3",
|
||||
"ts-api-utils": "^2.5.0"
|
||||
},
|
||||
@@ -1165,9 +1148,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/types": {
|
||||
"version": "8.72.2",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.72.2.tgz",
|
||||
"integrity": "sha512-Xfn37OLZx03+PCU7qWx9DTv2FCRh1E6fk2+wONeNY15HXIwtcwuveaSwVpGAUptkNmPQegRxW5JyRel9T7wrog==",
|
||||
"version": "8.73.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.73.0.tgz",
|
||||
"integrity": "sha512-O/1ytYzflF16QDKXx4/qOXg1IuZp+n7hr9t+S0nv7N/2Tl8rJiNCshztV1gcSUvHbPtoX3+zmNbtSAyVbzxVfw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -1179,18 +1162,18 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/typescript-estree": {
|
||||
"version": "8.72.2",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.72.2.tgz",
|
||||
"integrity": "sha512-pQEGqIK/cqEvKivVWaFLYpe7XYejFxfuAOi4mu1oAWFvIo36aRHI9esRFTUxcIy/z8N482RJyH+LpZB0ZIU7Ow==",
|
||||
"version": "8.73.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.73.0.tgz",
|
||||
"integrity": "sha512-InjlBkSdWceIwIBWSwS3ENUp+i0O02PGX3Zv2wnihWJC1WDVGvG7mTHuf8b57uAaITj94d6tRPDH+sUEtXdRQQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/project-service": "8.72.2",
|
||||
"@typescript-eslint/tsconfig-utils": "8.72.2",
|
||||
"@typescript-eslint/types": "8.72.2",
|
||||
"@typescript-eslint/visitor-keys": "8.72.2",
|
||||
"@typescript-eslint/project-service": "8.73.0",
|
||||
"@typescript-eslint/tsconfig-utils": "8.73.0",
|
||||
"@typescript-eslint/types": "8.73.0",
|
||||
"@typescript-eslint/visitor-keys": "8.73.0",
|
||||
"debug": "^4.4.3",
|
||||
"minimatch": "^10.2.2",
|
||||
"minimatch": "^11.0.1",
|
||||
"semver": "^7.7.3",
|
||||
"tinyglobby": "^0.2.15",
|
||||
"ts-api-utils": "^2.5.0"
|
||||
@@ -1203,20 +1186,26 @@
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@typescript/native": "npm:typescript@>=7.1.0-dev.20261009.1 || >=7.1.0-beta <7.1.0-dev",
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@typescript/native": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/utils": {
|
||||
"version": "8.72.2",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.72.2.tgz",
|
||||
"integrity": "sha512-hv3eRYbpPbbpezuax1EfGrzpa3C4ySgNZkPUkLOWOAjU8HsOKowEDAr8C7nsNl1C+SBSKDpvno6VKHnlhvp9iA==",
|
||||
"version": "8.73.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.73.0.tgz",
|
||||
"integrity": "sha512-j2SVJJvVkXdUL0WcEzo4vEH1mO1vIi8KlVukcYA2MgMZvYN2LlZR4PmsW+GTSxSW24j6Q/EP7+MOifLtg5hmsA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.9.1",
|
||||
"@typescript-eslint/scope-manager": "8.72.2",
|
||||
"@typescript-eslint/types": "8.72.2",
|
||||
"@typescript-eslint/typescript-estree": "8.72.2"
|
||||
"@typescript-eslint/scope-manager": "8.73.0",
|
||||
"@typescript-eslint/types": "8.73.0",
|
||||
"@typescript-eslint/typescript-estree": "8.73.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
@@ -1231,13 +1220,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/visitor-keys": {
|
||||
"version": "8.72.2",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.72.2.tgz",
|
||||
"integrity": "sha512-NAGrjn0Pitjqzq/GkgMC4kBYm233PQ8GffyQ9+kTA3AlNQYEzOf25EIM02BAHZv5FRJSpHpJk+OGUxVkOB93GQ==",
|
||||
"version": "8.73.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.73.0.tgz",
|
||||
"integrity": "sha512-k4lsFVpRZICbltkIEEH4hZRkwXkqDF1GHBpClKQOHQY+RkoZAAuyc1ci3I6p+CB6v3U4jaHIUshc4RzzQXZWLg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.72.2",
|
||||
"@typescript-eslint/types": "8.73.0",
|
||||
"eslint-visitor-keys": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
@@ -1262,16 +1251,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/mocker": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.1.0.tgz",
|
||||
"integrity": "sha512-5umB9/jlWcqVS6fsrFmv5Gdnpu6wAUio/lEOwAmvB7v+lFo/IW2B9FhAD0p19GCULTgMzLCdUmuCDCnAzWgppQ==",
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.1.1.tgz",
|
||||
"integrity": "sha512-b2OgTB4+3ImWIVafXKazJXwLKwQxUNnix6b3xUvUTMh7RyXlrtzoxfZr8aEz9zkHOMAS4K5lu3TvFWoiVeVTQg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@jridgewell/trace-mapping": "0.3.31",
|
||||
"@vitest/spy": "5.1.0",
|
||||
"@vitest/spy": "5.1.1",
|
||||
"estree-walker": "^3.0.3",
|
||||
"magic-string": "^1.4.3"
|
||||
"magic-string": "^1.4.5"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/vitest"
|
||||
@@ -1290,9 +1279,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/spy": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.1.0.tgz",
|
||||
"integrity": "sha512-2DPO5OMHWKrBngC+fCmTQqemNF0gidRhp3lxbBmRhW+M1XJrfgPpqNqWVevXtn2f2ufD5ZaR1B6B641aAlcX5A==",
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.1.1.tgz",
|
||||
"integrity": "sha512-6K8C6alQG1/Yc8/ZI22iJS7JEsxPdVzqtqDq+/xM4Z0mGVykemMVjLhqMy/q6/IHYG3kKD8hKSwRen/ZdyI9vQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
@@ -1886,23 +1875,6 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/eslint/node_modules/minimatch": {
|
||||
"version": "11.0.8",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.8.tgz",
|
||||
"integrity": "sha512-nFQuYSTVrGvysVBps5Ih+0BdnYFN/Cj3C816r6+p7yK+FHrVLGE4O4N9AFwykrlNlvM2HYt+Rad1Uiro6h88Ig==",
|
||||
"dev": true,
|
||||
"license": "BlueOak-1.0.0",
|
||||
"dependencies": {
|
||||
"@isaacs/nonrecursive-glob-match": "^1.1.0",
|
||||
"brace-expansion": "^5.0.12"
|
||||
},
|
||||
"engines": {
|
||||
"node": "20 || >=22"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/espree": {
|
||||
"version": "11.2.0",
|
||||
"resolved": "https://registry.npmjs.org/espree/-/espree-11.2.0.tgz",
|
||||
@@ -2078,9 +2050,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/express-rate-limit": {
|
||||
"version": "8.7.4",
|
||||
"resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-8.7.4.tgz",
|
||||
"integrity": "sha512-LKBXzX700wz3zAGNNmVnjRI5mEbYkLv7UbMI4+9Xa+JPcg2UZh6AgY/2CZh9RrJjFM5ttC/N1lD+KzyFoZITCw==",
|
||||
"version": "8.7.5",
|
||||
"resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-8.7.5.tgz",
|
||||
"integrity": "sha512-wi+v38cx2EqD0JnhE/e74o5tFqKWUOAPFJIgyEiqJ8v2MNpoOAA3kI2hXYOI+YM+HE5yqbdAlVxm2GqOIeYOgA==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
@@ -2403,9 +2375,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/hono": {
|
||||
"version": "4.13.18",
|
||||
"resolved": "https://registry.npmjs.org/hono/-/hono-4.13.18.tgz",
|
||||
"integrity": "sha512-H9q/E1XizaWstJxUW881dmLxEj+t/TrGGnyxINkm4+sK0qUwsMtFdo2BWI9Vs3cIS19MU6b6iCijoUoEf4f3DA==",
|
||||
"version": "4.13.19",
|
||||
"resolved": "https://registry.npmjs.org/hono/-/hono-4.13.19.tgz",
|
||||
"integrity": "sha512-KmXvQAXwcAHV+muzbIwoJ23niEB5nMoDVr9WcRkU8mvjUECm/1+7v4Jgp7P7a+H6MLFrh+vXrGonGrGS+RQfkA==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
@@ -2458,9 +2430,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/ignore": {
|
||||
"version": "7.0.14",
|
||||
"resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.14.tgz",
|
||||
"integrity": "sha512-wCBiZ77u1tuWde6G/nfOtLaCTYcFDU5yCzARzK10y+rLhzYoL7a7yEemcopcc2Mzow7gZOIjnV2ym1NYmdiJOQ==",
|
||||
"version": "7.0.16",
|
||||
"resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.16.tgz",
|
||||
"integrity": "sha512-52N+Y4HRMOJmbLmr+DqO4iSRyyB7N52gm7PWCT6h0p978+oKbqHCB7gIJIwZvBUsjlSdWbrBFqUSmIFNZMpn0A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -2541,9 +2513,9 @@
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/jose": {
|
||||
"version": "6.2.17",
|
||||
"resolved": "https://registry.npmjs.org/jose/-/jose-6.2.17.tgz",
|
||||
"integrity": "sha512-wOuK9V1yujQFH5S0ZWmLcDZN7+IKh9bUCC2ZPCf2HDlol3WWHy+PPyNjEI75FXRLMp3vDKQcupP59xhVU95hcg==",
|
||||
"version": "6.2.18",
|
||||
"resolved": "https://registry.npmjs.org/jose/-/jose-6.2.18.tgz",
|
||||
"integrity": "sha512-doV4thUwgkrycJH4yLeqwTGIIZphHl+pk7CPReuMIhYhncmgzdko85MaCG4YQFTxqMFr1/oEH32tZuKKovcDEg==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"funding": {
|
||||
@@ -2983,16 +2955,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/minimatch": {
|
||||
"version": "10.2.6",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz",
|
||||
"integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==",
|
||||
"version": "11.0.9",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.9.tgz",
|
||||
"integrity": "sha512-KCFkfyjqerNlSstjlhIGNXIKZGA/6O4V4RlhZ+Dsr621SPPw0mzlypE9D9ZOoPiVefHID+j7/XuMMlqfD/F60Q==",
|
||||
"dev": true,
|
||||
"license": "BlueOak-1.0.0",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^5.0.8"
|
||||
"@isaacs/nonrecursive-glob-match": "^1.1.0",
|
||||
"brace-expansion": "^5.0.12"
|
||||
},
|
||||
"engines": {
|
||||
"node": "18 || 20 || >=22"
|
||||
"node": "20 || >=22"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
@@ -3073,9 +3046,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/object-inspect": {
|
||||
"version": "1.13.4",
|
||||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
|
||||
"integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
|
||||
"version": "1.14.0",
|
||||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.14.0.tgz",
|
||||
"integrity": "sha512-IVgHNlp/jwQX271+Xzoq9LZNTWXxZK+cEOrGBOBxXNbn7fapnZ+Ts6TVMgNOuAezwG2wdtnMX97tTPK6VEnuOQ==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
@@ -3444,9 +3417,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/router": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz",
|
||||
"integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==",
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/router/-/router-2.3.0.tgz",
|
||||
"integrity": "sha512-bpowRfGjEPe8t9R6fJIzhwmyCGAXwKvxBUsgJm+bJukwdcWmUXbMo7p22w7aYmQBPQTUMNqMV39YX0kMou3z8w==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
@@ -3458,6 +3431,10 @@
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/safer-buffer": {
|
||||
@@ -3632,20 +3609,20 @@
|
||||
}
|
||||
},
|
||||
"node_modules/source-map-js": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz",
|
||||
"integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==",
|
||||
"version": "1.2.4",
|
||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.4.tgz",
|
||||
"integrity": "sha512-J7ZjMvHd9O1fcT/5V09QWaaSl2BbWx3F6O08spde82Namf9UB0GxRVIPiNbVsdKkoizHiSpTodo3vp2bAy91MA==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/standardwebhooks": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/standardwebhooks/-/standardwebhooks-1.1.1.tgz",
|
||||
"integrity": "sha512-bCbX9ZEyFkWPsRz7Bl3NuQUJohmwGSev/yhr7vhaGPlc4AfIrspIRa6cPTBuI1ItmrTDJ4d/S2hCsfe4+vQGnQ==",
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/standardwebhooks/-/standardwebhooks-1.3.0.tgz",
|
||||
"integrity": "sha512-5W9skHjqAm2dlA9wWvglTP+oX47JX4lFXVk1aJV7+TG1snvTR4QXaVgPscEzvOw9GRreeavMwbqEeL+MGhZHCg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@stablelib/base64": "^1.0.0",
|
||||
@@ -3670,9 +3647,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/tinybench": {
|
||||
"version": "6.2.3",
|
||||
"resolved": "https://registry.npmjs.org/tinybench/-/tinybench-6.2.3.tgz",
|
||||
"integrity": "sha512-Al01C2JIBnO2CXCAPbpAl6sUiOZHeThGtHYNTa51JRw9PyWOCdr+9Ong05R4qg/Sk3+H645E8ov1h2c58ityNw==",
|
||||
"version": "6.2.4",
|
||||
"resolved": "https://registry.npmjs.org/tinybench/-/tinybench-6.2.4.tgz",
|
||||
"integrity": "sha512-SQ52jEncXxbMCzJuY2A/jGIbbAu6NYsBWW7grz2pNE+EnzQdoGaoBfpk4qC/opE7qiUcGmGgaGIz5EoHdS1O9w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -3921,22 +3898,22 @@
|
||||
}
|
||||
},
|
||||
"node_modules/vitest": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/vitest/-/vitest-5.1.0.tgz",
|
||||
"integrity": "sha512-MzmNFnrwa8v8lF1bLxw3UJ4EREwVOVb75VqJZmUDRjJ6EluK/x9th7qTbaeDk41WxE1GxWqmTXcdsfobfH5sOA==",
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/vitest/-/vitest-5.1.1.tgz",
|
||||
"integrity": "sha512-trVmzUFOSraCZcI3uZIMD5FqBh4atFkC/XuJP/IU7qtyQay0FCs3Ia+0QiQ2JJwGyWG/xrcBoJNel2+O7kEZ0g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/chai": "^5.2.2",
|
||||
"@vitest/mocker": "5.1.0",
|
||||
"@vitest/mocker": "5.1.1",
|
||||
"chai": "^6.3.0",
|
||||
"es-module-lexer": "^2.3.2",
|
||||
"expect-type": "^1.4.0",
|
||||
"magic-string": "^1.4.3",
|
||||
"magic-string": "^1.4.5",
|
||||
"obug": "^3.0.0",
|
||||
"picomatch": "^4.0.7",
|
||||
"std-env": "^4.3.0",
|
||||
"tinybench": "^6.2.2",
|
||||
"tinybench": "^6.2.3",
|
||||
"tinyexec": "^1.3.1",
|
||||
"tinyglobby": "^0.2.17",
|
||||
"why-is-node-running": "3.2.1"
|
||||
@@ -3954,12 +3931,12 @@
|
||||
"@edge-runtime/vm": "*",
|
||||
"@opentelemetry/api": "^1.9.0",
|
||||
"@types/node": "^22.0.0 || >=24.0.0",
|
||||
"@vitest/browser-playwright": "5.1.0",
|
||||
"@vitest/browser-preview": "5.1.0",
|
||||
"@vitest/browser-playwright": "5.1.1",
|
||||
"@vitest/browser-preview": "5.1.1",
|
||||
"@vitest/browser-webdriverio": "^5.0.0-beta.5 || >=5.0.0",
|
||||
"@vitest/coverage-istanbul": "5.1.0",
|
||||
"@vitest/coverage-v8": "5.1.0",
|
||||
"@vitest/ui": "5.1.0",
|
||||
"@vitest/coverage-istanbul": "5.1.1",
|
||||
"@vitest/coverage-v8": "5.1.1",
|
||||
"@vitest/ui": "5.1.1",
|
||||
"happy-dom": "*",
|
||||
"jsdom": "*",
|
||||
"vite": "^6.4.0 || ^7.0.0 || ^8.0.0"
|
||||
|
||||
14
package.json
14
package.json
@@ -3,7 +3,7 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"version": "0.107.3",
|
||||
"version": "0.109.1",
|
||||
"description": "An ACP-compatible coding agent powered by the Claude Agent SDK (TypeScript)",
|
||||
"main": "dist/lib.js",
|
||||
"types": "dist/lib.d.ts",
|
||||
@@ -68,18 +68,18 @@
|
||||
"node": ">=22"
|
||||
},
|
||||
"dependencies": {
|
||||
"@agentclientprotocol/sdk": "2.7.0",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.3.325",
|
||||
"@agentclientprotocol/sdk": "2.9.1",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.3.330",
|
||||
"diff": "9.0.0",
|
||||
"zod": "4.6.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@anthropic-ai/sdk": "1.8.0",
|
||||
"@anthropic-ai/sdk": "1.12.0",
|
||||
"@eslint/js": "10.0.1",
|
||||
"@tsconfig/node22": "22.0.7",
|
||||
"@types/node": "26.6.6",
|
||||
"@typescript-eslint/eslint-plugin": "8.72.2",
|
||||
"@typescript-eslint/parser": "8.72.2",
|
||||
"@typescript-eslint/eslint-plugin": "8.73.0",
|
||||
"@typescript-eslint/parser": "8.73.0",
|
||||
"ajv": "8.20.0",
|
||||
"ajv-formats": "3.0.1",
|
||||
"eslint": "10.15.0",
|
||||
@@ -87,6 +87,6 @@
|
||||
"globals": "17.14.0",
|
||||
"prettier": "3.10.1",
|
||||
"typescript": "6.0.3",
|
||||
"vitest": "5.1.0"
|
||||
"vitest": "5.1.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,12 +3,14 @@ import type {
|
||||
CompleteElicitationNotification,
|
||||
CreateElicitationRequest,
|
||||
CreateElicitationResponse,
|
||||
McpServerAcp,
|
||||
ReadTextFileRequest,
|
||||
ReadTextFileResponse,
|
||||
RequestPermissionResponse,
|
||||
WriteTextFileRequest,
|
||||
WriteTextFileResponse,
|
||||
} from "@agentclientprotocol/sdk/unstable";
|
||||
import type { McpHttpServerConfig } from "@anthropic-ai/claude-agent-sdk";
|
||||
import type { AcpSessionNotification } from "./acp-subagents.js";
|
||||
import type { AcpPermissionRequest } from "./permissions/presentation.js";
|
||||
|
||||
@@ -43,4 +45,10 @@ export interface AcpClient {
|
||||
authStatusUpdate(params: AuthStatusUpdateNotification): Promise<void>;
|
||||
/** Send a custom (extension) notification, e.g. `_claude/sdkMessage`. */
|
||||
extNotification(method: string, params: Record<string, unknown>): Promise<void>;
|
||||
/**
|
||||
* The SDK config of an MCP server that the client serves over this
|
||||
* connection (`"type": "acp"`): an endpoint that sends each MCP request to
|
||||
* the client as `mcp/message` (see `McpOverAcp` in `mcp-servers.ts`).
|
||||
*/
|
||||
mcpServerOverAcp(server: McpServerAcp): Promise<McpHttpServerConfig>;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import type {
|
||||
ClientCapabilities,
|
||||
SessionCapabilities,
|
||||
SessionNotification,
|
||||
import {
|
||||
RequestError,
|
||||
type ClientCapabilities,
|
||||
type SessionCapabilities,
|
||||
type SessionNotification,
|
||||
} from "@agentclientprotocol/sdk/unstable";
|
||||
import {
|
||||
AIR_NATIVE_SUBAGENT_SESSIONS_CAPABILITY,
|
||||
@@ -24,6 +25,71 @@ export { AIR_NATIVE_SUBAGENT_SESSIONS_CAPABILITY } from "./air-extension.js";
|
||||
*/
|
||||
export type SubagentForm = "rfd" | "air";
|
||||
|
||||
/**
|
||||
* The error of a client's request that names a child session, other than
|
||||
* `session/cancel`: invalid params (-32602), as the RFD asks, not the -32002
|
||||
* of an unknown session. `method` completes "the client cannot … it".
|
||||
*/
|
||||
export function restrictedChild(sessionId: string, method: string): RequestError {
|
||||
return RequestError.invalidParams(
|
||||
{ sessionId },
|
||||
`${sessionId} is a subagent session: the client cannot ${method} it. Its parent session runs it.`,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* The child sessions that the sessions of one connection announced with
|
||||
* `subagent_update`, while they run or in the replay of a `session/load` or
|
||||
* `session/resume`. The client knows such a session, so a request that names
|
||||
* it fails as {@link restrictedChild} says, and not as a request of an unknown
|
||||
* session.
|
||||
*
|
||||
* A child is known from its announcement until the client ends its root
|
||||
* session ({@link rootClosed}): with `session/close`, or a request that closes
|
||||
* the session too, such as `session/delete`. Nothing else removes it: after a
|
||||
* conversation reset (`/clear`), a restart of the root's query or the end of
|
||||
* the root's Claude Code process, the client still holds the child.
|
||||
*
|
||||
* AIR's draft announces a child with `subagent_spawned` and keeps its own
|
||||
* rules, so its children are never known here.
|
||||
*/
|
||||
export class AnnouncedChildren {
|
||||
/** The root session of each announced child session, by the child's id. */
|
||||
private readonly rootByChild = new Map<string, string>();
|
||||
|
||||
/**
|
||||
* Takes a session update that goes to the client. A `subagent_update`
|
||||
* announces the child session it names, or reports on one that is known
|
||||
* already. The update's own session is the child's parent, which can be a
|
||||
* child itself: its root is the child's too.
|
||||
*/
|
||||
sending(notification: {
|
||||
sessionId: string;
|
||||
update: { sessionUpdate: string; sessionId?: unknown };
|
||||
}): void {
|
||||
const { sessionId: parent, update } = notification;
|
||||
if (update.sessionUpdate !== "subagent_update" || typeof update.sessionId !== "string") return;
|
||||
this.rootByChild.set(update.sessionId, this.rootByChild.get(parent) ?? parent);
|
||||
}
|
||||
|
||||
/** Whether `sessionId` is a child session that the client knows. */
|
||||
has(sessionId: string): boolean {
|
||||
return this.rootByChild.has(sessionId);
|
||||
}
|
||||
|
||||
/** The root session of the child session `sessionId`, when the client knows it. */
|
||||
rootOf(sessionId: string): string | undefined {
|
||||
return this.rootByChild.get(sessionId);
|
||||
}
|
||||
|
||||
/** The client ended the session `rootSessionId`, and can no longer name its children. */
|
||||
rootClosed(rootSessionId: string): void {
|
||||
for (const [child, root] of this.rootByChild) {
|
||||
if (root === rootSessionId) this.rootByChild.delete(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** The form of native subagent sessions that the client gets, or none. */
|
||||
export function subagentForm(capabilities?: ClientCapabilities | null): SubagentForm | undefined {
|
||||
if (!clientSupportsSubagents(capabilities)) return undefined;
|
||||
|
||||
@@ -20,13 +20,19 @@ import {
|
||||
AUTH_STATUS_PROBE_TIMEOUT_MS,
|
||||
type AuthStatus,
|
||||
type AuthStatusKind,
|
||||
cliAuthIdentity,
|
||||
fromAccountInfo,
|
||||
fromCliStatus,
|
||||
mergeAuthStatus,
|
||||
parseCliAuthStatus,
|
||||
sameAuthStatus,
|
||||
toAcpAuthStatus,
|
||||
} from "./auth-status.js";
|
||||
import { claudeCliPath } from "./claude-cli.js";
|
||||
import {
|
||||
claudeAuthRefusal,
|
||||
isClaudeEnterprisePlan,
|
||||
shouldHideClaudeAuth,
|
||||
} from "./hide-claude-auth.js";
|
||||
import type { SettingsManager } from "./settings.js";
|
||||
|
||||
const execFileAsync = promisify(execFile);
|
||||
@@ -81,8 +87,7 @@ export class AuthStatusReporter {
|
||||
private probeRuns = 0;
|
||||
/** The latest-started probe run that published its read. */
|
||||
private publishedRun = 0;
|
||||
/** The last `auth/status_update` payload sent, as JSON. */
|
||||
private sentAcp?: string;
|
||||
private acpStatus: AcpAuthStatus = { state: "unknown" };
|
||||
|
||||
constructor(private readonly options: AuthStatusReporterOptions) {}
|
||||
|
||||
@@ -100,28 +105,24 @@ export class AuthStatusReporter {
|
||||
* reach here at all (see the epoch check in the probe and the guards at
|
||||
* session create).
|
||||
*/
|
||||
set(next: AuthStatus | undefined): void {
|
||||
set(next: AuthStatus | undefined, refused = false): void {
|
||||
if (!next) {
|
||||
return;
|
||||
}
|
||||
if (sameAuthStatus(this.current, next)) {
|
||||
if (!sameAuthStatus(this.current, next)) {
|
||||
this.current = next;
|
||||
// Older clients still get the actual identity, including one the guard refused.
|
||||
void Promise.resolve()
|
||||
.then(() => this.options.push(next))
|
||||
.catch((error) => {
|
||||
this.options.logger.error("Failed to send _auth/status_update:", error);
|
||||
});
|
||||
}
|
||||
const acp = toAcpAuthStatus(next, refused);
|
||||
if (JSON.stringify(acp) === JSON.stringify(this.acpStatus)) {
|
||||
return;
|
||||
}
|
||||
this.current = next;
|
||||
// ACP notifications get no reply, and clients that do not know the method
|
||||
// drop it silently — send unconditionally and never fail a caller on it.
|
||||
void Promise.resolve()
|
||||
.then(() => this.options.push(next))
|
||||
.catch((error) => {
|
||||
this.options.logger.error("Failed to send _auth/status_update:", error);
|
||||
});
|
||||
// Compared on its own payload: two identities can map to the same one.
|
||||
const acp = toAcpAuthStatus(next);
|
||||
const sent = JSON.stringify(acp);
|
||||
if (sent === this.sentAcp) {
|
||||
return;
|
||||
}
|
||||
this.sentAcp = sent;
|
||||
this.acpStatus = acp;
|
||||
void Promise.resolve()
|
||||
.then(() => this.options.pushAcp(acp))
|
||||
.catch((error) => {
|
||||
@@ -152,7 +153,7 @@ export class AuthStatusReporter {
|
||||
} else {
|
||||
await this.probe();
|
||||
}
|
||||
return toAcpAuthStatus(this.current);
|
||||
return this.acpStatus;
|
||||
}
|
||||
|
||||
/** A login or a logout: any probe already running read the world before it. */
|
||||
@@ -224,8 +225,11 @@ export class AuthStatusReporter {
|
||||
return;
|
||||
}
|
||||
const fromSession = fromAccountInfo(account, apiKeyHelper);
|
||||
if (fromSession) {
|
||||
this.set(mergeAuthStatus(this.current, fromSession, "session"));
|
||||
if (account && fromSession) {
|
||||
this.set(
|
||||
mergeAuthStatus(this.current, fromSession, "session"),
|
||||
shouldHideClaudeAuth() && claudeAuthRefusal(account) !== undefined,
|
||||
);
|
||||
} else if (!this.loggedUninformativeAccount) {
|
||||
this.loggedUninformativeAccount = true;
|
||||
this.options.logger.log(
|
||||
@@ -308,19 +312,20 @@ export class AuthStatusReporter {
|
||||
}
|
||||
stdout = failed.stdout;
|
||||
}
|
||||
let status = fromCliStatus(stdout, apiKeyHelper);
|
||||
const cli = parseCliAuthStatus(stdout);
|
||||
if (!cli) {
|
||||
logger.error("claude auth status returned unparseable output");
|
||||
return undefined;
|
||||
}
|
||||
let status = cliAuthIdentity(cli, apiKeyHelper);
|
||||
if (!context && status?.kind === "api_key" && status.detail === "API key helper") {
|
||||
try {
|
||||
const resolved = await resolveSettings({ cwd: process.cwd() });
|
||||
status = fromCliStatus(stdout, filterEscalatingDefaultMode(resolved).apiKeyHelper);
|
||||
status = cliAuthIdentity(cli, filterEscalatingDefaultMode(resolved).apiKeyHelper);
|
||||
} catch {
|
||||
logger.error("Could not resolve auth source settings");
|
||||
}
|
||||
}
|
||||
if (!status) {
|
||||
logger.error("claude auth status returned unparseable output");
|
||||
return undefined;
|
||||
}
|
||||
if (epoch !== this.epoch) {
|
||||
// A login or logout landed while this probe was running; the newer
|
||||
// state wins and this answer is discarded, never published.
|
||||
@@ -338,7 +343,14 @@ export class AuthStatusReporter {
|
||||
// same login (no organization, say). Keep those extra fields rather than
|
||||
// regressing the payload; a different identity replaces it wholesale.
|
||||
const merged = mergeAuthStatus(this.current, status, "cli");
|
||||
this.set(merged);
|
||||
// The CLI names the effective credential, not the SDK's accountInfo tokenSource.
|
||||
// An OAuth setup token can carry a plan but, like an API key, is allowed.
|
||||
const refused =
|
||||
shouldHideClaudeAuth() &&
|
||||
status.kind === "account" &&
|
||||
cli.authMethod !== "oauth_token" &&
|
||||
!isClaudeEnterprisePlan(cli.subscriptionType);
|
||||
this.set(merged, refused);
|
||||
this.options.onProbe?.(status.kind);
|
||||
return merged;
|
||||
}
|
||||
|
||||
@@ -109,14 +109,14 @@ export type AcpAuthStatus = Pick<AuthStatusResponse, "state" | "accounts">;
|
||||
* `_meta.claudeCode` carries the `kind` and `plan`, and the `detail` again
|
||||
* for clients that read it there.
|
||||
*
|
||||
* `--hide-claude-auth` does not change the payload: it reports the login the
|
||||
* CLI holds, also when the subscription guard refuses to use it.
|
||||
* The legacy extension still reports a refused identity for display. ACP
|
||||
* reports that sign-in is needed instead of listing it as an active account.
|
||||
*/
|
||||
export function toAcpAuthStatus(status: AuthStatus | undefined): AcpAuthStatus {
|
||||
export function toAcpAuthStatus(status: AuthStatus | undefined, refused = false): AcpAuthStatus {
|
||||
if (!status) {
|
||||
return { state: "unknown" };
|
||||
}
|
||||
if (status.kind === "none") {
|
||||
if (refused || status.kind === "none") {
|
||||
return { state: "unauthenticated" };
|
||||
}
|
||||
const account: AuthAccount = { label: status.label, active: true };
|
||||
@@ -236,10 +236,8 @@ export function fromAccountInfo(
|
||||
});
|
||||
}
|
||||
|
||||
/** Pre-session mapping from `claude auth status --json` stdout. Returns
|
||||
* `undefined` when the output is not the expected JSON object, so callers can
|
||||
* report "not known" instead of guessing. */
|
||||
export function fromCliStatus(stdout: string, apiKeyHelper?: string): AuthStatus | undefined {
|
||||
/** An unreadable `claude auth status --json` result is unknown, not signed out. */
|
||||
export function parseCliAuthStatus(stdout: string): CliAuthStatus | undefined {
|
||||
let parsed: unknown;
|
||||
try {
|
||||
parsed = JSON.parse(stdout);
|
||||
@@ -253,6 +251,10 @@ export function fromCliStatus(stdout: string, apiKeyHelper?: string): AuthStatus
|
||||
if (typeof status.loggedIn !== "boolean") {
|
||||
return undefined;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
export function cliAuthIdentity(status: CliAuthStatus, apiKeyHelper?: string): AuthStatus {
|
||||
// `loggedIn` tracks the claude.ai login only. On a 3P backend (Bedrock,
|
||||
// Vertex, …) it is false while the credentials live outside the agent, so the
|
||||
// backend must decide the kind before the logged-out shortcut runs.
|
||||
|
||||
@@ -129,3 +129,166 @@ export class BackgroundOutputTail {
|
||||
await this.publish({ text, replaces });
|
||||
}
|
||||
}
|
||||
|
||||
/** What Claude Code's `get_task_output` returns: the end of a shell task's output. */
|
||||
export interface TaskOutput {
|
||||
/** At most the last 8 KiB of the output, decoded as UTF-8. */
|
||||
output: string;
|
||||
/** The size of the whole output in bytes. */
|
||||
total_bytes: number;
|
||||
/** Whether `output` holds only the end of the output. */
|
||||
truncated: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* The most bytes at the start of a truncated `output` that may not match the
|
||||
* command's bytes: a character that the 8 KiB cut split decodes as U+FFFD.
|
||||
*/
|
||||
const CUT_CHARACTER_BYTES = 4;
|
||||
|
||||
/**
|
||||
* Follows the output of a command that runs in the foreground, read with
|
||||
* `read` (Claude Code's `get_task_output`), and hands each piece of new text
|
||||
* to `publish`, in order. Claude Code streams no output of a foreground Bash
|
||||
* command either: the output arrives in the tool result. Claude Code writes
|
||||
* the output to the command's task before then, and `get_task_output` reads
|
||||
* it, though the task's `task_started` names no output file.
|
||||
*
|
||||
* The new text is the output past the bytes already sent. When `output` does
|
||||
* not hold all of it, or its bytes may not match the command's (not UTF-8),
|
||||
* the whole `output` replaces the terminal's output, as a snapshot. A read
|
||||
* that ends in U+FFFD may have cut a character that the command is still
|
||||
* writing, so it is sent only at the next read.
|
||||
*
|
||||
* Once the command ends, Claude Code drops its output: the task then reads as
|
||||
* empty (`total_bytes: 0`, CLI 2.1.325), up to the tool result that carries
|
||||
* the whole output. A read that holds less than was sent is that end, so it
|
||||
* stops the poll and publishes nothing: an empty snapshot would clear the
|
||||
* terminal.
|
||||
*
|
||||
* One read runs at a time: a poll that comes during a read is skipped, so a
|
||||
* read that Claude Code never answers queues nothing behind it. A read that
|
||||
* fails is tried again at the next poll. `publish` must not reject.
|
||||
*/
|
||||
export class TaskOutputPoll {
|
||||
private sentBytes = 0;
|
||||
private sent = false;
|
||||
private stopped = false;
|
||||
/** A read is in progress, or the publish of its text. */
|
||||
private busy = false;
|
||||
/** The publish in progress, or the last one. */
|
||||
private publishing: Promise<void> = Promise.resolve();
|
||||
private readonly timer: ReturnType<typeof setInterval>;
|
||||
|
||||
constructor(
|
||||
private readonly read: () => Promise<TaskOutput>,
|
||||
private readonly publish: (output: BackgroundOutput) => Promise<void>,
|
||||
) {
|
||||
this.timer = setInterval(() => void this.poll(), BACKGROUND_OUTPUT_POLL_MS);
|
||||
// A command that runs on must not keep the agent process alive.
|
||||
this.timer.unref();
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops, once a publish in progress is out. Returns whether any text was
|
||||
* published: the tool result then replaces it with the whole output.
|
||||
*
|
||||
* A read in progress is not waited for. It publishes nothing after this,
|
||||
* and Claude Code may never answer it.
|
||||
*/
|
||||
async finish(): Promise<boolean> {
|
||||
this.stop();
|
||||
await this.publishing;
|
||||
return this.sent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops now and returns whether any text was published, for a caller whose
|
||||
* `publish` sends in the same synchronous step (v2), so none is in progress.
|
||||
*/
|
||||
end(): boolean {
|
||||
this.stop();
|
||||
return this.sent;
|
||||
}
|
||||
|
||||
/** Stops without waiting: the command's task, the query or the session ended. */
|
||||
stop(): void {
|
||||
clearInterval(this.timer);
|
||||
this.stopped = true;
|
||||
}
|
||||
|
||||
private async poll(): Promise<void> {
|
||||
if (this.stopped || this.busy) return;
|
||||
this.busy = true;
|
||||
try {
|
||||
const read = await this.read();
|
||||
if (this.stopped) return;
|
||||
if (read.total_bytes < this.sentBytes) {
|
||||
this.stop();
|
||||
return;
|
||||
}
|
||||
const output = this.newText(read);
|
||||
if (output === undefined) return;
|
||||
this.sentBytes = read.total_bytes;
|
||||
this.sent = true;
|
||||
this.publishing = this.publish(output);
|
||||
await this.publishing;
|
||||
} catch {
|
||||
// The read failed: try again at the next poll.
|
||||
} finally {
|
||||
this.busy = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The text that `read` adds to what was sent, or undefined when it adds none
|
||||
* yet. `read` holds at least the bytes that were sent.
|
||||
*/
|
||||
private newText({ output, total_bytes, truncated }: TaskOutput): BackgroundOutput | undefined {
|
||||
if (total_bytes === this.sentBytes || output.endsWith("\uFFFD")) return undefined;
|
||||
const bytes = Buffer.from(output, "utf8");
|
||||
const added = total_bytes - this.sentBytes;
|
||||
const exact = truncated
|
||||
? added <= bytes.length - CUT_CHARACTER_BYTES
|
||||
: bytes.length === total_bytes;
|
||||
// `sentBytes` ends a read that ended in a whole character, so the cut is
|
||||
// at a character boundary.
|
||||
if (exact) {
|
||||
return { text: bytes.subarray(bytes.length - added).toString("utf8"), replaces: false };
|
||||
}
|
||||
return { text: output, replaces: true };
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The id of the tool call whose command the task `started` runs in the
|
||||
* foreground, or undefined for any other task. Claude Code starts the task of
|
||||
* a foreground command once the command has run for a few seconds (3.1 s with
|
||||
* CLI 2.1.325). A faster command gets no task, and its output comes with its
|
||||
* tool result, as before.
|
||||
*/
|
||||
export function foregroundCommandToolCall(started: {
|
||||
task_type?: string;
|
||||
is_backgrounded?: boolean;
|
||||
tool_use_id?: string;
|
||||
}): string | undefined {
|
||||
return started.task_type === "local_bash" && started.is_backgrounded === false
|
||||
? started.tool_use_id
|
||||
: undefined;
|
||||
}
|
||||
|
||||
/** Whether a call of the tool `name` runs a command that a terminal shows. */
|
||||
export function isCommandTool(name: string | undefined): boolean {
|
||||
return name === "Bash" || name === "PowerShell";
|
||||
}
|
||||
|
||||
/**
|
||||
* Claude Code's `get_task_output` on the SDK's query. Like `mcpAuthenticate`,
|
||||
* it is on the query object but not in the public `Query` declaration yet,
|
||||
* though the SDK types its control request (`SDKControlGetTaskOutputRequest`).
|
||||
*/
|
||||
export type TaskOutputQuery = { getTaskOutput(taskId: string): Promise<TaskOutput> };
|
||||
|
||||
export function supportsTaskOutput<T extends object>(query: T): query is T & TaskOutputQuery {
|
||||
return typeof (query as Partial<TaskOutputQuery>).getTaskOutput === "function";
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { existsSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import type { Options } from "@anthropic-ai/claude-agent-sdk";
|
||||
|
||||
const CLI_FILE_NAME = process.platform === "win32" ? "claude.exe" : "claude";
|
||||
|
||||
@@ -30,6 +31,46 @@ export async function claudeCliPath(): Promise<string> {
|
||||
return installedClaudeCliPath();
|
||||
}
|
||||
|
||||
/** How an option reaches the Claude CLI: in a flag, or over stdin in the SDK's initialize request. */
|
||||
type Delivery = NonNullable<Options["mcpServersDelivery"]>;
|
||||
|
||||
/**
|
||||
* The SDK options that say how a session's MCP servers and its `settings`
|
||||
* reach the CLI of {@link claudeCliPath}. A client's own options replace them.
|
||||
*
|
||||
* - `'initialize'` for the CLI that the adapter ships: over stdin, in the
|
||||
* SDK's initialize request.
|
||||
* - `'argv'` for a CLI that `CLAUDE_CODE_EXECUTABLE` names: in the
|
||||
* `--mcp-config` and `--settings` flags, as before SDK 0.3.326. Its version
|
||||
* is not known, and a CLI that cannot take them over stdin fails the session
|
||||
* at startup (2.1.323: "too old to read MCP servers from the initialize
|
||||
* request", "unknown option '--initialize-fields=settings'").
|
||||
* - `settings` stay `'argv'` when the client's `extraArgs` hold `settings`:
|
||||
* Claude Code refuses to start with both ("--initialize-fields=settings
|
||||
* cannot be used with --settings"), and in the flag the `settings` option
|
||||
* replaces that argument. They also stay `'argv'` with `sdk-url` in the
|
||||
* `extraArgs`: such a session cannot read the request at launch, and the SDK
|
||||
* sends its MCP servers in the flag for the same reason.
|
||||
*
|
||||
* The SDK reads `settingsDelivery` (0.3.328) but does not declare it in
|
||||
* `sdk.d.ts`, so nothing fails to compile if a later SDK drops it. The v2
|
||||
* integration tests check the delivery against the real CLI.
|
||||
*
|
||||
* `mcpServersDelivery` is always set. The adapter names the CLI to start
|
||||
* (`pathToClaudeCodeExecutable`), and for such an app the SDK prints a
|
||||
* `DeprecationWarning` when a session has MCP servers and the option is unset.
|
||||
*/
|
||||
export function cliDelivery(clientExtraArgs: Options["extraArgs"]): {
|
||||
mcpServersDelivery: Delivery;
|
||||
settingsDelivery: Delivery;
|
||||
} {
|
||||
const delivery = process.env.CLAUDE_CODE_EXECUTABLE ? "argv" : "initialize";
|
||||
const settingsInFlag = Object.keys(clientExtraArgs ?? {}).some(
|
||||
(name) => name === "settings" || name === "sdk-url" || name.startsWith("sdk-url="),
|
||||
);
|
||||
return { mcpServersDelivery: delivery, settingsDelivery: settingsInFlag ? "argv" : delivery };
|
||||
}
|
||||
|
||||
function bundledClaudeCliPath(directory: string): string {
|
||||
const path = join(directory, CLI_FILE_NAME);
|
||||
// Without this check, spawning a missing CLI fails with a bare ENOENT.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* The client-provided system prompt of the unstable `systemPrompt` field on
|
||||
* The client-provided system prompt of the `systemPrompt` field on
|
||||
* `session/new`, `session/load`, `session/resume`, and `session/fork`.
|
||||
*
|
||||
* - `append` keeps the Claude Code preset and adds the text after it, the
|
||||
@@ -10,7 +10,7 @@
|
||||
*
|
||||
* The CLI records the system prompt of a conversation on its first request
|
||||
* and reuses it on resume, so a different `systemPrompt` on a later
|
||||
* `session/resume` takes effect at the next compaction. The RFD allows this
|
||||
* `session/resume` takes effect at the next compaction. ACP allows this
|
||||
* deferral.
|
||||
*/
|
||||
import type { Options } from "@anthropic-ai/claude-agent-sdk";
|
||||
@@ -30,8 +30,10 @@ export type ClientSystemPrompt = { mode: "append" | "override"; text: string };
|
||||
/**
|
||||
* The mode and text of a `systemPrompt`, or `undefined` when the request has
|
||||
* none. Throws `invalid_params` for a mode other than `append` and `override`
|
||||
* and for a content block other than text: the RFD requires an error, and no
|
||||
* session, for a prompt the agent cannot apply.
|
||||
* and for a content block other than text: ACP requires an error, and no
|
||||
* session, for a prompt the agent cannot apply. Also for an empty `content`
|
||||
* list, which a client must not send: the v2 schema rejects it before this
|
||||
* runs, and a v1 client gets the same answer.
|
||||
*/
|
||||
export function clientSystemPrompt(
|
||||
systemPrompt: SystemPrompt | null | undefined,
|
||||
@@ -44,6 +46,12 @@ export function clientSystemPrompt(
|
||||
`Unsupported systemPrompt mode: ${mode}`,
|
||||
);
|
||||
}
|
||||
if (content.length === 0) {
|
||||
throw RequestError.invalidParams(
|
||||
{ systemPrompt: { content } },
|
||||
"systemPrompt content is empty. Send at least one text block, or leave systemPrompt out.",
|
||||
);
|
||||
}
|
||||
const text: string[] = [];
|
||||
for (const block of content) {
|
||||
if (block.type !== "text") {
|
||||
|
||||
@@ -382,9 +382,10 @@ export class ContextCompactionLifecycle {
|
||||
status: terminalStatus,
|
||||
...(summary !== undefined ? { summary: [{ type: "text", text: summary }] } : {}),
|
||||
...(terminalStatus === "failed" && metadata.error ? { error: metadata.error } : {}),
|
||||
// `_meta` is a replace-patch: seed it with the first terminal, then
|
||||
// only re-send it when the boundary adds facts, so a status-only
|
||||
// duplicate can't wipe the token counts.
|
||||
// A `_meta` that is sent replaces the facts a client holds (the
|
||||
// whole `_meta` on v1, its `jetbrains` key on v2): seed it with the
|
||||
// first terminal, then only re-send it when the boundary adds facts,
|
||||
// so a status-only duplicate can't wipe the token counts.
|
||||
// The standard `error` field carries the error, so `_meta` does not.
|
||||
// Only AIR gets the compaction facts.
|
||||
...(this.airClient && (firstTerminal || hasMetadata)
|
||||
|
||||
@@ -587,6 +587,17 @@ export async function answerMcpElicitation(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether `toolUseID` is the id of a question that Claude Code asks on its own
|
||||
* (its `confirmWithUser`), such as whether to download a connector's file. It
|
||||
* asks through `canUseTool` as AskUserQuestion under a `confirm_<uuid>` id,
|
||||
* and reads the answer from the callback's result: no tool_use and no
|
||||
* tool_result of the stream carry that id.
|
||||
*/
|
||||
export function isConfirmQuestion(toolUseID: string): boolean {
|
||||
return toolUseID.startsWith("confirm_");
|
||||
}
|
||||
|
||||
/**
|
||||
* Presents the AskUserQuestion tool's questions as a form elicitation of
|
||||
* `sessionId` through `elicit`, and returns the answers as the tool's
|
||||
|
||||
@@ -9,7 +9,8 @@ import {
|
||||
type SessionStoreEntry,
|
||||
} from "@anthropic-ai/claude-agent-sdk";
|
||||
import { createHash } from "node:crypto";
|
||||
import { loadFullSessionHistory } from "./resumed-session.js";
|
||||
import { loadFullSessionHistory, readHistoryAcrossCompactions } from "./resumed-session.js";
|
||||
import { forkPointOf } from "./session-cursors.js";
|
||||
import { assistantMessageText } from "./session-failure-extension.js";
|
||||
import { SessionTiming } from "./session-timing.js";
|
||||
|
||||
@@ -176,6 +177,15 @@ function isUnknownSessionError(error: unknown, sessionId: string): boolean {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copies the transcript of `params.sessionId` into a new session: all of it,
|
||||
* or with a `cursorId` the history before that session cursor (see
|
||||
* `session-cursors.ts`).
|
||||
*
|
||||
* Fails with invalid params (-32602) for a `cursorId` that is no cursor of
|
||||
* the session's stored history. ACP forbids forking the whole session, or at
|
||||
* another position, in its place.
|
||||
*/
|
||||
export async function forkSession(
|
||||
params: ForkSessionRequest,
|
||||
dependencies: ForkSessionDependencies,
|
||||
@@ -195,6 +205,24 @@ async function forkTranscript(
|
||||
dependencies: ForkSessionDependencies,
|
||||
): Promise<ForkSessionResponse> {
|
||||
const timing = new SessionTiming(dependencies.logger, "fork", params.sessionId);
|
||||
if (params.cursorId != null) {
|
||||
// The history as a replay reads it, which announces the cursors.
|
||||
const history = await readHistoryAcrossCompactions(
|
||||
params.sessionId,
|
||||
await getSessionMessages(params.sessionId),
|
||||
);
|
||||
const upToMessageId = forkPointOf(params.cursorId, history);
|
||||
timing.phase("cursor", ` resolution=${upToMessageId ? "found" : "missing"}`);
|
||||
if (upToMessageId === undefined) {
|
||||
throw RequestError.invalidParams(
|
||||
{ cursorId: params.cursorId },
|
||||
`Session ${params.sessionId} has no cursor ${params.cursorId} that a fork can start at. Use a cursor that the session announced with the \`fork\` capability, or send the request without \`cursorId\` to fork the whole session.`,
|
||||
);
|
||||
}
|
||||
const forked = await forkClaudeSession(params.sessionId, { upToMessageId });
|
||||
timing.phase("sdk-fork");
|
||||
return { sessionId: forked.sessionId };
|
||||
}
|
||||
const point = forkPoint(params._meta);
|
||||
// SDK `dir` scopes source lookup, not the fork's working directory. Search
|
||||
// all projects: params.cwd can name a different workspace for the new session.
|
||||
|
||||
@@ -1,16 +1,46 @@
|
||||
import type { McpServer } from "@agentclientprotocol/sdk/unstable";
|
||||
import type { McpServerConfig } from "@anthropic-ai/claude-agent-sdk";
|
||||
import {
|
||||
McpOverAcpCaller,
|
||||
type HasConnectionContext,
|
||||
type McpServer,
|
||||
type McpServerAcp,
|
||||
} from "@agentclientprotocol/sdk/unstable";
|
||||
import { McpOverAcpHttpBridge } from "@agentclientprotocol/sdk/experimental/mcp-http";
|
||||
import type { McpHttpServerConfig, McpServerConfig } from "@anthropic-ai/claude-agent-sdk";
|
||||
|
||||
/**
|
||||
* The SDK configs of a session's ACP MCP servers, by name. HTTP and SSE
|
||||
* servers keep their URL and headers; a server without `type` is stdio. A
|
||||
* server of any other transport is left out: the session's `initialize`
|
||||
* advertises none.
|
||||
* Makes the SDK config of an MCP server that the client serves over the ACP
|
||||
* connection (`"type": "acp"`): {@link McpOverAcp.sdkConfig} for a connection.
|
||||
*/
|
||||
export function sdkMcpServers(
|
||||
export type McpOverAcpConfig = (server: McpServerAcp) => Promise<McpHttpServerConfig>;
|
||||
|
||||
/**
|
||||
* A client MCP server that Claude Code is not given, so it lists no entry for
|
||||
* it. This is the entry it would list: `failed`, with the error.
|
||||
*/
|
||||
export type UnservedMcpServer = { name: string; status: "failed"; error: string };
|
||||
|
||||
/** A session's ACP MCP servers, as {@link sdkMcpServers} sorts them. */
|
||||
export type SdkMcpServers = {
|
||||
/** The SDK configs of the servers that Claude Code gets, by name. */
|
||||
configs: Record<string, McpServerConfig>;
|
||||
/** The `acp` servers that `overAcp` made no config for. */
|
||||
unserved: UnservedMcpServer[];
|
||||
};
|
||||
|
||||
/**
|
||||
* The SDK configs of a session's ACP MCP servers. HTTP and SSE servers keep
|
||||
* their URL and headers; a server without `type` is stdio; an `acp` server
|
||||
* gets the config that `overAcp` makes. When `overAcp` rejects, the server is
|
||||
* in `unserved` with the error and the session starts without it, as it
|
||||
* starts without a server that Claude Code cannot connect to. A server of any
|
||||
* other transport is left out: the session's `initialize` advertises none.
|
||||
*/
|
||||
export async function sdkMcpServers(
|
||||
servers: readonly McpServer[] | null | undefined,
|
||||
): Record<string, McpServerConfig> {
|
||||
overAcp: McpOverAcpConfig,
|
||||
): Promise<SdkMcpServers> {
|
||||
const configs: Record<string, McpServerConfig> = {};
|
||||
const unserved: UnservedMcpServer[] = [];
|
||||
for (const server of servers ?? []) {
|
||||
if ("type" in server && (server.type === "http" || server.type === "sse")) {
|
||||
configs[server.name] = {
|
||||
@@ -20,6 +50,16 @@ export function sdkMcpServers(
|
||||
? Object.fromEntries(server.headers.map((e) => [e.name, e.value]))
|
||||
: undefined,
|
||||
};
|
||||
} else if ("type" in server && server.type === "acp") {
|
||||
try {
|
||||
configs[server.name] = await overAcp(server);
|
||||
} catch (error) {
|
||||
unserved.push({
|
||||
name: server.name,
|
||||
status: "failed",
|
||||
error: error instanceof Error ? error.message : String(error),
|
||||
});
|
||||
}
|
||||
} else if (!("type" in server)) {
|
||||
configs[server.name] = {
|
||||
type: "stdio",
|
||||
@@ -29,5 +69,62 @@ export function sdkMcpServers(
|
||||
};
|
||||
}
|
||||
}
|
||||
return configs;
|
||||
return { configs, unserved };
|
||||
}
|
||||
|
||||
/**
|
||||
* Serves the MCP servers that a client declares with `"type": "acp"` to Claude
|
||||
* Code (MCP-over-ACP). Claude Code's MCP client connects to a command or a
|
||||
* URL, so each server gets an MCP 2026-07-28 HTTP endpoint on 127.0.0.1 that
|
||||
* sends every MCP request to the client as an `mcp/message` request (the ACP
|
||||
* SDK's `McpOverAcpHttpBridge`). The `acp` servers of a connection share one
|
||||
* listener, which closes with the connection. A request needs the bearer
|
||||
* token of its server, which only that server's config carries.
|
||||
*
|
||||
* The endpoint takes no `initialize`. Claude Code (2.1.325) sends
|
||||
* `server/discover` to an HTTP server first, unless
|
||||
* `MCP_PROTOCOL_NEGOTIATION=legacy` or its
|
||||
* `tengu_mcp_protocol_negotiation_http` flag turns that off. Then it sends
|
||||
* `initialize`, and the server is listed as failed.
|
||||
*/
|
||||
export class McpOverAcp {
|
||||
private readonly caller = new McpOverAcpCaller();
|
||||
private readonly bridge = new McpOverAcpHttpBridge(this.caller);
|
||||
|
||||
/**
|
||||
* Hands an `mcp/message` notification of the client (such as the progress
|
||||
* of a tool call) to the HTTP response of the MCP request that it names. An
|
||||
* agent app registers it for `methods.agent.mcp.message`.
|
||||
*/
|
||||
readonly handleNotification = this.caller.handleNotification;
|
||||
|
||||
/**
|
||||
* The SDK config of `server` for the sessions of the connection behind
|
||||
* `client`. A server gets the same config every time for as long as the
|
||||
* connection lives, so a session that restarts or resumes with the same
|
||||
* servers sees no change. Rejects when the listener cannot open (e.g.
|
||||
* `listen EPERM` where the process may not open a socket), or the
|
||||
* connection is closed. The next call tries to open the listener again.
|
||||
*/
|
||||
async sdkConfig(
|
||||
client: HasConnectionContext,
|
||||
server: McpServerAcp,
|
||||
): Promise<McpHttpServerConfig> {
|
||||
let http;
|
||||
try {
|
||||
http = await this.bridge.toHttp(client, { ...server, type: "acp" });
|
||||
} catch (error) {
|
||||
throw new Error(
|
||||
`The adapter could not open the local endpoint that serves it to Claude Code (${
|
||||
error instanceof Error ? error.message : String(error)
|
||||
}). A new session tries again.`,
|
||||
{ cause: error },
|
||||
);
|
||||
}
|
||||
return {
|
||||
type: "http",
|
||||
url: http.url,
|
||||
headers: Object.fromEntries(http.headers.map((header) => [header.name, header.value])),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@ import { realpath } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import type { AcpSessionNotification, SubagentForm, SubagentState } from "./acp-subagents.js";
|
||||
import { AIR_SUBAGENT_KEY, airExtensionMeta } from "./air-extension.js";
|
||||
import { orderedConfigOptions } from "./session-config-options.js";
|
||||
import { MODEL_CONFIG_ID } from "./session-model.js";
|
||||
import { orderedSubagentConfiguration } from "./subagent-configuration.js";
|
||||
import { isFinalToolCallStatus } from "./tool-calls/renderer.js";
|
||||
|
||||
/** The work state of a child, as the RFD's `subagent_update.state` carries it. */
|
||||
@@ -58,6 +58,14 @@ export type NativeSubagent = {
|
||||
endedRuns?: Set<string>;
|
||||
/** The RFD form: the calls that delegated to the child, whose runs handed back a report. */
|
||||
handedBack?: Set<string>;
|
||||
/** Whether a message of it came (see `NativeSubagentRuntime.messageCame`). */
|
||||
heard?: boolean;
|
||||
/**
|
||||
* The RFD form: the call that launched it is no Agent or Task call, such as
|
||||
* the Skill call of a forked skill. The client is shown that call, so the
|
||||
* prompt does not replace it.
|
||||
*/
|
||||
launchShown?: boolean;
|
||||
announced?: boolean;
|
||||
/**
|
||||
* The RFD form: the `cwd` that the client holds for the child. Undefined or
|
||||
@@ -126,6 +134,8 @@ export type TaskEnd = {
|
||||
* conversation was reset, and the runtime forgets its children.
|
||||
*/
|
||||
unobservable?: boolean;
|
||||
/** Whether the task ran in the foreground of its parent's work when it ended. */
|
||||
foreground?: boolean;
|
||||
};
|
||||
|
||||
type TaskStarted = {
|
||||
@@ -134,8 +144,52 @@ type TaskStarted = {
|
||||
subagentType?: unknown;
|
||||
description?: unknown;
|
||||
prompt?: unknown;
|
||||
/** The name of the tool of the call `toolUseId`, when the session has that call. */
|
||||
launchTool?: string;
|
||||
/** The task of the subagent that started this one. None means the root session. */
|
||||
parentTaskId?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Whether the end of a subagent's run waits for its messages. Claude Code
|
||||
* (2.1.328) holds the messages of a forked skill that the user typed, such as
|
||||
* `/code-review`, and writes them after its next `init` or before its next
|
||||
* result: most or all of them come after the task's end. Nothing but that
|
||||
* order tells such a subagent apart: no tool call launched it, and it ran in
|
||||
* the foreground.
|
||||
*/
|
||||
export function endWaitsForMessages(run: { launched: boolean; foreground: boolean }): boolean {
|
||||
return !run.launched && run.foreground;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether `message` ends the wait of an agent's end (see
|
||||
* {@link endWaitsForMessages}):
|
||||
*
|
||||
* - the turn's result, which Claude Code writes after the agent's messages;
|
||||
* - Claude Code's `idle`, for a turn that ends without a result;
|
||||
* - once a message of the agent came (`heard`), the first message of the main
|
||||
* conversation (`parent_tool_use_id: null`). Another subagent's message
|
||||
* ends no wait: Claude Code holds the messages of the subagents that the
|
||||
* agent launched along with the agent's own.
|
||||
*
|
||||
* Without a message, no more come: the turn or the query ended, or the
|
||||
* conversation was reset.
|
||||
*/
|
||||
export function endsMessageWait(
|
||||
message:
|
||||
{ type: string; subtype?: unknown; state?: unknown; parent_tool_use_id?: unknown } | undefined,
|
||||
heard: boolean,
|
||||
): boolean {
|
||||
if (message === undefined || message.type === "result") return true;
|
||||
if (message.type === "system") {
|
||||
return message.subtype === "session_state_changed" && message.state === "idle";
|
||||
}
|
||||
const conversation =
|
||||
message.type === "assistant" || message.type === "user" || message.type === "stream_event";
|
||||
return conversation && heard && message.parent_tool_use_id === null;
|
||||
}
|
||||
|
||||
export type SubagentIdentity = {
|
||||
name?: string;
|
||||
description?: string;
|
||||
@@ -204,6 +258,8 @@ export class NativeSubagentRuntime {
|
||||
*/
|
||||
private readonly childByToolCall = new Map<string, NativeSubagent>();
|
||||
private readonly taskFinishPromises = new Map<string, Promise<void>>();
|
||||
/** The ends that wait for their tasks' messages (see {@link finishTask}), by task id. */
|
||||
private readonly heldEnds = new Map<string, { status: unknown; end?: TaskEnd }>();
|
||||
/** The session that made each SendMessage call. */
|
||||
private readonly senderByToolUse = new Map<string, string>();
|
||||
/**
|
||||
@@ -347,6 +403,58 @@ export class NativeSubagentRuntime {
|
||||
return JSON.parse(published) as SessionConfigOption[];
|
||||
}
|
||||
|
||||
/**
|
||||
* The RFD form: what is current of the children that work now, for the
|
||||
* time after a `session/load` or `session/resume` of the session that runs
|
||||
* them. The client discarded the state and the capabilities it held for
|
||||
* them, and need not keep their place in the session tree, so each one is
|
||||
* announced again on its parent: with its labels, its `cwd`, the `cancel`
|
||||
* capability and its state, then the configuration that the client last
|
||||
* got for it. `covered` names the children that the load's replay reports
|
||||
* instead (see `RfdSubagentReplay.currentStates`).
|
||||
*
|
||||
* An announced child that no longer works but has one that does, such as a
|
||||
* background child of its own, is announced first, with its labels and
|
||||
* `cwd` only: nothing of it is current, but its child's updates name it.
|
||||
* Parents come before their children.
|
||||
*/
|
||||
currentChildren(covered: (sessionId: string) => boolean): AcpSessionNotification[] {
|
||||
if (this.form !== "rfd") return [];
|
||||
const bySession = new Map<string, NativeSubagent>();
|
||||
for (const child of this.children.values()) {
|
||||
if (child.announced && !covered(child.sessionId)) bySession.set(child.sessionId, child);
|
||||
}
|
||||
const ordered: NativeSubagent[] = [];
|
||||
const add = (child: NativeSubagent) => {
|
||||
if (ordered.includes(child)) return;
|
||||
const parent = bySession.get(child.parentSessionId);
|
||||
if (parent) add(parent);
|
||||
ordered.push(child);
|
||||
};
|
||||
for (const child of bySession.values()) if (isWorking(child)) add(child);
|
||||
return ordered.flatMap((child): AcpSessionNotification[] => {
|
||||
const announcement = rfdAnnouncement(child, child.reportedCwd);
|
||||
if (!isWorking(child)) return [{ sessionId: child.parentSessionId, update: announcement }];
|
||||
const configOptions = this.configurationOf(child.sessionId);
|
||||
const state: WorkState =
|
||||
child.workState === "requires_action" ? { state: "requires_action" } : { state: "running" };
|
||||
return [
|
||||
{
|
||||
sessionId: child.parentSessionId,
|
||||
update: { ...announcement, capabilities: { cancel: {} }, state },
|
||||
},
|
||||
...(configOptions
|
||||
? [
|
||||
{
|
||||
sessionId: child.sessionId,
|
||||
update: { sessionUpdate: "config_option_update" as const, configOptions },
|
||||
},
|
||||
]
|
||||
: []),
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes configuration options of the child `agentId`: an SDK agent id, as a
|
||||
* hook names it, or a child session id. Hook observations can precede the
|
||||
@@ -402,7 +510,7 @@ export class NativeSubagentRuntime {
|
||||
// so a delayed publication cannot replace newer settings with older ones.
|
||||
const publishing = config.publishing.then(async () => {
|
||||
if (this.configBySession.get(child.sessionId) !== config || ended()) return;
|
||||
const configOptions = orderedSubagentConfiguration(config.options.values());
|
||||
const configOptions = orderedConfigOptions(config.options.values());
|
||||
const snapshot = JSON.stringify(configOptions);
|
||||
if (config.published === snapshot) return;
|
||||
await this.publish({
|
||||
@@ -629,6 +737,87 @@ export class NativeSubagentRuntime {
|
||||
return notification;
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes a message of the query, before its updates are routed.
|
||||
*
|
||||
* A subagent's message names it by `agent_id`. A child that no tool call
|
||||
* launched has no id that its updates could go by: a forked skill that the
|
||||
* user typed sends `forked-command-<skill>` as `parent_tool_use_id`, for
|
||||
* every run of the skill. From this message on, the updates under that id
|
||||
* are the child's, and no longer those of an earlier run's child.
|
||||
*
|
||||
* It also ends the runs whose ends waited for their messages (see
|
||||
* {@link finishTask} and {@link endsMessageWait}). Only then does it return
|
||||
* a promise, for the caller to await: a caller that awaited every message
|
||||
* would let a cancel run between a message and its handling.
|
||||
*/
|
||||
messageCame(
|
||||
message: {
|
||||
type: string;
|
||||
subtype?: unknown;
|
||||
state?: unknown;
|
||||
parent_tool_use_id?: unknown;
|
||||
agent_id?: unknown;
|
||||
},
|
||||
deliver: Publish,
|
||||
): Promise<void> | undefined {
|
||||
if (!this.enabled) return undefined;
|
||||
const { parent_tool_use_id: launchId, agent_id: agentId } = message;
|
||||
const child = typeof agentId === "string" ? this.children.get(agentId) : undefined;
|
||||
if (child && typeof agentId === "string" && typeof launchId === "string") {
|
||||
child.heard = true;
|
||||
if (
|
||||
child.parentToolUseId === undefined &&
|
||||
this.childByParentToolUse.get(launchId) !== child
|
||||
) {
|
||||
this.taskByToolUse.set(launchId, agentId);
|
||||
this.childByParentToolUse.set(launchId, child);
|
||||
}
|
||||
}
|
||||
return this.releaseHeldEnds(deliver, message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ends the runs whose wait `message` ends; without a message, all of them.
|
||||
* Undefined when it ends none.
|
||||
*/
|
||||
private releaseHeldEnds(
|
||||
deliver: Publish,
|
||||
message?: Parameters<typeof endsMessageWait>[0],
|
||||
): Promise<void> | undefined {
|
||||
if (this.heldEnds.size === 0) return undefined;
|
||||
const ended = [...this.heldEnds].filter(([taskId]) =>
|
||||
endsMessageWait(message, this.children.get(taskId)?.heard === true),
|
||||
);
|
||||
if (ended.length === 0) return undefined;
|
||||
return (async () => {
|
||||
for (const [taskId, held] of ended) {
|
||||
this.heldEnds.delete(taskId);
|
||||
await this.finishTask(taskId, held.status, deliver, undefined, held.end);
|
||||
}
|
||||
})();
|
||||
}
|
||||
|
||||
/**
|
||||
* The session of the call that launched `task`, when the session has that
|
||||
* call and it is no Agent, Task or SendMessage call, such as the Skill call
|
||||
* of a forked skill: the session of the subagent that made it, once that
|
||||
* one is announced, or the root session.
|
||||
*/
|
||||
private shownLaunchParent(task: TaskStarted): string | undefined {
|
||||
if (
|
||||
!task.toolUseId ||
|
||||
task.launchTool === undefined ||
|
||||
task.launchTool === "SendMessage" ||
|
||||
isNativeSubagentControlTool(task.launchTool)
|
||||
) {
|
||||
return undefined;
|
||||
}
|
||||
if (task.parentTaskId === undefined) return this.rootSessionId;
|
||||
const parent = this.children.get(task.parentTaskId);
|
||||
return parent?.announced ? parent.sessionId : undefined;
|
||||
}
|
||||
|
||||
async taskStarted(task: TaskStarted, deliver: Publish): Promise<void> {
|
||||
if (!this.enabled) return;
|
||||
const known =
|
||||
@@ -678,9 +867,11 @@ export class NativeSubagentRuntime {
|
||||
|
||||
// A SendMessage resume reuses the finished generation's tool id, whose
|
||||
// control state is already cleaned up.
|
||||
const shownLaunchParent = this.shownLaunchParent(task);
|
||||
const knownParentSessionId =
|
||||
(task.toolUseId ? this.parentByToolUse.get(task.toolUseId) : undefined) ??
|
||||
(previous && this.resumedParentSessionId(previous));
|
||||
(previous && this.resumedParentSessionId(previous)) ??
|
||||
shownLaunchParent;
|
||||
const identity = task.toolUseId ? this.identityByToolUse.get(task.toolUseId) : undefined;
|
||||
// A nested child must wait for the spawning Agent/Task frame to establish
|
||||
// its immediate parent. Root children without a tool id can be announced.
|
||||
@@ -706,6 +897,7 @@ export class NativeSubagentRuntime {
|
||||
identity?.subagentType ?? task.subagentType,
|
||||
identity?.description ?? task.description,
|
||||
),
|
||||
...(shownLaunchParent !== undefined ? { launchShown: true } : {}),
|
||||
},
|
||||
!!knownParentSessionId || !task.toolUseId,
|
||||
deliver,
|
||||
@@ -804,6 +996,8 @@ export class NativeSubagentRuntime {
|
||||
/**
|
||||
* Reports that the SDK ended the task's work. `end` has what the SDK says
|
||||
* about it: its text for a failure, and its reason for an unusual end.
|
||||
* The end of a child whose messages Claude Code holds until after it (see
|
||||
* {@link endWaitsForMessages}) is reported once they came.
|
||||
*/
|
||||
async finishTask(
|
||||
taskId: string,
|
||||
@@ -834,6 +1028,23 @@ export class NativeSubagentRuntime {
|
||||
if (this.form === "rfd") await this.supplyError(child, state, end?.error);
|
||||
return;
|
||||
}
|
||||
const held = this.heldEnds.get(taskId);
|
||||
if (held) {
|
||||
// A second report of an end that waits can give the text of its failure.
|
||||
if (end?.error && !held.end?.error) held.end = { ...held.end, error: end.error };
|
||||
return;
|
||||
}
|
||||
if (
|
||||
child.announced &&
|
||||
endWaitsForMessages({
|
||||
launched: child.parentToolUseId !== undefined,
|
||||
foreground: end?.foreground === true,
|
||||
})
|
||||
) {
|
||||
// The run ends once its messages came (see `messageCame`).
|
||||
this.heldEnds.set(taskId, { status, end: { ...end, foreground: false } });
|
||||
return;
|
||||
}
|
||||
|
||||
const finish = Promise.resolve().then(async () => {
|
||||
try {
|
||||
@@ -896,6 +1107,12 @@ export class NativeSubagentRuntime {
|
||||
: mayStillRun
|
||||
? { unobservable: true }
|
||||
: { unexplained: true };
|
||||
try {
|
||||
// An end that waited for its task's messages is that task's end.
|
||||
await this.releaseHeldEnds(deliver);
|
||||
} catch (error) {
|
||||
errors.push(error);
|
||||
}
|
||||
try {
|
||||
for (const taskId of [...this.children.keys()].reverse()) {
|
||||
try {
|
||||
@@ -945,14 +1162,21 @@ export class NativeSubagentRuntime {
|
||||
* of this runtime. AIR's draft grants no `cancel`.
|
||||
*/
|
||||
async cancelChild(sessionId: string, stop: (taskId: string) => Promise<void>): Promise<boolean> {
|
||||
if (this.form !== "rfd") return false;
|
||||
for (const [taskId, child] of this.children) {
|
||||
if (child.sessionId !== sessionId || !child.announced) continue;
|
||||
child.cancels = (child.cancels ?? 0) + 1;
|
||||
await stop(taskId);
|
||||
return true;
|
||||
const announced = this.announcedChild(sessionId);
|
||||
if (!announced) return false;
|
||||
const [taskId, child] = announced;
|
||||
child.cancels = (child.cancels ?? 0) + 1;
|
||||
await stop(taskId);
|
||||
return true;
|
||||
}
|
||||
|
||||
/** The RFD form: the announced child session `sessionId`, with its task id. */
|
||||
private announcedChild(sessionId: string): [string, NativeSubagent] | undefined {
|
||||
if (this.form !== "rfd") return undefined;
|
||||
for (const entry of this.children) {
|
||||
if (entry[1].sessionId === sessionId && entry[1].announced) return entry;
|
||||
}
|
||||
return false;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1503,7 +1727,9 @@ export class NativeSubagentRuntime {
|
||||
* - a SendMessage call that resumed the child, and stays shown because a
|
||||
* permission request showed it;
|
||||
* - an Agent/Task call that launched the child, and stays shown for the
|
||||
* same reason.
|
||||
* same reason;
|
||||
* - the call that launched a child and is no Agent/Task call, such as the
|
||||
* Skill call of a forked skill, which always stays shown.
|
||||
*
|
||||
* The RFD requires the announcement before the reference, so a call whose
|
||||
* child is not announced yet gets none.
|
||||
@@ -1583,6 +1809,7 @@ export class NativeSubagentRuntime {
|
||||
this.cwdBySession.clear();
|
||||
this.childByParentToolUse.clear();
|
||||
this.taskFinishPromises.clear();
|
||||
this.heldEnds.clear();
|
||||
this.senderByToolUse.clear();
|
||||
this.hiddenLaunches.clear();
|
||||
this.hiddenSendMessages.clear();
|
||||
@@ -1682,6 +1909,7 @@ export class NativeSubagentRuntime {
|
||||
| "title"
|
||||
| "role"
|
||||
| "description"
|
||||
| "launchShown"
|
||||
>,
|
||||
announce: boolean,
|
||||
deliver: Publish,
|
||||
@@ -1775,6 +2003,24 @@ export function responseModelEntry(
|
||||
return models?.entry(model) ?? { value: model, name: models?.name(model) ?? model };
|
||||
}
|
||||
|
||||
/**
|
||||
* The RFD form: the `subagent_update` that names `child` on its parent, with
|
||||
* the parent's labels for it and `cwd`, its working directory when that is
|
||||
* not its parent's.
|
||||
*/
|
||||
function rfdAnnouncement(
|
||||
child: NativeSubagent,
|
||||
cwd: string | null | undefined,
|
||||
): Extract<AcpSessionNotification["update"], { sessionUpdate: "subagent_update" }> {
|
||||
return {
|
||||
sessionUpdate: "subagent_update",
|
||||
sessionId: child.sessionId,
|
||||
...(child.title ? { title: child.title } : {}),
|
||||
...(child.description ? { description: child.description } : {}),
|
||||
...(cwd ? { cwd } : {}),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Announces the child on its parent, once, before any update of the child.
|
||||
* The RFD form announces it as running and then sends the prompt as the
|
||||
@@ -1797,18 +2043,15 @@ export async function announceNativeSubagent(
|
||||
await publish({
|
||||
sessionId: child.parentSessionId,
|
||||
update: {
|
||||
sessionUpdate: "subagent_update",
|
||||
sessionId: child.sessionId,
|
||||
...(child.title ? { title: child.title } : {}),
|
||||
...(child.description ? { description: child.description } : {}),
|
||||
...(cwd ? { cwd } : {}),
|
||||
...rfdAnnouncement(child, cwd),
|
||||
capabilities: { cancel: {} },
|
||||
state: { state: "running" },
|
||||
},
|
||||
});
|
||||
if (cwd) child.reportedCwd = cwd;
|
||||
child.announced = true;
|
||||
// The immediate parent made the Agent/Task call that launched the child.
|
||||
// The immediate parent made the call that launched the child. The
|
||||
// prompt replaces an Agent/Task call, and not a call that stays shown.
|
||||
if (child.prompt) {
|
||||
await publishPrompt(
|
||||
child,
|
||||
@@ -1816,7 +2059,7 @@ export async function announceNativeSubagent(
|
||||
child.parentToolUseId,
|
||||
child.parentSessionId,
|
||||
publish,
|
||||
{ replacesCall: true },
|
||||
{ replacesCall: !child.launchShown },
|
||||
);
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -33,6 +33,9 @@ export interface PermissionOptionContext {
|
||||
/** False when no ACP turn can continue an accepted plan in a fresh
|
||||
* context. Then an ExitPlanMode request offers no clear-context option. */
|
||||
allowContextReset?: boolean;
|
||||
/** Claude Code's `showClearContextOnPlanAccept` setting. An ExitPlanMode
|
||||
* request offers the clear-context option only when it is true. */
|
||||
showClearContextOnPlanAccept?: boolean;
|
||||
}
|
||||
|
||||
export function allowOnce(name = "Yes"): PermissionOption {
|
||||
|
||||
@@ -70,7 +70,11 @@ export function buildExitPlanModePermissionOptions(
|
||||
: (["auto", "bypassPermissions"] as const)
|
||||
).filter((mode) => modes.has(mode));
|
||||
const preferredMode = elevatedModes[0] ?? "acceptEdits";
|
||||
if (context.allowContextReset !== false && plainString(context.input.plan)) {
|
||||
if (
|
||||
context.showClearContextOnPlanAccept === true &&
|
||||
context.allowContextReset !== false &&
|
||||
plainString(context.input.plan)
|
||||
) {
|
||||
const usage =
|
||||
context.contextUsedPercent === undefined ? "" : ` (${context.contextUsedPercent}% used)`;
|
||||
options.push(
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* The session updates that show the session's plans. A client with the `plan`
|
||||
* capability (every v2 client, and a v1 client that asks for it) tracks plans
|
||||
* by ID and gets `plan_update` and `plan_removed`; any other client gets the
|
||||
* legacy `plan` update, which holds one ID-less plan per session.
|
||||
* The session updates that show the session's plans. A v2 client, and a v1
|
||||
* client that advertises the `plan` capability, tracks plans by ID and gets
|
||||
* `plan_update` and `plan_removed`; any other v1 client gets the legacy `plan`
|
||||
* update, which holds one ID-less plan per session.
|
||||
*/
|
||||
import type {
|
||||
PlanEntry,
|
||||
|
||||
@@ -3,9 +3,17 @@
|
||||
*
|
||||
* With `promptSuggestions` on, the CLI emits one `prompt_suggestion` message
|
||||
* after a turn's `result` holding the prompt it expects the user to send next.
|
||||
* ACP has no field for it, so it travels as
|
||||
* `session_info_update._meta.promptSuggestions`: a client that does not read
|
||||
* the key sees a session info update that says nothing and ignores it.
|
||||
* The adapter turns it on only for a client that takes the prediction
|
||||
* ({@link promptSuggestionOptions}).
|
||||
* It reaches the client in up to two forms:
|
||||
*
|
||||
* - `prompt_suggestions_update`, ACP's unstable session update, for a client
|
||||
* that advertised `session.promptSuggestions`, on v1 and v2. The CLI
|
||||
* predicts one prompt, so the list holds one suggestion, whose prompt is
|
||||
* one text block.
|
||||
* - `session_info_update._meta.promptSuggestions`, for JetBrains AIR, which
|
||||
* read the prediction there before ACP had an update for it. A client that
|
||||
* does not read the key sees a session info update that says nothing.
|
||||
*
|
||||
* AIR renders the first non-blank `suggestions[].text` as gray text in an empty
|
||||
* composer, where Tab fills the composer without sending.
|
||||
@@ -14,6 +22,47 @@
|
||||
* error, in plan mode, and at the account's usage limit, so most sessions have
|
||||
* turns that end with no prediction at all.
|
||||
*/
|
||||
import type { SessionNotification } from "@agentclientprotocol/sdk/unstable";
|
||||
import type { Options } from "@anthropic-ai/claude-agent-sdk";
|
||||
|
||||
type SuggestionUpdate = SessionNotification["update"];
|
||||
|
||||
/** The forms of the prediction that a client takes. */
|
||||
export type PromptSuggestionForms = {
|
||||
/** `session_info_update._meta.promptSuggestions`: the client is JetBrains AIR. */
|
||||
meta: boolean;
|
||||
/** `prompt_suggestions_update`: the client advertised `session.promptSuggestions`. */
|
||||
update: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* Whether a client advertised `session.promptSuggestions`. `session` is the
|
||||
* session capabilities of its `initialize` request: `clientCapabilities.session`
|
||||
* on v1, `capabilities.session` on v2. ACP forbids the update without it.
|
||||
*/
|
||||
export function clientTakesPromptSuggestions(
|
||||
session: { promptSuggestions?: unknown } | null | undefined,
|
||||
): boolean {
|
||||
return session?.promptSuggestions != null;
|
||||
}
|
||||
|
||||
/** Whether a client takes the prediction in any form. */
|
||||
function takesPrediction(forms: PromptSuggestionForms): boolean {
|
||||
return forms.meta || forms.update;
|
||||
}
|
||||
|
||||
/**
|
||||
* The SDK option that makes Claude Code predict the next prompt, for a
|
||||
* session whose client takes the prediction in a form. Empty for any other
|
||||
* client: a prediction costs a request per turn, and none of it would reach
|
||||
* that client. Both cores spread it before the client's own options, so
|
||||
* `_meta.claudeCode.options.promptSuggestions: false` turns the prediction off.
|
||||
*/
|
||||
export function promptSuggestionOptions(
|
||||
forms: PromptSuggestionForms,
|
||||
): Pick<Options, "promptSuggestions"> {
|
||||
return takesPrediction(forms) ? { promptSuggestions: true } : {};
|
||||
}
|
||||
|
||||
/** The `_meta` key the suggestion travels under. It names no vendor. */
|
||||
export const PROMPT_SUGGESTIONS_META_KEY = "promptSuggestions";
|
||||
@@ -26,7 +75,8 @@ export type PromptSuggestionsMetaValue = {
|
||||
/**
|
||||
* The suggestion as it goes on the wire, or `null` for a suggestion that says
|
||||
* nothing: the CLI can predict whitespace, and an empty text would otherwise
|
||||
* reach the composer as a hint with no content.
|
||||
* reach the composer as a hint with no content. ACP forbids a suggestion whose
|
||||
* only content is empty or whitespace-only text.
|
||||
*/
|
||||
export function promptSuggestionText(raw: string | null | undefined): string | null {
|
||||
const text = raw?.trim();
|
||||
@@ -44,12 +94,19 @@ export function promptSuggestionsMeta(text: string | null): Record<string, unkno
|
||||
}
|
||||
|
||||
/**
|
||||
* The prediction a session holds on the client, and whether an arriving
|
||||
* `prompt_suggestion` still answers the turn the user waits on. Both cores
|
||||
* keep one per session and send the `_meta` that its methods return as a
|
||||
* `session_info_update`, to an AIR client only. Undefined: nothing to send.
|
||||
* The `prompt_suggestions_update` that makes `text` the session's list of
|
||||
* suggestions. `null` sends an empty list, which withdraws the list that the
|
||||
* client is offering.
|
||||
*/
|
||||
export class PromptSuggestions {
|
||||
export function promptSuggestionsUpdate(text: string | null): SuggestionUpdate {
|
||||
return {
|
||||
sessionUpdate: "prompt_suggestions_update",
|
||||
suggestions: text === null ? [] : [{ prompt: [{ type: "text", text }] }],
|
||||
};
|
||||
}
|
||||
|
||||
/** The prediction that a client holds in one form, and what is still to come of the last result. */
|
||||
class Lane {
|
||||
/** The last text sent (`null` after a clear). Undefined until the first send. */
|
||||
private published: string | null | undefined;
|
||||
/**
|
||||
@@ -60,33 +117,118 @@ export class PromptSuggestions {
|
||||
*/
|
||||
private expected = false;
|
||||
|
||||
/** A result came: the CLI predicts the next prompt right after it. */
|
||||
constructor(
|
||||
private readonly form: (text: string | null) => SuggestionUpdate,
|
||||
/** `prompt_suggestions_update`, whose rules ACP sets. */
|
||||
readonly standard: boolean,
|
||||
) {}
|
||||
|
||||
resultArrived(): void {
|
||||
this.expected = true;
|
||||
}
|
||||
|
||||
/** The `_meta` of the CLI's `prompt_suggestion`, if it answers the last result and changes what the client holds. */
|
||||
suggested(raw: string | null | undefined): Record<string, unknown> | undefined {
|
||||
suggested(text: string | null, working: boolean): SuggestionUpdate | undefined {
|
||||
if (!this.expected) return undefined;
|
||||
this.expected = false;
|
||||
return this.publish(promptSuggestionText(raw));
|
||||
// ACP: a prediction is discarded when the conversation changed before it
|
||||
// was sent. AIR's draft has no such rule.
|
||||
if (working && this.standard) return undefined;
|
||||
return this.publish(text);
|
||||
}
|
||||
|
||||
/**
|
||||
* The `_meta` that clears the prediction: a client prompt spent it, or a
|
||||
* `conversation_reset` dropped the transcript it came from. It also drops
|
||||
* a prediction still in flight for the last result. Undefined when the
|
||||
* client holds none.
|
||||
*/
|
||||
clear(): Record<string, unknown> | undefined {
|
||||
clear(): SuggestionUpdate | undefined {
|
||||
this.expected = false;
|
||||
return this.publish(null);
|
||||
}
|
||||
|
||||
private publish(text: string | null): Record<string, unknown> | undefined {
|
||||
private publish(text: string | null): SuggestionUpdate | undefined {
|
||||
// An unchanged prediction is not sent again.
|
||||
if ((this.published ?? null) === text) return undefined;
|
||||
this.published = text;
|
||||
return promptSuggestionsMeta(text);
|
||||
return this.form(text);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The predictions that a session holds on the client, and whether an arriving
|
||||
* `prompt_suggestion` still answers the turn the user waits on. Both cores
|
||||
* keep one per session and send the updates that its methods return, in
|
||||
* order. An empty list: nothing to send.
|
||||
*
|
||||
* Each form has its own state. The `_meta` form keeps the rules it had before
|
||||
* ACP had the update. The `prompt_suggestions_update` form follows ACP's, so
|
||||
* it also drops a prediction that arrives while Claude works
|
||||
* ({@link suggested}) and withdraws its list when work starts
|
||||
* ({@link workStarted}).
|
||||
*/
|
||||
export class PromptSuggestions {
|
||||
private readonly lanes: Lane[];
|
||||
|
||||
/**
|
||||
* The predictions of a session whose client takes `forms`. Undefined for a
|
||||
* client that takes neither: nothing of a prediction goes to it.
|
||||
*/
|
||||
static forClient(forms: PromptSuggestionForms): PromptSuggestions | undefined {
|
||||
return takesPrediction(forms) ? new PromptSuggestions(forms) : undefined;
|
||||
}
|
||||
|
||||
private constructor(forms: PromptSuggestionForms) {
|
||||
this.lanes = [
|
||||
...(forms.update ? [new Lane(promptSuggestionsUpdate, true)] : []),
|
||||
...(forms.meta
|
||||
? [
|
||||
new Lane(
|
||||
(text) => ({
|
||||
sessionUpdate: "session_info_update",
|
||||
_meta: promptSuggestionsMeta(text),
|
||||
}),
|
||||
false,
|
||||
),
|
||||
]
|
||||
: []),
|
||||
];
|
||||
}
|
||||
|
||||
/** A result came: the CLI predicts the next prompt right after it. */
|
||||
resultArrived(): void {
|
||||
for (const lane of this.lanes) lane.resultArrived();
|
||||
}
|
||||
|
||||
/**
|
||||
* The updates for the CLI's `prompt_suggestion`, in each form where it
|
||||
* answers the last result and changes what the client holds.
|
||||
*
|
||||
* `working`: Claude works in the session now, such as on a prompt that was
|
||||
* queued before the result, or in a cycle that Claude Code started on its
|
||||
* own. The prediction does not account for that work, so the
|
||||
* `prompt_suggestions_update` form drops it.
|
||||
*/
|
||||
suggested(raw: string | null | undefined, working: boolean): SuggestionUpdate[] {
|
||||
const text = promptSuggestionText(raw);
|
||||
return this.updates((lane) => lane.suggested(text, working));
|
||||
}
|
||||
|
||||
/**
|
||||
* The updates that clear the prediction: a client prompt spent it, or a
|
||||
* `conversation_reset` dropped the transcript it came from. It also drops
|
||||
* a prediction still in flight for the last result. Empty when the client
|
||||
* holds none.
|
||||
*/
|
||||
clear(): SuggestionUpdate[] {
|
||||
return this.updates((lane) => lane.clear());
|
||||
}
|
||||
|
||||
/**
|
||||
* Foreground work started. The `prompt_suggestions_update` form withdraws
|
||||
* its list, as {@link clear} does: ACP asks for it when work starts without
|
||||
* a prompt, and a prompt's own work finds the list withdrawn already. The
|
||||
* `_meta` form keeps its prediction until the next prompt, as before.
|
||||
*/
|
||||
workStarted(): SuggestionUpdate[] {
|
||||
return this.updates((lane) => (lane.standard ? lane.clear() : undefined));
|
||||
}
|
||||
|
||||
private updates(of: (lane: Lane) => SuggestionUpdate | undefined): SuggestionUpdate[] {
|
||||
return this.lanes.flatMap((lane) => of(lane) ?? []);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
* `providers/disable`, and the legacy gateway logins (`authenticate` or
|
||||
* `auth/login` with `gateway` or `gateway-bedrock`). Each core holds its own
|
||||
* {@link ProviderConfig} and gateway login, and builds the query env of its
|
||||
* sessions with {@link createEnvForProvider}.
|
||||
* sessions with {@link createEnvForProvider}. It holds that route above the
|
||||
* user's and the project's settings with {@link providerRouteSettings} and
|
||||
* {@link applyProviderRoute}.
|
||||
*/
|
||||
import {
|
||||
RequestError,
|
||||
@@ -15,6 +17,7 @@ import {
|
||||
type ProviderInfo,
|
||||
type SetProviderRequest,
|
||||
} from "@agentclientprotocol/sdk/unstable";
|
||||
import type { Query } from "@anthropic-ai/claude-agent-sdk";
|
||||
import {
|
||||
GatewayListingError,
|
||||
listBedrockModels,
|
||||
@@ -187,6 +190,50 @@ export function createEnvForProvider(config: ProviderConfig | null): Record<stri
|
||||
};
|
||||
}
|
||||
|
||||
/** A provider's route as settings of Claude Code (see {@link providerRouteSettings}). */
|
||||
export type ProviderRouteSettings = { apiKeyHelper: ""; env: Record<string, string> };
|
||||
|
||||
/**
|
||||
* The route of a provider as settings of Claude Code, for the tier of the
|
||||
* `settings` option. `env` is the result of {@link createEnvForProvider}.
|
||||
*
|
||||
* Claude Code applies the `env` of settings files after the process env, so
|
||||
* without this tier the user's or the project's settings could restore another
|
||||
* `ANTHROPIC_BASE_URL`. The empty `apiKeyHelper` turns off a helper of theirs.
|
||||
*/
|
||||
export function providerRouteSettings(env: Record<string, string>): ProviderRouteSettings {
|
||||
return { apiKeyHelper: "", env };
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends `route` to the running session, into the tier of the `settings`
|
||||
* option (`applyFlagSettings`). Call it right after the query's initialize
|
||||
* response, before a request of the session reaches the provider:
|
||||
* `getContextUsage()` sends one (`count_tokens`).
|
||||
*
|
||||
* The `settings` option holds the route too, in one object with the client's
|
||||
* settings and the model configuration. Claude Code loads that object as a
|
||||
* whole or not at all: one value that fails validation, e.g.
|
||||
* `permissions.allow: "Bash"`, leaves all of it out. This call does not depend
|
||||
* on that object. When the object did load, the call changes nothing: Claude
|
||||
* Code merges `env` key by key.
|
||||
*
|
||||
* Throws when Claude Code refuses the route. The caller must close the query.
|
||||
*/
|
||||
export async function applyProviderRoute(
|
||||
query: Pick<Query, "applyFlagSettings">,
|
||||
route: ProviderRouteSettings,
|
||||
): Promise<void> {
|
||||
try {
|
||||
await query.applyFlagSettings(route);
|
||||
} catch (error) {
|
||||
throw RequestError.internalError(
|
||||
{ details: error instanceof Error ? error.message : String(error) },
|
||||
"The session was not started, because Claude Code did not take its provider or gateway route. Try again, or set the provider or the gateway login again.",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function sameHeaders(a: Record<string, string>, b: Record<string, string>): boolean {
|
||||
const aKeys = Object.keys(a);
|
||||
return aKeys.length === Object.keys(b).length && aKeys.every((key) => b[key] === a[key]);
|
||||
|
||||
@@ -51,7 +51,7 @@ export function serveAcp(
|
||||
/**
|
||||
* Routes a connection to the protocol version that the client negotiates in
|
||||
* `initialize`. With `auto`, a client that requests version 2 or later gets
|
||||
* the draft ACP v2, and every other client gets ACP v1. With `v1`, a v2
|
||||
* ACP v2, and every other client gets ACP v1. With `v1`, a v2
|
||||
* client is negotiated down to v1. With `v2`, the router rejects the
|
||||
* `initialize` of a v1 client as an unsupported protocol version. `onAgent`
|
||||
* receives the agent of a v1 connection (`ClaudeAcpAgent`) once the router
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/**
|
||||
* The config options of a session, as both the v1 core and the v2 core
|
||||
* build them: mode, model, effort, Fast mode, ultracode and the main-thread
|
||||
* agent.
|
||||
* build them: model, effort, Fast mode, ultracode, mode and the main-thread
|
||||
* agent. A client gets them in that order (`orderedConfigOptions`), for a
|
||||
* root session and for a subagent's session.
|
||||
*/
|
||||
import {
|
||||
RequestError,
|
||||
@@ -15,7 +16,7 @@ import {
|
||||
AIR_RECOMMENDED_CONFIG_VALUE_CAPABILITY,
|
||||
clientSupportsAirCapability,
|
||||
} from "./air-extension.js";
|
||||
import { AGENT_CONFIG_ID, DEFAULT_AGENT_ID } from "./session-config-ids.js";
|
||||
import { AGENT_CONFIG_ID, DEFAULT_AGENT_ID, EFFORT_CONFIG_ID } from "./session-config-ids.js";
|
||||
import { buildEffortConfigOption } from "./session-effort.js";
|
||||
import {
|
||||
createFastModeConfigOption,
|
||||
@@ -43,12 +44,25 @@ import {
|
||||
// personas, so we filter them out and only surface the Agent picker when the
|
||||
// user (or a plugin/project) has configured custom agents. Update this set if
|
||||
// the SDK's built-in roster changes.
|
||||
//
|
||||
// The set is matched by name because `AgentInfo` does not say where an agent
|
||||
// comes from. `getContextUsage().agents` lists only the agents that are not
|
||||
// built in, but session setup does not wait for that request (see
|
||||
// `readContextWindow`).
|
||||
//
|
||||
// Claude Code does not list two of them in every session: `web-fetch` only
|
||||
// where its staged rollout or `CLAUDE_CODE_WEB_FETCH_AGENT=1` turns it on, and
|
||||
// `claude-code-guide` only where the adapter's environment sets
|
||||
// `CLAUDE_CODE_ENTRYPOINT` (the SDK sets `sdk-ts` when it is unset, and Claude
|
||||
// Code leaves the agent out for that value).
|
||||
export const BUILTIN_AGENT_NAMES = new Set([
|
||||
"claude",
|
||||
"claude-code-guide",
|
||||
"general-purpose",
|
||||
"Explore",
|
||||
"Plan",
|
||||
"statusline-setup",
|
||||
"web-fetch",
|
||||
]);
|
||||
|
||||
// Value of the synthetic "Default" entry in the agent picker, which maps to the
|
||||
@@ -105,6 +119,36 @@ export type ConfigOptionPresentation = {
|
||||
useRecommendedValue: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* The ids of a session's config options, in the order a client gets them.
|
||||
* An option is ranked by its id and not by its `category`, which the agent
|
||||
* option lacks.
|
||||
*/
|
||||
const CONFIG_OPTION_ORDER: readonly string[] = [
|
||||
MODEL_CONFIG_ID,
|
||||
EFFORT_CONFIG_ID,
|
||||
FAST_MODE_CONFIG_ID,
|
||||
ULTRACODE_CONFIG_ID,
|
||||
MODE_CONFIG_ID,
|
||||
AGENT_CONFIG_ID,
|
||||
];
|
||||
|
||||
/**
|
||||
* `options` as a client gets them, for a root session and for a subagent's
|
||||
* session: in {@link CONFIG_OPTION_ORDER}'s order, then each option with
|
||||
* another id, in the order it came.
|
||||
*/
|
||||
export function orderedConfigOptions(
|
||||
options: Iterable<SessionConfigOption>,
|
||||
): SessionConfigOption[] {
|
||||
const rank = (option: SessionConfigOption) => {
|
||||
const index = CONFIG_OPTION_ORDER.indexOf(option.id);
|
||||
return index < 0 ? CONFIG_OPTION_ORDER.length : index;
|
||||
};
|
||||
return [...options].sort((left, right) => rank(left) - rank(right));
|
||||
}
|
||||
|
||||
/** The config options of a root session, in the order a client gets them. */
|
||||
export function buildConfigOptions(
|
||||
modes: SessionModeState,
|
||||
models: SessionModelState,
|
||||
@@ -116,7 +160,7 @@ export function buildConfigOptions(
|
||||
presentation?: ConfigOptionPresentation,
|
||||
ultracode?: UltracodeOptionState,
|
||||
): SessionConfigOption[] {
|
||||
const options: SessionConfigOption[] = [SessionModeManager.configOption(modes)];
|
||||
const options: SessionConfigOption[] = [];
|
||||
// A gateway that lists none of the SDK's models leaves no model to offer, so
|
||||
// there is no model option at all.
|
||||
if (models.availableModels.length > 0) {
|
||||
@@ -151,6 +195,8 @@ export function buildConfigOptions(
|
||||
options.push(createUltracodeConfigOption(ultracode.enabled, ultracode.useBooleanOption));
|
||||
}
|
||||
|
||||
options.push(SessionModeManager.configOption(modes));
|
||||
|
||||
// Only surface the Agent picker when there's a real choice — i.e. the user
|
||||
// has configured at least one custom agent (built-ins are filtered out in
|
||||
// discoverCustomAgents). With none configured, "Default" would be the only
|
||||
@@ -173,7 +219,9 @@ export function buildConfigOptions(
|
||||
});
|
||||
}
|
||||
|
||||
return options;
|
||||
// The statements above already follow CONFIG_OPTION_ORDER. Sorting by it
|
||||
// keeps this list and a subagent's list on the one definition.
|
||||
return orderedConfigOptions(options);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
84
src/session-cursors.ts
Normal file
84
src/session-cursors.ts
Normal file
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
* Session cursors (the unstable session cursors RFD): the positions of a
|
||||
* session that a method can act at.
|
||||
*
|
||||
* The adapter announces one kind: the position before a user message that the
|
||||
* session's history stores, with the `fork` capability. `session/fork` with
|
||||
* its `cursorId` copies the history before that message, so a client can edit
|
||||
* the message or ask again from there. The first entry of a history has no
|
||||
* cursor: nothing is before it, and Claude Code forks at an entry, not before
|
||||
* the first one.
|
||||
*
|
||||
* A `cursorId` is derived from the uuid of its user message, which Claude Code
|
||||
* stores. So it is the same live, in every replay and after a restart, and
|
||||
* the adapter keeps no cursors of its own: a fork finds the position in the
|
||||
* stored history.
|
||||
*/
|
||||
import type { SessionMessage } from "@anthropic-ai/claude-agent-sdk";
|
||||
import { isCompactSummaryMessage } from "./context-compaction.js";
|
||||
import { isReplayHiddenMetaMessage, stripLocalCommandMetadata } from "./message-filters.js";
|
||||
|
||||
/** What the cursor ids start with. The rest is the uuid of the user message. */
|
||||
const BEFORE_MESSAGE = "before:";
|
||||
|
||||
/** The `cursor_update` of the cursor before the user message `messageId`. */
|
||||
export function forkCursorUpdate(messageId: string) {
|
||||
return {
|
||||
sessionUpdate: "cursor_update" as const,
|
||||
cursorId: `${BEFORE_MESSAGE}${messageId}`,
|
||||
capabilities: { fork: {} },
|
||||
anchor: { type: "user_message" as const, messageId, position: "before" as const },
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether a prompt with this content gets a cursor when it is inserted live.
|
||||
* A slash command does not: Claude Code stores a command as command metadata
|
||||
* or not at all, so a replay shows no user message for it and a fork finds no
|
||||
* cursor (see {@link hasForkCursor}). Text that only starts like a command
|
||||
* gets its cursor in the next replay.
|
||||
*/
|
||||
export function promptGetsCursor(prompt: ReadonlyArray<{ type: string; text?: unknown }>): boolean {
|
||||
const first = prompt.find((block) => block.type === "text");
|
||||
return !(typeof first?.text === "string" && first.text.trimStart().startsWith("/"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the entry `index` of the stored history `messages` is a user
|
||||
* message with a cursor before it: one that a replay shows as a user message
|
||||
* under its uuid, and that follows an entry that a fork can end with. A
|
||||
* replay announces the cursor of each such message, and a fork accepts no
|
||||
* other.
|
||||
*/
|
||||
export function hasForkCursor(messages: readonly SessionMessage[], index: number): boolean {
|
||||
const message = messages[index];
|
||||
if (!message || message.type !== "user" || !message.uuid) return false;
|
||||
if (!messages[index - 1]?.uuid) return false;
|
||||
if (message.parent_tool_use_id !== null) return false;
|
||||
if (isReplayHiddenMetaMessage(message) || isCompactSummaryMessage(message)) return false;
|
||||
// `null`: the message was command metadata alone, which a replay does not show.
|
||||
const content = stripLocalCommandMetadata(
|
||||
(message.message as { content?: unknown } | undefined)?.content,
|
||||
);
|
||||
if (typeof content === "string") return content.length > 0;
|
||||
// A message of tool results alone is no user message.
|
||||
return (
|
||||
Array.isArray(content) &&
|
||||
content.some((block) => (block as { type?: unknown } | null)?.type !== "tool_result")
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* The uuid of the entry that a fork at `cursorId` ends with: the entry before
|
||||
* the cursor's user message in the stored history `messages`. Undefined for
|
||||
* an id that is no cursor of that history (see {@link hasForkCursor}).
|
||||
*/
|
||||
export function forkPointOf(
|
||||
cursorId: string,
|
||||
messages: readonly SessionMessage[],
|
||||
): string | undefined {
|
||||
if (!cursorId.startsWith(BEFORE_MESSAGE)) return undefined;
|
||||
const messageId = cursorId.slice(BEFORE_MESSAGE.length);
|
||||
const index = messages.findIndex((message) => message.uuid === messageId);
|
||||
return hasForkCursor(messages, index) ? messages[index - 1]!.uuid : undefined;
|
||||
}
|
||||
@@ -74,9 +74,15 @@ export function normalizeFastModeDisabledReason(
|
||||
|
||||
/** Build the Fast mode config option. When the Client supports boolean config
|
||||
* options we expose a native `type: "boolean"` toggle; otherwise we degrade to
|
||||
* a two-value `select` ("on"/"off") so older Clients still get a usable
|
||||
* a two-value `select` ("off"/"on") so older Clients still get a usable
|
||||
* control.
|
||||
*
|
||||
* Its category is `speed`, the unstable ACP category of an option that
|
||||
* changes how fast the model responds, in v1 and v2. A category needs no
|
||||
* capability: a Client that does not know `speed` handles it as any unknown
|
||||
* category. ACP asks for a `speed` select's values from slowest to fastest,
|
||||
* so the fallback lists off before on.
|
||||
*
|
||||
* `disabledReason` (the SDK's `fast_mode_disabled_reason`) is folded into the
|
||||
* description while the toggle reads off, so a user whose account or provider
|
||||
* can't serve Fast mode sees why instead of a switch that silently refuses to
|
||||
@@ -92,7 +98,7 @@ export function createFastModeConfigOption(
|
||||
id: FAST_MODE_CONFIG_ID,
|
||||
name: "Fast mode",
|
||||
description: explanation ? `${FAST_MODE_DESCRIPTION} — ${explanation}` : FAST_MODE_DESCRIPTION,
|
||||
category: "model_config",
|
||||
category: "speed",
|
||||
} as const;
|
||||
|
||||
if (useBooleanOption) {
|
||||
@@ -104,8 +110,8 @@ export function createFastModeConfigOption(
|
||||
type: "select",
|
||||
currentValue: enabled ? FAST_MODE_ON : FAST_MODE_OFF,
|
||||
options: [
|
||||
{ value: FAST_MODE_ON, name: "On" },
|
||||
{ value: FAST_MODE_OFF, name: "Off" },
|
||||
{ value: FAST_MODE_ON, name: "On" },
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { RequestError } from "@agentclientprotocol/sdk/unstable";
|
||||
import { PROVIDER_ID } from "./providers.js";
|
||||
import type { SessionConfigOption } from "@agentclientprotocol/sdk/unstable";
|
||||
// matchDeniedModels is marked @alpha in the SDK; API may shift in a future release.
|
||||
import {
|
||||
@@ -595,7 +597,9 @@ export async function applyAvailableModelsAllowlist(
|
||||
*
|
||||
* When no row matches by its model (a `default` row kept only for lacking a
|
||||
* `resolvedModel` does not count), the gateway serves none of the SDK's
|
||||
* models, and nothing is left: the session offers no model.
|
||||
* models. If every row has a nonempty `resolvedModel`, session setup fails
|
||||
* with an error to choose a different provider. An empty catalog or any row
|
||||
* without a resolved model leaves no model config option instead.
|
||||
*/
|
||||
export function narrowToGatewayModels(
|
||||
models: ModelInfo[],
|
||||
@@ -615,9 +619,16 @@ export function narrowToGatewayModels(
|
||||
if (model.value === "default") return true;
|
||||
return MODEL_FAMILY_ALIASES.has(id) && [...listed].some((entry) => entry.includes(`-${id}`));
|
||||
});
|
||||
return narrowed.some((model) => listed.has(normalizeModelId(model.resolvedModel ?? model.value)))
|
||||
? narrowed
|
||||
: [];
|
||||
if (narrowed.some((model) => listed.has(normalizeModelId(model.resolvedModel ?? model.value)))) {
|
||||
return narrowed;
|
||||
}
|
||||
if (models.length > 0 && models.every((model) => model.resolvedModel?.trim())) {
|
||||
throw RequestError.internalError(
|
||||
{ providerId: PROVIDER_ID },
|
||||
"The selected provider offers no compatible Claude models. Choose a different provider and try again.",
|
||||
);
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -132,18 +132,23 @@ export function informationalNotice(message: { level: string; content: string })
|
||||
};
|
||||
}
|
||||
|
||||
/** The notice of a client MCP server that the `system/init` lists as not
|
||||
* started: `failed`, or `needs-auth` when the client cannot run the OAuth
|
||||
* flow (`oauthAvailable`). Undefined for any other status. */
|
||||
/** The notice of a client MCP server that did not start: `failed`, or
|
||||
* `needs-auth` when the client cannot run the OAuth flow (`oauthAvailable`).
|
||||
* Undefined for any other status. A server of the `system/init` list has no
|
||||
* `error`: `/mcp` shows it. An `UnservedMcpServer` is on no list of Claude
|
||||
* Code, so the notice has its `error`. */
|
||||
export function mcpServerStartupNotice(
|
||||
server: { name: string; status: string },
|
||||
server: { name: string; status: string; error?: string },
|
||||
oauthAvailable: boolean,
|
||||
): SessionNotice | undefined {
|
||||
if (server.status === "failed") {
|
||||
return {
|
||||
severity: "warning",
|
||||
title: `MCP server "${server.name}" failed to start`,
|
||||
description: "Its tools are unavailable in this session. Run /mcp for the error.",
|
||||
description:
|
||||
server.error === undefined
|
||||
? "Its tools are unavailable in this session. Run /mcp for the error."
|
||||
: `Its tools are unavailable in this session. ${server.error}`,
|
||||
};
|
||||
}
|
||||
if (server.status === "needs-auth" && !oauthAvailable) {
|
||||
|
||||
@@ -63,6 +63,7 @@ export class SettingsManager {
|
||||
private managedModelSettings: ModelSelectionSettings = {};
|
||||
private managedApiKeyHelper?: string;
|
||||
private managedCompactionSettings: CompactionSettings = {};
|
||||
private managedShowClearContextOnPlanAccept?: boolean;
|
||||
/** The policy sources last logged as not loaded (see {@link unloadedPolicySources}). */
|
||||
private unloadedPolicy?: string;
|
||||
private watchers: fs.FSWatcher[] = [];
|
||||
@@ -160,6 +161,9 @@ export class SettingsManager {
|
||||
?.autoCompactEnabled,
|
||||
env: Object.assign({}, ...managed.map((tier) => tier.env)),
|
||||
};
|
||||
this.managedShowClearContextOnPlanAccept = managed.findLast(
|
||||
(tier) => tier.showClearContextOnPlanAccept !== undefined,
|
||||
)?.showClearContextOnPlanAccept;
|
||||
} catch (error) {
|
||||
this.logger.error("Failed to resolve settings:", error);
|
||||
this.effective = {};
|
||||
@@ -167,6 +171,7 @@ export class SettingsManager {
|
||||
this.managedModelSettings = {};
|
||||
this.managedApiKeyHelper = undefined;
|
||||
this.managedCompactionSettings = {};
|
||||
this.managedShowClearContextOnPlanAccept = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -284,6 +289,21 @@ export class SettingsManager {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether an approved plan may be continued in a fresh context, as the CLI
|
||||
* resolves `showClearContextOnPlanAccept`: managed settings outrank the
|
||||
* `--settings` override, which outranks the user/project/local files. Off
|
||||
* unless one of them sets it, like the CLI.
|
||||
*/
|
||||
getShowClearContextOnPlanAccept(settingsOverride?: Settings): boolean {
|
||||
return (
|
||||
this.managedShowClearContextOnPlanAccept ??
|
||||
settingsOverride?.showClearContextOnPlanAccept ??
|
||||
this.effective.showClearContextOnPlanAccept ??
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* `deniedModels` entries from the managed tier, the only tier the CLI
|
||||
* honors them from.
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
* The configuration of a subagent's session, as its hooks report it. Both
|
||||
* the v1 core (`ClaudeAcpAgent.subagentConfigurationHook`, for both forms of
|
||||
* subagent sessions) and the v2 core (`v2/child-config.ts`)
|
||||
* build a child's config options with these.
|
||||
* build a child's config options with these, and send them in the root
|
||||
* session's order (`orderedConfigOptions` in `session-config-options.ts`).
|
||||
*/
|
||||
import type { SessionConfigOption, SessionModeState } from "@agentclientprotocol/sdk/unstable";
|
||||
import type { AgentInfo, HookInput } from "@anthropic-ai/claude-agent-sdk";
|
||||
@@ -78,19 +79,3 @@ export function subagentHookOptions(
|
||||
}
|
||||
return options;
|
||||
}
|
||||
|
||||
/**
|
||||
* A child's configuration, as it goes to the client: every option it holds,
|
||||
* the mode first, then the model, the effort and the model config, then the
|
||||
* rest in the order they came.
|
||||
*/
|
||||
export function orderedSubagentConfiguration(
|
||||
options: Iterable<SessionConfigOption>,
|
||||
): SessionConfigOption[] {
|
||||
const priority = ["mode", "model", "thought_level", "model_config"];
|
||||
const rank = (option: SessionConfigOption) => {
|
||||
const index = priority.indexOf(option.category ?? "");
|
||||
return index < 0 ? priority.length : index;
|
||||
};
|
||||
return [...options].sort((left, right) => rank(left) - rank(right));
|
||||
}
|
||||
|
||||
@@ -25,11 +25,12 @@
|
||||
* replayed child by its agent id carries the RFD's `session` reference to it
|
||||
* (`ReplayTranscript.withTarget`).
|
||||
*
|
||||
* Right after its announcement, each child gets its `model` option: the model
|
||||
* of its first response, in its transcript. A later response with another
|
||||
* model sends it again. A child without responses gets none. After the load
|
||||
* response, a model goes again only when the session's model list, which the
|
||||
* replay can lack, maps it to another entry.
|
||||
* The replay sends no `config_option_update` of a child: one that arrives
|
||||
* before the load response is a past value to the client. Each child's
|
||||
* configuration goes out after the response, with its current state
|
||||
* (`currentStates`): the configuration of a child that still runs in this
|
||||
* process, else the `model` option with the model of the latest response in
|
||||
* its transcript. A child that neither runs nor has a response gets none.
|
||||
*
|
||||
* A launch without metadata has no known id, so it is not announced: the RFD
|
||||
* forbids inventing one. Its Agent call stays an ordinary tool call of the
|
||||
@@ -46,7 +47,6 @@ import {
|
||||
isNativeSubagentControlTool,
|
||||
launchReply,
|
||||
linkedSessionMessages,
|
||||
type ModelEntry,
|
||||
nativeSubagentState,
|
||||
responseModelEntry,
|
||||
rfdEndState,
|
||||
@@ -83,8 +83,6 @@ export type ReplayChild = {
|
||||
promptSent: boolean;
|
||||
/** Whether it handed a report to its parent with a SubagentHandback call. */
|
||||
handedBack?: boolean;
|
||||
/** The `model` option entry that the replay sent. */
|
||||
model?: ModelEntry;
|
||||
/** The model id of the latest response in its transcript. */
|
||||
responseModel?: string;
|
||||
};
|
||||
@@ -219,13 +217,12 @@ export class RfdSubagentReplay {
|
||||
constructor(
|
||||
private readonly history: SubagentHistory,
|
||||
private readonly publish: Publish,
|
||||
private readonly models?: SubagentModels,
|
||||
/**
|
||||
* Whether the replay maps a model to the session's model list as it goes.
|
||||
* A load lacks the list until the CLI started, so it maps only in
|
||||
* {@link currentStates}, after the load response.
|
||||
* The session's model list, which {@link currentStates} maps each child's
|
||||
* model to. A load can lack the list until the CLI started, so it is read
|
||||
* after the load response.
|
||||
*/
|
||||
private readonly mapsDuringReplay = true,
|
||||
private readonly models?: SubagentModels,
|
||||
/** The working directory of the root session, which a child inherits unless it reports its own. */
|
||||
private readonly rootCwd?: string,
|
||||
) {
|
||||
@@ -253,10 +250,8 @@ export class RfdSubagentReplay {
|
||||
/**
|
||||
* Announces `child` on its parent, as live: running, with the parent's
|
||||
* labels, and with its recorded `cwd` when that differs from its parent's.
|
||||
* Then it sends `firstModel`, the model of the child's first response, when
|
||||
* the transcript has one.
|
||||
*/
|
||||
async announce(child: ReplayChild, firstModel?: string): Promise<void> {
|
||||
async announce(child: ReplayChild): Promise<void> {
|
||||
if (child.announced) return;
|
||||
const labels = rfdLabels(
|
||||
child.record.name ?? child.input.name,
|
||||
@@ -282,7 +277,6 @@ export class RfdSubagentReplay {
|
||||
});
|
||||
child.cwd = cwd;
|
||||
child.announced = true;
|
||||
await this.responseModel(child, firstModel);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -300,27 +294,9 @@ export class RfdSubagentReplay {
|
||||
return this.rootCwd;
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes the model of a replayed response of the child `owner`. A child
|
||||
* whose model changes gets its `model` option again.
|
||||
*/
|
||||
async responseModel(owner: ReplayChild, model: string | undefined): Promise<void> {
|
||||
const entry = responseModelEntry(model, this.mapsDuringReplay ? this.models : undefined);
|
||||
if (!entry || !owner.announced) return;
|
||||
owner.responseModel = model;
|
||||
await this.sendModel(owner, entry);
|
||||
}
|
||||
|
||||
private async sendModel(child: ReplayChild, model: ModelEntry): Promise<void> {
|
||||
if (child.model?.value === model.value && child.model.name === model.name) return;
|
||||
child.model = model;
|
||||
await this.publish({
|
||||
sessionId: child.sessionId,
|
||||
update: {
|
||||
sessionUpdate: "config_option_update",
|
||||
configOptions: [childModelOption(model)],
|
||||
},
|
||||
});
|
||||
/** Takes the model of a replayed response of the child `owner` (see {@link trackResponseModel}). */
|
||||
responseModel(owner: ReplayChild, model: string | undefined): void {
|
||||
trackResponseModel(owner, model);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -462,11 +438,16 @@ export class RfdSubagentReplay {
|
||||
}
|
||||
}
|
||||
|
||||
/** Whether the replay announced the child session `sessionId`. */
|
||||
announced(sessionId: string): boolean {
|
||||
return this.transcript.byAgentId.get(sessionId)?.announced === true;
|
||||
}
|
||||
|
||||
/**
|
||||
* The current state of each announced child, to send after the load
|
||||
* response. The RFD makes that response the freshness boundary: a client
|
||||
* treats the replayed states before it as history, so they show no current
|
||||
* activity and allow no cancel.
|
||||
* The current state and configuration of each announced child, to send
|
||||
* after the load response. The RFD makes that response the freshness
|
||||
* boundary: a client treats the replayed states before it as history, so
|
||||
* they show no current activity and allow no cancel.
|
||||
*
|
||||
* `live` gives the work state of a child that still runs in this process, as
|
||||
* when a live session is loaded again. Such a child reports that state and
|
||||
@@ -476,6 +457,10 @@ export class RfdSubagentReplay {
|
||||
* A replayed `cwd` whose directory is gone, such as a worktree that Claude
|
||||
* Code removed when the child finished, is cleared with `cwd: null`, as the
|
||||
* RFD requires after a reconnection.
|
||||
*
|
||||
* Each child's configuration follows its state (see
|
||||
* {@link currentChildConfiguration}). `liveConfiguration` gives the one
|
||||
* that the client last got for a child that still runs in this process.
|
||||
*/
|
||||
currentStates(
|
||||
live: (sessionId: string) => WorkState["state"] | undefined,
|
||||
@@ -489,13 +474,11 @@ export class RfdSubagentReplay {
|
||||
liveState === undefined || liveState === "idle"
|
||||
? replayEndState(child)
|
||||
: { state: liveState };
|
||||
// The session's model list may be known only now, after the load response.
|
||||
const entry = responseModelEntry(child.responseModel, this.models);
|
||||
const replayed = child.model ? JSON.stringify([childModelOption(child.model)]) : undefined;
|
||||
const current =
|
||||
liveConfiguration?.(child.sessionId) ?? (entry ? [childModelOption(entry)] : undefined);
|
||||
// A configuration that the replay already sent does not go again.
|
||||
const configOptions = current && JSON.stringify(current) !== replayed ? current : undefined;
|
||||
const configOptions = currentChildConfiguration(
|
||||
child,
|
||||
liveConfiguration?.(child.sessionId),
|
||||
this.models,
|
||||
);
|
||||
return [
|
||||
{
|
||||
sessionId: child.parentSessionId,
|
||||
@@ -584,14 +567,38 @@ export class RfdSubagentReplay {
|
||||
}
|
||||
}
|
||||
|
||||
/** The model of the first response in `messages`, a subagent's transcript. */
|
||||
export function firstResponseModel(messages: readonly SessionMessage[]): string | undefined {
|
||||
for (const message of messages) {
|
||||
if (message.type !== "assistant") continue;
|
||||
const model = (message.message as { model?: unknown } | undefined)?.model;
|
||||
if (typeof model === "string" && model && model !== "<synthetic>") return model;
|
||||
/**
|
||||
* Takes `model`, the model id of a replayed response of `child`. The latest
|
||||
* one is the child's model after the replay (see
|
||||
* {@link currentChildConfiguration}). A response without a model id, or with
|
||||
* `<synthetic>`, which marks a message that no model wrote, changes nothing.
|
||||
*/
|
||||
export function trackResponseModel(child: ReplayChild, model: unknown): void {
|
||||
if (typeof model === "string" && responseModelEntry(model, undefined)) {
|
||||
child.responseModel = model;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* The configuration of the replayed `child` to send once the replay is over:
|
||||
* after the load response on v1, after the root's `replay_complete` on v2. A
|
||||
* child's `config_option_update` inside a replay is a past value to the
|
||||
* client, so the replay sends none, and this one goes also when the client
|
||||
* held the same configuration before.
|
||||
*
|
||||
* `live` is the configuration that the client last got for a child that still
|
||||
* runs in this process. Any other child gets its `model` option, with the
|
||||
* model of the latest response in its transcript, as the session's model list
|
||||
* `models` names it. Undefined for such a child without responses.
|
||||
*/
|
||||
export function currentChildConfiguration(
|
||||
child: ReplayChild,
|
||||
live: SessionConfigOption[] | undefined,
|
||||
models: SubagentModels | undefined,
|
||||
): SessionConfigOption[] | undefined {
|
||||
if (live) return live;
|
||||
const entry = responseModelEntry(child.responseModel, models);
|
||||
return entry ? [childModelOption(entry)] : undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"rawInput":{"plan":"# Plan\n1. Do it"},"sessionUpdate":"tool_call_update","toolCallId":"toolu_plan"}}}
|
||||
{"kind":"requestPermission","payload":{"_meta":{"jetbrains":{"air":{"permission":{"title":"Ready to code?","version":1},"version":1}}},"options":[{"kind":"allow_once","name":"Yes, manually approve edits","optionId":"exit-plan-default"},{"kind":"allow_always","name":"Yes, clear context (0% used) and use auto mode","optionId":"exit-plan-clear-auto"},{"kind":"allow_always","name":"Yes, and use auto mode","optionId":"exit-plan-auto"},{"kind":"allow_always","name":"Yes, and bypass permissions","optionId":"exit-plan-bypass"},{"kind":"reject_once","name":"No, keep planning","optionId":"reject"}],"sessionId":"<session>","toolCall":{"rawInput":{"plan":"# Plan\n1. Do it"},"title":"Approve Plan","toolCallId":"toolu_plan"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"currentModeId":"default","sessionUpdate":"current_mode_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"configOptions":[{"category":"mode","currentValue":"default","description":"Session permission mode","id":"mode","name":"Mode","options":[{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Always ask before making changes","name":"Manual","value":"default"},{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"_meta":{"jetbrains":{"air":{"kind":"plan","version":1}}},"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"_meta":{"jetbrains":{"air":{"kind":"auto_review","version":1}}},"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"_meta":{"jetbrains":{"air":{"kind":"full_access","version":1}}},"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","id":"model","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionUpdate":"config_option_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"configOptions":[{"category":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","id":"model","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","currentValue":"default","description":"Session permission mode","id":"mode","name":"Mode","options":[{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Always ask before making changes","name":"Manual","value":"default"},{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"_meta":{"jetbrains":{"air":{"kind":"plan","version":1}}},"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"_meta":{"jetbrains":{"air":{"kind":"auto_review","version":1}}},"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"_meta":{"jetbrains":{"air":{"kind":"full_access","version":1}}},"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionUpdate":"config_option_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"sessionUpdate":"tool_call_update","status":"completed","title":"Exited Plan Mode","toolCallId":"toolu_plan"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
|
||||
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"mcp__docs__search"},"is_mcp_tool_call":true,"jetbrains":{"air":{"mcp":{"server":"docs","tool":"search"},"version":1}}},"content":[],"kind":"other","name":"mcp__docs__search","sessionUpdate":"tool_call","status":"pending","title":"mcp__docs__search","toolCallId":"toolu_mcp"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"mcp__docs__search"},"is_mcp_tool_call":true,"jetbrains":{"air":{"mcp":{"server":"docs","tool":"search"},"version":1}}},"content":[],"kind":"other","name":"mcp__docs__search","sessionUpdate":"tool_call","status":"pending","title":"docs: search","toolCallId":"toolu_mcp"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"rawInput":{"q":"acp"},"sessionUpdate":"tool_call_update","toolCallId":"toolu_mcp"}}}
|
||||
{"kind":"requestPermission","payload":{"_meta":{"jetbrains":{"air":{"permission":{"title":"mcp__docs__search","version":1},"version":1}}},"options":[{"kind":"allow_once","name":"Yes","optionId":"allow-once"},{"kind":"reject_once","name":"No","optionId":"reject"}],"sessionId":"<session>","toolCall":{"_meta":{"claudeCode":{"mcpServer":{"name":"docs","source":"project"}}},"rawInput":{"q":"acp"},"title":"mcp__docs__search","toolCallId":"toolu_mcp"}}}
|
||||
{"kind":"requestPermission","payload":{"_meta":{"jetbrains":{"air":{"permission":{"title":"docs: search","version":1},"version":1}}},"options":[{"kind":"allow_once","name":"Yes","optionId":"allow-once"},{"kind":"reject_once","name":"No","optionId":"reject"}],"sessionId":"<session>","toolCall":{"_meta":{"claudeCode":{"mcpServer":{"name":"docs","source":"project"}}},"rawInput":{"q":"acp"},"title":"docs: search","toolCallId":"toolu_mcp"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":[{"content":{"text":"Found 2 documents.","type":"text"},"type":"content"}],"sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_mcp"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
|
||||
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"initialize","payload":{"_meta":{"jetbrains":{"air":{"capabilities":["sessionFailure","agentFileChangeReport","nativeSubagentSessions","asyncTasks","customInstructions","recommendedValue","diffPatch","planFile","backgroundSubagents"],"goal":{"actions":["set","clear"],"controlMethod":"_session/goal","version":1},"version":1}},"steering":{"supported":true}},"agentCapabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"logout":{},"status":{}},"loadSession":true,"mcpCapabilities":{"http":true,"sse":true},"promptCapabilities":{"embeddedContext":true,"image":true},"providers":{},"sessionCapabilities":{"additionalDirectories":{},"close":{},"delete":{},"fork":{},"list":{},"options":{},"resume":{},"status":{},"subagents":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"agentInfo":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"authMethods":[],"protocolVersion":1}}
|
||||
{"kind":"initialize","payload":{"_meta":{"jetbrains":{"air":{"capabilities":["sessionFailure","agentFileChangeReport","nativeSubagentSessions","asyncTasks","customInstructions","recommendedValue","diffPatch","planFile","backgroundSubagents"],"goal":{"actions":["set","clear"],"controlMethod":"_session/goal","version":1},"version":1}},"steering":{"supported":true}},"agentCapabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"logout":{},"status":{}},"loadSession":true,"mcpCapabilities":{"acp":true,"http":true,"sse":true},"promptCapabilities":{"embeddedContext":true,"image":true},"providers":{},"sessionCapabilities":{"additionalDirectories":{},"close":{},"delete":{},"fork":{},"list":{},"options":{},"resume":{},"status":{},"subagents":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"agentInfo":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"authMethods":[],"protocolVersion":1}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":{"text":"Fix the bug","type":"text"},"messageId":"00000000-0000-4000-8000-00000000c001","sessionUpdate":"user_message_chunk"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":{"text":"Check the file.","type":"text"},"messageId":"msg_r1","sessionUpdate":"agent_thought_chunk"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":{"text":"I will edit it.","type":"text"},"messageId":"msg_r1","sessionUpdate":"agent_message_chunk"}}}
|
||||
@@ -12,6 +12,6 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>:replay-subagent:toolu_r_task","update":{"_meta":{"claudeCode":{"parentToolUseId":"toolu_r_task"}},"content":{"text":"Subagent text.","type":"text"},"messageId":"msg_r_sub","sessionUpdate":"agent_message_chunk"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":{"text":"Fixed.","type":"text"},"messageId":"msg_r2","sessionUpdate":"agent_message_chunk"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"sessionUpdate":"subagent_state_update","state":"completed","subagentSessionId":"<session>:replay-subagent:toolu_r_task"}}}
|
||||
{"kind":"loadSession","payload":{"configOptions":[{"category":"mode","currentValue":"auto","description":"Session permission mode","id":"mode","name":"Mode","options":[{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Always ask before making changes","name":"Manual","value":"default"},{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"_meta":{"jetbrains":{"air":{"kind":"plan","version":1}}},"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"_meta":{"jetbrains":{"air":{"kind":"auto_review","version":1}}},"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"_meta":{"jetbrains":{"air":{"kind":"full_access","version":1}}},"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","id":"model","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"modes":{"availableModes":[{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Always ask before making changes","id":"default","name":"Manual"},{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Automatically accept all file edits","id":"acceptEdits","name":"Accept edits"},{"_meta":{"jetbrains":{"air":{"kind":"plan","version":1}}},"description":"Create a plan before making changes","id":"plan","name":"Plan"},{"_meta":{"jetbrains":{"air":{"kind":"auto_review","version":1}}},"description":"Claude handles permission decisions","id":"auto","name":"Auto"},{"_meta":{"jetbrains":{"air":{"kind":"full_access","version":1}}},"description":"Accepts all permissions","id":"bypassPermissions","name":"Bypass permissions"}],"currentModeId":"auto"},"sessionId":"<session>"}}
|
||||
{"kind":"loadSession","payload":{"configOptions":[{"category":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","id":"model","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","currentValue":"auto","description":"Session permission mode","id":"mode","name":"Mode","options":[{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Always ask before making changes","name":"Manual","value":"default"},{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"_meta":{"jetbrains":{"air":{"kind":"plan","version":1}}},"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"_meta":{"jetbrains":{"air":{"kind":"auto_review","version":1}}},"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"_meta":{"jetbrains":{"air":{"kind":"full_access","version":1}}},"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"modes":{"availableModes":[{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Always ask before making changes","id":"default","name":"Manual"},{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Automatically accept all file edits","id":"acceptEdits","name":"Accept edits"},{"_meta":{"jetbrains":{"air":{"kind":"plan","version":1}}},"description":"Create a plan before making changes","id":"plan","name":"Plan"},{"_meta":{"jetbrains":{"air":{"kind":"auto_review","version":1}}},"description":"Claude handles permission decisions","id":"auto","name":"Auto"},{"_meta":{"jetbrains":{"air":{"kind":"full_access","version":1}}},"description":"Accepts all permissions","id":"bypassPermissions","name":"Bypass permissions"}],"currentModeId":"auto"},"sessionId":"<session>"}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>:replay-subagent:toolu_r_task","update":{"configOptions":[{"category":"model","currentValue":"claude-sonnet-4-6","id":"model","name":"Model","options":[{"name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionUpdate":"config_option_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{"kind":"initialize","payload":{"_meta":{"jetbrains":{"air":{"capabilities":["sessionFailure","agentFileChangeReport","nativeSubagentSessions","asyncTasks","customInstructions","recommendedValue","diffPatch","planFile","backgroundSubagents"],"goal":{"actions":["set","clear"],"controlMethod":"_session/goal","version":1},"version":1}},"steering":{"supported":true}},"agentCapabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"logout":{},"status":{}},"loadSession":true,"mcpCapabilities":{"http":true,"sse":true},"promptCapabilities":{"embeddedContext":true,"image":true},"providers":{},"sessionCapabilities":{"additionalDirectories":{},"close":{},"delete":{},"fork":{},"list":{},"options":{},"resume":{},"status":{},"subagents":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"agentInfo":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"authMethods":[],"protocolVersion":1}}
|
||||
{"kind":"newSession","payload":{"configOptions":[{"category":"mode","currentValue":"auto","description":"Session permission mode","id":"mode","name":"Mode","options":[{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Always ask before making changes","name":"Manual","value":"default"},{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"_meta":{"jetbrains":{"air":{"kind":"plan","version":1}}},"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"_meta":{"jetbrains":{"air":{"kind":"auto_review","version":1}}},"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"_meta":{"jetbrains":{"air":{"kind":"full_access","version":1}}},"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","id":"model","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"modes":{"availableModes":[{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Always ask before making changes","id":"default","name":"Manual"},{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Automatically accept all file edits","id":"acceptEdits","name":"Accept edits"},{"_meta":{"jetbrains":{"air":{"kind":"plan","version":1}}},"description":"Create a plan before making changes","id":"plan","name":"Plan"},{"_meta":{"jetbrains":{"air":{"kind":"auto_review","version":1}}},"description":"Claude handles permission decisions","id":"auto","name":"Auto"},{"_meta":{"jetbrains":{"air":{"kind":"full_access","version":1}}},"description":"Accepts all permissions","id":"bypassPermissions","name":"Bypass permissions"}],"currentModeId":"auto"},"sessionId":"<session>"}}
|
||||
{"kind":"initialize","payload":{"_meta":{"jetbrains":{"air":{"capabilities":["sessionFailure","agentFileChangeReport","nativeSubagentSessions","asyncTasks","customInstructions","recommendedValue","diffPatch","planFile","backgroundSubagents"],"goal":{"actions":["set","clear"],"controlMethod":"_session/goal","version":1},"version":1}},"steering":{"supported":true}},"agentCapabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"logout":{},"status":{}},"loadSession":true,"mcpCapabilities":{"acp":true,"http":true,"sse":true},"promptCapabilities":{"embeddedContext":true,"image":true},"providers":{},"sessionCapabilities":{"additionalDirectories":{},"close":{},"delete":{},"fork":{},"list":{},"options":{},"resume":{},"status":{},"subagents":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"agentInfo":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"authMethods":[],"protocolVersion":1}}
|
||||
{"kind":"newSession","payload":{"configOptions":[{"category":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","id":"model","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","currentValue":"auto","description":"Session permission mode","id":"mode","name":"Mode","options":[{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Always ask before making changes","name":"Manual","value":"default"},{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"_meta":{"jetbrains":{"air":{"kind":"plan","version":1}}},"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"_meta":{"jetbrains":{"air":{"kind":"auto_review","version":1}}},"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"_meta":{"jetbrains":{"air":{"kind":"full_access","version":1}}},"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"modes":{"availableModes":[{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Always ask before making changes","id":"default","name":"Manual"},{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Automatically accept all file edits","id":"acceptEdits","name":"Accept edits"},{"_meta":{"jetbrains":{"air":{"kind":"plan","version":1}}},"description":"Create a plan before making changes","id":"plan","name":"Plan"},{"_meta":{"jetbrains":{"air":{"kind":"auto_review","version":1}}},"description":"Claude handles permission decisions","id":"auto","name":"Auto"},{"_meta":{"jetbrains":{"air":{"kind":"full_access","version":1}}},"description":"Accepts all permissions","id":"bypassPermissions","name":"Bypass permissions"}],"currentModeId":"auto"},"sessionId":"<session>"}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
@@ -10,7 +10,7 @@
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"requires_action"}}}
|
||||
{"kind":"request","method":"session/request_permission","payload":{"options":[{"kind":"allow_once","name":"Yes, manually approve edits","optionId":"exit-plan-default"},{"kind":"allow_always","name":"Yes, clear context (0% used) and use auto mode","optionId":"exit-plan-clear-auto"},{"kind":"allow_always","name":"Yes, and use auto mode","optionId":"exit-plan-auto"},{"kind":"allow_always","name":"Yes, and bypass permissions","optionId":"exit-plan-bypass"},{"kind":"reject_once","name":"No, keep planning","optionId":"reject"}],"sessionId":"<session>","subject":{"toolCall":{"content":[{"content":{"text":"# Plan\n1. Do it","type":"text"},"type":"content"}],"kind":"switch_mode","name":"ExitPlanMode","rawInput":{"plan":"# Plan\n1. Do it"},"title":"Approve Plan","toolCallId":"toolu_plan"},"type":"tool_call"},"title":"Ready to code?"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"configOptions":[{"category":"mode","configId":"mode","currentValue":"default","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionUpdate":"config_option_update"}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"default","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionUpdate":"config_option_update"}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"rawOutput":"User has approved your plan. You can now start coding.\n\n## Approved Plan:\n# Plan\n1. Do it","sessionUpdate":"tool_call_update","status":"completed","title":"Exited Plan Mode","toolCallId":"toolu_plan"}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"plan":{"content":"# Plan\n1. Do it","planId":"plan-mode","type":"markdown"},"sessionUpdate":"plan_update"}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"/goal Ship the feature","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
@@ -13,7 +13,7 @@
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"content":{"text":"src/app.ts:2:const value = 1;","type":"text"},"type":"content"}],"rawOutput":"src/app.ts:2:const value = 1;","sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_grep"}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[],"kind":"search","locations":[],"name":"Glob","rawInput":{},"sessionUpdate":"tool_call_update","status":"pending","title":"Find","toolCallId":"toolu_glob"}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"rawInput":{"pattern":"**/*.ts"},"sessionUpdate":"tool_call_update","title":"Find `**/*.ts`","toolCallId":"toolu_glob"}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"rawInput":{"pattern":"**/*.ts"},"sessionUpdate":"tool_call_update","title":"Find **/*.ts","toolCallId":"toolu_glob"}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"content":{"text":"src/app.ts\nsrc/b.ts","type":"text"},"type":"content"}],"rawOutput":"src/app.ts\nsrc/b.ts","sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_glob"}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"background":[],"sessionUpdate":"state_update","state":"idle","stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[],"kind":"other","name":"mcp__docs__search","rawInput":{},"sessionUpdate":"tool_call_update","status":"pending","title":"mcp__docs__search","toolCallId":"toolu_mcp"}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[],"kind":"other","name":"mcp__docs__search","rawInput":{},"sessionUpdate":"tool_call_update","status":"pending","title":"docs: search","toolCallId":"toolu_mcp"}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"rawInput":{"q":"acp"},"sessionUpdate":"tool_call_update","toolCallId":"toolu_mcp"}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"requires_action"}}}
|
||||
{"kind":"request","method":"session/request_permission","payload":{"options":[{"kind":"allow_once","name":"Yes","optionId":"allow-once"},{"kind":"reject_once","name":"No","optionId":"reject"}],"sessionId":"<session>","subject":{"toolCall":{"_meta":{"claudeCode":{"mcpServer":{"name":"docs","source":"project"}}},"content":[],"kind":"other","name":"mcp__docs__search","rawInput":{"q":"acp"},"title":"mcp__docs__search","toolCallId":"toolu_mcp"},"type":"tool_call"},"title":"mcp__docs__search"}}
|
||||
{"kind":"request","method":"session/request_permission","payload":{"options":[{"kind":"allow_once","name":"Yes","optionId":"allow-once"},{"kind":"reject_once","name":"No","optionId":"reject"}],"sessionId":"<session>","subject":{"toolCall":{"_meta":{"claudeCode":{"mcpServer":{"name":"docs","source":"project"}}},"content":[],"kind":"other","name":"mcp__docs__search","rawInput":{"q":"acp"},"title":"docs: search","toolCallId":"toolu_mcp"},"type":"tool_call"},"title":"docs: search"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"content":{"text":"Found 2 documents.","type":"text"},"type":"content"}],"rawOutput":[{"text":"Found 2 documents.","type":"text"}],"sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_mcp"}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[],"messageId":"00000000-0000-4000-8000-00000000c001","sessionUpdate":"user_message"}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":{"text":"Fix the bug","type":"text"},"messageId":"00000000-0000-4000-8000-00000000c001","sessionUpdate":"user_message_chunk"}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[],"messageId":"msg_r1","sessionUpdate":"agent_thought"}}}
|
||||
@@ -20,4 +20,4 @@
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"description":"The history of 1 subagent of this session could not be restored.","sessionUpdate":"notice","severity":"info","title":"Some subagent history is not available"}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"sessionUpdate":"session_info_update","title":"Fix the app","updatedAt":"2026-01-01T00:00:00.000Z"}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"idle"}}}
|
||||
{"kind":"response","method":"session/resume","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}]}}
|
||||
{"kind":"response","method":"session/resume","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}]}}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
@@ -15,7 +15,7 @@
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"agent_t","update":{"_meta":{"claudeCode":{"parentToolUseId":"toolu_transcript"}},"content":{"text":"The repo has ","type":"text"},"messageId":"msg_transcript_sub","sessionUpdate":"agent_message_chunk"}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"agent_t","update":{"_meta":{"claudeCode":{"parentToolUseId":"toolu_transcript"}},"content":{"text":"two packages.","type":"text"},"messageId":"msg_transcript_sub","sessionUpdate":"agent_message_chunk"}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"agent_t","update":{"_meta":{"claudeCode":{"parentToolUseId":"toolu_transcript"}},"content":[],"kind":"search","locations":[],"name":"Glob","rawInput":{},"sessionUpdate":"tool_call_update","status":"pending","title":"Find","toolCallId":"toolu_transcript_glob"}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"agent_t","update":{"rawInput":{"pattern":"*"},"sessionUpdate":"tool_call_update","title":"Find `*`","toolCallId":"toolu_transcript_glob"}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"agent_t","update":{"rawInput":{"pattern":"*"},"sessionUpdate":"tool_call_update","title":"Find *","toolCallId":"toolu_transcript_glob"}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"agent_t","update":{"content":[{"content":{"text":"a\nb","type":"text"},"type":"content"}],"rawOutput":"a\nb","sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_transcript_glob"}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"Two packages.","type":"text"}],"messageId":"toolu_transcript:reply","recipientSessionId":"<session>","senderSessionId":"agent_t","sessionUpdate":"session_message"}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"sessionId":"agent_t","sessionUpdate":"subagent_update","state":{"background":[],"state":"idle","stopReason":"end_turn"}}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
@@ -15,6 +15,7 @@
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"background":[],"sessionUpdate":"state_update","state":"idle","stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 2","type":"text"}],"messageId":"<id-2>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"anchor":{"messageId":"<id-2>","position":"before","type":"user_message"},"capabilities":{"fork":{}},"cursorId":"before:<id-2>","sessionUpdate":"cursor_update"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-2>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
* change since the previous report of the same tool call. An update with
|
||||
* nothing new is not sent. ACP does not merge `_meta` keys, so every
|
||||
* `_meta` key that origin/main sent must still be there.
|
||||
* - An MCP tool call, including one in a permission request, has title
|
||||
* `server: tool` where origin/main used the programmatic name as its title.
|
||||
* - A `compaction_update` leaves out a summary whose text is the same as the
|
||||
* `compaction_summary_chunk` text that went out before it.
|
||||
* - A subagent message or thought is not sent again in full when the chunks
|
||||
@@ -38,6 +40,10 @@
|
||||
* `agentCapabilities.sessionCapabilities.options`, which origin/main did
|
||||
* not: the agent now serves `session/options` and takes `configOptions` on
|
||||
* session setup requests.
|
||||
* - The `initialize` response also advertises
|
||||
* `agentCapabilities.mcpCapabilities.acp`, which origin/main did not: the
|
||||
* agent now takes MCP servers that the client serves over the ACP
|
||||
* connection (`"type": "acp"`).
|
||||
* - A SandboxNetworkAccess tool call is settled by a `tool_call_update` with
|
||||
* only its final `status` once its permission request is answered. The
|
||||
* callback runs nothing, so origin/main never settled the call (see
|
||||
@@ -172,6 +178,21 @@ function updateOf(record: Recorded): Json | undefined {
|
||||
return (record.payload as { update: Json }).update;
|
||||
}
|
||||
|
||||
/** Changes only a baseline tool call's title, not its name or raw input. */
|
||||
function withMcpToolTitle(record: Recorded): Recorded {
|
||||
if (record.kind !== "sessionUpdate" && record.kind !== "requestPermission") return record;
|
||||
const payload = record.payload as Json;
|
||||
const key = record.kind === "requestPermission" ? "toolCall" : "update";
|
||||
const call = payload[key] as Json | undefined;
|
||||
if (!call?.toolCallId || typeof call.title !== "string") return record;
|
||||
const meta = call._meta as { claudeCode?: { toolName?: string } } | undefined;
|
||||
if (call.title !== (call.name ?? meta?.claudeCode?.toolName)) return record;
|
||||
const [prefix, server, ...rest] = call.title.split("__");
|
||||
const tool = rest.join("__");
|
||||
if (prefix !== "mcp" || !server || !tool) return record;
|
||||
return { ...record, payload: { ...payload, [key]: { ...call, title: `${server}: ${tool}` } } };
|
||||
}
|
||||
|
||||
/** The key and the text of a subagent message or thought chunk. */
|
||||
function subagentChunk(update: Json | undefined): { key: string; text: string } | undefined {
|
||||
if (
|
||||
@@ -253,16 +274,16 @@ function withoutSessionCapabilities(record: Recorded, keys: readonly string[]):
|
||||
} as Recorded;
|
||||
}
|
||||
|
||||
/** `record` without `agentCapabilities.auth.status`, when it is an `initialize` response. */
|
||||
function withoutAuthStatusCapability(record: Recorded): Recorded {
|
||||
/** `record` without `agentCapabilities.<group>.<key>`, when it is an `initialize` response. */
|
||||
function withoutAgentCapability(record: Recorded, group: string, key: string): Recorded {
|
||||
if (record.kind !== "initialize") return record;
|
||||
const payload = record.payload as Json;
|
||||
const agent = payload.agentCapabilities as Json | undefined;
|
||||
const auth = agent?.auth as Json | undefined;
|
||||
if (!auth || !("status" in auth)) return record;
|
||||
const capabilities = agent?.[group] as Json | undefined;
|
||||
if (!capabilities || !(key in capabilities)) return record;
|
||||
return {
|
||||
...record,
|
||||
payload: { ...payload, agentCapabilities: { ...agent, auth: without(auth, "status") } },
|
||||
payload: { ...payload, agentCapabilities: { ...agent, [group]: without(capabilities, key) } },
|
||||
} as Recorded;
|
||||
}
|
||||
|
||||
@@ -275,14 +296,21 @@ export function compareWithBaseline(baseline: Recorded[], traffic: Recorded[]):
|
||||
.map((record) =>
|
||||
withoutSessionCapabilities(withoutAirOnlyKeys(record) as Recorded, ["subagents"]),
|
||||
)
|
||||
.map(withMcpToolTitle)
|
||||
.filter((record) => {
|
||||
const update = updateOf(record);
|
||||
return !(update?.sessionUpdate === "session_info_update" && Object.keys(update).length === 1);
|
||||
});
|
||||
const current = withoutSandboxNetworkSettlements(
|
||||
traffic.map((record) =>
|
||||
withoutAuthStatusCapability(
|
||||
withoutSessionCapabilities(record, ["systemPrompt", "status", "title", "options"]),
|
||||
withoutAgentCapability(
|
||||
withoutAgentCapability(
|
||||
withoutSessionCapabilities(record, ["systemPrompt", "status", "title", "options"]),
|
||||
"auth",
|
||||
"status",
|
||||
),
|
||||
"mcpCapabilities",
|
||||
"acp",
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"ExitPlanMode"}},"content":[{"content":{"text":"# Plan\n1. Do it","type":"text"},"type":"content"}],"kind":"switch_mode","rawInput":{"plan":"# Plan\n1. Do it"},"sessionUpdate":"tool_call_update","title":"Approve Plan","toolCallId":"toolu_plan"}}}
|
||||
{"kind":"requestPermission","payload":{"_meta":{"permission":{"title":"Ready to code?","version":1}},"options":[{"kind":"allow_once","name":"Yes, manually approve edits","optionId":"exit-plan-default"},{"kind":"allow_always","name":"Yes, clear context (0% used) and use auto mode","optionId":"exit-plan-clear-auto"},{"kind":"allow_always","name":"Yes, and use auto mode","optionId":"exit-plan-auto"},{"kind":"allow_always","name":"Yes, and bypass permissions","optionId":"exit-plan-bypass"},{"kind":"reject_once","name":"No, keep planning","optionId":"reject"}],"sessionId":"<session>","toolCall":{"content":[{"content":{"text":"# Plan\n1. Do it","type":"text"},"type":"content"}],"kind":"switch_mode","name":"ExitPlanMode","rawInput":{"plan":"# Plan\n1. Do it"},"status":"pending","title":"Approve Plan","toolCallId":"toolu_plan"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"currentModeId":"default","sessionUpdate":"current_mode_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"configOptions":[{"category":"mode","currentValue":"default","description":"Session permission mode","id":"mode","name":"Mode","options":[{"_meta":{"kind":"standard"},"description":"Always ask before making changes","name":"Manual","value":"default"},{"_meta":{"kind":"standard"},"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"_meta":{"kind":"plan"},"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"_meta":{"kind":"auto_review"},"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"_meta":{"kind":"full_access"},"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","id":"model","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionUpdate":"config_option_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"configOptions":[{"category":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","id":"model","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","currentValue":"default","description":"Session permission mode","id":"mode","name":"Mode","options":[{"_meta":{"kind":"standard"},"description":"Always ask before making changes","name":"Manual","value":"default"},{"_meta":{"kind":"standard"},"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"_meta":{"kind":"plan"},"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"_meta":{"kind":"auto_review"},"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"_meta":{"kind":"full_access"},"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionUpdate":"config_option_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"ExitPlanMode"}},"rawOutput":"User has approved your plan. You can now start coding.\n\n## Approved Plan:\n# Plan\n1. Do it","sessionUpdate":"tool_call_update","status":"completed","title":"Exited Plan Mode","toolCallId":"toolu_plan"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
|
||||
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}
|
||||
|
||||
@@ -9,5 +9,5 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"Edit"}},"rawOutput":"The file <cwd>/src/app.ts has been updated successfully.","sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_r_edit"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"Task"}},"content":[{"content":{"text":"Report.","type":"text"},"type":"content"}],"rawOutput":"Report.","sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_r_task"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":{"text":"Fixed.","type":"text"},"messageId":"msg_r2","sessionUpdate":"agent_message_chunk"}}}
|
||||
{"kind":"loadSession","payload":{"configOptions":[{"category":"mode","currentValue":"auto","description":"Session permission mode","id":"mode","name":"Mode","options":[{"_meta":{"kind":"standard"},"description":"Always ask before making changes","name":"Manual","value":"default"},{"_meta":{"kind":"standard"},"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"_meta":{"kind":"plan"},"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"_meta":{"kind":"auto_review"},"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"_meta":{"kind":"full_access"},"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","id":"model","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"modes":{"availableModes":[{"_meta":{"kind":"standard"},"description":"Always ask before making changes","id":"default","name":"Manual"},{"_meta":{"kind":"standard"},"description":"Automatically accept all file edits","id":"acceptEdits","name":"Accept edits"},{"_meta":{"kind":"plan"},"description":"Create a plan before making changes","id":"plan","name":"Plan"},{"_meta":{"kind":"auto_review"},"description":"Claude handles permission decisions","id":"auto","name":"Auto"},{"_meta":{"kind":"full_access"},"description":"Accepts all permissions","id":"bypassPermissions","name":"Bypass permissions"}],"currentModeId":"auto"},"sessionId":"<session>"}}
|
||||
{"kind":"loadSession","payload":{"configOptions":[{"category":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","id":"model","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","currentValue":"auto","description":"Session permission mode","id":"mode","name":"Mode","options":[{"_meta":{"kind":"standard"},"description":"Always ask before making changes","name":"Manual","value":"default"},{"_meta":{"kind":"standard"},"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"_meta":{"kind":"plan"},"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"_meta":{"kind":"auto_review"},"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"_meta":{"kind":"full_access"},"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"modes":{"availableModes":[{"_meta":{"kind":"standard"},"description":"Always ask before making changes","id":"default","name":"Manual"},{"_meta":{"kind":"standard"},"description":"Automatically accept all file edits","id":"acceptEdits","name":"Accept edits"},{"_meta":{"kind":"plan"},"description":"Create a plan before making changes","id":"plan","name":"Plan"},{"_meta":{"kind":"auto_review"},"description":"Claude handles permission decisions","id":"auto","name":"Auto"},{"_meta":{"kind":"full_access"},"description":"Accepts all permissions","id":"bypassPermissions","name":"Bypass permissions"}],"currentModeId":"auto"},"sessionId":"<session>"}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{"kind":"initialize","payload":{"_meta":{"goal":{"actions":["set","clear"],"controlMethod":"_session/goal","version":1},"jetbrains":{"air":{"capabilities":["sessionFailure","agentFileChangeReport","nativeSubagentSessions","asyncTasks","recommendedValue"],"version":1}},"steering":{"supported":true}},"agentCapabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"logout":{}},"loadSession":true,"mcpCapabilities":{"http":true,"sse":true},"promptCapabilities":{"embeddedContext":true,"image":true},"providers":{},"sessionCapabilities":{"additionalDirectories":{},"close":{},"delete":{},"fork":{},"list":{},"resume":{},"subagents":{}}},"agentInfo":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"authMethods":[],"protocolVersion":1}}
|
||||
{"kind":"newSession","payload":{"configOptions":[{"category":"mode","currentValue":"auto","description":"Session permission mode","id":"mode","name":"Mode","options":[{"_meta":{"kind":"standard"},"description":"Always ask before making changes","name":"Manual","value":"default"},{"_meta":{"kind":"standard"},"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"_meta":{"kind":"plan"},"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"_meta":{"kind":"auto_review"},"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"_meta":{"kind":"full_access"},"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","id":"model","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"modes":{"availableModes":[{"_meta":{"kind":"standard"},"description":"Always ask before making changes","id":"default","name":"Manual"},{"_meta":{"kind":"standard"},"description":"Automatically accept all file edits","id":"acceptEdits","name":"Accept edits"},{"_meta":{"kind":"plan"},"description":"Create a plan before making changes","id":"plan","name":"Plan"},{"_meta":{"kind":"auto_review"},"description":"Claude handles permission decisions","id":"auto","name":"Auto"},{"_meta":{"kind":"full_access"},"description":"Accepts all permissions","id":"bypassPermissions","name":"Bypass permissions"}],"currentModeId":"auto"},"sessionId":"<session>"}}
|
||||
{"kind":"newSession","payload":{"configOptions":[{"category":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","id":"model","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","currentValue":"auto","description":"Session permission mode","id":"mode","name":"Mode","options":[{"_meta":{"kind":"standard"},"description":"Always ask before making changes","name":"Manual","value":"default"},{"_meta":{"kind":"standard"},"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"_meta":{"kind":"plan"},"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"_meta":{"kind":"auto_review"},"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"_meta":{"kind":"full_access"},"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"modes":{"availableModes":[{"_meta":{"kind":"standard"},"description":"Always ask before making changes","id":"default","name":"Manual"},{"_meta":{"kind":"standard"},"description":"Automatically accept all file edits","id":"acceptEdits","name":"Accept edits"},{"_meta":{"kind":"plan"},"description":"Create a plan before making changes","id":"plan","name":"Plan"},{"_meta":{"kind":"auto_review"},"description":"Claude handles permission decisions","id":"auto","name":"Auto"},{"_meta":{"kind":"full_access"},"description":"Accepts all permissions","id":"bypassPermissions","name":"Bypass permissions"}],"currentModeId":"auto"},"sessionId":"<session>"}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
|
||||
|
||||
@@ -10,5 +10,5 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"Edit"}},"rawOutput":"The file <cwd>/src/app.ts has been updated successfully.","sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_r_edit"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"Task"}},"content":[{"content":{"text":"Report.","type":"text"},"type":"content"}],"rawOutput":"Report.","sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_r_task"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":{"text":"Fixed.","type":"text"},"messageId":"msg_r2","sessionUpdate":"agent_message_chunk"}}}
|
||||
{"kind":"loadSession","payload":{"configOptions":[{"category":"mode","currentValue":"auto","description":"Session permission mode","id":"mode","name":"Mode","options":[{"_meta":{"kind":"standard"},"description":"Always ask before making changes","name":"Manual","value":"default"},{"_meta":{"kind":"standard"},"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"_meta":{"kind":"plan"},"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"_meta":{"kind":"auto_review"},"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"_meta":{"kind":"full_access"},"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","id":"model","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"modes":{"availableModes":[{"_meta":{"kind":"standard"},"description":"Always ask before making changes","id":"default","name":"Manual"},{"_meta":{"kind":"standard"},"description":"Automatically accept all file edits","id":"acceptEdits","name":"Accept edits"},{"_meta":{"kind":"plan"},"description":"Create a plan before making changes","id":"plan","name":"Plan"},{"_meta":{"kind":"auto_review"},"description":"Claude handles permission decisions","id":"auto","name":"Auto"},{"_meta":{"kind":"full_access"},"description":"Accepts all permissions","id":"bypassPermissions","name":"Bypass permissions"}],"currentModeId":"auto"},"sessionId":"<session>"}}
|
||||
{"kind":"loadSession","payload":{"configOptions":[{"category":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","id":"model","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","currentValue":"auto","description":"Session permission mode","id":"mode","name":"Mode","options":[{"_meta":{"kind":"standard"},"description":"Always ask before making changes","name":"Manual","value":"default"},{"_meta":{"kind":"standard"},"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"_meta":{"kind":"plan"},"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"_meta":{"kind":"auto_review"},"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"_meta":{"kind":"full_access"},"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"modes":{"availableModes":[{"_meta":{"kind":"standard"},"description":"Always ask before making changes","id":"default","name":"Manual"},{"_meta":{"kind":"standard"},"description":"Automatically accept all file edits","id":"acceptEdits","name":"Accept edits"},{"_meta":{"kind":"plan"},"description":"Create a plan before making changes","id":"plan","name":"Plan"},{"_meta":{"kind":"auto_review"},"description":"Claude handles permission decisions","id":"auto","name":"Auto"},{"_meta":{"kind":"full_access"},"description":"Accepts all permissions","id":"bypassPermissions","name":"Bypass permissions"}],"currentModeId":"auto"},"sessionId":"<session>"}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{"kind":"initialize","payload":{"_meta":{"goal":{"actions":["set","clear"],"controlMethod":"_session/goal","version":1},"jetbrains":{"air":{"capabilities":["sessionFailure","agentFileChangeReport","nativeSubagentSessions","asyncTasks","recommendedValue"],"version":1}},"steering":{"supported":true}},"agentCapabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"logout":{}},"loadSession":true,"mcpCapabilities":{"http":true,"sse":true},"promptCapabilities":{"embeddedContext":true,"image":true},"providers":{},"sessionCapabilities":{"additionalDirectories":{},"close":{},"delete":{},"fork":{},"list":{},"resume":{},"subagents":{}}},"agentInfo":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"authMethods":[{"_meta":{"terminal-auth":{"args":["<argv>","--cli","auth","login","--claudeai"],"command":"<executable>","label":"Claude Login"}},"args":["--cli","auth","login","--claudeai"],"description":"Use Claude subscription ","id":"claude-ai-login","name":"Claude Subscription","type":"terminal"},{"_meta":{"terminal-auth":{"args":["<argv>","--cli","auth","login","--console"],"command":"<executable>","label":"Anthropic Console Login"}},"args":["--cli","auth","login","--console"],"description":"Use Anthropic Console (API usage billing)","id":"console-login","name":"Anthropic Console","type":"terminal"}],"protocolVersion":1}}
|
||||
{"kind":"newSession","payload":{"configOptions":[{"category":"mode","currentValue":"auto","description":"Session permission mode","id":"mode","name":"Mode","options":[{"_meta":{"kind":"standard"},"description":"Always ask before making changes","name":"Manual","value":"default"},{"_meta":{"kind":"standard"},"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"_meta":{"kind":"plan"},"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"_meta":{"kind":"auto_review"},"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"_meta":{"kind":"full_access"},"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","id":"model","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"modes":{"availableModes":[{"_meta":{"kind":"standard"},"description":"Always ask before making changes","id":"default","name":"Manual"},{"_meta":{"kind":"standard"},"description":"Automatically accept all file edits","id":"acceptEdits","name":"Accept edits"},{"_meta":{"kind":"plan"},"description":"Create a plan before making changes","id":"plan","name":"Plan"},{"_meta":{"kind":"auto_review"},"description":"Claude handles permission decisions","id":"auto","name":"Auto"},{"_meta":{"kind":"full_access"},"description":"Accepts all permissions","id":"bypassPermissions","name":"Bypass permissions"}],"currentModeId":"auto"},"sessionId":"<session>"}}
|
||||
{"kind":"newSession","payload":{"configOptions":[{"category":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","id":"model","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","currentValue":"auto","description":"Session permission mode","id":"mode","name":"Mode","options":[{"_meta":{"kind":"standard"},"description":"Always ask before making changes","name":"Manual","value":"default"},{"_meta":{"kind":"standard"},"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"_meta":{"kind":"plan"},"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"_meta":{"kind":"auto_review"},"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"_meta":{"kind":"full_access"},"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"modes":{"availableModes":[{"_meta":{"kind":"standard"},"description":"Always ask before making changes","id":"default","name":"Manual"},{"_meta":{"kind":"standard"},"description":"Automatically accept all file edits","id":"acceptEdits","name":"Accept edits"},{"_meta":{"kind":"plan"},"description":"Create a plan before making changes","id":"plan","name":"Plan"},{"_meta":{"kind":"auto_review"},"description":"Claude handles permission decisions","id":"auto","name":"Auto"},{"_meta":{"kind":"full_access"},"description":"Accepts all permissions","id":"bypassPermissions","name":"Bypass permissions"}],"currentModeId":"auto"},"sessionId":"<session>"}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
|
||||
|
||||
@@ -32,6 +32,9 @@ const hookHeartbeat = (event: "PreToolUse" | "PostToolUse", toolUseId: string, u
|
||||
session_id: activeSdkSessionId(),
|
||||
});
|
||||
|
||||
/** Project settings that make ExitPlanMode offer clearing the context. */
|
||||
const CLEAR_CONTEXT_SETTINGS = JSON.stringify({ showClearContextOnPlanAccept: true });
|
||||
|
||||
export const SCENARIOS: Scenario[] = [
|
||||
{
|
||||
name: "session-setup",
|
||||
@@ -963,6 +966,8 @@ export const SCENARIOS: Scenario[] = [
|
||||
},
|
||||
{
|
||||
name: "exit-plan-approve",
|
||||
// Claude Code offers clearing the context only with this setting on.
|
||||
files: { ".claude/settings.json": CLEAR_CONTEXT_SETTINGS },
|
||||
turns: [
|
||||
async function* (ctx) {
|
||||
yield* toolCall(
|
||||
@@ -981,6 +986,8 @@ export const SCENARIOS: Scenario[] = [
|
||||
},
|
||||
{
|
||||
name: "exit-plan-reject",
|
||||
// Claude Code offers clearing the context only with this setting on.
|
||||
files: { ".claude/settings.json": CLEAR_CONTEXT_SETTINGS },
|
||||
permission: "reject_once",
|
||||
turns: [
|
||||
async function* (ctx) {
|
||||
|
||||
59
src/tests/acp-subagents.test.ts
Normal file
59
src/tests/acp-subagents.test.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { AnnouncedChildren, type AcpSessionNotification } from "../acp-subagents.js";
|
||||
|
||||
describe("AnnouncedChildren", () => {
|
||||
const announce = (children: AnnouncedChildren, parent: string, child: string) =>
|
||||
children.sending({
|
||||
sessionId: parent,
|
||||
update: { sessionUpdate: "subagent_update", sessionId: child },
|
||||
});
|
||||
|
||||
it("knows a child from its subagent_update, under the root of its parent", () => {
|
||||
const children = new AnnouncedChildren();
|
||||
announce(children, "root", "coordinator");
|
||||
announce(children, "coordinator", "worker");
|
||||
|
||||
expect(["root", "coordinator", "worker"].map((id) => children.rootOf(id))).toEqual([
|
||||
undefined,
|
||||
"root",
|
||||
"root",
|
||||
]);
|
||||
expect(["root", "coordinator", "worker"].map((id) => children.has(id))).toEqual([
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
]);
|
||||
});
|
||||
|
||||
it("takes no child from the subagent_spawned of AIR's draft", () => {
|
||||
const children = new AnnouncedChildren();
|
||||
const spawned: AcpSessionNotification = {
|
||||
sessionId: "root",
|
||||
update: {
|
||||
sessionUpdate: "subagent_spawned",
|
||||
subagentSessionId: "spawned",
|
||||
name: "Explore",
|
||||
task: "Look around",
|
||||
capabilities: {},
|
||||
},
|
||||
};
|
||||
children.sending(spawned);
|
||||
|
||||
expect(children.has("spawned")).toBe(false);
|
||||
});
|
||||
|
||||
it("forgets the children of a closed root, also the nested ones, and no other root's", () => {
|
||||
const children = new AnnouncedChildren();
|
||||
announce(children, "root", "coordinator");
|
||||
announce(children, "coordinator", "worker");
|
||||
announce(children, "other-root", "other-child");
|
||||
|
||||
children.rootClosed("root");
|
||||
|
||||
expect(["coordinator", "worker", "other-child"].map((id) => children.has(id))).toEqual([
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
]);
|
||||
});
|
||||
});
|
||||
@@ -11,6 +11,13 @@ import { discoverCustomAgents, BUILTIN_AGENT_NAMES } from "../session-config-opt
|
||||
// silently if the SDK changes its default roster: a newly added built-in would
|
||||
// leak into the ACP "Agent" picker as if the user had configured it. This
|
||||
// integration test runs the real SDK so the set is flagged the moment it does.
|
||||
//
|
||||
// Claude Code does not list every built-in in every session (issue #1670):
|
||||
// `web-fetch` needs its staged rollout or `CLAUDE_CODE_WEB_FETCH_AGENT=1`, and
|
||||
// `claude-code-guide` an entrypoint other than the SDK's `sdk-ts`. The test
|
||||
// sets both variables, so the roster does not depend on the account or on the
|
||||
// shell that runs it. A built-in behind a rollout with no variable set here
|
||||
// shows up only where that rollout is on.
|
||||
describe.skipIf(!process.env.RUN_INTEGRATION_TESTS)("agent discovery (SDK)", () => {
|
||||
it("BUILTIN_AGENT_NAMES exactly covers the SDK's default agent roster", async () => {
|
||||
const input = new Pushable<SDKUserMessage>();
|
||||
@@ -24,6 +31,11 @@ describe.skipIf(!process.env.RUN_INTEGRATION_TESTS)("agent discovery (SDK)", ()
|
||||
// regardless of what the developer has in ~/.claude/agents.
|
||||
settingSources: [],
|
||||
includePartialMessages: true,
|
||||
env: {
|
||||
...process.env,
|
||||
CLAUDE_CODE_WEB_FETCH_AGENT: "1",
|
||||
CLAUDE_CODE_ENTRYPOINT: "agent-roster-test",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
import { appendFile, mkdtemp, rm, writeFile } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import path from "node:path";
|
||||
import { query } from "@anthropic-ai/claude-agent-sdk";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import {
|
||||
BACKGROUND_OUTPUT_MAX_BACKLOG_BYTES,
|
||||
BACKGROUND_OUTPUT_READ_BYTES,
|
||||
type BackgroundOutput,
|
||||
BackgroundOutputTail,
|
||||
supportsTaskOutput,
|
||||
type TaskOutput,
|
||||
TaskOutputPoll,
|
||||
} from "../background-output.js";
|
||||
|
||||
describe("BackgroundOutputTail", () => {
|
||||
@@ -127,3 +131,129 @@ describe("BackgroundOutputTail", () => {
|
||||
expect(published).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("TaskOutputPoll", () => {
|
||||
let published: BackgroundOutput[];
|
||||
let poll: TaskOutputPoll | undefined;
|
||||
/**
|
||||
* `get_task_output` returning each of `reads` in turn, then the last one
|
||||
* again. An `unanswered` read never returns.
|
||||
*/
|
||||
const follow = (reads: Array<TaskOutput | "unanswered">) => {
|
||||
let next = 0;
|
||||
const read = async () => {
|
||||
const answer = reads[Math.min(next++, reads.length - 1)]!;
|
||||
return answer === "unanswered" ? new Promise<never>(() => {}) : answer;
|
||||
};
|
||||
poll = new TaskOutputPoll(read, async (output) => void published.push(output));
|
||||
return () => next;
|
||||
};
|
||||
const whole = (output: string): TaskOutput => ({
|
||||
output,
|
||||
total_bytes: Buffer.byteLength(output),
|
||||
truncated: false,
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
published = [];
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
poll?.stop();
|
||||
});
|
||||
|
||||
it("appends what the output adds, and reports on finish that it sent text", async () => {
|
||||
follow([whole(""), whole("line1\n"), whole("line1\nline2 ✓\n")]);
|
||||
await vi.waitFor(() => expect(published).toHaveLength(2), { timeout: 3000 });
|
||||
|
||||
expect(await poll!.finish()).toBe(true);
|
||||
expect(published).toEqual([
|
||||
{ text: "line1\n", replaces: false },
|
||||
{ text: "line2 ✓\n", replaces: false },
|
||||
]);
|
||||
});
|
||||
|
||||
it.each([
|
||||
// More was added than the 8 KiB tail holds.
|
||||
[
|
||||
"a tail that misses text",
|
||||
[whole("a\n"), { output: "z\n", total_bytes: 9000, truncated: true }],
|
||||
],
|
||||
// Bytes that are not UTF-8 decode to other bytes.
|
||||
[
|
||||
"an output that is not UTF-8",
|
||||
[whole("a\n"), { output: "a\nb\n", total_bytes: 3, truncated: false }],
|
||||
],
|
||||
])("sends %s as a snapshot", async (_case, reads) => {
|
||||
follow(reads);
|
||||
await vi.waitFor(() => expect(published).toHaveLength(2), { timeout: 3000 });
|
||||
|
||||
expect(published[1]).toEqual({ text: reads[1]!.output, replaces: true });
|
||||
});
|
||||
|
||||
// Claude Code drops a foreground command's output when the command ends:
|
||||
// CLI 2.1.325 then answers `total_bytes: 0` until the tool result comes.
|
||||
it("stops at a read that holds less than was sent, without clearing the terminal", async () => {
|
||||
const reads = follow([whole("line1\n"), whole("")]);
|
||||
await vi.waitFor(() => expect(reads()).toBe(2), { timeout: 3000 });
|
||||
await new Promise((resolve) => setTimeout(resolve, 700));
|
||||
|
||||
expect(reads()).toBe(2);
|
||||
expect(published).toEqual([{ text: "line1\n", replaces: false }]);
|
||||
expect(await poll!.finish()).toBe(true);
|
||||
});
|
||||
|
||||
it("does not wait at finish for a read that Claude Code never answers", async () => {
|
||||
const reads = follow([whole("line1\n"), "unanswered"]);
|
||||
await vi.waitFor(() => expect(reads()).toBe(2), { timeout: 3000 });
|
||||
|
||||
expect(await poll!.finish()).toBe(true);
|
||||
expect(published).toEqual([{ text: "line1\n", replaces: false }]);
|
||||
});
|
||||
|
||||
it("appends from the end of a truncated tail that holds all the new text", async () => {
|
||||
const tail = "x".repeat(8000);
|
||||
follow([
|
||||
{ output: tail, total_bytes: 9000, truncated: true },
|
||||
{ output: tail.slice(3) + "end", total_bytes: 9003, truncated: true },
|
||||
]);
|
||||
await vi.waitFor(() => expect(published).toHaveLength(2), { timeout: 3000 });
|
||||
|
||||
expect(published[1]).toEqual({ text: "end", replaces: false });
|
||||
});
|
||||
|
||||
it("holds a read that ends in a cut character until the character is whole", async () => {
|
||||
const reads = follow([whole("a\uFFFD"), whole("a✓")]);
|
||||
await vi.waitFor(() => expect(reads()).toBeGreaterThan(2), { timeout: 3000 });
|
||||
|
||||
expect(published).toEqual([{ text: "a✓", replaces: false }]);
|
||||
});
|
||||
|
||||
it("reports that it sent nothing when no read added text, and reads nothing after finish", async () => {
|
||||
const reads = follow([whole("")]);
|
||||
expect(await poll!.finish()).toBe(false);
|
||||
await new Promise((resolve) => setTimeout(resolve, 700));
|
||||
expect(reads()).toBe(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe("supportsTaskOutput", () => {
|
||||
// The SDK's `Query` type does not declare `getTaskOutput`, so the compiler
|
||||
// does not report an SDK update that drops it, and no poll would start.
|
||||
it("finds getTaskOutput on a query of the installed SDK", () => {
|
||||
// The CLI of this query exits at once: the check reads the query object only.
|
||||
const sdkQuery = query({
|
||||
prompt: "hi",
|
||||
options: { pathToClaudeCodeExecutable: "/usr/bin/false" },
|
||||
});
|
||||
try {
|
||||
expect(supportsTaskOutput(sdkQuery)).toBe(true);
|
||||
} finally {
|
||||
sdkQuery.close();
|
||||
}
|
||||
});
|
||||
|
||||
it("finds none on a query without the method", () => {
|
||||
expect(supportsTaskOutput({ interrupt: async () => {} })).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -55,3 +55,50 @@ describe("claudeCliPath", () => {
|
||||
expect(await claudeCliPath()).toMatch(/@anthropic-ai\/claude-agent-sdk-[^/]+\/claude(\.exe)?$/);
|
||||
});
|
||||
});
|
||||
|
||||
describe("cliDelivery", () => {
|
||||
afterEach(() => vi.unstubAllEnvs());
|
||||
|
||||
it.each<{
|
||||
name: string;
|
||||
cli: string;
|
||||
extraArgs?: Record<string, string>;
|
||||
mcpServers: string;
|
||||
settings: string;
|
||||
}>([
|
||||
{
|
||||
name: "is stdin for the CLI that it ships",
|
||||
cli: "",
|
||||
mcpServers: "initialize",
|
||||
settings: "initialize",
|
||||
},
|
||||
{
|
||||
name: "is a flag for a CLAUDE_CODE_EXECUTABLE",
|
||||
cli: "/opt/claude",
|
||||
mcpServers: "argv",
|
||||
settings: "argv",
|
||||
},
|
||||
{
|
||||
name: "keeps settings a flag beside a client's",
|
||||
cli: "",
|
||||
extraArgs: { settings: "{}" },
|
||||
mcpServers: "initialize",
|
||||
settings: "argv",
|
||||
},
|
||||
{
|
||||
name: "keeps settings a flag with sdk-url",
|
||||
cli: "",
|
||||
extraArgs: { "sdk-url": "wss://example.com/session" },
|
||||
mcpServers: "initialize",
|
||||
settings: "argv",
|
||||
},
|
||||
])("$name", async ({ cli, extraArgs, mcpServers, settings }) => {
|
||||
vi.stubEnv("CLAUDE_CODE_EXECUTABLE", cli);
|
||||
const { cliDelivery } = await load();
|
||||
|
||||
expect(cliDelivery(extraArgs)).toEqual({
|
||||
mcpServersDelivery: mcpServers,
|
||||
settingsDelivery: settings,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -320,17 +320,25 @@ describe("narrowToGatewayModels", () => {
|
||||
expect(narrowed.map((m) => m.value)).toEqual(["sonnet", "sonnet[1m]"]);
|
||||
});
|
||||
|
||||
it("leaves no model when the listing matches none", () => {
|
||||
expect(narrowToGatewayModels(MODELS, ["gpt-5", "gemini-3-pro"])).toEqual([]);
|
||||
expect(narrowToGatewayModels(MODELS, [])).toEqual([]);
|
||||
expect(narrowToGatewayModels(MODELS, ["anthropic/openai/gpt-5"])).toEqual([]);
|
||||
// A default row without resolvedModel is not a match on its own.
|
||||
expect(
|
||||
narrowToGatewayModels(
|
||||
[{ value: "default", displayName: "Default", description: "" }, ...MODELS.slice(1)],
|
||||
["gpt-5"],
|
||||
),
|
||||
).toEqual([]);
|
||||
it.each([
|
||||
{ listing: ["gpt-5", "gemini-3-pro"] },
|
||||
{ listing: [] },
|
||||
{ listing: ["anthropic/openai/gpt-5"] },
|
||||
])("rejects a listing $listing that matches none of the resolved models", ({ listing }) => {
|
||||
expect(() => narrowToGatewayModels(MODELS, listing)).toThrow(
|
||||
"The selected provider offers no compatible Claude models. Choose a different provider and try again.",
|
||||
);
|
||||
});
|
||||
|
||||
it.each([
|
||||
{ name: "empty", models: [] },
|
||||
{ name: "alias-only", models: MODELS.map(({ resolvedModel: _, ...model }) => model) },
|
||||
{
|
||||
name: "mixed",
|
||||
models: [{ value: "default", displayName: "Default", description: "" }, ...MODELS.slice(1)],
|
||||
},
|
||||
])("leaves no model when a $name catalog has no match", ({ models }) => {
|
||||
expect(narrowToGatewayModels(models, ["gpt-5"])).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
type InitializeRequest,
|
||||
} from "@agentclientprotocol/sdk/unstable";
|
||||
import { mkdir, writeFile } from "node:fs/promises";
|
||||
import { request } from "node:http";
|
||||
import path from "node:path";
|
||||
|
||||
/** The context-usage report the base mock query returns: a 200K window, as
|
||||
@@ -38,6 +39,7 @@ export function makeMockQuery(overrides: Record<string, unknown> = {}) {
|
||||
supportedCommands: async () => [],
|
||||
mcpServerStatus: async () => [],
|
||||
setMcpServers: async () => ({ added: [], removed: [], errors: {} }),
|
||||
applyFlagSettings: async () => {},
|
||||
getContextUsage: async () => DEFAULT_CONTEXT_USAGE,
|
||||
// No ultracode fields: session creation falls back to settings and the
|
||||
// model's effort levels, as with a CLI that does not report them.
|
||||
@@ -168,3 +170,82 @@ export async function writeTranscript(
|
||||
});
|
||||
await writeFile(path.join(directory, `${sessionId}.jsonl`), lines.join("\n") + "\n");
|
||||
}
|
||||
|
||||
/** The `_meta` of every MCP 2026-07-28 request of Claude Code 2.1.325, as its HTTP client sends it. */
|
||||
const CLAUDE_CODE_MCP_META = {
|
||||
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
|
||||
"io.modelcontextprotocol/clientInfo": {
|
||||
name: "claude-code",
|
||||
title: "Claude Code",
|
||||
version: "2.1.325",
|
||||
description: "Anthropic's agentic coding tool",
|
||||
websiteUrl: "https://claude.com/claude-code",
|
||||
},
|
||||
"io.modelcontextprotocol/clientCapabilities": {
|
||||
roots: { listChanged: true },
|
||||
elicitation: { form: {}, url: {} },
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Sends the MCP request `method` to the HTTP server of an SDK config, as
|
||||
* Claude Code 2.1.325 sends it: one JSON-RPC request in a POST, with the
|
||||
* headers that mirror its version, method and tool name. A `tools/call` has
|
||||
* the tool use id and a progress token in `_meta`. `headers` replace the
|
||||
* config's own, which carry the server's bearer token.
|
||||
*
|
||||
* Resolves with the HTTP status and the JSON-RPC messages of the response:
|
||||
* the one message of a JSON body, or every message of an event stream. It
|
||||
* uses `node:http`: the test setup stubs the global `fetch`.
|
||||
*/
|
||||
export function claudeCodeMcpRequest(
|
||||
config: { url: string; headers?: Record<string, string> },
|
||||
method: string,
|
||||
params: Record<string, unknown> = {},
|
||||
headers: Record<string, string> | undefined = config.headers,
|
||||
): Promise<{ status: number; messages: Array<Record<string, any>> }> {
|
||||
const meta =
|
||||
method === "tools/call"
|
||||
? { ...CLAUDE_CODE_MCP_META, "claudecode/toolUseId": "toolu_01", progressToken: 1 }
|
||||
: CLAUDE_CODE_MCP_META;
|
||||
const body = JSON.stringify({
|
||||
jsonrpc: "2.0",
|
||||
id: 1,
|
||||
method,
|
||||
params: { ...params, _meta: meta },
|
||||
});
|
||||
return new Promise((resolve, reject) => {
|
||||
const post = request(
|
||||
config.url,
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
...headers,
|
||||
accept: "application/json, text/event-stream",
|
||||
"content-type": "application/json",
|
||||
"content-length": Buffer.byteLength(body),
|
||||
"mcp-protocol-version": "2026-07-28",
|
||||
"mcp-method": method,
|
||||
...(typeof params.name === "string" ? { "mcp-name": params.name } : {}),
|
||||
},
|
||||
},
|
||||
(response) => {
|
||||
const chunks: Buffer[] = [];
|
||||
response.on("data", (chunk: Buffer) => chunks.push(chunk));
|
||||
response.on("error", reject);
|
||||
response.on("end", () => {
|
||||
const text = Buffer.concat(chunks).toString("utf8");
|
||||
const messages = response.headers["content-type"]?.startsWith("text/event-stream")
|
||||
? text
|
||||
.split("\n\n")
|
||||
.flatMap((event) => event.split("\n").filter((line) => line.startsWith("data: ")))
|
||||
.map((line) => JSON.parse(line.slice("data: ".length)))
|
||||
: [JSON.parse(text)];
|
||||
resolve({ status: response.statusCode ?? 0, messages });
|
||||
});
|
||||
},
|
||||
);
|
||||
post.on("error", reject);
|
||||
post.end(body);
|
||||
});
|
||||
}
|
||||
|
||||
173
src/tests/mcp-servers.test.ts
Normal file
173
src/tests/mcp-servers.test.ts
Normal file
@@ -0,0 +1,173 @@
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
import * as acp from "@agentclientprotocol/sdk/unstable";
|
||||
import { McpOverAcp, sdkMcpServers } from "../mcp-servers.js";
|
||||
import { claudeCodeMcpRequest } from "./helpers.js";
|
||||
|
||||
describe("sdkMcpServers", () => {
|
||||
it("maps each transport to its SDK config, and leaves out an unknown one", async () => {
|
||||
const overAcp = { type: "http" as const, url: "http://127.0.0.1:1/mcp-tools" };
|
||||
const servers = [
|
||||
{ name: "files", command: "/bin/files", args: ["--stdio"], env: [{ name: "A", value: "1" }] },
|
||||
{
|
||||
type: "http",
|
||||
name: "linear",
|
||||
url: "https://mcp.linear.app/mcp",
|
||||
headers: [{ name: "Authorization", value: "Bearer token" }],
|
||||
},
|
||||
{ type: "sse", name: "events", url: "https://example.com/sse", headers: [] },
|
||||
{ type: "acp", name: "tools", serverId: "tools:1" },
|
||||
{ type: "_custom", name: "custom" },
|
||||
] as acp.McpServer[];
|
||||
|
||||
const acpServers: acp.McpServerAcp[] = [];
|
||||
const configs = await sdkMcpServers(servers, async (server) => {
|
||||
acpServers.push(server);
|
||||
return overAcp;
|
||||
});
|
||||
|
||||
expect(configs).toEqual({
|
||||
configs: {
|
||||
files: { type: "stdio", command: "/bin/files", args: ["--stdio"], env: { A: "1" } },
|
||||
linear: {
|
||||
type: "http",
|
||||
url: "https://mcp.linear.app/mcp",
|
||||
headers: { Authorization: "Bearer token" },
|
||||
},
|
||||
events: { type: "sse", url: "https://example.com/sse", headers: {} },
|
||||
tools: overAcp,
|
||||
},
|
||||
unserved: [],
|
||||
});
|
||||
expect(acpServers).toEqual([{ type: "acp", name: "tools", serverId: "tools:1" }]);
|
||||
});
|
||||
|
||||
it("leaves out an acp server that gets no config, and keeps the others", async () => {
|
||||
const servers = [
|
||||
{ type: "acp", name: "tools", serverId: "tools:1" },
|
||||
{ name: "files", command: "/bin/files", args: [], env: [] },
|
||||
] as acp.McpServer[];
|
||||
|
||||
const served = await sdkMcpServers(servers, async () => {
|
||||
throw new Error("listen EPERM");
|
||||
});
|
||||
|
||||
expect(served).toEqual({
|
||||
configs: { files: { type: "stdio", command: "/bin/files", args: [], env: {} } },
|
||||
unserved: [{ name: "tools", status: "failed", error: "listen EPERM" }],
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("McpOverAcp", () => {
|
||||
const connections: Array<{ close(): void }> = [];
|
||||
|
||||
afterEach(() => {
|
||||
for (const connection of connections.splice(0)) connection.close();
|
||||
});
|
||||
|
||||
/** An agent connection that serves `mcp`, and a client that provides MCP servers over it. */
|
||||
function connect() {
|
||||
const mcp = new McpOverAcp();
|
||||
const provider = new acp.McpOverAcpProvider();
|
||||
const toAgent = new TransformStream<Uint8Array, Uint8Array>();
|
||||
const toClient = new TransformStream<Uint8Array, Uint8Array>();
|
||||
const agent = acp
|
||||
.agent()
|
||||
.onNotification(acp.methods.agent.mcp.message, mcp.handleNotification)
|
||||
.connect(acp.ndJsonStream(toClient.writable, toAgent.readable));
|
||||
const client = acp
|
||||
.client()
|
||||
.onRequest(acp.methods.client.mcp.message, provider.handleRequest)
|
||||
.connect(acp.ndJsonStream(toAgent.writable, toClient.readable));
|
||||
connections.push(agent, client);
|
||||
/** Registers a server on the client, and returns its declaration. */
|
||||
const serve = (name: string, handler: acp.McpRequestHandler) =>
|
||||
provider.registerServer(client.agent, { name, handler }).declaration;
|
||||
return { mcp, agent, serve };
|
||||
}
|
||||
|
||||
it("sends a request of Claude Code to the client, and its progress and result back", async () => {
|
||||
const { mcp, agent, serve } = connect();
|
||||
const requests: acp.McpOperationContext[] = [];
|
||||
const tools = serve("tools", async (request) => {
|
||||
requests.push(request);
|
||||
await request.notify("notifications/progress", { progressToken: 1, progress: 1, total: 2 });
|
||||
return { result: { resultType: "complete", content: [{ type: "text", text: "hello" }] } };
|
||||
});
|
||||
|
||||
const config = await mcp.sdkConfig(agent.client, tools);
|
||||
const call = { name: "echo", arguments: { message: "hello" } };
|
||||
const response = await claudeCodeMcpRequest(config, "tools/call", call);
|
||||
|
||||
expect(config).toEqual({
|
||||
type: "http",
|
||||
url: expect.stringMatching(/^http:\/\/127\.0\.0\.1:\d+\//),
|
||||
headers: { Authorization: expect.stringMatching(/^Bearer \S+$/) },
|
||||
});
|
||||
expect(requests).toMatchObject([
|
||||
{ serverId: tools.serverId, method: "tools/call", params: call },
|
||||
]);
|
||||
expect(response.messages).toEqual([
|
||||
{
|
||||
jsonrpc: "2.0",
|
||||
method: "notifications/progress",
|
||||
params: { progressToken: 1, progress: 1, total: 2 },
|
||||
},
|
||||
{
|
||||
jsonrpc: "2.0",
|
||||
id: 1,
|
||||
result: { resultType: "complete", content: [{ type: "text", text: "hello" }] },
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it("gives a server one config on one listener for as long as the connection lives", async () => {
|
||||
const { mcp, agent, serve } = connect();
|
||||
const tools = serve("tools", () => ({ result: {} }));
|
||||
const docs = serve("docs", () => ({ result: {} }));
|
||||
|
||||
const config = await mcp.sdkConfig(agent.client, tools);
|
||||
const other = await mcp.sdkConfig(agent.client, docs);
|
||||
|
||||
expect(await mcp.sdkConfig(agent.client, tools)).toEqual(config);
|
||||
expect(new URL(other.url).origin).toBe(new URL(config.url).origin);
|
||||
expect(other.url).not.toBe(config.url);
|
||||
|
||||
agent.close();
|
||||
await agent.closed;
|
||||
await expect(claudeCodeMcpRequest(config, "tools/list")).rejects.toThrow();
|
||||
await expect(mcp.sdkConfig(agent.client, tools)).rejects.toThrow(
|
||||
"The adapter could not open the local endpoint that serves it to Claude Code " +
|
||||
"(ACP connection is closed). A new session tries again.",
|
||||
);
|
||||
});
|
||||
|
||||
it.each([
|
||||
{
|
||||
refused: "a request with the token of another server",
|
||||
method: "tools/list",
|
||||
token: "other" as const,
|
||||
status: 401,
|
||||
},
|
||||
{ refused: "an initialize request", method: "initialize", token: "own" as const, status: 404 },
|
||||
])("refuses $refused", async ({ method, token, status }) => {
|
||||
const { mcp, agent, serve } = connect();
|
||||
const requests: string[] = [];
|
||||
const record = (request: acp.McpOperationContext) => {
|
||||
requests.push(request.method);
|
||||
return { result: {} };
|
||||
};
|
||||
const config = await mcp.sdkConfig(agent.client, serve("tools", record));
|
||||
const other = await mcp.sdkConfig(agent.client, serve("docs", record));
|
||||
|
||||
const response = await claudeCodeMcpRequest(
|
||||
config,
|
||||
method,
|
||||
{},
|
||||
token === "own" ? config.headers : other.headers,
|
||||
);
|
||||
|
||||
expect(response.status).toBe(status);
|
||||
expect(requests).toEqual([]);
|
||||
});
|
||||
});
|
||||
@@ -900,6 +900,78 @@ describe("NativeSubagentRuntime in the RFD form", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("gives what is current of the children that work, each after its parent", async () => {
|
||||
const published: AcpSessionNotification[] = [];
|
||||
const runtime = new NativeSubagentRuntime(
|
||||
"rfd",
|
||||
"root",
|
||||
{ cwd: "/project" },
|
||||
async (notification) => {
|
||||
published.push(notification);
|
||||
},
|
||||
{ log: () => {} },
|
||||
);
|
||||
const deliver = async (notification: AcpSessionNotification) => {
|
||||
const routed = await runtime.route(notification, deliver);
|
||||
if (routed) published.push(routed);
|
||||
};
|
||||
const start = async (taskId: string, parentLaunch?: string) => {
|
||||
await deliver(launch(`launch-${taskId}`, { description: `Run ${taskId}` }, parentLaunch));
|
||||
await runtime.taskStarted(
|
||||
{ taskId, toolUseId: `launch-${taskId}`, subagentType: "Explore" },
|
||||
deliver,
|
||||
);
|
||||
};
|
||||
await start("outer");
|
||||
await start("inner", "launch-outer");
|
||||
const worktree = "/project/.claude/worktrees/asking";
|
||||
await runtime.reportCwd("asking", worktree);
|
||||
await start("asking");
|
||||
await start("ended");
|
||||
await start("replayed");
|
||||
// `outer` ends while its child works on, as the parent of a background child does.
|
||||
await runtime.finishTask("outer", "completed", deliver, "launch-outer");
|
||||
await runtime.finishTask("ended", "completed", deliver, "launch-ended");
|
||||
await runtime.reportModel("launch-inner", "child-model", deliver);
|
||||
const answer = Promise.withResolvers<string>();
|
||||
const request = runtime.awaitingUser("asking", () => answer.promise);
|
||||
await vi.waitFor(() => expect(runtime.liveWorkState("asking")).toBe("requires_action"));
|
||||
|
||||
const labels = (sessionId: string) => ({
|
||||
sessionUpdate: "subagent_update",
|
||||
sessionId,
|
||||
title: `Run ${sessionId}`,
|
||||
description: "Explore",
|
||||
});
|
||||
// `ended` does not work, and `replayed` is one that a load's replay reports.
|
||||
expect(runtime.currentChildren((sessionId) => sessionId === "replayed")).toEqual([
|
||||
// Nothing of `outer` is current: it is named for its child.
|
||||
{ sessionId: "root", update: labels("outer") },
|
||||
{
|
||||
sessionId: "outer",
|
||||
update: { ...labels("inner"), capabilities: { cancel: {} }, state: { state: "running" } },
|
||||
},
|
||||
{
|
||||
sessionId: "inner",
|
||||
update: {
|
||||
sessionUpdate: "config_option_update",
|
||||
configOptions: [expect.objectContaining({ id: "model", currentValue: "child-model" })],
|
||||
},
|
||||
},
|
||||
{
|
||||
sessionId: "root",
|
||||
update: {
|
||||
...labels("asking"),
|
||||
cwd: worktree,
|
||||
capabilities: { cancel: {} },
|
||||
state: { state: "requires_action" },
|
||||
},
|
||||
},
|
||||
]);
|
||||
answer.resolve("allow");
|
||||
await request;
|
||||
});
|
||||
|
||||
it("buffers model observations until the child is announced", async () => {
|
||||
const published: AcpSessionNotification[] = [];
|
||||
const runtime = new NativeSubagentRuntime(
|
||||
@@ -963,10 +1035,11 @@ describe("NativeSubagentRuntime in the RFD form", () => {
|
||||
update.sessionUpdate === "config_option_update" ? [update.configOptions] : [],
|
||||
);
|
||||
expect(configs).toHaveLength(4);
|
||||
// The effort and the mode came first: a child's list has the root's order.
|
||||
expect(configs.at(-1)?.map((option) => [option.id, option.currentValue])).toEqual([
|
||||
["mode", "plan"],
|
||||
["model", "fallback-model"],
|
||||
["effort", "low"],
|
||||
["mode", "plan"],
|
||||
]);
|
||||
expect(
|
||||
configs.at(-1)?.every((option) => option.type === "select" && option.options.length === 1),
|
||||
@@ -1948,6 +2021,267 @@ describe("NativeSubagentRuntime in the RFD form", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("a forked skill", () => {
|
||||
/** The `parent_tool_use_id` of every message of a typed `/code-review`. */
|
||||
const FORKED = "forked-command-code-review";
|
||||
/** The `task_started` of a typed `/code-review`: no tool call launched it. */
|
||||
const typed = {
|
||||
taskId: "fork-1",
|
||||
subagentType: "general-purpose",
|
||||
description: "/code-review",
|
||||
prompt: "Review the diff",
|
||||
};
|
||||
const forkMessage = (agentId: string) => ({
|
||||
type: "assistant",
|
||||
parent_tool_use_id: FORKED,
|
||||
agent_id: agentId,
|
||||
});
|
||||
const rootMessage = { type: "assistant", parent_tool_use_id: null };
|
||||
const skillCall = (toolCallId: string, parentToolUseId?: string): AcpSessionNotification =>
|
||||
({
|
||||
sessionId: "root",
|
||||
update: {
|
||||
sessionUpdate: "tool_call",
|
||||
toolCallId,
|
||||
title: "Load skill: code-review",
|
||||
status: "pending",
|
||||
rawInput: { skill: "code-review" },
|
||||
_meta: {
|
||||
claudeCode: { toolName: "Skill", ...(parentToolUseId ? { parentToolUseId } : {}) },
|
||||
},
|
||||
},
|
||||
}) as AcpSessionNotification;
|
||||
|
||||
/** A runtime, the updates it sends in order, and the deliver function of
|
||||
* the agent, which sends what the runtime routes (as `sendUpdate` does). */
|
||||
function setup(form: "rfd" | "air" = "rfd") {
|
||||
const sent: AcpSessionNotification[] = [];
|
||||
const runtime: NativeSubagentRuntime = new NativeSubagentRuntime(
|
||||
form,
|
||||
"root",
|
||||
{},
|
||||
async (notification) => {
|
||||
sent.push(notification);
|
||||
},
|
||||
{ log: () => {} },
|
||||
);
|
||||
const deliver = async (notification: AcpSessionNotification): Promise<void> => {
|
||||
const routed = await runtime.route(notification, deliver);
|
||||
if (routed) sent.push(routed);
|
||||
};
|
||||
return { runtime, sent, deliver };
|
||||
}
|
||||
/** The child's text and its ends, in order, as "<session> <what>". */
|
||||
const story = (sent: AcpSessionNotification[]) =>
|
||||
sent.flatMap(({ sessionId, update }) =>
|
||||
update.sessionUpdate === "agent_message_chunk"
|
||||
? [`${sessionId} text`]
|
||||
: update.sessionUpdate === "subagent_state_update"
|
||||
? [`${update.subagentSessionId} ${update.state}`]
|
||||
: update.sessionUpdate === "subagent_update" && update.state?.state === "idle"
|
||||
? [`${update.sessionId} idle ${update.state.stopReason}`]
|
||||
: [],
|
||||
);
|
||||
const announcements = (sent: AcpSessionNotification[]) =>
|
||||
sent.flatMap(({ sessionId, update }) =>
|
||||
update.sessionUpdate === "subagent_update" && update.title !== undefined
|
||||
? [[sessionId, update.sessionId]]
|
||||
: [],
|
||||
);
|
||||
|
||||
it("that the user typed gets the updates of its messages by their agent id, for each run", async () => {
|
||||
const { runtime, sent, deliver } = setup();
|
||||
for (const taskId of ["fork-1", "fork-2"]) {
|
||||
await runtime.taskStarted({ ...typed, taskId }, deliver);
|
||||
await runtime.messageCame(forkMessage(taskId), deliver);
|
||||
await deliver(output(FORKED));
|
||||
}
|
||||
|
||||
expect(story(sent)).toEqual(["fork-1 text", "fork-2 text"]);
|
||||
});
|
||||
|
||||
it.each([
|
||||
["rfd", "fork-1 idle end_turn"],
|
||||
["air", "fork-1 completed"],
|
||||
] as const)(
|
||||
"that the user typed ends after its messages, which come after its task's end (%s)",
|
||||
async (form, end) => {
|
||||
const { runtime, sent, deliver } = setup(form);
|
||||
await runtime.taskStarted(typed, deliver);
|
||||
await runtime.finishTask("fork-1", "completed", deliver, undefined, { foreground: true });
|
||||
// A second report of the end, and the turn's `init`, end no wait.
|
||||
await runtime.finishTask("fork-1", "completed", deliver);
|
||||
await runtime.messageCame({ type: "system", subtype: "init" }, deliver);
|
||||
// Neither does a message of the root before the child's.
|
||||
await runtime.messageCame(rootMessage, deliver);
|
||||
expect(story(sent)).toEqual([]);
|
||||
|
||||
await runtime.messageCame(forkMessage("fork-1"), deliver);
|
||||
await deliver(output(FORKED));
|
||||
// Nor a message of a subagent that the skill launched, which Claude
|
||||
// Code holds along with the skill's own.
|
||||
await runtime.messageCame(
|
||||
{ type: "assistant", parent_tool_use_id: "toolu_nested", agent_id: "nested-1" },
|
||||
deliver,
|
||||
);
|
||||
await runtime.messageCame(forkMessage("fork-1"), deliver);
|
||||
await deliver(output(FORKED));
|
||||
expect(story(sent)).toEqual(["fork-1 text", "fork-1 text"]);
|
||||
|
||||
await runtime.messageCame(rootMessage, deliver);
|
||||
expect(story(sent)).toEqual(["fork-1 text", "fork-1 text", end]);
|
||||
},
|
||||
);
|
||||
|
||||
it("that the user typed also waits when some of its messages came before its task's end", async () => {
|
||||
const { runtime, sent, deliver } = setup();
|
||||
await runtime.taskStarted(typed, deliver);
|
||||
// Claude Code wrote an `init` while the command ran: the messages so far came.
|
||||
await runtime.messageCame(forkMessage("fork-1"), deliver);
|
||||
await deliver(output(FORKED));
|
||||
await runtime.finishTask("fork-1", "completed", deliver, undefined, { foreground: true });
|
||||
await runtime.messageCame(forkMessage("fork-1"), deliver);
|
||||
await deliver(output(FORKED));
|
||||
expect(story(sent)).toEqual(["fork-1 text", "fork-1 text"]);
|
||||
|
||||
await runtime.messageCame(rootMessage, deliver);
|
||||
expect(story(sent)).toEqual(["fork-1 text", "fork-1 text", "fork-1 idle end_turn"]);
|
||||
});
|
||||
|
||||
it("reports a failure's text that only a second report of the waiting end gives", async () => {
|
||||
const { runtime, sent, deliver } = setup();
|
||||
await runtime.taskStarted(typed, deliver);
|
||||
await runtime.finishTask("fork-1", "failed", deliver, undefined, { foreground: true });
|
||||
await runtime.finishTask("fork-1", "failed", deliver, undefined, { error: "boom" });
|
||||
await runtime.messageCame({ type: "result" }, deliver);
|
||||
|
||||
expect(sent.at(-1)?.update).toMatchObject({
|
||||
sessionUpdate: "subagent_update",
|
||||
state: { state: "idle", stopReason: "error", error: { message: "boom" } },
|
||||
});
|
||||
});
|
||||
|
||||
it.each([
|
||||
[
|
||||
"at the turn's result",
|
||||
(runtime: NativeSubagentRuntime) => runtime.messageCame({ type: "result" }, async () => {}),
|
||||
],
|
||||
[
|
||||
"at Claude Code's idle",
|
||||
(runtime: NativeSubagentRuntime) =>
|
||||
runtime.messageCame(
|
||||
{ type: "system", subtype: "session_state_changed", state: "idle" },
|
||||
async () => {},
|
||||
),
|
||||
],
|
||||
[
|
||||
"with the stream",
|
||||
(runtime: NativeSubagentRuntime) => runtime.finishAll("completed", async () => {}),
|
||||
],
|
||||
])(
|
||||
"that the user typed ends %s, as its task ended, when no message of it comes",
|
||||
async (_, end) => {
|
||||
const { runtime, sent, deliver } = setup();
|
||||
await runtime.taskStarted(typed, deliver);
|
||||
await runtime.finishTask("fork-1", "stopped", deliver, undefined, { foreground: true });
|
||||
expect(story(sent)).toEqual([]);
|
||||
|
||||
await end(runtime);
|
||||
|
||||
expect(story(sent)).toEqual(["fork-1 idle cancelled"]);
|
||||
},
|
||||
);
|
||||
|
||||
it("ends with its task when it runs in the background", async () => {
|
||||
const { runtime, sent, deliver } = setup();
|
||||
await runtime.taskStarted(typed, deliver);
|
||||
|
||||
await runtime.finishTask("fork-1", "completed", deliver, undefined, { foreground: false });
|
||||
|
||||
expect(story(sent)).toEqual(["fork-1 idle end_turn"]);
|
||||
});
|
||||
|
||||
it("that Claude called is announced on the root, with the Skill call shown and the prompt as its message only", async () => {
|
||||
const { runtime, sent, deliver } = setup();
|
||||
await deliver(skillCall("skill-1"));
|
||||
await runtime.taskStarted({ ...typed, toolUseId: "skill-1", launchTool: "Skill" }, deliver);
|
||||
await deliver(output("skill-1"));
|
||||
|
||||
expect(sent.map(({ sessionId, update }) => [sessionId, update.sessionUpdate])).toEqual([
|
||||
["root", "tool_call"],
|
||||
["root", "subagent_update"],
|
||||
["fork-1", "session_message"],
|
||||
["fork-1", "agent_message_chunk"],
|
||||
]);
|
||||
expect(sent[2]?.update).toEqual({
|
||||
sessionUpdate: "session_message",
|
||||
messageId: "skill-1",
|
||||
senderSessionId: "root",
|
||||
recipientSessionId: "fork-1",
|
||||
content: [{ type: "text", text: "Review the diff" }],
|
||||
});
|
||||
});
|
||||
|
||||
it("references the child from the Skill call that launched it", async () => {
|
||||
const { runtime, sent, deliver } = setup();
|
||||
await deliver(skillCall("skill-1"));
|
||||
await runtime.taskStarted({ ...typed, toolUseId: "skill-1", launchTool: "Skill" }, deliver);
|
||||
const failure = [{ type: "content", content: { type: "text", text: "The skill failed" } }];
|
||||
await deliver({
|
||||
sessionId: "root",
|
||||
update: {
|
||||
sessionUpdate: "tool_call_update",
|
||||
toolCallId: "skill-1",
|
||||
status: "failed",
|
||||
content: failure,
|
||||
_meta: { claudeCode: { toolName: "Skill" } },
|
||||
},
|
||||
} as AcpSessionNotification);
|
||||
|
||||
expect(sent.at(-1)).toMatchObject({
|
||||
sessionId: "root",
|
||||
update: { content: [...failure, { type: "session", sessionId: "fork-1" }] },
|
||||
});
|
||||
});
|
||||
|
||||
it("that a subagent called is announced on that subagent's session, once it is announced", async () => {
|
||||
const { runtime, sent, deliver } = setup();
|
||||
const nested = { ...typed, launchTool: "Skill", parentTaskId: "worker-1" };
|
||||
// worker-1 is known, but its launch frame has not come: not announced.
|
||||
await runtime.taskStarted(
|
||||
{ taskId: "worker-1", toolUseId: "launch-1", subagentType: "Explore" },
|
||||
deliver,
|
||||
);
|
||||
await runtime.taskStarted({ ...nested, taskId: "fork-0", toolUseId: "skill-0" }, deliver);
|
||||
expect(announcements(sent)).toEqual([]);
|
||||
|
||||
await deliver(launch("launch-1", { description: "Fix the build" }));
|
||||
await deliver(skillCall("skill-1", "launch-1"));
|
||||
await runtime.taskStarted({ ...nested, toolUseId: "skill-1" }, deliver);
|
||||
|
||||
expect(announcements(sent)).toEqual([
|
||||
["root", "worker-1"],
|
||||
["worker-1", "fork-1"],
|
||||
]);
|
||||
});
|
||||
|
||||
it("keeps an agent that a SendMessage call resumed and the history cannot place unexposed", async () => {
|
||||
const { runtime, sent, deliver } = setup();
|
||||
// The call's update did not come: the subagent that made it is not announced.
|
||||
await runtime.taskStarted(
|
||||
{
|
||||
taskId: "old-1",
|
||||
toolUseId: "send-1",
|
||||
subagentType: "Explore",
|
||||
launchTool: "SendMessage",
|
||||
},
|
||||
deliver,
|
||||
);
|
||||
|
||||
expect(announcements(sent)).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
it("titles the child by the name a late frame gives it, and keeps its role", async () => {
|
||||
const published: AcpSessionNotification[] = [];
|
||||
const runtime = new NativeSubagentRuntime(
|
||||
|
||||
@@ -26,6 +26,7 @@ describe("Claude permission response effects", () => {
|
||||
durableChangeSet,
|
||||
allowPersistentOptions,
|
||||
availableModes,
|
||||
showClearContextOnPlanAccept: true,
|
||||
});
|
||||
|
||||
it.each([
|
||||
|
||||
@@ -30,6 +30,7 @@ describe("Claude permission options and response mapping", () => {
|
||||
availableModes,
|
||||
contextUsedPercent,
|
||||
prePlanMode,
|
||||
showClearContextOnPlanAccept: true,
|
||||
});
|
||||
|
||||
it("leads with the reject options when the CLI defaults the ask to no", () => {
|
||||
@@ -589,6 +590,26 @@ describe("Claude permission options and response mapping", () => {
|
||||
},
|
||||
);
|
||||
|
||||
it.each([undefined, false])(
|
||||
"does not offer clear-context ExitPlanMode when showClearContextOnPlanAccept is %s",
|
||||
(showClearContextOnPlanAccept) => {
|
||||
const optionIds = buildClaudePermissionOptions({
|
||||
toolName: "ExitPlanMode",
|
||||
input: { plan: "Implement it" },
|
||||
cwd: "/workspace",
|
||||
availableModes: ["auto", "bypassPermissions", "acceptEdits"],
|
||||
contextUsedPercent: 73,
|
||||
showClearContextOnPlanAccept,
|
||||
}).map((option) => option.optionId);
|
||||
expect(optionIds).toEqual([
|
||||
PERMISSION_OPTION_ID.exitPlanDefault,
|
||||
PERMISSION_OPTION_ID.exitPlanAuto,
|
||||
PERMISSION_OPTION_ID.exitPlanBypass,
|
||||
PERMISSION_OPTION_ID.reject,
|
||||
]);
|
||||
},
|
||||
);
|
||||
|
||||
it("does not offer clear-context ExitPlanMode without a plan", () => {
|
||||
expect(
|
||||
build("ExitPlanMode", undefined, {}, undefined, true, ["auto"], 73).map(
|
||||
@@ -641,7 +662,7 @@ describe("Claude permission options and response mapping", () => {
|
||||
})._meta,
|
||||
).toEqual({
|
||||
jetbrains: {
|
||||
air: { version: 1, permission: { version: 1, title: "mcp__computer-use__screenshot" } },
|
||||
air: { version: 1, permission: { version: 1, title: "computer-use: screenshot" } },
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -438,7 +438,7 @@ describe("Claude permission ACP v1 presentation", () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it("reuses the standard title for an unknown tool", () => {
|
||||
it("reuses the MCP tool title for the permission request", () => {
|
||||
const presentation = buildClaudePermissionPresentation({
|
||||
capabilities: airCapabilities(),
|
||||
toolName: "mcp__demo__deploy",
|
||||
@@ -447,11 +447,11 @@ describe("Claude permission ACP v1 presentation", () => {
|
||||
});
|
||||
expect(presentation.toolCall).toEqual({
|
||||
toolCallId: "tool-5",
|
||||
title: "mcp__demo__deploy",
|
||||
title: "demo: deploy",
|
||||
rawInput: { target: "staging" },
|
||||
});
|
||||
expect(presentation._meta).toEqual({
|
||||
jetbrains: { air: { version: 1, permission: { version: 1, title: "mcp__demo__deploy" } } },
|
||||
jetbrains: { air: { version: 1, permission: { version: 1, title: "demo: deploy" } } },
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import type { ClientCapabilities } from "@agentclientprotocol/sdk/unstable";
|
||||
import type { ClientCapabilities, SessionConfigOption } from "@agentclientprotocol/sdk/unstable";
|
||||
import type { ModelInfo } from "@anthropic-ai/claude-agent-sdk";
|
||||
import {
|
||||
buildConfigOptions,
|
||||
clientSupportsRecommendedConfigValue,
|
||||
orderedConfigOptions,
|
||||
} from "../session-config-options.js";
|
||||
import { AIR_RECOMMENDED_CONFIG_VALUE_CAPABILITY } from "../air-extension.js";
|
||||
|
||||
@@ -283,3 +284,51 @@ describe("buildConfigOptions recommended values presentation", () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("config option order", () => {
|
||||
const TOGGLE = { supported: true, enabled: false, useBooleanOption: true };
|
||||
/** The options of a root session that has all six. */
|
||||
const allSix = () =>
|
||||
buildConfigOptions(
|
||||
MODES,
|
||||
MODELS,
|
||||
MODEL_INFOS,
|
||||
undefined,
|
||||
[{ name: "reviewer", description: "Reviews code" }],
|
||||
"default",
|
||||
TOGGLE,
|
||||
undefined,
|
||||
TOGGLE,
|
||||
);
|
||||
|
||||
it("builds a root session's options as model, effort, Fast mode, ultracode, mode, agent", () => {
|
||||
expect(allSix().map((option) => option.id)).toEqual([
|
||||
"model",
|
||||
"effort",
|
||||
"fast",
|
||||
"ultracode",
|
||||
"mode",
|
||||
"agent",
|
||||
]);
|
||||
});
|
||||
|
||||
it("orders options by id, and puts other ids last in the order they came", () => {
|
||||
const other = (id: string): SessionConfigOption => ({
|
||||
id,
|
||||
name: id,
|
||||
type: "boolean",
|
||||
currentValue: false,
|
||||
});
|
||||
const options = [other("zeta"), ...allSix().reverse(), other("alpha")];
|
||||
expect(orderedConfigOptions(options).map((option) => option.id)).toEqual([
|
||||
"model",
|
||||
"effort",
|
||||
"fast",
|
||||
"ultracode",
|
||||
"mode",
|
||||
"agent",
|
||||
"zeta",
|
||||
"alpha",
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
98
src/tests/server-tool-calls.test.ts
Normal file
98
src/tests/server-tool-calls.test.ts
Normal file
@@ -0,0 +1,98 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { UnansweredServerToolCalls } from "../tool-calls/server-tool-calls.js";
|
||||
|
||||
const text = { type: "text", text: "Next." };
|
||||
const advisorCall = (id: string) => ({ type: "server_tool_use", id, name: "advisor", input: {} });
|
||||
const advisorResult = (id: string) => ({
|
||||
type: "advisor_tool_result",
|
||||
tool_use_id: id,
|
||||
content: { type: "advisor_result", text: "Check the edge case." },
|
||||
});
|
||||
const bashCall = (id: string) => ({ type: "tool_use", id, name: "Bash", input: {} });
|
||||
|
||||
describe("UnansweredServerToolCalls", () => {
|
||||
it("never ends a call that its own reply answers", () => {
|
||||
const calls = new UnansweredServerToolCalls();
|
||||
calls.replyStarted(null, "msg_1");
|
||||
expect(calls.observe(null, advisorCall("srvtoolu_1"))).toEqual([]);
|
||||
expect(calls.observe(null, advisorResult("srvtoolu_1"))).toEqual([]);
|
||||
expect(calls.observe(null, text)).toEqual([]);
|
||||
calls.replyStarted(null, "msg_2");
|
||||
expect(calls.observe(null, text)).toEqual([]);
|
||||
});
|
||||
|
||||
it("waits for the next reply to start with the result of a call its reply left pending", () => {
|
||||
const calls = new UnansweredServerToolCalls();
|
||||
calls.replyStarted(null, "msg_1");
|
||||
calls.observe(null, bashCall("toolu_1"));
|
||||
calls.observe(null, advisorCall("srvtoolu_1"));
|
||||
calls.replyStarted(null, "msg_2");
|
||||
expect(calls.observe(null, advisorResult("srvtoolu_1"))).toEqual([]);
|
||||
expect(calls.observe(null, text)).toEqual([]);
|
||||
});
|
||||
|
||||
it("ends a call still waiting once a later reply starts any other block, and only once", () => {
|
||||
const calls = new UnansweredServerToolCalls();
|
||||
calls.replyStarted(null, "msg_cut_off");
|
||||
calls.observe(null, advisorCall("srvtoolu_1"));
|
||||
calls.replyStarted(null, "msg_asked_again");
|
||||
expect(calls.observe(null, { type: "thinking", thinking: "" })).toEqual(["srvtoolu_1"]);
|
||||
expect(calls.observe(null, text)).toEqual([]);
|
||||
});
|
||||
|
||||
it("ends the earlier call at a later reply's own server tool use, which then waits in turn", () => {
|
||||
const calls = new UnansweredServerToolCalls();
|
||||
calls.replyStarted(null, "msg_cut_off");
|
||||
calls.observe(null, advisorCall("srvtoolu_1"));
|
||||
calls.replyStarted(null, "msg_asked_again");
|
||||
expect(calls.observe(null, advisorCall("srvtoolu_2"))).toEqual(["srvtoolu_1"]);
|
||||
expect(calls.observe(null, text)).toEqual([]);
|
||||
calls.replyStarted(null, "msg_3");
|
||||
expect(calls.observe(null, text)).toEqual(["srvtoolu_2"]);
|
||||
});
|
||||
|
||||
it("takes a consolidated message's blocks as its own reply's, by the id it carries", () => {
|
||||
const calls = new UnansweredServerToolCalls();
|
||||
calls.replyStarted(null, "msg_1");
|
||||
calls.observe(null, advisorCall("srvtoolu_1"));
|
||||
expect(calls.observe(null, advisorCall("srvtoolu_1"), "msg_1")).toEqual([]);
|
||||
expect(calls.observe(null, text, "msg_1")).toEqual([]);
|
||||
expect(calls.observe(null, text, "msg_2")).toEqual(["srvtoolu_1"]);
|
||||
});
|
||||
|
||||
it("follows calls of a reply that was not streamed, by its consolidated messages", () => {
|
||||
const calls = new UnansweredServerToolCalls();
|
||||
expect(calls.observe(null, advisorCall("srvtoolu_1"), "msg_1")).toEqual([]);
|
||||
expect(calls.observe(null, text, "msg_2")).toEqual(["srvtoolu_1"]);
|
||||
});
|
||||
|
||||
it("keeps each conversation's calls to that conversation", () => {
|
||||
const calls = new UnansweredServerToolCalls();
|
||||
calls.replyStarted(null, "msg_main");
|
||||
calls.observe(null, advisorCall("srvtoolu_main"));
|
||||
calls.replyStarted("toolu_agent", "msg_sub_1");
|
||||
calls.observe("toolu_agent", advisorCall("srvtoolu_sub"));
|
||||
calls.replyStarted("toolu_agent", "msg_sub_2");
|
||||
expect(calls.observe("toolu_agent", text)).toEqual(["srvtoolu_sub"]);
|
||||
calls.replyStarted(null, "msg_main_2");
|
||||
expect(calls.observe(null, text)).toEqual(["srvtoolu_main"]);
|
||||
});
|
||||
|
||||
it("does not follow the calls of a reply of unknown id", () => {
|
||||
const calls = new UnansweredServerToolCalls();
|
||||
calls.replyStarted(null, undefined);
|
||||
calls.observe(null, advisorCall("srvtoolu_1"));
|
||||
expect(calls.observe(null, text)).toEqual([]);
|
||||
calls.replyStarted(null, "msg_2");
|
||||
expect(calls.observe(null, text)).toEqual([]);
|
||||
});
|
||||
|
||||
it("forgets the calls of a subagent that ended", () => {
|
||||
const calls = new UnansweredServerToolCalls();
|
||||
calls.replyStarted("toolu_agent", "msg_sub_1");
|
||||
calls.observe("toolu_agent", advisorCall("srvtoolu_sub"));
|
||||
calls.forget("toolu_agent");
|
||||
calls.replyStarted("toolu_agent", "msg_sub_2");
|
||||
expect(calls.observe("toolu_agent", text)).toEqual([]);
|
||||
});
|
||||
});
|
||||
@@ -97,3 +97,32 @@ describe("SettingsManager.getCompactionSettings", () => {
|
||||
manager.dispose();
|
||||
});
|
||||
});
|
||||
|
||||
describe("SettingsManager.getShowClearContextOnPlanAccept", () => {
|
||||
it("ranks managed settings over the --settings override over the files, and is off by default", async () => {
|
||||
const managed = await managerResolving({
|
||||
effective: { showClearContextOnPlanAccept: false },
|
||||
provenance: {},
|
||||
sources: [{ source: "managed", settings: { showClearContextOnPlanAccept: false } }],
|
||||
});
|
||||
expect(managed.getShowClearContextOnPlanAccept({ showClearContextOnPlanAccept: true })).toBe(
|
||||
false,
|
||||
);
|
||||
managed.dispose();
|
||||
|
||||
const files = await managerResolving({
|
||||
effective: { showClearContextOnPlanAccept: true },
|
||||
provenance: {},
|
||||
sources: [{ source: "userSettings", settings: { showClearContextOnPlanAccept: true } }],
|
||||
});
|
||||
expect(files.getShowClearContextOnPlanAccept({ showClearContextOnPlanAccept: false })).toBe(
|
||||
false,
|
||||
);
|
||||
expect(files.getShowClearContextOnPlanAccept()).toBe(true);
|
||||
files.dispose();
|
||||
|
||||
const unset = await managerResolving({ effective: {}, provenance: {}, sources: [] });
|
||||
expect(unset.getShowClearContextOnPlanAccept()).toBe(false);
|
||||
unset.dispose();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -3,14 +3,12 @@ import { beforeEach, vi } from "vitest";
|
||||
// `providers/set` lists the gateway's models with `fetch` (gateway-models.ts),
|
||||
// and a failed listing fails the call. Tests that set an `anthropic` or
|
||||
// `bedrock` provider would otherwise send that request to their example
|
||||
// gateway URLs, so every test gets an empty listing instead. An empty listing
|
||||
// narrows the picker to no model: a test that checks the picker after
|
||||
// `providers/set` stubs `fetch` with the models it expects. This default is
|
||||
// deliberate: listing fixture models for every test would hide which tests
|
||||
// depend on a listing.
|
||||
// gateway URLs, so every test gets a 404 instead. That means the gateway has
|
||||
// no listing and leaves the SDK catalog unchanged. Tests of model discovery
|
||||
// supply their own listing, including authoritative empty results.
|
||||
beforeEach(() => {
|
||||
vi.stubGlobal(
|
||||
"fetch",
|
||||
vi.fn(async () => new Response(JSON.stringify({ data: [], modelSummaries: [] }))),
|
||||
vi.fn(async () => new Response("No model listing", { status: 404 })),
|
||||
);
|
||||
});
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user