Compare commits

...

17 Commits

Author SHA1 Message Date
acp-release-bot[bot]
b4b7f561e2 chore(main): release 0.48.0 (#788)
🤖 I have created a release *beep* *boop*
---


##
[0.48.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.47.0...v0.48.0)
(2026-06-19)


### Features

* Agent selection dropdown in config options
([#794](https://github.com/agentclientprotocol/claude-agent-acp/issues/794))
([5729c47](5729c471f9))
* **deps:** bump the minor group with 11 updates
([#787](https://github.com/agentclientprotocol/claude-agent-acp/issues/787))
([ad3b5fe](ad3b5fe745))
* Update to claude-agent-sdk 0.3.183
([#791](https://github.com/agentclientprotocol/claude-agent-acp/issues/791))
([744b2d4](744b2d4112))
* Update to new ACP SDK patterns
([#790](https://github.com/agentclientprotocol/claude-agent-acp/issues/790))
([2554c7b](2554c7bf98))


### Bug Fixes

* duplicate assistant text when turn activates mid-message
([#789](https://github.com/agentclientprotocol/claude-agent-acp/issues/789))
([1c80bf8](1c80bf8e56))
* Skip empty thinking chunks
([#793](https://github.com/agentclientprotocol/claude-agent-acp/issues/793))
([15fdf26](15fdf26fc7))
* surface Bash tool image output instead of dropping it
([#617](https://github.com/agentclientprotocol/claude-agent-acp/issues/617))
([a759e64](a759e64ef6))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: acp-release-bot[bot] <246668977+acp-release-bot[bot]@users.noreply.github.com>
2026-06-19 13:19:37 +02:00
Luca Dibattista
41cde99fd7 test: isolate CLAUDE_CONFIG_DIR in settings tests to stop user-tier leak (#769)
## Summary

`src/tests/settings.test.ts` didn't isolate the **user settings tier**,
so the `availableModels` merge tests failed on any machine whose real
`~/.claude/settings.json` defines `availableModels`.

`SettingsManager.loadAllSettings()` resolves through the SDK's
`resolveSettings({ cwd })`, which reads the user `settings.json` from
`process.env.CLAUDE_CONFIG_DIR` at call time and falls back to the real
`~/.claude` when it's unset. The tests set up only the project/local
tiers under a temp `cwd` and left the user tier pointing at the
developer's real home, so the developer's own settings merged into the
result.

This only surfaced for `availableModels` because that key is **unioned**
across tiers — leaked entries get prepended. `model` and
`permissions.defaultMode` use override semantics (project tier wins), so
they masked the leak. Example failure with `availableModels:
["sonnet","opus","haiku"]` in the user's real settings:

```
- Expected
+ Received
+   "sonnet",
+   "opus",
+   "haiku",
    "claude-haiku-4-5",
    "claude-opus-4-7[1m]",
    "claude-sonnet-4-6[1m]",
```

## Fix

Point `CLAUDE_CONFIG_DIR` at an empty per-test directory in `beforeEach`
(and restore it in `afterEach`) so the user tier contributes nothing.
This mirrors the isolation already used in `acp-agent-settings.test.ts`.

Test-only change; no production code touched.

## Test Plan

- `settings.test.ts` run plainly with a real `~/.claude` containing
`availableModels` → 10 passed (previously 2 failing).
- `settings.test.ts` run with `CLAUDE_CONFIG_DIR` pointed at a directory
holding decoy `availableModels`/`model` → 10 passed, confirming
`beforeEach` overrides any external user tier.
- Full suite with no env wrapper → 355 passed, 0 failed.
- lint + prettier clean.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 11:19:12 +00:00
Ben Brandt
5729c471f9 feat: Agent selection dropdown in config options (#794)
- **feat: add agent selection as ACP session config option**
- **fix: harden agent selection edge cases + SDK roster guard**
- **fix: reserve "default" agent sentinel to prevent collision**

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 13:17:00 +02:00
David Alvarez
a759e64ef6 fix: surface Bash tool image output instead of dropping it (#617)
## What's broken

The Bash branch of `toolUpdateFromToolResult` (`src/tools.ts`) guards
the array-content path on `"text" in result[0]`. When the local Bash
tool produces image content — `[{ type: "image", source: { type:
"base64", ... } }]`, e.g. when a command pipes a base64 data URI — the
guard rejects the array and `output` stays empty. The image is silently
dropped from the ACP `tool_call_update` and the client renders nothing.

## Fix

Distinguish text-only arrays (existing terminal-stream behavior) from
arrays containing non-text blocks. For the latter, bypass the terminal
`_meta` channel (binary payloads can't be streamed through it) and
delegate to `toAcpContentUpdate` so images surface as ACP content
blocks.

The change is contained to the Bash case in `toolUpdateFromToolResult`;
no other tool dispatch is affected.

## Tests

Three regression tests added in `src/tests/tools.test.ts` under a new
`describe("with image array tool_result …")`:

- pure image, `supportsTerminalOutput: false` — image surfaces as ACP
content
- pure image, `supportsTerminalOutput: true` — `_meta` is correctly
bypassed and image still surfaces
- mixed text + image — both blocks surface in order

All existing tests pass. Total: 240 → 243.

## Validation

- `npm run check` ✅
- `npm run build` ✅
- `npm run test:run` ✅ (243 passed, 13 integration skipped)

Co-authored-by: dave <dave@mint.lan>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2026-06-19 10:27:32 +00:00
Ben Brandt
15fdf26fc7 fix: Skip empty thinking chunks (#793)
These carried a signature but we don't need that in the updates if it is
empty.
2026-06-19 10:18:36 +00:00
Ben Brandt
9f38cb67df test: Improve tmp dirs in tests (#792) 2026-06-19 12:08:11 +02:00
Ben Brandt
744b2d4112 feat: Update to claude-agent-sdk 0.3.183 (#791) 2026-06-19 10:03:32 +00:00
Ben Brandt
2554c7bf98 feat: Update to new ACP SDK patterns (#790) 2026-06-19 11:48:41 +02:00
Hugo Baraúna
1c80bf8e56 fix: duplicate assistant text when turn activates mid-message (#789)
I generated this PR using AI. if not helpful, please delete it.

Or, maybe its value is just to show a potential bug.

I found this bug when using Tidewave. I noticed text was being
duplicated when using claude and claude-agent-acp 0.47.0.

I asked the agent to investigate, and this PR seems to fix it.

---

## Summary

- Stop `resetTurnScratch()` from nulling `currentStreamMessageId` on
turn activation, which was causing the assistant's message text to
render **twice** (concatenated) in the feed.

## Problem

When a turn activates mid-message, the agent's message text renders
twice, back-to-back. Only prose duplicates — never tool calls — and
specifically the text/thinking block that streams *after* the
activation. Reproduces on `0.47.0` with a prompt like *"say a sentence,
run a shell command that sleeps 10s, then say a sentence."*
2026-06-19 08:28:54 +00:00
dependabot[bot]
ad3b5fe745 feat(deps): bump the minor group with 11 updates (#787)
Bumps the minor group with 11 updates:

| Package | From | To |
| --- | --- | --- |
|
[@agentclientprotocol/sdk](https://github.com/agentclientprotocol/typescript-sdk)
| `0.26.0` | `0.27.0` |
|
[@anthropic-ai/claude-agent-sdk](https://github.com/anthropics/claude-agent-sdk-typescript)
| `0.3.179` | `0.3.181` |
| @anthropic-ai/claude-agent-sdk-darwin-arm64 | `0.3.179` | `0.3.181` |
| @anthropic-ai/claude-agent-sdk-darwin-x64 | `0.3.179` | `0.3.181` |
| @anthropic-ai/claude-agent-sdk-linux-arm64 | `0.3.179` | `0.3.181` |
| @anthropic-ai/claude-agent-sdk-linux-arm64-musl | `0.3.179` |
`0.3.181` |
| @anthropic-ai/claude-agent-sdk-linux-x64 | `0.3.179` | `0.3.181` |
| @anthropic-ai/claude-agent-sdk-linux-x64-musl | `0.3.179` | `0.3.181`
|
| @anthropic-ai/claude-agent-sdk-win32-arm64 | `0.3.179` | `0.3.181` |
| @anthropic-ai/claude-agent-sdk-win32-x64 | `0.3.179` | `0.3.181` |
| [hono](https://github.com/honojs/hono) | `4.12.25` | `4.12.26` |

Updates `@agentclientprotocol/sdk` from 0.26.0 to 0.27.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/agentclientprotocol/typescript-sdk/releases">@​agentclientprotocol/sdk's
releases</a>.</em></p>
<blockquote>
<h2>v0.27.0</h2>
<h2><a
href="https://github.com/agentclientprotocol/typescript-sdk/compare/v0.26.0...v0.27.0">0.27.0</a>
(2026-06-18)</h2>
<p>This is a big release! We have rewritten the SDK to have a more
ergonomic design for creating new agents and clients. You can read more
in the <a
href="https://github.com/agentclientprotocol/typescript-sdk/blob/main/MIGRATION_0.26_0.27.md">Migration
Guide</a> for how to migrate.</p>
<p>For now, you will still have the old interfaces available to ease the
migration, but they are deprecated and will be removed in a future
release.</p>
<h3>Features</h3>
<ul>
<li>Experimental Streamable HTTP &amp; WebSocket Transport (<a
href="https://redirect.github.com/agentclientprotocol/typescript-sdk/issues/155">#155</a>)
(<a
href="d6a3d88107">d6a3d88</a>)</li>
<li>New SDK design (see MIGRATION_0.26_0.27.md) (<a
href="https://redirect.github.com/agentclientprotocol/typescript-sdk/issues/181">#181</a>)
(<a
href="87e2df33b5">87e2df3</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/agentclientprotocol/typescript-sdk/blob/main/CHANGELOG.md">@​agentclientprotocol/sdk's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/agentclientprotocol/typescript-sdk/compare/v0.26.0...v0.27.0">0.27.0</a>
(2026-06-18)</h2>
<p>This is a big release! We have rewritten the SDK to have a more
ergonomic design for creating new agents and clients. You can read more
in the <a
href="https://github.com/agentclientprotocol/typescript-sdk/blob/main/MIGRATION_0.26_0.27.md">Migration
Guide</a> for how to migrate.</p>
<p>For now, you will still have the old interfaces available to ease the
migration, but they are deprecated and will be removed in a future
release.</p>
<h3>Features</h3>
<ul>
<li>Experimental Streamable HTTP &amp; WebSocket Transport (<a
href="https://redirect.github.com/agentclientprotocol/typescript-sdk/issues/155">#155</a>)
(<a
href="d6a3d88107">d6a3d88</a>)</li>
<li>New SDK design (see MIGRATION_0.26_0.27.md) (<a
href="https://redirect.github.com/agentclientprotocol/typescript-sdk/issues/181">#181</a>)
(<a
href="87e2df33b5">87e2df3</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="a3437f5f3f"><code>a3437f5</code></a>
chore(main): release 0.27.0 (<a
href="https://redirect.github.com/agentclientprotocol/typescript-sdk/issues/182">#182</a>)</li>
<li><a
href="a3acfa25d7"><code>a3acfa2</code></a>
chore: Cleanup documentation of ctx args and slim down public api (<a
href="https://redirect.github.com/agentclientprotocol/typescript-sdk/issues/184">#184</a>)</li>
<li><a
href="bd1f514d02"><code>bd1f514</code></a>
Update dev deps (<a
href="https://redirect.github.com/agentclientprotocol/typescript-sdk/issues/183">#183</a>)</li>
<li><a
href="87e2df33b5"><code>87e2df3</code></a>
feat: New SDK design (see MIGRATION_0.26_0.27.md) (<a
href="https://redirect.github.com/agentclientprotocol/typescript-sdk/issues/181">#181</a>)</li>
<li><a
href="d6a3d88107"><code>d6a3d88</code></a>
feat: Experimental Streamable HTTP &amp; WebSocket Transport (<a
href="https://redirect.github.com/agentclientprotocol/typescript-sdk/issues/155">#155</a>)</li>
<li>See full diff in <a
href="https://github.com/agentclientprotocol/typescript-sdk/compare/v0.26.0...v0.27.0">compare
view</a></li>
</ul>
</details>
<br />

Updates `@anthropic-ai/claude-agent-sdk` from 0.3.179 to 0.3.181
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/anthropics/claude-agent-sdk-typescript/releases">@​anthropic-ai/claude-agent-sdk's
releases</a>.</em></p>
<blockquote>
<h2>v0.3.181</h2>
<h2>What's changed</h2>
<ul>
<li>Added <code>errorCode</code>, <code>canUserPurchaseCredits</code>,
and <code>hasChargeableSavedPaymentMethod</code> fields to
<code>SDKRateLimitInfo</code> for detecting credits-required rate
limits</li>
<li>Added <code>tool_use_meta.icon_url</code> to assistant messages,
populated from MCP server directory metadata</li>
<li>Fixed SDK-hosted Remote Control sessions dropping
<code>file_attachments</code> from inbound user messages</li>
</ul>
<h2>Update</h2>
<pre lang="sh"><code>npm install @anthropic-ai/claude-agent-sdk@0.3.181
# or
yarn add @anthropic-ai/claude-agent-sdk@0.3.181
# or
pnpm add @anthropic-ai/claude-agent-sdk@0.3.181
# or
bun add @anthropic-ai/claude-agent-sdk@0.3.181
</code></pre>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/anthropics/claude-agent-sdk-typescript/blob/main/CHANGELOG.md">@​anthropic-ai/claude-agent-sdk's
changelog</a>.</em></p>
<blockquote>
<h2>0.3.181</h2>
<ul>
<li>Added <code>errorCode</code>, <code>canUserPurchaseCredits</code>,
and <code>hasChargeableSavedPaymentMethod</code> fields to
<code>SDKRateLimitInfo</code> for detecting credits-required rate
limits</li>
<li>Added <code>tool_use_meta.icon_url</code> to assistant messages,
populated from MCP server directory metadata</li>
<li>Fixed SDK-hosted Remote Control sessions dropping
<code>file_attachments</code> from inbound user messages</li>
</ul>
<h2>0.3.180</h2>
<ul>
<li>Updated to parity with Claude Code v2.1.180</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="4d3840c936"><code>4d3840c</code></a>
chore: Update CHANGELOG.md</li>
<li>See full diff in <a
href="https://github.com/anthropics/claude-agent-sdk-typescript/compare/v0.3.179...v0.3.181">compare
view</a></li>
</ul>
</details>
<br />

Updates `@anthropic-ai/claude-agent-sdk-darwin-arm64` from 0.3.179 to
0.3.181

Updates `@anthropic-ai/claude-agent-sdk-darwin-x64` from 0.3.179 to
0.3.181

Updates `@anthropic-ai/claude-agent-sdk-linux-arm64` from 0.3.179 to
0.3.181

Updates `@anthropic-ai/claude-agent-sdk-linux-arm64-musl` from 0.3.179
to 0.3.181

Updates `@anthropic-ai/claude-agent-sdk-linux-x64` from 0.3.179 to
0.3.181

Updates `@anthropic-ai/claude-agent-sdk-linux-x64-musl` from 0.3.179 to
0.3.181

Updates `@anthropic-ai/claude-agent-sdk-win32-arm64` from 0.3.179 to
0.3.181

Updates `@anthropic-ai/claude-agent-sdk-win32-x64` from 0.3.179 to
0.3.181

Updates `hono` from 4.12.25 to 4.12.26
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/honojs/hono/releases">hono's
releases</a>.</em></p>
<blockquote>
<h2>v4.12.26</h2>
<h2>What's Changed</h2>
<ul>
<li>fix(lambda-edge): satisfy Deno lib types for Content-Length body
encoding by <a
href="https://github.com/yusukebe"><code>@​yusukebe</code></a> in <a
href="https://redirect.github.com/honojs/hono/pull/5013">honojs/hono#5013</a></li>
<li>ci: publish to npm from CI with OIDC trusted publishing by <a
href="https://github.com/yusukebe"><code>@​yusukebe</code></a> in <a
href="https://redirect.github.com/honojs/hono/pull/5028">honojs/hono#5028</a></li>
<li>chore: remove unused devcontainer and gitpod configs by <a
href="https://github.com/yusukebe"><code>@​yusukebe</code></a> in <a
href="https://redirect.github.com/honojs/hono/pull/5029">honojs/hono#5029</a></li>
<li>chore: replace arg and glob with Bun native APIs in build script by
<a href="https://github.com/yusukebe"><code>@​yusukebe</code></a> in <a
href="https://redirect.github.com/honojs/hono/pull/5030">honojs/hono#5030</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/honojs/hono/compare/v4.12.25...v4.12.26">https://github.com/honojs/hono/compare/v4.12.25...v4.12.26</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="27b7992f82"><code>27b7992</code></a>
4.12.26</li>
<li><a
href="d29982cc40"><code>d29982c</code></a>
chore: replace arg and glob with Bun native APIs in build script</li>
<li><a
href="16215d5f50"><code>16215d5</code></a>
chore: remove unused devcontainer and gitpod configs (<a
href="https://redirect.github.com/honojs/hono/issues/5029">#5029</a>)</li>
<li><a
href="c574cf1640"><code>c574cf1</code></a>
ci: publish to npm from CI with OIDC trusted publishing (<a
href="https://redirect.github.com/honojs/hono/issues/5028">#5028</a>)</li>
<li><a
href="e50df01453"><code>e50df01</code></a>
fix(lambda-edge): satisfy Deno lib types for Content-Length body
encoding (<a
href="https://redirect.github.com/honojs/hono/issues/5">#5</a>...</li>
<li>See full diff in <a
href="https://github.com/honojs/hono/compare/v4.12.25...v4.12.26">compare
view</a></li>
</ul>
</details>
<details>
<summary>Maintainer changes</summary>
<p>This version was pushed to npm by <a
href="https://www.npmjs.com/~GitHub%20Actions">GitHub Actions</a>, a new
releaser for hono since your current version.</p>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2026-06-18 16:55:17 +02:00
acp-release-bot[bot]
794aa84684 chore(main): release 0.47.0 (#784)
🤖 I have created a release *beep* *boop*
---


##
[0.47.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.46.0...v0.47.0)
(2026-06-17)


### Features

* Update to claude-agent-sdk 0.3.179
([#783](https://github.com/agentclientprotocol/claude-agent-acp/issues/783))
([59a098c](59a098c2b5))


### Bug Fixes

* Duplicate assistant messages in feed
([#785](https://github.com/agentclientprotocol/claude-agent-acp/issues/785))
([12d34e6](12d34e64e5))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: acp-release-bot[bot] <246668977+acp-release-bot[bot]@users.noreply.github.com>
2026-06-17 12:17:10 +02:00
Ben Brandt
12d34e64e5 fix: Duplicate assistant messages in feed (#785) 2026-06-17 12:12:26 +02:00
Ben Brandt
59a098c2b5 feat: Update to claude-agent-sdk 0.3.179 (#783) 2026-06-17 09:04:56 +00:00
acp-release-bot[bot]
c27e6aec90 chore(main): release 0.46.0 (#778)
🤖 I have created a release *beep* *boop*
---


##
[0.46.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.45.1...v0.46.0)
(2026-06-16)


### Features

* Update to claude-agent-sdk 0.3.178
([#777](https://github.com/agentclientprotocol/claude-agent-acp/issues/777))
([58549ff](58549ffe6a))


### Bug Fixes

* Better handle out of turn events
([#780](https://github.com/agentclientprotocol/claude-agent-acp/issues/780))
([4f273a2](4f273a20d8))
* Forward option details in elicitation meta
([#779](https://github.com/agentclientprotocol/claude-agent-acp/issues/779))
([b364059](b3640599ae)),
closes
[#764](https://github.com/agentclientprotocol/claude-agent-acp/issues/764)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: acp-release-bot[bot] <246668977+acp-release-bot[bot]@users.noreply.github.com>
2026-06-16 21:36:40 +02:00
Ben Brandt
4f273a20d8 fix: Better handle out of turn events (#780)
Claude has a lot of background tasks. If we wait for "idle", some people
experience turns that never end.
If we stop iterating the query after result, people end up with events
that never show up.

Given we already often have session_updates outside of the prompt (and
clients need to handle it for v2 if they aren't already) this moves the
setup to better handle how the SDK gives us this information.

I've been test-driving this build all day and it seems to be working
great.

Closes #773
Closes #679
Closes #435
Closes #497
Closes #688
Closes #630

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 21:33:54 +02:00
Ben Brandt
b3640599ae fix: Forward option details in elicitation meta (#779)
Closes #764
2026-06-16 12:32:54 +00:00
Ben Brandt
58549ffe6a feat: Update to claude-agent-sdk 0.3.178 (#777) 2026-06-16 14:25:08 +02:00
18 changed files with 2528 additions and 747 deletions

View File

@@ -1,3 +1,3 @@
{
".": "0.45.1"
".": "0.48.0"
}

View File

@@ -1,5 +1,47 @@
# Changelog
## [0.48.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.47.0...v0.48.0) (2026-06-19)
### Features
* Agent selection dropdown in config options ([#794](https://github.com/agentclientprotocol/claude-agent-acp/issues/794)) ([5729c47](https://github.com/agentclientprotocol/claude-agent-acp/commit/5729c471f92e1d2a191eb2a6d18c2be47821e9ec))
* **deps:** bump the minor group with 11 updates ([#787](https://github.com/agentclientprotocol/claude-agent-acp/issues/787)) ([ad3b5fe](https://github.com/agentclientprotocol/claude-agent-acp/commit/ad3b5fe74527f83964695a1e8056d010b981fc79))
* Update to claude-agent-sdk 0.3.183 ([#791](https://github.com/agentclientprotocol/claude-agent-acp/issues/791)) ([744b2d4](https://github.com/agentclientprotocol/claude-agent-acp/commit/744b2d41128f67091d4136283594c0db11ea4db5))
* Update to new ACP SDK patterns ([#790](https://github.com/agentclientprotocol/claude-agent-acp/issues/790)) ([2554c7b](https://github.com/agentclientprotocol/claude-agent-acp/commit/2554c7bf980472760a6e7810b826f030d2c3af25))
### Bug Fixes
* duplicate assistant text when turn activates mid-message ([#789](https://github.com/agentclientprotocol/claude-agent-acp/issues/789)) ([1c80bf8](https://github.com/agentclientprotocol/claude-agent-acp/commit/1c80bf8e56a9279dc799e7bbdcae87241e99c18b))
* Skip empty thinking chunks ([#793](https://github.com/agentclientprotocol/claude-agent-acp/issues/793)) ([15fdf26](https://github.com/agentclientprotocol/claude-agent-acp/commit/15fdf26fc7d3a6c51e89d3e56fc91dd00cb3d7ae))
* surface Bash tool image output instead of dropping it ([#617](https://github.com/agentclientprotocol/claude-agent-acp/issues/617)) ([a759e64](https://github.com/agentclientprotocol/claude-agent-acp/commit/a759e64ef6d9b7c5bfe9a6e6b182db835f8ed3b6))
## [0.47.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.46.0...v0.47.0) (2026-06-17)
### Features
* Update to claude-agent-sdk 0.3.179 ([#783](https://github.com/agentclientprotocol/claude-agent-acp/issues/783)) ([59a098c](https://github.com/agentclientprotocol/claude-agent-acp/commit/59a098c2b530bbae034e9a2dfbd31f8b4ef2a4d0))
### Bug Fixes
* Duplicate assistant messages in feed ([#785](https://github.com/agentclientprotocol/claude-agent-acp/issues/785)) ([12d34e6](https://github.com/agentclientprotocol/claude-agent-acp/commit/12d34e64e53564602ac1c38a30127e234c5c25ff))
## [0.46.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.45.1...v0.46.0) (2026-06-16)
### Features
* Update to claude-agent-sdk 0.3.178 ([#777](https://github.com/agentclientprotocol/claude-agent-acp/issues/777)) ([58549ff](https://github.com/agentclientprotocol/claude-agent-acp/commit/58549ffe6a8b02ce59894e567407bd4299c11428))
### Bug Fixes
* Better handle out of turn events ([#780](https://github.com/agentclientprotocol/claude-agent-acp/issues/780)) ([4f273a2](https://github.com/agentclientprotocol/claude-agent-acp/commit/4f273a20d870c9c69f71556b8e0519f1de30f285))
* Forward option details in elicitation meta ([#779](https://github.com/agentclientprotocol/claude-agent-acp/issues/779)) ([b364059](https://github.com/agentclientprotocol/claude-agent-acp/commit/b3640599ae685beecacd93e012d5bbc9dac716f7)), closes [#764](https://github.com/agentclientprotocol/claude-agent-acp/issues/764)
## [0.45.1](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.45.0...v0.45.1) (2026-06-16)

274
package-lock.json generated
View File

@@ -1,27 +1,27 @@
{
"name": "@agentclientprotocol/claude-agent-acp",
"version": "0.45.1",
"version": "0.48.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@agentclientprotocol/claude-agent-acp",
"version": "0.45.1",
"version": "0.48.0",
"license": "Apache-2.0",
"dependencies": {
"@agentclientprotocol/sdk": "0.25.1",
"@anthropic-ai/claude-agent-sdk": "0.3.177",
"@agentclientprotocol/sdk": "0.28.1",
"@anthropic-ai/claude-agent-sdk": "0.3.183",
"zod": "^3.25.0 || ^4.0.0"
},
"bin": {
"claude-agent-acp": "dist/index.js"
},
"devDependencies": {
"@anthropic-ai/sdk": "0.104.1",
"@anthropic-ai/sdk": "0.105.0",
"@eslint/js": "10.0.1",
"@types/node": "25.9.3",
"@typescript-eslint/eslint-plugin": "8.61.0",
"@typescript-eslint/parser": "8.61.0",
"@types/node": "26.0.0",
"@typescript-eslint/eslint-plugin": "8.61.1",
"@typescript-eslint/parser": "8.61.1",
"eslint": "10.5.0",
"eslint-config-prettier": "10.1.8",
"globals": "17.6.0",
@@ -32,31 +32,31 @@
}
},
"node_modules/@agentclientprotocol/sdk": {
"version": "0.25.1",
"resolved": "https://registry.npmjs.org/@agentclientprotocol/sdk/-/sdk-0.25.1.tgz",
"integrity": "sha512-jx2rF3bdpGwZ75Q/meyEDLLbYmbtxk82Uh9hDCdxDvcEedBnNSF5hZAnL/kJR5VNz56JqwOmqnAqasC84MwwkQ==",
"version": "0.28.1",
"resolved": "https://registry.npmjs.org/@agentclientprotocol/sdk/-/sdk-0.28.1.tgz",
"integrity": "sha512-Z2Frs6YtPhnZZ+XwFXyQkRDXY0fn8FjCalEs0W4yUhQnY4TztmNq0/RnfzWdFN3vqT3h0jTz5klzYbZHGxCDyQ==",
"license": "Apache-2.0",
"peerDependencies": {
"zod": "^3.25.0 || ^4.0.0"
}
},
"node_modules/@anthropic-ai/claude-agent-sdk": {
"version": "0.3.177",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk/-/claude-agent-sdk-0.3.177.tgz",
"integrity": "sha512-CBzXnzR661q3AlfZzBjmIFQx0cxr36iJV3PExTYmPyGQX32qxtiFQgnxTcF8wB4hcSVf2hnoy/gprVJdkNx7cw==",
"version": "0.3.183",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk/-/claude-agent-sdk-0.3.183.tgz",
"integrity": "sha512-rAKws76RKdFu+DK5q9wYN0AGLRdPrw0vGd+TMzSFynFdxwUAehYc9vUKJoK27j2xRoHFdNt+JDsih5BzsUzi+Q==",
"license": "SEE LICENSE IN README.md",
"engines": {
"node": ">=18.0.0"
},
"optionalDependencies": {
"@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.177",
"@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.177",
"@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.177",
"@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.177",
"@anthropic-ai/claude-agent-sdk-linux-x64": "0.3.177",
"@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.177",
"@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.177",
"@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.177"
"@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.183",
"@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.183",
"@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.183",
"@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.183",
"@anthropic-ai/claude-agent-sdk-linux-x64": "0.3.183",
"@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.183",
"@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.183",
"@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.183"
},
"peerDependencies": {
"@anthropic-ai/sdk": ">=0.93.0",
@@ -65,9 +65,9 @@
}
},
"node_modules/@anthropic-ai/claude-agent-sdk-darwin-arm64": {
"version": "0.3.177",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-arm64/-/claude-agent-sdk-darwin-arm64-0.3.177.tgz",
"integrity": "sha512-u9Ty+KPllm2nw0RatdPF0zcPRquNZjVptmyLG0DqduGbgZDLQpfPFMF5hffFIRnVaXhx7+jkUmEdw0jrda0UcA==",
"version": "0.3.183",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-arm64/-/claude-agent-sdk-darwin-arm64-0.3.183.tgz",
"integrity": "sha512-o/+sxwKgXuw6RG5cERWjvcvL1CDSPe/TaXMhax+dq+V4lDOI5iTqg3y5Wfb6dL3xlWoTA2OhWowDQllKbE04LQ==",
"cpu": [
"arm64"
],
@@ -78,9 +78,9 @@
]
},
"node_modules/@anthropic-ai/claude-agent-sdk-darwin-x64": {
"version": "0.3.177",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-x64/-/claude-agent-sdk-darwin-x64-0.3.177.tgz",
"integrity": "sha512-ona6Jv54XFwBTqOj3MzLWfKtc2m7Rdh58wOAX9Hnue/6FcWfyeuz/UDcidVTXQ7Xytz//Tb0JJgFtiQjO7FbIA==",
"version": "0.3.183",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-x64/-/claude-agent-sdk-darwin-x64-0.3.183.tgz",
"integrity": "sha512-V7Cf8JeD5EPf4MPomFUlEblCIQI0wg+aWdOSqvfMsDmCBEHljd52CQ3a7W263oVt6I7QUfRTpX2KNvdma56rDA==",
"cpu": [
"x64"
],
@@ -91,12 +91,15 @@
]
},
"node_modules/@anthropic-ai/claude-agent-sdk-linux-arm64": {
"version": "0.3.177",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64/-/claude-agent-sdk-linux-arm64-0.3.177.tgz",
"integrity": "sha512-wBCbklkaDb483Ab4DUFfmJjZJKXz58YXPv+CiGsyjq1St19mbKEma5KKz3Ya9mlV8aLyh4zmLK2mEHPnF//Ipg==",
"version": "0.3.183",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64/-/claude-agent-sdk-linux-arm64-0.3.183.tgz",
"integrity": "sha512-qqnSf85D3uBH7kRHLGOMhr7aQrREUZ4hUlCztrkJe/twUT4bmJsO86zamnAf7vOYeCul/sHYwBMmXtOfI+cHZg==",
"cpu": [
"arm64"
],
"libc": [
"glibc"
],
"license": "SEE LICENSE IN LICENSE.md",
"optional": true,
"os": [
@@ -104,12 +107,15 @@
]
},
"node_modules/@anthropic-ai/claude-agent-sdk-linux-arm64-musl": {
"version": "0.3.177",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64-musl/-/claude-agent-sdk-linux-arm64-musl-0.3.177.tgz",
"integrity": "sha512-v6PMDD3h2erLuTK5S2ZvExqdL3v44OyC70XpKhyqIUnyPaGR9YAMjh//EKdWC+mNvt6mIbRZpaDcHtbASVW8Rw==",
"version": "0.3.183",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64-musl/-/claude-agent-sdk-linux-arm64-musl-0.3.183.tgz",
"integrity": "sha512-ua6XaiCcYYKfd0CY9cjoyYnTQWI2GocpbP7Gwvmr+9taW/lTpQGVQH3FrF2VFKXVSt7AaVE6Z7WN9oPxcxl3VA==",
"cpu": [
"arm64"
],
"libc": [
"musl"
],
"license": "SEE LICENSE IN LICENSE.md",
"optional": true,
"os": [
@@ -117,12 +123,15 @@
]
},
"node_modules/@anthropic-ai/claude-agent-sdk-linux-x64": {
"version": "0.3.177",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64/-/claude-agent-sdk-linux-x64-0.3.177.tgz",
"integrity": "sha512-WDP6puwPHscggNAfvIxyUSHSAjfUEkGRfnMXEPBHOqO+qjX2KGxeE13/ih3EVioeBVOUIqPui6VB05vXLa6T9Q==",
"version": "0.3.183",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64/-/claude-agent-sdk-linux-x64-0.3.183.tgz",
"integrity": "sha512-GvfNp9XsKWFvr0EH3NgX2pqzHPYhFeqhOmVc4A+2e+GdxBMYUEa0ylfPLJItahQU9FkTJAw2oQNnzTHPPm1GxA==",
"cpu": [
"x64"
],
"libc": [
"glibc"
],
"license": "SEE LICENSE IN LICENSE.md",
"optional": true,
"os": [
@@ -130,12 +139,15 @@
]
},
"node_modules/@anthropic-ai/claude-agent-sdk-linux-x64-musl": {
"version": "0.3.177",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64-musl/-/claude-agent-sdk-linux-x64-musl-0.3.177.tgz",
"integrity": "sha512-1cdEO06WoEsl1JnnLCPIlg/8x37GtBsTuj65gIpSjdrImNBjgIuMWVyceP4qaXhFjtQgYK1nx3TpaxEFVDOrDg==",
"version": "0.3.183",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64-musl/-/claude-agent-sdk-linux-x64-musl-0.3.183.tgz",
"integrity": "sha512-wp+p+4xeZOW+h4InMKR7nIdGlgYftXyR+ErOVz7i2tMRcKuYMoc5jRIYjdJkuETMSr5nsRj0rDeO5gG7M6MGZQ==",
"cpu": [
"x64"
],
"libc": [
"musl"
],
"license": "SEE LICENSE IN LICENSE.md",
"optional": true,
"os": [
@@ -143,9 +155,9 @@
]
},
"node_modules/@anthropic-ai/claude-agent-sdk-win32-arm64": {
"version": "0.3.177",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-arm64/-/claude-agent-sdk-win32-arm64-0.3.177.tgz",
"integrity": "sha512-xLgDWnZaYohtFrkgEIkGZdP+rp4sXxAMbbpEvEp0LK1vAYmJam/ztT2yoK6gfI58IbToJq1WGUEX2HVnE65yOg==",
"version": "0.3.183",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-arm64/-/claude-agent-sdk-win32-arm64-0.3.183.tgz",
"integrity": "sha512-cGyMC9YDsrCQ4av74dMVa2liOb5oLFX4+1SxwJGRCW7mBVBazcM6rg7ifWbd9XfkDhNPKOIfyiloipyMfoaE4g==",
"cpu": [
"arm64"
],
@@ -156,9 +168,9 @@
]
},
"node_modules/@anthropic-ai/claude-agent-sdk-win32-x64": {
"version": "0.3.177",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-x64/-/claude-agent-sdk-win32-x64-0.3.177.tgz",
"integrity": "sha512-SIdQLbtF//rYK4KDBNpUPyjyui7NwCFPZ2/3vyW3TR8R8xynkNq3cLis90FnPSgxaSshi38vkJYWh+9kGDB7zg==",
"version": "0.3.183",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-x64/-/claude-agent-sdk-win32-x64-0.3.183.tgz",
"integrity": "sha512-h/XzbrSmXGroTk/FYKR6J4/8G9vDb1HUUUeNXeBGqGW1kppIiWPJKLRzjtSe0brVjADOKOT6tE5IHK0mV/1gBw==",
"cpu": [
"x64"
],
@@ -169,9 +181,9 @@
]
},
"node_modules/@anthropic-ai/sdk": {
"version": "0.104.1",
"resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-0.104.1.tgz",
"integrity": "sha512-gGACa/+IaiXzRRmF96aOhamoBgapKRBiFWbmmTFP8aMkpaEcuStF+Q61bjo4vPxBM7gqWJNZqsngslRdnLHv0Q==",
"version": "0.105.0",
"resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-0.105.0.tgz",
"integrity": "sha512-sDyu+aM9cE6uZE+HgRjjHRb+qqb87GHZOx+8bE0YlWetdL1YcVLxn8h9ltxGOflyChTe6PMEo50kMQV4cw0hfg==",
"license": "MIT",
"dependencies": {
"json-schema-to-ts": "^3.1.1",
@@ -630,6 +642,9 @@
"arm64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@@ -647,6 +662,9 @@
"arm64"
],
"dev": true,
"libc": [
"musl"
],
"license": "MIT",
"optional": true,
"os": [
@@ -664,6 +682,9 @@
"ppc64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@@ -681,6 +702,9 @@
"s390x"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@@ -698,6 +722,9 @@
"x64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@@ -715,6 +742,9 @@
"x64"
],
"dev": true,
"libc": [
"musl"
],
"license": "MIT",
"optional": true,
"os": [
@@ -893,27 +923,27 @@
"license": "MIT"
},
"node_modules/@types/node": {
"version": "25.9.3",
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.9.3.tgz",
"integrity": "sha512-603BddQMv3pUcr4U2dhujk83N2tTDVr/34wII2B6bJy6g+8WD6yUb11jszNs0gdi4PesVWl7ABt8nYMVpnLUcg==",
"version": "26.0.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.0.0.tgz",
"integrity": "sha512-vf2YFi1iY9lHGwNJMs01biZFbKJkrZR1T6/MlzjhJLPdntOHLhTrDSnSVcdtvjihi4VQNlrFRIxLsDBlQpAipA==",
"dev": true,
"license": "MIT",
"dependencies": {
"undici-types": ">=7.24.0 <7.24.7"
"undici-types": "~8.3.0"
}
},
"node_modules/@typescript-eslint/eslint-plugin": {
"version": "8.61.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.61.0.tgz",
"integrity": "sha512-bFNvl9ZczlVb+wR2Akszf3gHfKVj/8WanXaGJ3UstTA7brNKg0cNdk6X1Psu5V7MZ2oQtzZKOEzIUehaoxbDGw==",
"version": "8.61.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.61.1.tgz",
"integrity": "sha512-ZPlVl3PB3et/59Ne0fv/sci6ZXz4T4Hp4nTJ56i/Y0gR89ARb+KphojTq6j+56E5PIezmOIOOWyY+aWQFd+IkQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@eslint-community/regexpp": "^4.12.2",
"@typescript-eslint/scope-manager": "8.61.0",
"@typescript-eslint/type-utils": "8.61.0",
"@typescript-eslint/utils": "8.61.0",
"@typescript-eslint/visitor-keys": "8.61.0",
"@typescript-eslint/scope-manager": "8.61.1",
"@typescript-eslint/type-utils": "8.61.1",
"@typescript-eslint/utils": "8.61.1",
"@typescript-eslint/visitor-keys": "8.61.1",
"ignore": "^7.0.5",
"natural-compare": "^1.4.0",
"ts-api-utils": "^2.5.0"
@@ -926,22 +956,22 @@
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"@typescript-eslint/parser": "^8.61.0",
"@typescript-eslint/parser": "^8.61.1",
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
"typescript": ">=4.8.4 <6.1.0"
}
},
"node_modules/@typescript-eslint/parser": {
"version": "8.61.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.61.0.tgz",
"integrity": "sha512-5B7PfA2e1NQGCnDHd/0lW7W3gvp3d59Ryw54FYO8Uswxo9f6ikw3AZV+Xj/TvpImmpsiYyUqAfhC6kJID1jF6w==",
"version": "8.61.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.61.1.tgz",
"integrity": "sha512-PJ5vePq5/ognBbrIcoC5+SHO5dfpeLPzP9FpLkzWrguoYQEeeSjlJpVwOpo1JRSTEi7dRcwNy4h4dzV70PqHcg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/scope-manager": "8.61.0",
"@typescript-eslint/types": "8.61.0",
"@typescript-eslint/typescript-estree": "8.61.0",
"@typescript-eslint/visitor-keys": "8.61.0",
"@typescript-eslint/scope-manager": "8.61.1",
"@typescript-eslint/types": "8.61.1",
"@typescript-eslint/typescript-estree": "8.61.1",
"@typescript-eslint/visitor-keys": "8.61.1",
"debug": "^4.4.3"
},
"engines": {
@@ -957,14 +987,14 @@
}
},
"node_modules/@typescript-eslint/project-service": {
"version": "8.61.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.61.0.tgz",
"integrity": "sha512-DV42F7MLJO6Rax7SK1yg43tcnEfGUrurSpSxKuVX+a3RCTzBlH3fuxprrOJXKCJGAaw82xXocikJ0uQaqwXgGA==",
"version": "8.61.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.61.1.tgz",
"integrity": "sha512-PrC4JYGmR241lYnfhmKGTXkFqv8+ymbTFgSAY0fVXpY82/QkMw5TZPl+vGzuDDU2QYJk9fIDOBTntF+yDv9LEA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/tsconfig-utils": "^8.61.0",
"@typescript-eslint/types": "^8.61.0",
"@typescript-eslint/tsconfig-utils": "^8.61.1",
"@typescript-eslint/types": "^8.61.1",
"debug": "^4.4.3"
},
"engines": {
@@ -979,14 +1009,14 @@
}
},
"node_modules/@typescript-eslint/scope-manager": {
"version": "8.61.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.61.0.tgz",
"integrity": "sha512-IWdXFHFSb6mlC3HPc7QsLDm5zYEbUla6trDEHf32D3/dnuUyXd87plScSNXSbm0/RxMvObpI17sv/EDTGrGZkA==",
"version": "8.61.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.61.1.tgz",
"integrity": "sha512-L2bdIeoQS8FlKAvONAr20w6OcLXeB+qiDKbAooS9A0Ben+iSIkBef0FxqwKWYqt5sa0i4KJtxVyVmhMylKzF5w==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/types": "8.61.0",
"@typescript-eslint/visitor-keys": "8.61.0"
"@typescript-eslint/types": "8.61.1",
"@typescript-eslint/visitor-keys": "8.61.1"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -997,9 +1027,9 @@
}
},
"node_modules/@typescript-eslint/tsconfig-utils": {
"version": "8.61.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.61.0.tgz",
"integrity": "sha512-O5Amvdv9ztMpxpf+vmFULGG78IE6Qwdr3bCGvqwG4nwc9H2qXkOYJJnRbRHyMkQTjv1d03olqwwwzHLMqpFePQ==",
"version": "8.61.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.61.1.tgz",
"integrity": "sha512-UN/H4di+OO7EWx2ovME+8t31YO+KVnK0RRKEHR3kOt21/Ay8BOq3M1OMvWs5vNiqcFCYGYoxK3MXPZzmMUE+yg==",
"dev": true,
"license": "MIT",
"engines": {
@@ -1014,15 +1044,15 @@
}
},
"node_modules/@typescript-eslint/type-utils": {
"version": "8.61.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.61.0.tgz",
"integrity": "sha512-TuBiQYIkd97yBfInHCTKVYMbX4kvEmpOEuixIuzCU9p8BGT1SfyyO0d0IfDMbPIHcjn/hWnusUX5e8v5Xg+X8A==",
"version": "8.61.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.61.1.tgz",
"integrity": "sha512-GYRicKmVK0C4fsKgaACaknOUAq9Oa2kwsjnpFhFcS/5p4Ht5IP9OVLbgIgcK4SRk92nVHFluurg1lumD9dBcLw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/types": "8.61.0",
"@typescript-eslint/typescript-estree": "8.61.0",
"@typescript-eslint/utils": "8.61.0",
"@typescript-eslint/types": "8.61.1",
"@typescript-eslint/typescript-estree": "8.61.1",
"@typescript-eslint/utils": "8.61.1",
"debug": "^4.4.3",
"ts-api-utils": "^2.5.0"
},
@@ -1039,9 +1069,9 @@
}
},
"node_modules/@typescript-eslint/types": {
"version": "8.61.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.61.0.tgz",
"integrity": "sha512-9QTQpZ5Iin4CdIodfbDQFSeiSJKidgYJYug1P9CC2xWgUTvlmixViqDZNciMjwLBZyJnG4tGmPl97rVAFb1AJg==",
"version": "8.61.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.61.1.tgz",
"integrity": "sha512-G+CRlPqLv7Bz1IZVs03x5K59F1veqL0EJUROAdGhKsEq8qOiRiZbI+HUojPq5l0fEGOKModD9br6lObhB8zkoA==",
"dev": true,
"license": "MIT",
"engines": {
@@ -1053,16 +1083,16 @@
}
},
"node_modules/@typescript-eslint/typescript-estree": {
"version": "8.61.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.61.0.tgz",
"integrity": "sha512-42zatd5qSvvcV1JdDBCLxYRznvP4eIHpPoZXdkPFnAmanA4FuZ5dibSnCBggY8hQnqajPpoGjXFdZ7fIJKQnlA==",
"version": "8.61.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.61.1.tgz",
"integrity": "sha512-u+oQD3BqYWPc8YV9Zab4vaJElJuwOLPRc10Jm1o/qS+6Qwen14HCWwx0Seo4LnSn2wxea2Ik8DxPt2/FHmuhrg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/project-service": "8.61.0",
"@typescript-eslint/tsconfig-utils": "8.61.0",
"@typescript-eslint/types": "8.61.0",
"@typescript-eslint/visitor-keys": "8.61.0",
"@typescript-eslint/project-service": "8.61.1",
"@typescript-eslint/tsconfig-utils": "8.61.1",
"@typescript-eslint/types": "8.61.1",
"@typescript-eslint/visitor-keys": "8.61.1",
"debug": "^4.4.3",
"minimatch": "^10.2.2",
"semver": "^7.7.3",
@@ -1081,16 +1111,16 @@
}
},
"node_modules/@typescript-eslint/utils": {
"version": "8.61.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.61.0.tgz",
"integrity": "sha512-3bzFt7ImFMW/jVYwJamDoe/dMOdFLSC6pom6rRjdh4SZJEYupyMzem8e7vKZLclLfpHjlwSAXOUxtKxGXUiLqA==",
"version": "8.61.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.61.1.tgz",
"integrity": "sha512-1+P/3Dj6jvtybE1q0HQ6yBt/gq+oKJyLdEv4HdnqasaEXRSYCAsD59mXEVQnM/ULNdQxbX77tdG4jPRjIS6knA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@eslint-community/eslint-utils": "^4.9.1",
"@typescript-eslint/scope-manager": "8.61.0",
"@typescript-eslint/types": "8.61.0",
"@typescript-eslint/typescript-estree": "8.61.0"
"@typescript-eslint/scope-manager": "8.61.1",
"@typescript-eslint/types": "8.61.1",
"@typescript-eslint/typescript-estree": "8.61.1"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -1105,13 +1135,13 @@
}
},
"node_modules/@typescript-eslint/visitor-keys": {
"version": "8.61.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.61.0.tgz",
"integrity": "sha512-QVLZu3ZPQEE+HICQyAMZ2yLQhxf0meY/wx6Hx14YcTNj13JB3qHlX3lJ02L3fLGHgERRH71kvYDwiXIguT3AjQ==",
"version": "8.61.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.61.1.tgz",
"integrity": "sha512-6fJ9MHWtK14C1DSkiMlHUSOmrVebL7150xZJBlJiL62jjhIA4JmOq6flwBgDxIdBKKdoiZRel+dfPD5MLfny3w==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/types": "8.61.0",
"@typescript-eslint/types": "8.61.1",
"eslint-visitor-keys": "^5.0.0"
},
"engines": {
@@ -2330,9 +2360,9 @@
}
},
"node_modules/hono": {
"version": "4.12.25",
"resolved": "https://registry.npmjs.org/hono/-/hono-4.12.25.tgz",
"integrity": "sha512-2NFaIyNVgJmBs/ecmtGzlmluTFs5cHEWGTdu0t1HBwYzoGXOL5nUQBRMXsXWla5i4KkG//QMzVP88m1+I3fdAQ==",
"version": "4.12.26",
"resolved": "https://registry.npmjs.org/hono/-/hono-4.12.26.tgz",
"integrity": "sha512-uyZtpnYxM9CmQ7QsQknM4zN8EftNqhON1qYeIKM0Se67CCEe2c44xyGURwB0axX2fBDu1dqHrHAc1hmNT8ITkw==",
"license": "MIT",
"peer": true,
"engines": {
@@ -2678,6 +2708,9 @@
"arm64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -2699,6 +2732,9 @@
"arm64"
],
"dev": true,
"libc": [
"musl"
],
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -2720,6 +2756,9 @@
"x64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -2741,6 +2780,9 @@
"x64"
],
"dev": true,
"libc": [
"musl"
],
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -2912,9 +2954,9 @@
"license": "MIT"
},
"node_modules/nanoid": {
"version": "3.3.12",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.12.tgz",
"integrity": "sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==",
"version": "3.3.13",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.13.tgz",
"integrity": "sha512-sPdqC6ByMVVGvF1ynvvMo0/o+oD1VX7DaHhijt1bFgjvBkHBib4t49GoNDhf2NDta4oeUNlaGbSt5K7qjZ955Q==",
"dev": true,
"funding": [
{
@@ -3724,9 +3766,9 @@
}
},
"node_modules/undici-types": {
"version": "7.24.6",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz",
"integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==",
"version": "8.3.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz",
"integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==",
"dev": true,
"license": "MIT"
},

View File

@@ -3,7 +3,7 @@
"publishConfig": {
"access": "public"
},
"version": "0.45.1",
"version": "0.48.0",
"description": "An ACP-compatible coding agent powered by the Claude Agent SDK (TypeScript)",
"main": "dist/lib.js",
"types": "dist/lib.d.ts",
@@ -60,16 +60,16 @@
"author": "Zed Industries",
"license": "Apache-2.0",
"dependencies": {
"@agentclientprotocol/sdk": "0.25.1",
"@anthropic-ai/claude-agent-sdk": "0.3.177",
"@agentclientprotocol/sdk": "0.28.1",
"@anthropic-ai/claude-agent-sdk": "0.3.183",
"zod": "^3.25.0 || ^4.0.0"
},
"devDependencies": {
"@anthropic-ai/sdk": "0.104.1",
"@anthropic-ai/sdk": "0.105.0",
"@eslint/js": "10.0.1",
"@types/node": "25.9.3",
"@typescript-eslint/eslint-plugin": "8.61.0",
"@typescript-eslint/parser": "8.61.0",
"@types/node": "26.0.0",
"@typescript-eslint/eslint-plugin": "8.61.1",
"@typescript-eslint/parser": "8.61.1",
"eslint": "10.5.0",
"eslint-config-prettier": "10.1.8",
"globals": "17.6.0",

File diff suppressed because it is too large Load Diff

View File

@@ -125,6 +125,34 @@ function questionCustomFieldKey(index: number): string {
return `question_${index}_custom`;
}
/**
* `_meta` key under which a bridged enum option carries its structured
* `description`/`preview`, since ACP's `EnumOption` has no field for either.
* Namespaced like the agent's other `_meta` extensions (`_claude/...`).
*/
const OPTION_META_KEY = "_claude/askUserQuestionOption";
/** A single option as supplied by the AskUserQuestion tool. */
type AskUserQuestionOption = AskUserQuestion["options"][number];
/**
* Build the `_meta` payload that carries an option's structured `description`
* and optional `preview` for clients that can render them as distinct fields.
* Returns `undefined` when neither is present, so we don't emit an empty `_meta`.
*/
function askUserQuestionOptionMeta(
option: AskUserQuestionOption,
): NonNullable<EnumOption["_meta"]> | undefined {
const detail: { description?: string; preview?: string } = {};
if (option.description) {
detail.description = option.description;
}
if (option.preview) {
detail.preview = option.preview;
}
return Object.keys(detail).length > 0 ? { [OPTION_META_KEY]: detail } : undefined;
}
/**
* Render the AskUserQuestion tool's questions as an ACP form elicitation.
*
@@ -149,10 +177,25 @@ export function askUserQuestionsToCreateRequest(
const properties: Record<string, ElicitationPropertySchema> = {};
questions.forEach((question, index) => {
const options: EnumOption[] = question.options.map((option) => ({
const: option.label,
title: option.description ? `${option.label} — ${option.description}` : option.label,
}));
const options: EnumOption[] = question.options.map((option) => {
const enumOption: EnumOption = {
const: option.label,
// `title` stays a flattened "label — description" string so clients that
// only read `const`/`title` still surface the description. Clients that
// understand the `_meta` below should prefer its structured fields (and
// treat `const` as the clean label) rather than parsing this title.
title: option.description ? `${option.label} — ${option.description}` : option.label,
};
// The SDK option carries a `description` (secondary text) and an optional
// `preview` (mockups, code snippets, comparisons shown on focus). Neither
// has a structural slot in `EnumOption`, so forward them under ACP's
// reserved `_meta` extension point for clients that can render them.
const meta = askUserQuestionOptionMeta(option);
if (meta) {
enumOption._meta = meta;
}
return enumOption;
});
// For a single question the prompt is carried by `message`, so we don't
// repeat it in the field description. With multiple questions each field

View File

@@ -2,8 +2,7 @@ import { describe, it, expect, beforeEach, afterEach, vi } from "vitest";
import * as fs from "node:fs";
import * as path from "node:path";
import * as os from "node:os";
import type { AgentSideConnection } from "@agentclientprotocol/sdk";
import type { ClaudeAcpAgent as ClaudeAcpAgentType } from "../acp-agent.js";
import type { AcpClient, ClaudeAcpAgent as ClaudeAcpAgentType } from "../acp-agent.js";
const { querySpy } = vi.hoisted(() => ({
querySpy: vi.fn(),
@@ -21,13 +20,13 @@ describe("ClaudeAcpAgent settings", () => {
let tempDir: string;
let originalClaudeConfigDir: string | undefined;
function createMockClient(): AgentSideConnection {
function createMockClient(): AcpClient {
return {
sessionUpdate: async () => {},
requestPermission: async () => ({ outcome: { outcome: "cancelled" } }),
readTextFile: async () => ({ content: "" }),
writeTextFile: async () => ({}),
} as unknown as AgentSideConnection;
} as unknown as AcpClient;
}
function mockQuery() {

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,9 @@
import { mkdtemp, rm } from "node:fs/promises";
import * as os from "node:os";
import * as path from "node:path";
import { AgentSideConnection, SessionNotification } from "@agentclientprotocol/sdk";
import { SessionNotification } from "@agentclientprotocol/sdk";
import type { Options } from "@anthropic-ai/claude-agent-sdk";
import type { ClaudeAcpAgent as ClaudeAcpAgentType } from "../acp-agent.js";
import type { AcpClient, ClaudeAcpAgent as ClaudeAcpAgentType } from "../acp-agent.js";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
let capturedOptions: Options | undefined;
@@ -52,7 +52,7 @@ describe("additionalRoots", () => {
requestPermission: async () => ({ outcome: { outcome: "cancelled" } }),
readTextFile: async () => ({ content: "" }),
writeTextFile: async () => ({}),
} as unknown as AgentSideConnection);
} as unknown as AcpClient);
});
afterEach(

View File

@@ -0,0 +1,42 @@
import { describe, it, expect } from "vitest";
import { randomUUID } from "crypto";
import { query } from "@anthropic-ai/claude-agent-sdk";
import type { SDKUserMessage } from "@anthropic-ai/claude-agent-sdk";
import { Pushable } from "../utils.js";
import { discoverCustomAgents, BUILTIN_AGENT_NAMES } from "../acp-agent.js";
// `discoverCustomAgents` distinguishes user/plugin-configured agents from
// Claude Code's built-in subagents by name (BUILTIN_AGENT_NAMES), since the
// SDK's `AgentInfo` carries no built-in/source flag. That hardcoded set drifts
// 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.
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>();
const q = query({
prompt: input,
options: {
systemPrompt: { type: "preset", preset: "claude_code" },
sessionId: randomUUID(),
// No setting sources → no user/project/local custom agents are loaded,
// so `supportedAgents()` reports exactly the intrinsic built-ins
// regardless of what the developer has in ~/.claude/agents.
settingSources: [],
includePartialMessages: true,
},
});
try {
const reported = (await q.supportedAgents()).map((a) => a.name).sort();
expect(reported).toEqual([...BUILTIN_AGENT_NAMES].sort());
// With the built-ins being the only agents present, discovery surfaces
// nothing — the ACP "Agent" picker is correctly omitted.
expect(await discoverCustomAgents(q)).toEqual([]);
} finally {
input.end();
q.return(undefined);
}
}, 30000);
});

View File

@@ -1,6 +1,5 @@
import { describe, expect, it, Mock, vi, afterEach, beforeEach } from "vitest";
import { ClaudeAcpAgent } from "../acp-agent.js";
import { AgentSideConnection } from "@agentclientprotocol/sdk";
import { AcpClient, ClaudeAcpAgent } from "../acp-agent.js";
const mockQuery = vi.hoisted(() =>
vi.fn(() => ({
@@ -39,7 +38,7 @@ describe("authorization", () => {
async function createAgentMock(): Promise<[ClaudeAcpAgent, Mock]> {
const connectionMock = {
sessionUpdate: async (_: any) => {},
} as AgentSideConnection;
} as AcpClient;
const agent = new ClaudeAcpAgent(connectionMock);

View File

@@ -1,7 +1,7 @@
import { describe, it, expect, beforeEach, afterEach, vi } from "vitest";
import { AgentSideConnection, RequestError, SessionNotification } from "@agentclientprotocol/sdk";
import { RequestError, SessionNotification } from "@agentclientprotocol/sdk";
import type { Options } from "@anthropic-ai/claude-agent-sdk";
import type { ClaudeAcpAgent as ClaudeAcpAgentType } from "../acp-agent.js";
import type { AcpClient, ClaudeAcpAgent as ClaudeAcpAgentType } from "../acp-agent.js";
import * as fs from "node:fs";
import * as os from "node:os";
import * as path from "node:path";
@@ -47,13 +47,13 @@ describe("createSession options merging", () => {
let agent: ClaudeAcpAgentType;
let ClaudeAcpAgent: typeof ClaudeAcpAgentType;
function createMockClient(): AgentSideConnection {
function createMockClient(): AcpClient {
return {
sessionUpdate: async (_notification: SessionNotification) => {},
requestPermission: async () => ({ outcome: { outcome: "cancelled" } }),
readTextFile: async () => ({ content: "" }),
writeTextFile: async () => ({}),
} as unknown as AgentSideConnection;
} as unknown as AcpClient;
}
beforeEach(async () => {
@@ -550,14 +550,15 @@ describe("createSession options merging", () => {
});
it("rejects a cwd that points at a file with invalidParams", async () => {
const file = path.join(os.tmpdir(), "claude-acp-cwd-is-a-file.txt");
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "claude-acp-cwd-is-a-file-"));
const file = path.join(dir, "not-a-directory.txt");
fs.writeFileSync(file, "not a directory");
try {
await expect(agent.newSession({ cwd: file, mcpServers: [] })).rejects.toMatchObject({
code: RequestError.invalidParams().code,
});
} finally {
fs.rmSync(file, { force: true });
fs.rmSync(dir, { recursive: true, force: true });
}
});

View File

@@ -1,5 +1,9 @@
import { describe, it, expect } from "vitest";
import type { CreateElicitationRequest, CreateElicitationResponse } from "@agentclientprotocol/sdk";
import type {
CreateElicitationRequest,
CreateElicitationResponse,
EnumOption,
} from "@agentclientprotocol/sdk";
import type { ElicitationRequest } from "@anthropic-ai/claude-agent-sdk";
import {
applyAskElicitationResponse,
@@ -19,14 +23,18 @@ const SESSION_ID = "session-1";
*/
function mkQuestion(
question: string,
options: Array<{ label: string; description?: string }>,
options: Array<{ label: string; description?: string; preview?: string }>,
opts: { header?: string; multiSelect?: boolean } = {},
): AskUserQuestion {
return {
question,
header: opts.header ?? "",
multiSelect: opts.multiSelect ?? false,
options: options.map((o) => ({ label: o.label, description: o.description ?? "" })),
options: options.map((o) => ({
label: o.label,
description: o.description ?? "",
...(o.preview ? { preview: o.preview } : {}),
})),
} as AskUserQuestion;
}
@@ -179,7 +187,14 @@ describe("askUserQuestionsToCreateRequest", () => {
title: "Library",
description: undefined,
oneOf: [
{ const: "date-fns", title: "date-fns — Lightweight" },
{
const: "date-fns",
title: "date-fns — Lightweight",
// Structured description forwarded under `_meta` so clients can render
// it as secondary text instead of parsing it out of the title.
_meta: { "_claude/askUserQuestionOption": { description: "Lightweight" } },
},
// No description → no `_meta` emitted.
{ const: "luxon", title: "luxon" },
],
});
@@ -187,6 +202,47 @@ describe("askUserQuestionsToCreateRequest", () => {
expect(schema.properties?.["Which library?"]).toBeUndefined();
});
it("forwards option description and preview under _meta for rich clients", () => {
const questions = [
mkQuestion("Which layout?", [
{
label: "Grid",
description: "Cards in a responsive grid",
preview: "```\n[ ] [ ] [ ]\n[ ] [ ] [ ]\n```",
},
{ label: "List", description: "Stacked rows" },
{ label: "Plain" },
]),
];
const schema = (
askUserQuestionsToCreateRequest(questions, SESSION_ID, undefined) as Extract<
CreateElicitationRequest,
{ mode: "form" }
>
).requestedSchema;
const oneOf = (schema.properties?.["question_0"] as { oneOf: EnumOption[] }).oneOf;
// Both description and preview travel structurally; the title still flattens
// the description for clients that only read const/title.
expect(oneOf[0]).toEqual({
const: "Grid",
title: "Grid — Cards in a responsive grid",
_meta: {
"_claude/askUserQuestionOption": {
description: "Cards in a responsive grid",
preview: "```\n[ ] [ ] [ ]\n[ ] [ ] [ ]\n```",
},
},
});
// Description only → preview omitted from _meta.
expect(oneOf[1]._meta).toEqual({
"_claude/askUserQuestionOption": { description: "Stacked rows" },
});
// Neither → no _meta at all.
expect(oneOf[2]._meta).toBeUndefined();
});
it("includes a per-question optional free-text custom-answer field", () => {
const questions = [
mkQuestion("Which?", [{ label: "A" }, { label: "B" }]),
@@ -208,7 +264,6 @@ describe("askUserQuestionsToCreateRequest", () => {
type: "string",
title: "Other",
});
expect(schema.properties?.["customAnswer"]).toBeUndefined();
});
it("builds an array property for multi-select questions and includes per-field question text", () => {

View File

@@ -1,7 +1,7 @@
import { describe, it, expect, beforeEach, vi } from "vitest";
import { AgentSideConnection, SessionNotification } from "@agentclientprotocol/sdk";
import { SessionNotification } from "@agentclientprotocol/sdk";
import type { ModelInfo } from "@anthropic-ai/claude-agent-sdk";
import type { ClaudeAcpAgent as ClaudeAcpAgentType } from "../acp-agent.js";
import type { AcpClient, ClaudeAcpAgent as ClaudeAcpAgentType } from "../acp-agent.js";
const { registerHookCallbackSpy } = vi.hoisted(() => ({
registerHookCallbackSpy: vi.fn(),
@@ -84,7 +84,7 @@ describe("session config options", () => {
let setModelSpy: ReturnType<typeof vi.fn>;
let applyFlagSettingsSpy: ReturnType<typeof vi.fn>;
function createMockClient(): AgentSideConnection {
function createMockClient(): AcpClient {
return {
sessionUpdate: async (notification: SessionNotification) => {
sessionUpdates.push(notification);
@@ -92,7 +92,7 @@ describe("session config options", () => {
requestPermission: async () => ({ outcome: { outcome: "cancelled" } }),
readTextFile: async () => ({ content: "" }),
writeTextFile: async () => ({}),
} as unknown as AgentSideConnection;
} as unknown as AcpClient;
}
function populateSession() {
@@ -216,6 +216,31 @@ describe("session config options", () => {
).rejects.toThrow("Invalid value for config option mode: invalid-mode");
});
it("rejects mode and config changes once the query stream has closed (husk session)", async () => {
// After an unexpected stream death the session lingers as a husk
// (queryClosed=true) so prompt() can answer with a clear error. The
// config/mode handlers must do the same rather than calling setModel/
// setPermissionMode on the closed query.
const session = (agent as unknown as { sessions: Record<string, { queryClosed?: boolean }> })
.sessions[SESSION_ID];
session.queryClosed = true;
await expect(
agent.setSessionConfigOption({
sessionId: SESSION_ID,
configId: "model",
value: "claude-sonnet-4-6",
}),
).rejects.toThrow(/start a new session/);
await expect(agent.setSessionMode({ sessionId: SESSION_ID, modeId: "plan" })).rejects.toThrow(
/start a new session/,
);
// Short-circuited before touching the (closed) query.
expect(setModelSpy).not.toHaveBeenCalled();
expect(setPermissionModeSpy).not.toHaveBeenCalled();
});
it("changes mode, sends current_mode_update but not config_option_update", async () => {
await agent.setSessionConfigOption({
sessionId: SESSION_ID,

View File

@@ -1,18 +1,18 @@
import { describe, it, expect } from "vitest";
import { randomUUID } from "crypto";
import { AgentSideConnection, RequestError, SessionNotification } from "@agentclientprotocol/sdk";
import { RequestError, SessionNotification } from "@agentclientprotocol/sdk";
import { query, getSessionMessages } from "@anthropic-ai/claude-agent-sdk";
import { ClaudeAcpAgent } from "../acp-agent.js";
import { AcpClient, ClaudeAcpAgent } from "../acp-agent.js";
import { Pushable } from "../utils.js";
import type { SDKUserMessage } from "@anthropic-ai/claude-agent-sdk";
function createMockClient(): AgentSideConnection {
function createMockClient(): AcpClient {
return {
sessionUpdate: async (_notification: SessionNotification) => {},
requestPermission: async () => ({ outcome: { outcome: "cancelled" } }),
readTextFile: async () => ({ content: "" }),
writeTextFile: async () => ({}),
} as unknown as AgentSideConnection;
} as unknown as AcpClient;
}
describe.skipIf(!process.env.RUN_INTEGRATION_TESTS)("session load/resume lifecycle", () => {
@@ -165,7 +165,7 @@ describe.skipIf(!process.env.RUN_INTEGRATION_TESTS)("session load/resume lifecyc
requestPermission: async () => ({ outcome: { outcome: "cancelled" } }),
readTextFile: async () => ({ content: "" }),
writeTextFile: async () => ({}),
} as unknown as AgentSideConnection;
} as unknown as AcpClient;
const commandName =
"<command-name>/model</command-name>\n <command-message>model</command-message>\n <command-args>opus</command-args>";
@@ -274,7 +274,7 @@ describe.skipIf(!process.env.RUN_INTEGRATION_TESTS)("session load/resume lifecyc
requestPermission: async () => ({ outcome: { outcome: "cancelled" } }),
readTextFile: async () => ({ content: "" }),
writeTextFile: async () => ({}),
} as unknown as AgentSideConnection;
} as unknown as AcpClient;
// Exact shape from https://github.com/zed-industries/claude-code-acp/issues/579.
const concatenated =

View File

@@ -7,13 +7,26 @@ import * as os from "node:os";
describe("SettingsManager", () => {
let tempDir: string;
let settingsManager: SettingsManager;
let originalConfigDir: string | undefined;
beforeEach(async () => {
tempDir = await fs.promises.mkdtemp(path.join(os.tmpdir(), "settings-test-"));
// Isolate the user tier. resolveSettings reads the user settings.json from
// CLAUDE_CONFIG_DIR at call time; without this it falls back to the real
// ~/.claude and the developer's own settings (e.g. availableModels) leak
// into the merge, making union-based assertions fail on their machine.
originalConfigDir = process.env.CLAUDE_CONFIG_DIR;
process.env.CLAUDE_CONFIG_DIR = path.join(tempDir, "user-config");
await fs.promises.mkdir(process.env.CLAUDE_CONFIG_DIR, { recursive: true });
});
afterEach(async () => {
settingsManager?.dispose();
if (originalConfigDir === undefined) {
delete process.env.CLAUDE_CONFIG_DIR;
} else {
process.env.CLAUDE_CONFIG_DIR = originalConfigDir;
}
await fs.promises.rm(tempDir, { recursive: true, force: true });
});

View File

@@ -1,5 +1,5 @@
import { describe, it, expect, beforeEach } from "vitest";
import { AgentSideConnection, ClientCapabilities } from "@agentclientprotocol/sdk";
import { ClientCapabilities } from "@agentclientprotocol/sdk";
import { ImageBlockParam, ToolResultBlockParam } from "@anthropic-ai/sdk/resources";
import {
BetaMCPToolResultBlock,
@@ -10,7 +10,7 @@ import {
BetaBashCodeExecutionResultBlock,
BetaBashCodeExecutionToolResultBlockParam,
} from "@anthropic-ai/sdk/resources/beta.mjs";
import { toAcpNotifications, ToolUseCache, Logger } from "../acp-agent.js";
import { AcpClient, toAcpNotifications, ToolUseCache, Logger } from "../acp-agent.js";
import {
toolUpdateFromToolResult,
createPostToolUseHook,
@@ -25,7 +25,7 @@ import {
} from "../tools.js";
describe("rawOutput in tool call updates", () => {
const mockClient = {} as AgentSideConnection;
const mockClient = {} as AcpClient;
const mockLogger: Logger = { log: () => {}, error: () => {} };
it("should include rawOutput with string content for tool_result", () => {
@@ -425,7 +425,7 @@ describe("rawOutput in tool call updates", () => {
});
describe("Bash terminal output", () => {
const mockClient = {} as AgentSideConnection;
const mockClient = {} as AcpClient;
const mockLogger: Logger = { log: () => {}, error: () => {} };
const bashToolUse = {
@@ -702,6 +702,77 @@ describe("Bash terminal output", () => {
});
});
});
describe("with image array tool_result (local Bash image output path)", () => {
// The local Bash tool emits image content as
// `[{ type: "image", source: { type: "base64", ... } }]` when a
// command produces an image (e.g. piping a base64 data URI).
const makeImageBashResult = (
data: string,
media_type: "image/png" | "image/jpeg" | "image/gif" | "image/webp" = "image/png",
): ToolResultBlockParam => ({
type: "tool_result",
tool_use_id: "toolu_bash",
content: [
{
type: "image",
source: { type: "base64", media_type, data },
} as ImageBlockParam,
],
});
it("should surface image content as ACP image content (terminal disabled)", () => {
const toolResult = makeImageBashResult("iVBORw0KGgo=");
const update = toolUpdateFromToolResult(toolResult, bashToolUse, false);
expect(update.content).toEqual([
{
type: "content",
content: { type: "image", data: "iVBORw0KGgo=", mimeType: "image/png" },
},
]);
expect(update._meta).toBeUndefined();
});
it("should bypass terminal _meta even when supportsTerminalOutput is true", () => {
// Binary content cannot be streamed through the terminal-output
// _meta channel, so the fix returns ACP content directly and skips
// the terminal info/output/exit triple.
const toolResult = makeImageBashResult("iVBORw0KGgo=", "image/jpeg");
const update = toolUpdateFromToolResult(toolResult, bashToolUse, true);
expect(update.content).toEqual([
{
type: "content",
content: { type: "image", data: "iVBORw0KGgo=", mimeType: "image/jpeg" },
},
]);
expect(update._meta).toBeUndefined();
});
it("should still surface multi-block content with text + image mixed", () => {
const toolResult: ToolResultBlockParam = {
type: "tool_result",
tool_use_id: "toolu_bash",
content: [
{ type: "text", text: "generated:" },
{
type: "image",
source: { type: "base64", media_type: "image/png", data: "AAAA" },
} as ImageBlockParam,
],
};
const update = toolUpdateFromToolResult(toolResult, bashToolUse, false);
expect(update.content).toEqual([
{ type: "content", content: { type: "text", text: "generated:" } },
{
type: "content",
content: { type: "image", data: "AAAA", mimeType: "image/png" },
},
]);
});
});
});
describe("toAcpNotifications with clientCapabilities", () => {
@@ -929,7 +1000,7 @@ describe("Bash terminal output", () => {
sessionUpdate: async (notification: any) => {
hookUpdates.push(notification);
},
} as unknown as AgentSideConnection;
} as unknown as AcpClient;
// Register hook callback by processing tool_use
toAcpNotifications(
@@ -1008,7 +1079,7 @@ describe("Bash terminal output", () => {
sessionUpdate: async (notification: any) => {
hookUpdates.push(notification);
},
} as unknown as AgentSideConnection;
} as unknown as AcpClient;
toAcpNotifications(
[
@@ -1093,7 +1164,7 @@ describe("Bash terminal output", () => {
sessionUpdate: async (notification: any) => {
hookUpdates.push(notification);
},
} as unknown as AgentSideConnection;
} as unknown as AcpClient;
toAcpNotifications(
[
@@ -1147,7 +1218,7 @@ describe("Bash terminal output", () => {
sessionUpdate: async (notification: any) => {
hookUpdates.push(notification);
},
} as unknown as AgentSideConnection;
} as unknown as AcpClient;
toAcpNotifications(
[
@@ -1223,7 +1294,7 @@ describe("Bash terminal output", () => {
sessionUpdate: async (notification: any) => {
hookUpdates.push(notification);
},
} as unknown as AgentSideConnection;
} as unknown as AcpClient;
toAcpNotifications(
[
@@ -1304,7 +1375,7 @@ describe("Bash terminal output", () => {
sessionUpdate: async (notification: any) => {
hookUpdates.push(notification);
},
} as unknown as AgentSideConnection;
} as unknown as AcpClient;
// Step 1: Process tool_use chunk — registers the PostToolUse hook callback
const toolUseChunk = {
@@ -1404,7 +1475,7 @@ describe("Bash terminal output", () => {
sessionUpdate: async (notification: any) => {
hookUpdates.push(notification);
},
} as unknown as AgentSideConnection;
} as unknown as AcpClient;
// Process tool_use (registers hook)
toAcpNotifications(
@@ -1569,7 +1640,7 @@ describe("planEntries - undefined input regression", () => {
});
describe("toAcpNotifications - TodoWrite with undefined input regression", () => {
const mockClient = {} as AgentSideConnection;
const mockClient = {} as AcpClient;
const mockLogger: Logger = { log: () => {}, error: () => {} };
it("should not throw when TodoWrite tool_use has undefined input", () => {
@@ -1704,7 +1775,7 @@ describe("applyTaskCreate / applyTaskUpdate", () => {
});
describe("toAcpNotifications - Task* tools", () => {
const mockClient = {} as AgentSideConnection;
const mockClient = {} as AcpClient;
const mockLogger: Logger = { log: () => {}, error: () => {} };
it("suppresses tool_call for TaskCreate/TaskUpdate/TaskList/TaskGet on tool_use", () => {

View File

@@ -530,7 +530,9 @@ export function toolUpdateFromToolResult(
// Extract output and exit code from either format:
// 1. BetaBashCodeExecutionResultBlock: { type: "bash_code_execution_result", stdout, stderr, return_code }
// 2. Plain string content from a regular tool_result
// 3. Array content (e.g. [{ type: "text", text: "..." }])
// 3. Array content (e.g. [{ type: "text", text: "..." }] for stdout,
// or [{ type: "image", source: {...} }] when the local Bash tool
// produces an image, e.g. piping a base64 data URI)
let output = "";
let exitCode = isError ? 1 : 0;
@@ -545,13 +547,20 @@ export function toolUpdateFromToolResult(
exitCode = bashResult.return_code;
} else if (typeof result === "string") {
output = result;
} else if (
Array.isArray(result) &&
result.length > 0 &&
"text" in result[0] &&
typeof result[0].text === "string"
) {
output = result.map((c: any) => c.text).join("\n");
} else if (Array.isArray(result) && result.length > 0) {
const textOnly = result.every(
(c: any) => c && typeof c === "object" && typeof c.text === "string",
);
if (textOnly) {
output = result.map((c: any) => c.text).join("\n");
} else {
// Image (or mixed non-text) content. Binary payloads can't be
// streamed through the terminal-output _meta channel, so bypass
// it and surface the blocks as ACP content. This handles the
// local Bash tool's image output, which previously failed the
// text-only guard and was silently dropped.
return toAcpContentUpdate(result, isError);
}
}
if (supportsTerminalOutput) {