Compare commits

...

14 Commits

Author SHA1 Message Date
acp-release-bot[bot]
6d608cb399 chore(main): release 0.65.0 (#957)
🤖 I have created a release *beep* *boop*
---


##
[0.65.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.64.2...v0.65.0)
(2026-08-05)


### Features

* **deps-dev:** Bump nanoid from 3.3.16 to 3.3.17
([#951](https://github.com/agentclientprotocol/claude-agent-acp/issues/951))
([b965dd2](b965dd2191))
* **deps-dev:** Bump tinyexec from 1.2.4 to 1.3.0 in the minor group
([#959](https://github.com/agentclientprotocol/claude-agent-acp/issues/959))
([15b4eb4](15b4eb46f3))
* **deps:** Bump @hono/node-server from 1.19.17 to 2.1.0
([#956](https://github.com/agentclientprotocol/claude-agent-acp/issues/956))
([f9123f3](f9123f3e18))
* **deps:** Bump fast-uri from 3.1.4 to 3.1.5
([#952](https://github.com/agentclientprotocol/claude-agent-acp/issues/952))
([0988438](0988438428))
* **steering:** settle a steered turn at idle, not at the interrupt
([#958](https://github.com/agentclientprotocol/claude-agent-acp/issues/958))
([a84b810](a84b81080a))

---
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-08-05 18:43:03 +02:00
Andrey Bragin
a84b81080a feat(steering): settle a steered turn at idle, not at the interrupt (#958)
Steering is delivered at priority `now`, which makes the CLI **abort**
the running cycle instead of folding the message into it. The aborted
cycle ends with an ordinary human-origin `result`, so we answered
`session/prompt` with `end_turn` while the steered work was still going
— its remaining tool calls, its answer, and its file edits then streamed
with no turn in flight.

A steered turn's results now only record their outcome, and the turn
settles at the SDK's `idle` — the only signal spanning both the
interrupted and the steered cycle. The injected message's replay tells
them apart: an idle arriving before it means the steered cycle hasn't
started, so it is swallowed. `session/cancel` and the next prompt still
settle the turn early, with the recorded stop reason.

Four steering tests cover the interrupt, an early idle, the next-prompt
hand-off, and cancel.
2026-08-05 18:41:00 +02:00
dependabot[bot]
b965dd2191 feat(deps-dev): Bump nanoid from 3.3.16 to 3.3.17 (#951)
Bumps [nanoid](https://github.com/ai/nanoid) from 3.3.16 to 3.3.17.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/ai/nanoid/releases">nanoid's
releases</a>.</em></p>
<blockquote>
<h2>3.3.17</h2>
<ul>
<li>Fixed infinite loop on zero size.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/ai/nanoid/blob/main/CHANGELOG.md">nanoid's
changelog</a>.</em></p>
<blockquote>
<h2>3.3.17</h2>
<ul>
<li>Fixed infinite loop on zero size.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="73d6716813"><code>73d6716</code></a>
Release 3.3.17 version</li>
<li><a
href="f9d13f1508"><code>f9d13f1</code></a>
Sync 0 size behaviour with PostCSS 5</li>
<li>See full diff in <a
href="https://github.com/ai/nanoid/compare/3.3.16...3.3.17">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=nanoid&package-manager=npm_and_yarn&previous-version=3.3.16&new-version=3.3.17)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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 this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-05 18:40:03 +02:00
dependabot[bot]
0988438428 feat(deps): Bump fast-uri from 3.1.4 to 3.1.5 (#952)
Bumps [fast-uri](https://github.com/fastify/fast-uri) from 3.1.4 to
3.1.5.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/fastify/fast-uri/releases">fast-uri's
releases</a>.</em></p>
<blockquote>
<h2>v3.1.5</h2>
<h2>⚠️ Security Warning</h2>
<p>Fix for <a
href="https://github.com/fastify/fast-uri/security/advisories/GHSA-7p8r-x3mc-p8w7">https://github.com/fastify/fast-uri/security/advisories/GHSA-7p8r-x3mc-p8w7</a></p>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/fastify/fast-uri/compare/v3.1.4...v3.1.5">https://github.com/fastify/fast-uri/compare/v3.1.4...v3.1.5</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="5e179cbb46"><code>5e179cb</code></a>
Bumped v3.1.5</li>
<li><a
href="2cad02d6ed"><code>2cad02d</code></a>
Merge commit from fork</li>
<li>See full diff in <a
href="https://github.com/fastify/fast-uri/compare/v3.1.4...v3.1.5">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=fast-uri&package-manager=npm_and_yarn&previous-version=3.1.4&new-version=3.1.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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 this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-05 18:39:45 +02:00
dependabot[bot]
15b4eb46f3 feat(deps-dev): Bump tinyexec from 1.2.4 to 1.3.0 in the minor group (#959)
Bumps the minor group with 1 update:
[tinyexec](https://github.com/tinylibs/tinyexec).

Updates `tinyexec` from 1.2.4 to 1.3.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/tinylibs/tinyexec/releases">tinyexec's
releases</a>.</em></p>
<blockquote>
<h2>1.3.0</h2>
<h2>What's Changed</h2>
<ul>
<li>chore(deps-dev): bump the development-dependencies group with 5
updates by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/tinylibs/tinyexec/pull/143">tinylibs/tinyexec#143</a></li>
<li>chore(deps): bump actions/checkout from 6.0.2 to 6.0.3 in the
github-actions group by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/tinylibs/tinyexec/pull/142">tinylibs/tinyexec#142</a></li>
<li>chore(deps-dev): bump the development-dependencies group with 3
updates by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/tinylibs/tinyexec/pull/145">tinylibs/tinyexec#145</a></li>
<li>chore(deps-dev): bump the development-dependencies group with 6
updates by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/tinylibs/tinyexec/pull/147">tinylibs/tinyexec#147</a></li>
<li>chore(deps-dev): bump the development-dependencies group with 3
updates by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/tinylibs/tinyexec/pull/149">tinylibs/tinyexec#149</a></li>
<li>chore(deps): bump actions/checkout from 6.0.3 to 7.0.0 in the
github-actions group by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/tinylibs/tinyexec/pull/148">tinylibs/tinyexec#148</a></li>
<li>fix: disable code minification by <a
href="https://github.com/bluwy"><code>@​bluwy</code></a> in <a
href="https://redirect.github.com/tinylibs/tinyexec/pull/150">tinylibs/tinyexec#150</a></li>
<li>feat: improve NonZeroExitError message by <a
href="https://github.com/bluwy"><code>@​bluwy</code></a> in <a
href="https://redirect.github.com/tinylibs/tinyexec/pull/151">tinylibs/tinyexec#151</a></li>
<li>chore(deps-dev): bump the development-dependencies group with 4
updates by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/tinylibs/tinyexec/pull/152">tinylibs/tinyexec#152</a></li>
<li>fix: throw NonZeroExitError when process is killed by signal by <a
href="https://github.com/naveentehrpariya"><code>@​naveentehrpariya</code></a>
in <a
href="https://redirect.github.com/tinylibs/tinyexec/pull/146">tinylibs/tinyexec#146</a></li>
<li>chore(deps-dev): bump the development-dependencies group with 5
updates by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/tinylibs/tinyexec/pull/153">tinylibs/tinyexec#153</a></li>
<li>chore(deps): bump the github-actions group with 2 updates by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/tinylibs/tinyexec/pull/158">tinylibs/tinyexec#158</a></li>
<li>chore(deps-dev): bump the development-dependencies group across 1
directory with 7 updates by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/tinylibs/tinyexec/pull/159">tinylibs/tinyexec#159</a></li>
<li>fix: add a second pass of resolution with no extension by <a
href="https://github.com/43081j"><code>@​43081j</code></a> in <a
href="https://redirect.github.com/tinylibs/tinyexec/pull/161">tinylibs/tinyexec#161</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/naveentehrpariya"><code>@​naveentehrpariya</code></a>
made their first contribution in <a
href="https://redirect.github.com/tinylibs/tinyexec/pull/146">tinylibs/tinyexec#146</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/tinylibs/tinyexec/compare/1.2.4...1.3.0">https://github.com/tinylibs/tinyexec/compare/1.2.4...1.3.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="7d37564956"><code>7d37564</code></a>
fix: add a second pass of resolution with no extension (<a
href="https://redirect.github.com/tinylibs/tinyexec/issues/161">#161</a>)</li>
<li><a
href="d9d6ab0d64"><code>d9d6ab0</code></a>
chore(deps-dev): bump the development-dependencies group across 1
directory w...</li>
<li><a
href="1ab7d9e4bd"><code>1ab7d9e</code></a>
chore(deps): bump the github-actions group with 2 updates (<a
href="https://redirect.github.com/tinylibs/tinyexec/issues/158">#158</a>)</li>
<li><a
href="8a4ccdef4f"><code>8a4ccde</code></a>
chore(deps-dev): bump the development-dependencies group with 5 updates
(<a
href="https://redirect.github.com/tinylibs/tinyexec/issues/153">#153</a>)</li>
<li><a
href="dc1042654e"><code>dc10426</code></a>
fix: throw NonZeroExitError when process is killed by signal (<a
href="https://redirect.github.com/tinylibs/tinyexec/issues/146">#146</a>)</li>
<li><a
href="64f05030ab"><code>64f0503</code></a>
chore(deps-dev): bump the development-dependencies group with 4 updates
(<a
href="https://redirect.github.com/tinylibs/tinyexec/issues/152">#152</a>)</li>
<li><a
href="e2c6a2fe3a"><code>e2c6a2f</code></a>
feat: improve NonZeroExitError message (<a
href="https://redirect.github.com/tinylibs/tinyexec/issues/151">#151</a>)</li>
<li><a
href="c84e823712"><code>c84e823</code></a>
fix: disable code minification (<a
href="https://redirect.github.com/tinylibs/tinyexec/issues/150">#150</a>)</li>
<li><a
href="d6f3b734ef"><code>d6f3b73</code></a>
chore(deps): bump actions/checkout in the github-actions group (<a
href="https://redirect.github.com/tinylibs/tinyexec/issues/148">#148</a>)</li>
<li><a
href="68a1c79994"><code>68a1c79</code></a>
chore(deps-dev): bump the development-dependencies group with 3 updates
(<a
href="https://redirect.github.com/tinylibs/tinyexec/issues/149">#149</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/tinylibs/tinyexec/compare/1.2.4...1.3.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tinyexec&package-manager=npm_and_yarn&previous-version=1.2.4&new-version=1.3.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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>
2026-08-05 18:37:46 +02:00
dependabot[bot]
fc95717b38 feat(deps): Bump the minor group across 1 directory with 8 updates (#950)
Bumps the minor group with 8 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
|
[@napi-rs/wasm-runtime](https://github.com/napi-rs/napi-rs/tree/HEAD/wasm-runtime)
| `1.2.0` | `1.2.2` |
| [brace-expansion](https://github.com/juliangruber/brace-expansion) |
`5.0.8` | `5.0.9` |
| [flatted](https://github.com/WebReflection/flatted) | `3.4.3` |
`3.4.4` |
| [hono](https://github.com/honojs/hono) | `4.12.32` | `4.13.0` |
| [ip-address](https://github.com/beaugunderson/ip-address) | `10.3.1` |
`10.4.0` |
| [jose](https://github.com/panva/jose) | `6.2.4` | `6.2.8` |
| [postcss](https://github.com/postcss/postcss) | `8.5.24` | `8.5.25` |
| [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) |
`8.1.5` | `8.2.0` |


Updates `@napi-rs/wasm-runtime` from 1.2.0 to 1.2.2
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/napi-rs/napi-rs/blob/main/wasm-runtime/CHANGELOG.md">@​napi-rs/wasm-runtime's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/napi-rs/napi-rs/compare/@napi-rs/wasm-runtime@1.2.1...@napi-rs/wasm-runtime@1.2.2">1.2.2</a>
(2026-07-31)</h2>
<h3>Performance Improvements</h3>
<ul>
<li><strong>wasm-runtime:</strong> remove sourcemap (<a
href="https://redirect.github.com/napi-rs/napi-rs/issues/3428">#3428</a>)
(<a
href="0fd17fa5f0">0fd17fa</a>)</li>
</ul>
<h2><a
href="https://github.com/napi-rs/napi-rs/compare/@napi-rs/wasm-runtime@1.2.0...@napi-rs/wasm-runtime@1.2.1">1.2.1</a>
(2026-07-30)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>wasm-runtime:</strong> preserve emnapi v1 compatibility (<a
href="https://redirect.github.com/napi-rs/napi-rs/issues/3426">#3426</a>)
(<a
href="856326b305">856326b</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="5b344c367e"><code>5b344c3</code></a>
chore(release): publish</li>
<li><a
href="0fd17fa5f0"><code>0fd17fa</code></a>
perf(wasm-runtime): remove sourcemap (<a
href="https://github.com/napi-rs/napi-rs/tree/HEAD/wasm-runtime/issues/3428">#3428</a>)</li>
<li><a
href="164a1ca6b1"><code>164a1ca</code></a>
chore(release): publish</li>
<li><a
href="856326b305"><code>856326b</code></a>
fix(wasm-runtime): preserve emnapi v1 compatibility (<a
href="https://github.com/napi-rs/napi-rs/tree/HEAD/wasm-runtime/issues/3426">#3426</a>)</li>
<li>See full diff in <a
href="https://github.com/napi-rs/napi-rs/commits/@napi-rs/wasm-runtime@1.2.2/wasm-runtime">compare
view</a></li>
</ul>
</details>
<br />

Updates `brace-expansion` from 5.0.8 to 5.0.9
<details>
<summary>Commits</summary>
<ul>
<li><a
href="fbcf8ec75b"><code>fbcf8ec</code></a>
5.0.9</li>
<li><a
href="f6f3939e53"><code>f6f3939</code></a>
test: cover dropping empties when only some prefixes are empty</li>
<li><a
href="688a99eeaa"><code>688a99e</code></a>
Merge commit from fork</li>
<li><a
href="c66e5f9bce"><code>c66e5f9</code></a>
docs: make the maxLength example produce a non-empty result (<a
href="https://redirect.github.com/juliangruber/brace-expansion/issues/137">#137</a>)</li>
<li><a
href="473d3e95e9"><code>473d3e9</code></a>
Bump linkify-it from 5.0.1 to 5.0.2 (<a
href="https://redirect.github.com/juliangruber/brace-expansion/issues/128">#128</a>)</li>
<li>See full diff in <a
href="https://github.com/juliangruber/brace-expansion/compare/v5.0.8...v5.0.9">compare
view</a></li>
</ul>
</details>
<br />

Updates `flatted` from 3.4.3 to 3.4.4
<details>
<summary>Commits</summary>
<ul>
<li><a
href="e6f5ca700c"><code>e6f5ca7</code></a>
3.4.4</li>
<li><a
href="47f14fac0b"><code>47f14fa</code></a>
removed E_STRICT from PHP</li>
<li><a
href="4050568846"><code>4050568</code></a>
fixced go-lang issues in CI</li>
<li><a
href="4303f4db38"><code>4303f4d</code></a>
Merge pull request <a
href="https://redirect.github.com/WebReflection/flatted/issues/101">#101</a>
from mfinelli/gocriticfixes</li>
<li><a
href="106735b609"><code>106735b</code></a>
updated package-lock.json</li>
<li><a
href="b85577f39f"><code>b85577f</code></a>
Fix go-critic errors</li>
<li>See full diff in <a
href="https://github.com/WebReflection/flatted/compare/v3.4.3...v3.4.4">compare
view</a></li>
</ul>
</details>
<br />

Updates `hono` from 4.12.32 to 4.13.0
<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.13.0</h2>
<p>Hono v4.13.0 is now available!</p>
<p>The highlight of this release is performance: a batch of low-level
optimizations makes the core request/response path significantly faster
— up to 1.25x on common routes in our benchmark. This release also adds
first-class support for the HTTP QUERY method, defined in <a
href="https://www.rfc-editor.org/rfc/rfc10008.html">RFC 10008</a>, a new
Method Not Allowed middleware, and more.</p>
<h2>Performance improvements</h2>
<p>This release includes a series of small optimizations: skipping
unnecessary <code>Headers</code> allocations, replacing regex tests with
<code>indexOf</code>, allocating internal state lazily, and more.</p>
<p>Here is <a
href="https://github.com/honojs/hono/tree/main/benchmarks/fetch"><code>benchmarks/fetch</code></a>
comparing v4.12 and v4.13 (<code>ROUNDS=5 ./compare.sh</code>, Bun
1.4.0, Apple Silicon — each measurement runs in a fresh process, and the
variant order is reversed every round to avoid warm-up bias):</p>
<table>
<thead>
<tr>
<th>Benchmark</th>
<th align="right">v4.12</th>
<th align="right">v4.13</th>
<th align="right">Speedup</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>ping</code> — <code>GET /</code></td>
<td align="right">165.83 ns</td>
<td align="right">163.99 ns</td>
<td align="right">1.01x</td>
</tr>
<tr>
<td><code>query</code> — <code>GET /id/1?name=bun</code></td>
<td align="right">674.40 ns</td>
<td align="right">616.99 ns</td>
<td align="right"><strong>1.09x</strong></td>
</tr>
<tr>
<td><code>json</code> — <code>GET /user</code></td>
<td align="right">528.99 ns</td>
<td align="right">422.44 ns</td>
<td align="right"><strong>1.25x</strong></td>
</tr>
<tr>
<td><code>body</code> — <code>POST /json</code></td>
<td align="right">1.16 µs</td>
<td align="right">1.00 µs</td>
<td align="right"><strong>1.15x</strong></td>
</tr>
</tbody>
</table>
<p>The individual changes:</p>
<ul>
<li>perf(context): iterate the header record with <code>for..in</code>
<a
href="https://redirect.github.com/honojs/hono/pull/5118">honojs/hono#5118</a></li>
<li>perf(url): replace regex tests with <code>indexOf</code> <a
href="https://redirect.github.com/honojs/hono/pull/5121">honojs/hono#5121</a></li>
<li>perf(context): skip <code>Headers</code> creation when there are no
headers to merge <a
href="https://redirect.github.com/honojs/hono/pull/5122">honojs/hono#5122</a></li>
<li>perf(urls): refactor <code>tryDecodeURIComponent</code> <a
href="https://redirect.github.com/honojs/hono/pull/5158">honojs/hono#5158</a></li>
<li>perf(request): allocate <code>#validatedData</code> lazily <a
href="https://redirect.github.com/honojs/hono/pull/5175">honojs/hono#5175</a></li>
<li>perf(request): probe the body cache without allocating <a
href="https://redirect.github.com/honojs/hono/pull/5176">honojs/hono#5176</a></li>
</ul>
<p>In addition, the RegExpRouter rewrite described below makes route
registration plus the first match roughly 20% faster.</p>
<p>Thanks <a
href="https://github.com/kibertoad"><code>@​kibertoad</code></a> for the
contributions!</p>
<h2>First-class QUERY method support</h2>
<p>The QUERY method — a safe, idempotent method that carries a request
body — is now a first-class citizen in Hono. You can define QUERY
handlers with <code>app.query()</code>:</p>
<pre lang="ts"><code>const app = new Hono()
<p>app.query('/search', async (c) =&gt; {<br />
const conditions = await c.req.json()<br />
return c.json(await search(conditions))<br />
})<br />
</code></pre></p>
<p>Thanks <a
href="https://github.com/shellhaki"><code>@​shellhaki</code></a>!</p>
<h2>QUERY support across built-in middleware</h2>
<p>The built-in middleware has been updated to handle QUERY requests
properly:</p>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="192768fbaf"><code>192768f</code></a>
4.13.0</li>
<li><a
href="b0c2d90eb0"><code>b0c2d90</code></a>
Merge pull request <a
href="https://redirect.github.com/honojs/hono/issues/5154">#5154</a>
from honojs/next</li>
<li><a
href="8f07028270"><code>8f07028</code></a>
fix(compress): set Vary: Accept-Encoding on negotiated responses (<a
href="https://redirect.github.com/honojs/hono/issues/5137">#5137</a>)</li>
<li><a
href="8a0b18fd9b"><code>8a0b18f</code></a>
feat(reg-exp-router): throw UnsupportedPathError during route
registration (#...</li>
<li><a
href="3feb3551d4"><code>3feb355</code></a>
fix(jsx): allow a function component to return an array (<a
href="https://redirect.github.com/honojs/hono/issues/5179">#5179</a>)</li>
<li><a
href="5d911d2ab7"><code>5d911d2</code></a>
feat(utils/headers): add HTTP fields newly registered with IANA (<a
href="https://redirect.github.com/honojs/hono/issues/5153">#5153</a>)</li>
<li><a
href="30277aee0d"><code>30277ae</code></a>
feat(jwt,jwk): add a configurable WWW-Authenticate realm (<a
href="https://redirect.github.com/honojs/hono/issues/5141">#5141</a>)</li>
<li><a
href="1f707c5637"><code>1f707c5</code></a>
feat(middleware): add method-not-allowed middleware (<a
href="https://redirect.github.com/honojs/hono/issues/5132">#5132</a>)</li>
<li><a
href="2df0b47659"><code>2df0b47</code></a>
feat(jsx): add React-compatible overloads to useRef (<a
href="https://redirect.github.com/honojs/hono/issues/5063">#5063</a>)</li>
<li><a
href="3bc96ba915"><code>3bc96ba</code></a>
feat(cache): add first-class support for QUERY requests (<a
href="https://redirect.github.com/honojs/hono/issues/5119">#5119</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/honojs/hono/compare/v4.12.32...v4.13.0">compare
view</a></li>
</ul>
</details>
<br />

Updates `ip-address` from 10.3.1 to 10.4.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/beaugunderson/ip-address/releases">ip-address's
releases</a>.</em></p>
<blockquote>
<h2>v10.4.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Add GitHub Actions CI by <a
href="https://github.com/beaugunderson"><code>@​beaugunderson</code></a>
in <a
href="https://redirect.github.com/beaugunderson/ip-address/pull/213">beaugunderson/ip-address#213</a></li>
<li>Keep the package loadable on node 12, and enforce it by <a
href="https://github.com/beaugunderson"><code>@​beaugunderson</code></a>
in <a
href="https://redirect.github.com/beaugunderson/ip-address/pull/216">beaugunderson/ip-address#216</a></li>
<li>Validate the byte arrays Address6 is given by <a
href="https://github.com/beaugunderson"><code>@​beaugunderson</code></a>
in <a
href="https://redirect.github.com/beaugunderson/ip-address/pull/217">beaugunderson/ip-address#217</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/beaugunderson/ip-address/compare/v10.3.1...v10.4.0">https://github.com/beaugunderson/ip-address/compare/v10.3.1...v10.4.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="fbb8db28f1"><code>fbb8db2</code></a>
10.4.0</li>
<li><a
href="45a2b11ec2"><code>45a2b11</code></a>
Validate the byte arrays Address6 is given (<a
href="https://redirect.github.com/beaugunderson/ip-address/issues/217">#217</a>)</li>
<li><a
href="bac8810b39"><code>bac8810</code></a>
Keep the package loadable on node 12, and enforce it (<a
href="https://redirect.github.com/beaugunderson/ip-address/issues/216">#216</a>)</li>
<li><a
href="9b3d8488d1"><code>9b3d848</code></a>
Add a security policy and a README section on security posture</li>
<li><a
href="e84a7b381d"><code>e84a7b3</code></a>
Order the README API reference Address4, Address6, AddressError</li>
<li><a
href="015160b85e"><code>015160b</code></a>
Collapse each class in the README API reference</li>
<li><a
href="34061a897d"><code>34061a8</code></a>
Pin checkout and setup-node to commits in the release job</li>
<li><a
href="c5fae5d9bd"><code>c5fae5d</code></a>
Pin action-gh-release to a commit and move it to 3.0.2</li>
<li><a
href="e0ef048419"><code>e0ef048</code></a>
Replace CircleCI with GitHub Actions</li>
<li><a
href="5e3ceb779a"><code>5e3ceb7</code></a>
Add GitHub Actions CI across Node 20, 22, 24 and 25 (<a
href="https://redirect.github.com/beaugunderson/ip-address/issues/213">#213</a>)</li>
<li>See full diff in <a
href="https://github.com/beaugunderson/ip-address/compare/v10.3.1...v10.4.0">compare
view</a></li>
</ul>
</details>
<details>
<summary>Install script changes</summary>
<p>This version adds <code>prepare</code> script that runs during
installation. Review the package contents before updating.</p>
</details>
<br />

Updates `jose` from 6.2.4 to 6.2.8
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/panva/jose/releases">jose's
releases</a>.</em></p>
<blockquote>
<h2>v6.2.8</h2>
<h3>Fixes</h3>
<ul>
<li>enforce a single recipient when decrypting dir and ECDH-ES (<a
href="505c3833ec">505c383</a>)</li>
<li>reject a non-string &quot;alg&quot; in EmbeddedJWK (<a
href="714f870434">714f870</a>)</li>
</ul>
<h3>Refactor</h3>
<ul>
<li>index the JWS and JWE registries without a wrapper (<a
href="925f3bbbee">925f3bb</a>)</li>
<li>name the &quot;alg&quot; source in unsupported algorithm failures
(<a
href="1500459c6f">1500459</a>)</li>
</ul>
<h2>v6.2.7</h2>
<h3>Fixes</h3>
<ul>
<li>require own JOSE properties for presence checks (<a
href="90ab09c461">90ab09c</a>)</li>
</ul>
<h3>Refactor</h3>
<ul>
<li>reduce bundle size (<a
href="767d7f12d0">767d7f1</a>)</li>
</ul>
<h2>v6.2.6</h2>
<h3>Fixes</h3>
<ul>
<li><strong>types:</strong> accept host CryptoKey declarations (<a
href="b48a15b396">b48a15b</a>)</li>
</ul>
<h2>v6.2.5</h2>
<h3>Fixes</h3>
<ul>
<li>compare claim values for falsy validation options (<a
href="eb8695699c">eb86956</a>)</li>
<li>forward key management parameters for a single JWE recipient (<a
href="2d4f8014e0">2d4f801</a>)</li>
<li>handle a zero-length JWE additional authenticated data (<a
href="16ca398103">16ca398</a>)</li>
<li>reject a generateKeyPair crv option the algorithm does not imply (<a
href="76364e9f15">76364e9</a>)</li>
<li>reject an unencoded payload in the JWS Compact Serialization (<a
href="01d053f3b0">01d053f</a>)</li>
<li>reject characters outside the Base64URL alphabet (<a
href="0ebb97158a">0ebb971</a>),
references <a
href="https://redirect.github.com/panva/jose/issues/879">#879</a></li>
<li>reject duplicate &quot;crit&quot; values when producing (<a
href="31d60e1542">31d60e1</a>)</li>
<li>reject invalid UTF-8 in JOSE Headers and JWT Claims Sets (<a
href="5df3fedcc0">5df3fed</a>)</li>
<li>reject truncated ASN.1 key data (<a
href="7a16c66b9f">7a16c66</a>)</li>
<li>surface non-ASCII token segments as JOSE errors (<a
href="194fe11450">194fe11</a>)</li>
<li><strong>types:</strong> correct JWK and CryptoKey types (<a
href="62a196dc8e">62a196d</a>)</li>
<li><strong>types:</strong> correct key resolver and JWT header types
(<a
href="e95f8c4086">e95f8c4</a>)</li>
<li>validate the clockTolerance and currentDate options are finite (<a
href="ab2f18dad4">ab2f18d</a>)</li>
</ul>
<h3>Documentation</h3>
<ul>
<li>correct subpaths and API documentation (<a
href="2daec38296">2daec38</a>)</li>
<li>document consumer-supplied type parameters (<a
href="9e9f66c86b">9e9f66c</a>)</li>
<li>stop claiming the JWK &quot;use&quot; parameter is used during
import (<a
href="47a07b2f95">47a07b2</a>)</li>
<li>update CHANGELOG.md (<a
href="fc51bf56f9">fc51bf5</a>)</li>
</ul>
<h3>Refactor</h3>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/panva/jose/blob/main/CHANGELOG.md">jose's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/panva/jose/compare/v6.2.7...v6.2.8">6.2.8</a>
(2026-08-03)</h2>
<h3>Fixes</h3>
<ul>
<li>enforce a single recipient when decrypting dir and ECDH-ES (<a
href="505c3833ec">505c383</a>)</li>
<li>reject a non-string &quot;alg&quot; in EmbeddedJWK (<a
href="714f870434">714f870</a>)</li>
</ul>
<h3>Refactor</h3>
<ul>
<li>index the JWS and JWE registries without a wrapper (<a
href="925f3bbbee">925f3bb</a>)</li>
<li>name the &quot;alg&quot; source in unsupported algorithm failures
(<a
href="1500459c6f">1500459</a>)</li>
</ul>
<h2><a
href="https://github.com/panva/jose/compare/v6.2.6...v6.2.7">6.2.7</a>
(2026-08-01)</h2>
<h3>Fixes</h3>
<ul>
<li>require own JOSE properties for presence checks (<a
href="90ab09c461">90ab09c</a>)</li>
</ul>
<h3>Refactor</h3>
<ul>
<li>reduce bundle size (<a
href="767d7f12d0">767d7f1</a>)</li>
</ul>
<h2><a
href="https://github.com/panva/jose/compare/v6.2.5...v6.2.6">6.2.6</a>
(2026-07-31)</h2>
<h3>Fixes</h3>
<ul>
<li><strong>types:</strong> accept host CryptoKey declarations (<a
href="b48a15b396">b48a15b</a>)</li>
</ul>
<h2><a
href="https://github.com/panva/jose/compare/v6.2.4...v6.2.5">6.2.5</a>
(2026-07-29)</h2>
<h3>Fixes</h3>
<ul>
<li>compare claim values for falsy validation options (<a
href="eb8695699c">eb86956</a>)</li>
<li>forward key management parameters for a single JWE recipient (<a
href="2d4f8014e0">2d4f801</a>)</li>
<li>handle a zero-length JWE additional authenticated data (<a
href="16ca398103">16ca398</a>)</li>
<li>reject a generateKeyPair crv option the algorithm does not imply (<a
href="76364e9f15">76364e9</a>)</li>
<li>reject an unencoded payload in the JWS Compact Serialization (<a
href="01d053f3b0">01d053f</a>)</li>
<li>reject characters outside the Base64URL alphabet (<a
href="0ebb97158a">0ebb971</a>),
references <a
href="https://redirect.github.com/panva/jose/issues/879">#879</a></li>
<li>reject duplicate &quot;crit&quot; values when producing (<a
href="31d60e1542">31d60e1</a>)</li>
<li>reject invalid UTF-8 in JOSE Headers and JWT Claims Sets (<a
href="5df3fedcc0">5df3fed</a>)</li>
<li>reject truncated ASN.1 key data (<a
href="7a16c66b9f">7a16c66</a>)</li>
<li>surface non-ASCII token segments as JOSE errors (<a
href="194fe11450">194fe11</a>)</li>
<li><strong>types:</strong> correct JWK and CryptoKey types (<a
href="62a196dc8e">62a196d</a>)</li>
<li><strong>types:</strong> correct key resolver and JWT header types
(<a
href="e95f8c4086">e95f8c4</a>)</li>
<li>validate the clockTolerance and currentDate options are finite (<a
href="ab2f18dad4">ab2f18d</a>)</li>
</ul>
<h3>Documentation</h3>
<ul>
<li>correct subpaths and API documentation (<a
href="2daec38296">2daec38</a>)</li>
<li>document consumer-supplied type parameters (<a
href="9e9f66c86b">9e9f66c</a>)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8b768eb8d2"><code>8b768eb</code></a>
chore(release): 6.2.8</li>
<li><a
href="1500459c6f"><code>1500459</code></a>
refactor: name the &quot;alg&quot; source in unsupported algorithm
failures</li>
<li><a
href="714f870434"><code>714f870</code></a>
fix: reject a non-string &quot;alg&quot; in EmbeddedJWK</li>
<li><a
href="925f3bbbee"><code>925f3bb</code></a>
refactor: index the JWS and JWE registries without a wrapper</li>
<li><a
href="505c3833ec"><code>505c383</code></a>
fix: enforce a single recipient when decrypting dir and ECDH-ES</li>
<li><a
href="514831da55"><code>514831d</code></a>
chore(deps): bump the actions group with 3 updates</li>
<li><a
href="45965db443"><code>45965db</code></a>
chore: cleanup after release</li>
<li><a
href="60b941f6d5"><code>60b941f</code></a>
chore(release): 6.2.7</li>
<li><a
href="90ab09c461"><code>90ab09c</code></a>
fix: require own JOSE properties for presence checks</li>
<li><a
href="767d7f12d0"><code>767d7f1</code></a>
refactor: reduce bundle size</li>
<li>Additional commits viewable in <a
href="https://github.com/panva/jose/compare/v6.2.4...v6.2.8">compare
view</a></li>
</ul>
</details>
<br />

Updates `postcss` from 8.5.24 to 8.5.25
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/postcss/postcss/releases">postcss's
releases</a>.</em></p>
<blockquote>
<h2>8.5.25</h2>
<ul>
<li>Fixed 8.5.17 visitor regression.</li>
<li>Fixed <code>list.split()</code> for non-string values (by <a
href="https://github.com/amir-rezaei"><code>@​amir-rezaei</code></a>).</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/postcss/postcss/blob/main/CHANGELOG.md">postcss's
changelog</a>.</em></p>
<blockquote>
<h2>8.5.25</h2>
<ul>
<li>Fixed 8.5.17 visitor regression.</li>
<li>Fixed <code>list.split()</code> for non-string values (by <a
href="https://github.com/amir-rezaei"><code>@​amir-rezaei</code></a>).</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="08c989c43c"><code>08c989c</code></a>
Release 8.5.25 version</li>
<li><a
href="24f6814716"><code>24f6814</code></a>
Fix 8.5.17 visitor regression</li>
<li><a
href="f2fa53f11d"><code>f2fa53f</code></a>
Add supply chain security requirement to PostCSS plugin guide</li>
<li><a
href="10edf0b060"><code>10edf0b</code></a>
fix: return empty array for empty string in list.split (<a
href="https://redirect.github.com/postcss/postcss/issues/2121">#2121</a>)</li>
<li>See full diff in <a
href="https://github.com/postcss/postcss/compare/8.5.24...8.5.25">compare
view</a></li>
</ul>
</details>
<br />

Updates `vite` from 8.1.5 to 8.2.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/vitejs/vite/releases">vite's
releases</a>.</em></p>
<blockquote>
<h2>create-vite@8.2.0</h2>
<p>Please refer to <a
href="https://github.com/vitejs/vite/blob/create-vite@8.2.0/packages/create-vite/CHANGELOG.md">CHANGELOG.md</a>
for details.</p>
<h2>plugin-legacy@8.2.0</h2>
<p>Please refer to <a
href="https://github.com/vitejs/vite/blob/plugin-legacy@8.2.0/packages/plugin-legacy/CHANGELOG.md">CHANGELOG.md</a>
for details.</p>
<h2>v8.2.0</h2>
<p>Please refer to <a
href="https://github.com/vitejs/vite/blob/v8.2.0/packages/vite/CHANGELOG.md">CHANGELOG.md</a>
for details.</p>
<h2>v8.2.0-beta.0</h2>
<p>Please refer to <a
href="https://github.com/vitejs/vite/blob/v8.2.0-beta.0/packages/vite/CHANGELOG.md">CHANGELOG.md</a>
for details.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md">vite's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/vitejs/vite/compare/v8.2.0-beta.0...v8.2.0">8.2.0</a>
(2026-07-30)</h2>
<h3>Features</h3>
<ul>
<li>add <code>input</code> to <code>server.fs.allow</code> (<a
href="https://redirect.github.com/vitejs/vite/issues/23035">#23035</a>)
(<a
href="95a3cdab83">95a3cda</a>)</li>
<li><strong>bundled-dev:</strong> reload once after rebuild instead of
via the fallback page (<a
href="https://redirect.github.com/vitejs/vite/issues/23106">#23106</a>)
(<a
href="b24381d741">b24381d</a>)</li>
<li><strong>bundled-dev:</strong> support worker file update accepted by
HMR (<a
href="https://redirect.github.com/vitejs/vite/issues/23068">#23068</a>)
(<a
href="0d04351fdc">0d04351</a>)</li>
<li><strong>config:</strong> include column in config incompatibility
location (<a
href="https://redirect.github.com/vitejs/vite/issues/23064">#23064</a>)
(<a
href="8a24572694">8a24572</a>)</li>
<li><strong>dev:</strong> resolve interface name for explicit host in
network URLs (<a
href="https://redirect.github.com/vitejs/vite/issues/22965">#22965</a>)
(<a
href="3ac77d9dd7">3ac77d9</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li><strong>bundledDev:</strong> print build errors to the terminal when
an HMR update fails (<a
href="https://redirect.github.com/vitejs/vite/issues/23024">#23024</a>)
(<a
href="41c465896e">41c4658</a>)</li>
<li><strong>deps:</strong> update all non-major dependencies (<a
href="https://redirect.github.com/vitejs/vite/issues/23069">#23069</a>)
(<a
href="4c07b74416">4c07b74</a>)</li>
<li><strong>hmr:</strong> preserve environment snapshot during server
restart (<a
href="https://redirect.github.com/vitejs/vite/issues/22992">#22992</a>)
(<a
href="b1186c36d0">b1186c3</a>)</li>
<li><strong>importAnalysis:</strong> interop imports injected into
optimized dep files by plugins (<a
href="https://redirect.github.com/vitejs/vite/issues/23029">#23029</a>)
(<a
href="8c2a87d41f">8c2a87d</a>)</li>
<li><strong>module-runner:</strong> keep stack trace interception
working when <code>Object.prototype</code> is frozen (<a
href="https://redirect.github.com/vitejs/vite/issues/23073">#23073</a>)
(<a
href="599c5b02a8">599c5b0</a>)</li>
<li><strong>server:</strong> strip base in indexHtml module graph lookup
(<a
href="https://redirect.github.com/vitejs/vite/issues/22932">#22932</a>)
(<a
href="fa005d19af">fa005d1</a>)</li>
<li>support resolving top-level input option with plugins (<a
href="https://redirect.github.com/vitejs/vite/issues/23101">#23101</a>)
(<a
href="41df81a6a4">41df81a</a>)</li>
</ul>
<h3>Documentation</h3>
<ul>
<li><strong>config:</strong> correct cacheDir default fallback
description (<a
href="https://redirect.github.com/vitejs/vite/issues/23060">#23060</a>)
(<a
href="aafa103af5">aafa103</a>)</li>
</ul>
<h3>Tests</h3>
<ul>
<li>config CJS module vars in ESM case (<a
href="https://redirect.github.com/vitejs/vite/issues/23010">#23010</a>)
(<a
href="d8cd388302">d8cd388</a>)</li>
</ul>
<h2><a
href="https://github.com/vitejs/vite/compare/v8.1.5...v8.2.0-beta.0">8.2.0-beta.0</a>
(2026-07-22)</h2>
<h3>Features</h3>
<ul>
<li>add <code>input</code> option (<a
href="https://redirect.github.com/vitejs/vite/issues/22642">#22642</a>)
(<a
href="9beae37d72">9beae37</a>)</li>
<li><strong>config:</strong> warn features incompatible with native
loader in bundle loader (<a
href="https://redirect.github.com/vitejs/vite/issues/22850">#22850</a>)
(<a
href="05302b0726">05302b0</a>)</li>
<li><strong>css:</strong> export PostCSS config type for type-safe
configs (<a
href="https://redirect.github.com/vitejs/vite/issues/22792">#22792</a>)
(<a
href="302c755a81">302c755</a>)</li>
<li><strong>dev:</strong> label network URLs with their interface name
(<a
href="https://redirect.github.com/vitejs/vite/issues/22830">#22830</a>)
(<a
href="78accc42a5">78accc4</a>)</li>
<li><strong>optimizer:</strong> support aube lockfile (<a
href="https://redirect.github.com/vitejs/vite/issues/22813">#22813</a>)
(<a
href="6319827116">6319827</a>)</li>
<li><strong>optimizer:</strong> support nub lockfile (<a
href="https://redirect.github.com/vitejs/vite/issues/22891">#22891</a>)
(<a
href="65d3604f6f">65d3604</a>)</li>
<li>update rolldown-related dependencies and use client-side HMR in
bundled-dev (<a
href="https://redirect.github.com/vitejs/vite/issues/22961">#22961</a>)
(<a
href="960e9efbc1">960e9ef</a>)</li>
<li><strong>wasm:</strong> expand test suite, unwrap WebAssembly.Global
and enable js-string builtins (<a
href="https://redirect.github.com/vitejs/vite/issues/22674">#22674</a>)
(<a
href="9e79b51579">9e79b51</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li><strong>build:</strong> map CSS chunks in chunk import maps (fix <a
href="https://redirect.github.com/vitejs/vite/issues/22946">#22946</a>)
(<a
href="https://redirect.github.com/vitejs/vite/issues/22947">#22947</a>)
(<a
href="e16ff3a119">e16ff3a</a>)</li>
<li><strong>config:</strong> exclude virtual modules from native config
compat check (<a
href="https://redirect.github.com/vitejs/vite/issues/22979">#22979</a>)
(<a
href="2ced1fe4e4">2ced1fe</a>)</li>
<li><strong>css:</strong> rewrite urls in OnceExit-injected content (<a
href="https://redirect.github.com/vitejs/vite/issues/22983">#22983</a>)
(<a
href="abb793e18c">abb793e</a>)</li>
<li><strong>deps:</strong> update all non-major dependencies (<a
href="https://redirect.github.com/vitejs/vite/issues/22985">#22985</a>)
(<a
href="04f345b370">04f345b</a>)</li>
<li><strong>deps:</strong> update dependency magic-string to v1 (<a
href="https://redirect.github.com/vitejs/vite/issues/22998">#22998</a>)
(<a
href="c60b4d7cdb">c60b4d7</a>)</li>
<li><strong>hmr:</strong> remove hot data after prune (<a
href="https://redirect.github.com/vitejs/vite/issues/23002">#23002</a>)
(<a
href="be9631658f">be96316</a>)</li>
<li>resolve root to real path (<a
href="https://redirect.github.com/vitejs/vite/issues/22832">#22832</a>)
(<a
href="55bba7bbd9">55bba7b</a>)</li>
</ul>
<h3>Performance Improvements</h3>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="24a611f1c8"><code>24a611f</code></a>
release: v7.2.4</li>
<li><a
href="2d66b7b14a"><code>2d66b7b</code></a>
fix: revert &quot;perf(deps): replace debug with obug (<a
href="https://github.com/vitejs/vite/tree/HEAD/packages/vite/issues/21107">#21107</a>)&quot;</li>
<li><a
href="a668014dba"><code>a668014</code></a>
release: v7.2.3</li>
<li><a
href="acfe939e1f"><code>acfe939</code></a>
perf(deps): replace debug with obug (<a
href="https://github.com/vitejs/vite/tree/HEAD/packages/vite/issues/21107">#21107</a>)</li>
<li><a
href="4f8171eb30"><code>4f8171e</code></a>
fix(deps): update all non-major dependencies (<a
href="https://github.com/vitejs/vite/tree/HEAD/packages/vite/issues/21128">#21128</a>)</li>
<li><a
href="5029720845"><code>5029720</code></a>
chore(deps): update rolldown-related dependencies (<a
href="https://github.com/vitejs/vite/tree/HEAD/packages/vite/issues/21127">#21127</a>)</li>
<li><a
href="5909efd8fb"><code>5909efd</code></a>
fix: allow multiple <code>bindCLIShortcuts</code> calls with shortcut
merging (<a
href="https://github.com/vitejs/vite/tree/HEAD/packages/vite/issues/21103">#21103</a>)</li>
<li><a
href="39a0a15fd2"><code>39a0a15</code></a>
chore(deps): update rolldown-related dependencies (<a
href="https://github.com/vitejs/vite/tree/HEAD/packages/vite/issues/21095">#21095</a>)</li>
<li><a
href="6a34ac3422"><code>6a34ac3</code></a>
fix(deps): update all non-major dependencies (<a
href="https://github.com/vitejs/vite/tree/HEAD/packages/vite/issues/21096">#21096</a>)</li>
<li><a
href="02ceaec45e"><code>02ceaec</code></a>
chore(deps): update dependency <code>@​rollup/plugin-commonjs</code> to
v29 (<a
href="https://github.com/vitejs/vite/tree/HEAD/packages/vite/issues/21099">#21099</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/vitejs/vite/commits/create-vite@8.2.0/packages/vite">compare
view</a></li>
</ul>
</details>
<br />

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-04 16:58:37 +02:00
dependabot[bot]
f9123f3e18 feat(deps): Bump @hono/node-server from 1.19.17 to 2.1.0 (#956)
Bumps [@hono/node-server](https://github.com/honojs/node-server) from
1.19.17 to 2.1.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/honojs/node-server/releases">@​hono/node-server's
releases</a>.</em></p>
<blockquote>
<h2>v2.1.0</h2>
<h2>What's Changed</h2>
<ul>
<li>feat: add Early Hints (HTTP 103) middleware by <a
href="https://github.com/bilal-azam"><code>@​bilal-azam</code></a> in <a
href="https://redirect.github.com/honojs/node-server/pull/378">honojs/node-server#378</a></li>
<li>fix(listener): avoid uncaught error when force-closing a
non-standard socket by <a
href="https://github.com/mohamedramadan14"><code>@​mohamedramadan14</code></a>
in <a
href="https://redirect.github.com/honojs/node-server/pull/383">honojs/node-server#383</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/bilal-azam"><code>@​bilal-azam</code></a> made
their first contribution in <a
href="https://redirect.github.com/honojs/node-server/pull/378">honojs/node-server#378</a></li>
<li><a
href="https://github.com/mohamedramadan14"><code>@​mohamedramadan14</code></a>
made their first contribution in <a
href="https://redirect.github.com/honojs/node-server/pull/383">honojs/node-server#383</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/honojs/node-server/compare/v2.0.12...v2.1.0">https://github.com/honojs/node-server/compare/v2.0.12...v2.1.0</a></p>
<h2>v2.0.12</h2>
<h2>What's Changed</h2>
<ul>
<li>test: replace supertest by <a
href="https://github.com/BlankParticle"><code>@​BlankParticle</code></a>
in <a
href="https://redirect.github.com/honojs/node-server/pull/379">honojs/node-server#379</a></li>
<li>fix(response): copy headers when init is a foreign Response by <a
href="https://github.com/yusukebe"><code>@​yusukebe</code></a> in <a
href="https://redirect.github.com/honojs/node-server/pull/382">honojs/node-server#382</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/honojs/node-server/compare/v2.0.11...v2.0.12">https://github.com/honojs/node-server/compare/v2.0.11...v2.0.12</a></p>
<h2>v2.0.11</h2>
<h2>What's Changed</h2>
<ul>
<li>test: use a custom helper for path traversal tests by <a
href="https://github.com/BlankParticle"><code>@​BlankParticle</code></a>
in <a
href="https://redirect.github.com/honojs/node-server/pull/377">honojs/node-server#377</a></li>
<li>perf(request): fast-path QUERY methods by <a
href="https://github.com/usualoma"><code>@​usualoma</code></a> in <a
href="https://redirect.github.com/honojs/node-server/pull/376">honojs/node-server#376</a></li>
<li>perf(request): fast-path PATCH method by <a
href="https://github.com/yusukebe"><code>@​yusukebe</code></a> in <a
href="https://redirect.github.com/honojs/node-server/pull/380">honojs/node-server#380</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/honojs/node-server/compare/v2.0.10...v2.0.11">https://github.com/honojs/node-server/compare/v2.0.10...v2.0.11</a></p>
<h2>v2.0.10</h2>
<h2>Security fixes</h2>
<p>This release includes a fix for the following security issue:</p>
<h3>Unauthenticated memory-leak DoS via aborted WebSocket handshake</h3>
<p>Affects: <code>upgradeWebSocket</code>. A WebSocket upgrade request
with a missing or malformed <code>Sec-WebSocket-Key</code> header leaked
the request's <code>IncomingMessage</code> and left a promise pending,
even though no connection was established. Since the route is reachable
pre-handshake without authentication, an attacker could flood it to
gradually exhaust memory. <a
href="https://github.com/honojs/node-server/security/advisories/GHSA-9mqv-5hh9-4cgg">GHSA-9mqv-5hh9-4cgg</a></p>
<hr />
<p>Users of <code>upgradeWebSocket</code> are encouraged to upgrade to
this version.</p>
<h2>v2.0.9</h2>
<h2>What's Changed</h2>
<ul>
<li>fix(websocket): polyfill missing ErrorEvent global by <a
href="https://github.com/otnc"><code>@​otnc</code></a> in <a
href="https://redirect.github.com/honojs/node-server/pull/371">honojs/node-server#371</a></li>
<li>fix(serve-static): correct Range header parsing edge cases by <a
href="https://github.com/otnc"><code>@​otnc</code></a> in <a
href="https://redirect.github.com/honojs/node-server/pull/372">honojs/node-server#372</a></li>
<li>fix: recover complete request bodies after client disconnect by <a
href="https://github.com/usualoma"><code>@​usualoma</code></a> in <a
href="https://redirect.github.com/honojs/node-server/pull/375">honojs/node-server#375</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/otnc"><code>@​otnc</code></a> made their
first contribution in <a
href="https://redirect.github.com/honojs/node-server/pull/371">honojs/node-server#371</a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="82ba34e6b1"><code>82ba34e</code></a>
2.1.0</li>
<li><a
href="1f2909a5ef"><code>1f2909a</code></a>
fix(listener): avoid uncaught error when force-closing a non-standard
socket ...</li>
<li><a
href="977a242557"><code>977a242</code></a>
feat: add Early Hints (HTTP 103) middleware (<a
href="https://redirect.github.com/honojs/node-server/issues/378">#378</a>)</li>
<li><a
href="a813b6cdaa"><code>a813b6c</code></a>
2.0.12</li>
<li><a
href="caf48bafd4"><code>caf48ba</code></a>
fix(response): copy headers when init is a foreign Response (<a
href="https://redirect.github.com/honojs/node-server/issues/382">#382</a>)</li>
<li><a
href="3b1dd68758"><code>3b1dd68</code></a>
test: replace supertest (<a
href="https://redirect.github.com/honojs/node-server/issues/379">#379</a>)</li>
<li><a
href="834e54f15c"><code>834e54f</code></a>
2.0.11</li>
<li><a
href="ba72bcd8c5"><code>ba72bcd</code></a>
perf(request): fast-path PATCH method (<a
href="https://redirect.github.com/honojs/node-server/issues/380">#380</a>)</li>
<li><a
href="962baa4638"><code>962baa4</code></a>
perf(request): fast-path QUERY methods (<a
href="https://redirect.github.com/honojs/node-server/issues/376">#376</a>)</li>
<li><a
href="62284d6593"><code>62284d6</code></a>
test: use a custom helper for path traversal tests (<a
href="https://redirect.github.com/honojs/node-server/issues/377">#377</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/honojs/node-server/compare/v1.19.17...v2.1.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@hono/node-server&package-manager=npm_and_yarn&previous-version=1.19.17&new-version=2.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

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 this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/agentclientprotocol/claude-agent-acp/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-04 16:27:34 +02:00
Andrey Bragin
88da9d800f Add an interactive console ACP simple client example (#936)
## Description
Testing this agent means wiring it into an editor's ACP integration,
which is an overkill when you just want to watch the JSON and reply with
JSON. This adds a second example next to `examples/steering.ts`: a
minimal interactive ACP client that spawns the built agent, prints every
JSON-RPC message in both directions, and turns what you type into
prompts.
```
npm run build
npm run example:simple-client
```

All four ways a client can get a message to this agent are reachable
from the prompt"
  | Input | Wire |
  | --- | --- |
| `<text>` | `session/prompt`; buffered client-side if a turn is running
|
| `!steer <text>` | `_session/steering`, injected into the running turn
|
| `!queue <text>` | `session/prompt` sent mid-turn, so the agent queues
it |
  | `!cancel`, Ctrl-C | `session/cancel` |
  
## Additional options
* `--debug-port=<port>` rebuilds with source maps and starts the agent
under
* `--inspect-brk`, paused, so a debugger can attach and step through
`src/*.ts` —
replacing a hand-written editor run configuration. Teardown cancels any
live
turn, closes the agent's stdin (its clean-exit path), waits, and only
then
closes the connection, so neither side dies of EPIPE and nothing is
orphaned.
2026-08-04 15:10:58 +02:00
nikita-ashihmin
08e0e7f14e chore: allow registry-only release recovery (#947)
npm may accept a package before the registry update stage can run, and
repeating the workflow would attempt to republish the same immutable
version.

Add an opt-out for npm publishing on manual dispatch so the repository
GitHub App can safely retry only the registry update. The default
remains `true`, preserving the normal manual release path.

Validation: Prettier workflow check.
2026-08-02 23:55:45 +04:00
nikita-ashihmin
11a3193574 chore: preserve registry update after manual publish (#946)
A skipped `release-please` job propagates to downstream jobs during a
manual release, even when npm publishing succeeds through an `always()`
condition.

Explicitly evaluate the npm job result so successful manual publications
continue to update the agent registry.

Validation: Prettier workflow check.
2026-08-02 23:53:19 +04:00
nikita-ashihmin
c98141201e chore: recover 0.64.2 release publishing (#945)
Release-please cannot process the already-merged, untagged release PR
#943.

This adds an explicit workflow dispatch path for publishing a supplied
tag or commit while preserving the normal push-driven release flow, and
restores the 0.64.2 release metadata for the recovery tag.

After merge, I will create `v0.64.2` at this commit and dispatch the
publish workflow for that tag.

Validation:
- ESLint
- Prettier
- TypeScript build
- Vitest: 684 passed, 20 skipped
2026-08-02 23:49:28 +04:00
nikita-ashihmin
76009f1ede fix: prepare ExitPlanMode revert release (#944)
Restore the last published version metadata so release-please can generate the real 0.64.2 release.
2026-08-02 23:45:07 +04:00
nikita-ashihmin
fd60fc2b31 chore(main): release 0.64.2 (#943)
Release 0.64.2 with the ExitPlanMode plan-update revert from #942.
2026-08-02 23:42:27 +04:00
nikita-ashihmin
4302a4b0b6 Revert ExitPlanMode Markdown plan updates (#942)
## Summary

- revert the ExitPlanMode plan_update integration from #938
- restore the previous single switch_mode tool-call representation
- keep plan Markdown and approval state on the same transcript item

## Why

Clients currently receive both a plan_update and the separate tool call
required by requestPermission. Without a protocol-level link between
those entries, clients can render the same final plan twice. Returning
to the legacy representation avoids the duplicate while preserving the
existing approval flow.

## Testing

- pnpm exec vitest run src/tests/tools.test.ts
src/tests/acp-agent.test.ts src/tests/session-config-options.test.ts
(482 passed, 9 skipped)
- pnpm run build
- pnpm run lint
- pnpm run format:check
2026-08-02 23:36:47 +04:00
11 changed files with 1242 additions and 829 deletions

View File

@@ -3,9 +3,21 @@ on:
push:
branches:
- main
workflow_dispatch:
inputs:
ref:
description: Tag or commit to publish
required: true
type: string
publish_npm:
description: Publish the package before updating the registry
required: true
default: true
type: boolean
jobs:
release-please:
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
environment: release # Optional: for enhanced security
permissions:
@@ -38,13 +50,15 @@ jobs:
name: Publish to npm
runs-on: ubuntu-latest
needs: [release-please]
if: ${{ needs.release-please.outputs.release_created }}
if: ${{ always() && ((github.event_name == 'workflow_dispatch' && inputs.publish_npm) || needs.release-please.outputs.release_created == 'true') }}
environment: release # Optional: for enhanced security
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || github.ref }}
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020
with:
@@ -56,6 +70,7 @@ jobs:
trigger-registry-update:
needs: publish-npm
if: ${{ always() && (needs.publish-npm.result == 'success' || (github.event_name == 'workflow_dispatch' && !inputs.publish_npm)) }}
runs-on: ubuntu-latest
environment: release
permissions: {}

View File

@@ -1,3 +1,3 @@
{
".": "0.64.1"
".": "0.65.0"
}

View File

@@ -1,5 +1,23 @@
# Changelog
## [0.65.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.64.2...v0.65.0) (2026-08-05)
### Features
* **deps-dev:** Bump nanoid from 3.3.16 to 3.3.17 ([#951](https://github.com/agentclientprotocol/claude-agent-acp/issues/951)) ([b965dd2](https://github.com/agentclientprotocol/claude-agent-acp/commit/b965dd21917e822b56f5012c3572902f26c065c9))
* **deps-dev:** Bump tinyexec from 1.2.4 to 1.3.0 in the minor group ([#959](https://github.com/agentclientprotocol/claude-agent-acp/issues/959)) ([15b4eb4](https://github.com/agentclientprotocol/claude-agent-acp/commit/15b4eb46f329566837eae58f2ee4b05e3e81bf64))
* **deps:** Bump @hono/node-server from 1.19.17 to 2.1.0 ([#956](https://github.com/agentclientprotocol/claude-agent-acp/issues/956)) ([f9123f3](https://github.com/agentclientprotocol/claude-agent-acp/commit/f9123f3e18560b580398aabf49e2190f69746976))
* **deps:** Bump fast-uri from 3.1.4 to 3.1.5 ([#952](https://github.com/agentclientprotocol/claude-agent-acp/issues/952)) ([0988438](https://github.com/agentclientprotocol/claude-agent-acp/commit/098843842895dcb450746bd064dbb1509e3049d1))
* **steering:** settle a steered turn at idle, not at the interrupt ([#958](https://github.com/agentclientprotocol/claude-agent-acp/issues/958)) ([a84b810](https://github.com/agentclientprotocol/claude-agent-acp/commit/a84b81080a4127edf40bc448fc8bf2b15503304d))
## [0.64.2](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.64.1...v0.64.2) (2026-08-02)
### Bug Fixes
* restore the single-tool representation for ExitPlanMode ([#942](https://github.com/agentclientprotocol/claude-agent-acp/issues/942)) ([4302a4b](https://github.com/agentclientprotocol/claude-agent-acp/commit/4302a4b0b6df821b164cbe4857f26cf5b44b532c))
## [0.64.1](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.64.0...v0.64.1) (2026-08-02)

706
examples/simple-client.ts Normal file
View File

@@ -0,0 +1,706 @@
/**
* Example: a dead-simple interactive ACP client for this agent.
*
* This is the "no editor required" way to exercise the agent: it launches
* `dist/index.js` as a subprocess, speaks ACP over its stdio using the SDK, and
* prints every JSON-RPC message that crosses the wire in both directions. Each
* line you type becomes a `session/prompt`; the agent's answer streams back as
* `session/update` notifications.
*
* Every message is preceded by a header line naming its direction:
*
* [agent] ◂ inbound — everything the agent sends us
* [user] ▸ outbound — everything we send the agent, including our own
* permission answers and `session/cancel`
*
* The label and the arrow carry the direction, so it survives NO_COLOR and
* redirection to a file (`2> wire.log`). The JSON itself is printed in full,
* flush left and undecorated — select it and you have valid JSON on the
* clipboard. This exists to show you the protocol, not to summarize it.
*
* There are four ways for a client to get a message to this agent, and all four
* are reachable from the prompt so you can watch what each one looks like on
* the wire. Plain text is the first; the rest are `!`-prefixed commands, chosen
* so they cannot be confused with the agent's own slash commands (`/compact`
* and friends are ordinary prompt text here). `!!` escapes a literal `!`.
*
* <text> `session/prompt`. Typed mid-turn it is *buffered* by this
* client and sent once the running turn responds.
* !steer <text> `_session/steering` — injected into the turn that is
* already running, so it can change course between tool
* calls. Answers "injected", or "startedNewTurn" if the turn
* beat us to the finish. An injected reply streams as
* `session/update` notifications inside that turn, whose
* `stopReason` waits for it. "startedNewTurn" output belongs
* to a detached turn no `session/prompt` of ours tracks.
* See ./steering.ts.
* !queue <text> `session/prompt` sent mid-turn anyway. The agent advertises
* `promptQueueing`, so it takes the backlog instead of us —
* same ordering, different owner.
* !cancel `session/cancel` for the running turn, as Ctrl-C does.
*
* Run (build the agent first so `dist/index.js` exists):
*
* npm run build
* node examples/simple-client.ts
*
* or, equivalently, `npm run example:simple-client`.
*
* To debug the agent itself, pass a port. The agent is then rebuilt with source
* maps and started under `--inspect-brk=<port>`, i.e. paused before its first
* line, so you can attach (IntelliJ: Run → Attach to Node.js/Chrome; VS Code:
* "Attach to Node Process"), set breakpoints in `src/*.ts`, and resume:
*
* node examples/simple-client.ts --debug-port=9229
*
* The client will sit waiting for `initialize` until you attach and resume —
* that is expected, ACP has no request timeout.
*
* (Node < 22.18 needs `node --experimental-strip-types examples/simple-client.ts`.)
*
* Keys: Enter sends (or buffers), Ctrl-C cancels the running turn (again to
* quit), Ctrl-D drains anything buffered and exits. `!help` lists the commands.
*
* Flags: --debug-port=<port>, --no-build, --help.
* Env: AGENT_ENTRY (default dist/index.js), CWD (default process.cwd()).
*
* Requires the agent to be authenticated, since it talks to the real model.
*
* Note: this client does not advertise the `elicitation` capability, so the
* agent disables its AskUserQuestion tool instead of asking us to render a
* form. That is the one intentional behaviour difference from a full client.
*/
import { spawn } from "node:child_process";
import { once } from "node:events";
import { existsSync } from "node:fs";
import path from "node:path";
import readline from "node:readline";
import { Readable, Writable } from "node:stream";
import { fileURLToPath } from "node:url";
import {
PROTOCOL_VERSION,
client as acpClient,
methods,
ndJsonStream,
} from "@agentclientprotocol/sdk";
// Type-only: Node's type stripping does not elide value imports, and these two
// exist only in the .d.ts — importing them normally is a runtime SyntaxError.
import type { AnyMessage, Stream } from "@agentclientprotocol/sdk";
// ---------------------------------------------------------------- steering
/**
* The steering extension (../steering_protocol.md, and ./steering.ts for a
* scripted walkthrough). It is not part of ACP proper, so it has no entry in
* `methods` and is sent as a raw method name with hand-written types.
*/
const STEERING_METHOD = "_session/steering";
type SteeringRequest = {
sessionId: string;
prompt: Array<{ type: "text"; text: string }>;
};
/** Both outcomes are successes; they say where the message landed, not whether
* it worked. "startedNewTurn" means the turn finished before we got there. */
type SteeringResponse = {
outcome: "injected" | "startedNewTurn";
};
// ---------------------------------------------------------------- arguments
const ARGV = process.argv.slice(2);
/** Reads `--name=value` or `--name value`; returns "" for a valueless flag. */
function flag(name: string): string | undefined {
const index = ARGV.findIndex((arg) => arg === `--${name}` || arg.startsWith(`--${name}=`));
if (index === -1) return undefined;
const [, ...rest] = ARGV[index].split("=");
return rest.length > 0 ? rest.join("=") : (ARGV[index + 1] ?? "");
}
if (ARGV.includes("--help") || ARGV.includes("-h")) {
process.stdout.write(
[
"Usage: node examples/simple-client.ts [--debug-port=<port>] [--no-build]",
"",
" --debug-port=<port> rebuild with source maps and start the agent under",
" --inspect-brk=<port>, paused until a debugger attaches",
" --no-build skip the tsc rebuild and use dist/ as-is",
"",
"Env: AGENT_ENTRY (default dist/index.js), CWD (default process.cwd()).",
"",
].join("\n"),
);
process.exit(0);
}
// The built agent entry. Rebuilt below unless --no-build is passed.
const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
const AGENT_ENTRY = process.env.AGENT_ENTRY ?? path.join(repoRoot, "dist", "index.js");
const CWD = process.env.CWD ?? process.cwd();
const BUILD = !ARGV.includes("--no-build");
const debugPortArg = flag("debug-port");
const DEBUG_PORT = debugPortArg === undefined ? undefined : Number(debugPortArg);
if (
DEBUG_PORT !== undefined &&
(!Number.isInteger(DEBUG_PORT) || DEBUG_PORT < 1 || DEBUG_PORT > 65535)
) {
process.stderr.write(`--debug-port expects a port between 1 and 65535, got "${debugPortArg}"\n`);
process.exit(1);
}
/** Shown by `!help`, and once at startup. */
const HELP = [
"<text> send it — as a new turn, or buffered until this turn ends",
"!steer <text> inject into the running turn (_session/steering)",
"!queue <text> send session/prompt now and let the agent queue it",
"!cancel session/cancel the running turn (same as Ctrl-C)",
"!help this list; !! sends a line that really starts with '!'",
];
// How long to wait for a cancelled turn to settle, and for the agent to exit
// after we close its stdin, before escalating during shutdown.
const CANCEL_TIMEOUT_MS = 5_000;
const EXIT_TIMEOUT_MS = 5_000;
// ---------------------------------------------------------------- output
const COLOR = process.stderr.isTTY === true && !process.env.NO_COLOR;
const paint = (code: string, text: string) => (COLOR ? `\x1b[${code}m${text}\x1b[0m` : text);
const dim = (text: string) => paint("2", text);
const TTY = process.stdin.isTTY === true && process.stderr.isTTY === true;
const startedAt = Date.now();
let rl: readline.Interface | null = null;
let shuttingDown = false;
let queue: string[] = [];
// How many `session/prompt` requests are awaiting a response. Usually 0 or 1;
// `!queue` deliberately drives it higher to exercise the agent's own queueing.
let inFlight = 0;
const turnRunning = () => inFlight > 0;
let cancelRequested = false;
let lastUpdateKind = "";
// False until `initialize` returns — an agent still paused under --inspect-brk
// will never act on stdin EOF, so shutdown skips straight to signalling it.
let agentReady = false;
/**
* The single writer for everything this process prints. It wipes the half-typed
* input line, writes the block, then asks readline to redraw its prompt with the
* buffer intact — without this, streamed output and typing shred each other.
* (One caveat: a soft-wrapped input line leaves a stale fragment behind, since
* clearLine only clears the row the cursor is on.)
*/
function writeBlock(text: string) {
if (TTY) {
readline.cursorTo(process.stderr, 0);
readline.clearLine(process.stderr, 0);
}
process.stderr.write(text.endsWith("\n") ? text : `${text}\n`);
if (TTY) rl?.prompt(true);
}
function log(message: string) {
writeBlock(`${dim("[client]")} ${message}`);
}
function refreshPrompt() {
if (!rl) return;
const queued = queue.length > 0 ? `[${queue.length} queued] ` : "";
const running = inFlight > 1 ? `[${inFlight} turns] ` : "";
const busy = turnRunning() ? dim(`⋯ ${lastUpdateKind} `) : "";
rl.setPrompt(`${busy}${running}${queued}› `);
if (TTY) rl.prompt(true);
}
const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
// ---------------------------------------------------------------- wire log
/** A permissive view of the JSON-RPC union, purely for the summary line. */
type WireMessage = {
id?: string | number | null;
method?: string;
params?: { update?: { sessionUpdate?: string } };
result?: { stopReason?: string };
error?: { code: number; message: string };
};
/** One-line summary: method (plus session update kind), or which reply this is. */
function describe(message: AnyMessage): string {
const wire = message as WireMessage;
const id = wire.id === undefined || wire.id === null ? "" : ` #${wire.id}`;
if (wire.method !== undefined) {
const kind = wire.params?.update?.sessionUpdate;
return `${wire.method}${kind ? ` · ${kind}` : ""}${id}`;
}
if (wire.error !== undefined) {
return `error${id} · ${wire.error.code} ${wire.error.message}`;
}
const stopReason = wire.result?.stopReason;
return `result${id}${stopReason ? ` · ${stopReason}` : ""}`;
}
/**
* Prints one JSON-RPC message. The SDK exposes no logging hook, so this is
* called from a stream tap (see `tapStream`) that sits between the SDK and the
* transport — what you see is exactly what is written to / read from the pipe.
*/
function logMessage(direction: "agent" | "user", message: AnyMessage) {
const inbound = direction === "agent";
const color = inbound ? "36" : "35";
const elapsed = ((Date.now() - startedAt) / 1000).toFixed(3);
const header = [
dim(`+${elapsed}s`),
paint(`1;${color}`, inbound ? "[agent]" : "[user] "),
paint(color, inbound ? "◂" : "▸"),
dim(describe(message)),
].join(" ");
// The body is printed flush left and unadorned so that selecting it in the
// terminal yields valid JSON you can paste straight into a tool.
writeBlock(`${header}\n${JSON.stringify(message, null, 2)}`);
}
/**
* Wraps a transport stream so every message is logged post-parse/pre-stringify.
* A TransformStream per direction is the only complete interposition point: the
* SDK reads inbound with a single reader and takes a fresh writer per outbound
* message, and both survive being handed a transform.
*/
function tapStream(inner: Stream): Stream {
const inbound = new TransformStream<AnyMessage, AnyMessage>({
transform(message, controller) {
logMessage("agent", message);
controller.enqueue(message);
},
});
const outbound = new TransformStream<AnyMessage, AnyMessage>({
transform(message, controller) {
logMessage("user", message);
controller.enqueue(message);
},
});
// The SDK never closes its writable, so this pipe only settles on failure —
// typically the agent died and its stdin is gone. Teardown handles the rest;
// without the catch this would be an unhandled rejection.
outbound.readable.pipeTo(inner.writable).catch((err) => {
if (!shuttingDown) log(`transport write failed: ${err}`);
});
return { readable: inner.readable.pipeThrough(inbound), writable: outbound.writable };
}
// ---------------------------------------------------------------- build
/** Runs the repo's tsc, sending its diagnostics to our stderr. */
async function build(sourceMaps: boolean) {
const localTsc = path.join(repoRoot, "node_modules", "typescript", "bin", "tsc");
const useLocal = existsSync(localTsc);
const args = sourceMaps ? ["--sourceMap"] : [];
log(`building agent (tsc${sourceMaps ? " --sourceMap" : ""}) …`);
const child = useLocal
? spawn(process.execPath, [localTsc, ...args], { cwd: repoRoot, stdio: ["ignore", 2, 2] })
: spawn(process.platform === "win32" ? "npx.cmd" : "npx", ["tsc", ...args], {
cwd: repoRoot,
stdio: ["ignore", 2, 2],
});
const [code] = (await once(child, "exit")) as [number | null];
if (code !== 0) {
log(`build failed (tsc exit ${code}) — fix the errors above, or pass --no-build`);
process.exit(1);
}
}
// ---------------------------------------------------------------- main
async function main() {
if (BUILD) {
await build(DEBUG_PORT !== undefined);
} else if (!existsSync(AGENT_ENTRY)) {
log(`${AGENT_ENTRY} not found — run \`npm run build\` first, or unset --no-build`);
process.exit(1);
}
// An ACP client launches the agent as a subprocess and speaks JSON-RPC over
// its stdin/stdout. Its stderr is piped rather than inherited so that agent
// logs go through writeBlock() and don't corrupt the readline input line.
const nodeArgs =
DEBUG_PORT === undefined ? [AGENT_ENTRY] : [`--inspect-brk=${DEBUG_PORT}`, AGENT_ENTRY];
const child = spawn(process.execPath, nodeArgs, {
cwd: repoRoot,
stdio: ["pipe", "pipe", "pipe"],
env: process.env,
});
child.on("error", (err) => {
log(`failed to spawn agent (${AGENT_ENTRY}): ${err}`);
process.exit(1);
});
// A write racing the agent's exit surfaces as an unhandled 'error' event that
// would take this client down with it.
child.stdin?.on("error", (err: NodeJS.ErrnoException) => {
if (err.code !== "EPIPE") log(`agent stdin error: ${err}`);
});
child.stdout?.on("error", () => {});
process.stderr.on("error", () => {});
pumpAgentStderr(child);
child.on("exit", (code, signal) => {
if (!shuttingDown) log(`agent exited (code ${code}, signal ${signal})`);
});
const stream = tapStream(
ndJsonStream(
Writable.toWeb(child.stdin!) as WritableStream<Uint8Array>,
Readable.toWeb(child.stdout!) as unknown as ReadableStream<Uint8Array>,
),
);
const connection = acpClient({ name: "simple-client" })
// The tap already prints every update; this handler exists so the prompt line
// can show what the agent is currently doing.
.onNotification(methods.client.session.update, (ctx) => {
lastUpdateKind = ctx.params.update.sessionUpdate;
})
// Auto-approve, chosen by `kind` and never by a hard-coded optionId: for
// ExitPlanMode this agent uses permission-*mode* names as option ids
// (auto / acceptEdits / default / plan / bypassPermissions).
.onRequest(methods.client.session.requestPermission, (ctx) => {
const options = ctx.params.options;
const option = options.find((o) => o.kind === "allow_once") ?? options[0];
if (!option) return { outcome: { outcome: "cancelled" } };
log(`auto-approving permission: ${option.name} (${option.kind}/${option.optionId})`);
return { outcome: { outcome: "selected", optionId: option.optionId } };
})
// Minimal file-system stubs. This agent performs its own file I/O inside the
// Claude Agent SDK subprocess and never calls these today.
.onRequest(methods.client.fs.readTextFile, () => ({ content: "" }))
.onRequest(methods.client.fs.writeTextFile, () => ({}))
.connect(stream);
const agent = connection.agent;
// Signals are wired up *before* the first request. Under --inspect-brk the
// wait below is unbounded, and a client that dies without running shutdown()
// orphans a paused agent still holding the debug port.
const onInterrupt = () => {
if (turnRunning() && !cancelRequested) {
cancelRequested = true;
const dropped = queue.length;
queue = [];
// A notification, not a request: every turn in flight settles through its
// own session/prompt response, normally with stopReason "cancelled".
void agent.notify(methods.agent.session.cancel, { sessionId });
log(`sent session/cancel${dropped > 0 ? `, dropped ${dropped} queued line(s)` : ""}`);
refreshPrompt();
return;
}
void shutdown(turnRunning() ? "^C while cancelling" : "^C");
};
// In terminal mode readline puts stdin in raw mode and owns ^C, so this only
// ever fires for an explicit `kill -INT`; with piped stdin it is the ^C path.
process.on("SIGINT", onInterrupt);
process.on("SIGTERM", () => void shutdown("SIGTERM"));
// 1. Initialize. Under --inspect-brk the agent is paused before it reads a
// single byte, so this request stays unanswered until a debugger attaches
// and resumes it. ACP has no request timeout, so waiting is safe; the
// interval below just keeps the terminal from looking dead.
let nudge: NodeJS.Timeout | undefined;
if (DEBUG_PORT !== undefined) {
log(`agent is PAUSED before its first line (--inspect-brk=${DEBUG_PORT})`);
log(`attach a debugger to port ${DEBUG_PORT} and resume it — breakpoints go in src/*.ts`);
nudge = setInterval(
() => log(`still waiting for a debugger on port ${DEBUG_PORT} … (Ctrl-C to give up)`),
10_000,
);
}
let init;
try {
init = await agent.request(methods.agent.initialize, {
protocolVersion: PROTOCOL_VERSION,
clientCapabilities: {
fs: { readTextFile: true, writeTextFile: true },
terminal: false,
},
});
} finally {
if (nudge) clearInterval(nudge);
}
agentReady = true;
log(`connected to ${init.agentInfo?.name ?? "agent"} ${init.agentInfo?.version ?? ""}`.trim());
// Steering is advertised at the TOP-LEVEL `_meta` of the initialize result —
// a sibling of `agentCapabilities`, not nested inside it. Prompt queueing is
// a Claude-specific capability flag and does live inside.
const initMeta = init._meta as { steering?: { supported?: boolean } } | null | undefined;
const steeringSupported = initMeta?.steering?.supported === true;
const queueMeta = init.agentCapabilities?._meta as
{ claudeCode?: { promptQueueing?: boolean } } | null | undefined;
log(
`agent supports: steering=${steeringSupported} ` +
`promptQueueing=${queueMeta?.claudeCode?.promptQueueing === true}`,
);
// 2. Open a session.
let sessionId: string;
try {
const session = await agent.request(methods.agent.session.new, { cwd: CWD, mcpServers: [] });
sessionId = session.sessionId;
} catch (err) {
log(`session/new failed: ${err}`);
log("if this is an auth error, log in first: node dist/index.js --cli auth login");
await shutdown("session/new failed", 1);
return;
}
log(`session ${sessionId} in ${CWD}`);
// 3. Turns. There are four ways to get a message to the agent, and the client
// can drive all of them (see `handleCommand`); plain text uses the first.
//
// session/prompt a new turn, or — for text typed mid-turn — one
// buffered here and sent when the turn responds
// session/prompt sent mid-turn anyway, so the *agent* queues it
// (!queue) (it advertises `_meta.claudeCode.promptQueueing`)
// _session/steering injected into the turn that is already running
// (!steer)
// session/cancel abandon the running turn
// (!cancel, ^C)
let draining = false;
/** One `session/prompt` round-trip. Several may be in flight at once when
* `!queue` is used; the agent runs them in order. */
async function sendPrompt(text: string) {
inFlight += 1;
cancelRequested = false;
refreshPrompt();
try {
const result = await agent.request(methods.agent.session.prompt, {
sessionId,
prompt: [{ type: "text", text }],
});
log(`turn ended: ${result.stopReason}`);
} catch (err) {
// The error response itself was already printed by the tap; this is
// the human-readable "your prompt did not run".
log(`prompt failed: ${err}`);
if (connection.signal.aborted) queue = [];
} finally {
inFlight -= 1;
refreshPrompt();
exitWhenIdle();
}
}
/** Sends the buffered lines one turn at a time, oldest first. */
async function drain() {
if (draining) return;
draining = true;
try {
while (queue.length > 0 && !shuttingDown) {
await sendPrompt(queue.shift()!);
if (connection.signal.aborted) break;
}
} finally {
draining = false;
refreshPrompt();
exitWhenIdle();
}
}
/** A piped stdin ends; exiting has to wait for the work already handed out. */
function exitWhenIdle() {
if (inputClosed && !draining && queue.length === 0 && inFlight === 0) {
void shutdown("input closed, queue drained");
}
}
/**
* Client-side commands, prefixed with `!` so they cannot collide with the
* agent's own slash commands (`/compact` and friends, which are just prompt
* text as far as this client is concerned). `!!` escapes a literal `!`.
*/
function handleCommand(line: string) {
const word = line.split(/\s+/)[0];
const text = line.slice(word.length).trim();
switch (word) {
case "!steer":
if (text.length === 0) {
log("usage: !steer <message> — injects into the turn that is running");
break;
}
if (!steeringSupported) log("agent did not advertise steering; trying anyway");
void steer(text);
break;
case "!queue":
if (text.length === 0) {
log("usage: !queue <message> — sends session/prompt now, agent queues it");
break;
}
void sendPrompt(text);
break;
case "!cancel":
if (!turnRunning()) {
log("nothing to cancel");
break;
}
onInterrupt();
break;
case "!help":
for (const entry of HELP) log(entry);
break;
default:
log(`unknown command ${word} — try !help`);
break;
}
refreshPrompt();
}
/** `_session/steering`: deliver a message to the turn already in progress. */
async function steer(text: string) {
const params: SteeringRequest = { sessionId, prompt: [{ type: "text", text }] };
try {
const result = await agent.request<SteeringResponse>(STEERING_METHOD, params);
// Either way the steered message's own output arrives as `session/update`
// notifications, not in this response. When injected, it lands inside the
// turn we steered, whose `stopReason` waits for it.
log(
result.outcome === "injected"
? "steer outcome: injected into the running turn"
: "steer outcome: startedNewTurn — the turn had already finished, so the " +
"agent began a new one that no session/prompt of ours is tracking",
);
} catch (err) {
log(`steer rejected: ${err}`);
}
}
let inputClosed = false;
let steerHinted = false;
rl = readline.createInterface({
input: process.stdin,
output: process.stderr,
terminal: TTY,
crlfDelay: Infinity,
historySize: 200,
});
rl.on("line", (raw) => {
const line = raw.trim();
if (line.length === 0 || shuttingDown) {
refreshPrompt();
return;
}
if (line.startsWith("!") && !line.startsWith("!!")) {
handleCommand(line);
return;
}
// "!!steer …" is how you send text that begins with the command prefix.
queue.push(line.startsWith("!!") ? line.slice(1) : line);
if (turnRunning()) {
log(`buffered — will send when this turn ends (${queue.length} queued)`);
if (!steerHinted) {
steerHinted = true;
log("…or use !steer <text> to inject into the running turn instead");
}
}
refreshPrompt();
void drain();
});
rl.on("SIGINT", onInterrupt);
rl.on("close", () => {
inputClosed = true;
exitWhenIdle();
});
void connection.closed.then(() => {
if (!shuttingDown) void shutdown("connection closed");
});
for (const entry of HELP) log(entry);
log("Enter sends, Ctrl-C cancels a turn, Ctrl-D exits");
refreshPrompt();
/**
* Order matters here. The agent exits cleanly on stdin EOF (src/index.ts wires
* `connection.closed` to `agent.dispose()`), whereas killing it skips disposal
* and can orphan the Claude Agent SDK subprocess. Closing our connection first
* would cancel the reader on the agent's stdout and make it die of EPIPE
* mid-write, so that comes last.
*/
async function shutdown(reason: string, exitCode = 0) {
if (shuttingDown) return;
shuttingDown = true;
log(`shutting down (${reason})`);
queue = [];
rl?.removeAllListeners("close");
rl?.close();
if (turnRunning()) {
if (!cancelRequested) {
try {
await agent.notify(methods.agent.session.cancel, { sessionId });
} catch {
// The connection may already be gone; teardown continues regardless.
}
}
const deadline = Date.now() + CANCEL_TIMEOUT_MS;
while (turnRunning() && Date.now() < deadline) await delay(50);
}
child.stdin?.end();
const exited = await Promise.race([
once(child, "exit").then(() => true),
delay(agentReady ? EXIT_TIMEOUT_MS : 250).then(() => false),
]);
if (!exited) {
log("agent did not exit on stdin EOF; sending SIGTERM");
child.kill("SIGTERM");
const stopped = await Promise.race([
once(child, "exit").then(() => true),
delay(2_000).then(() => false),
]);
if (!stopped) child.kill("SIGKILL");
}
connection.close();
process.exit(exitCode);
}
}
/** Streams the agent's stderr through writeBlock, flagging inspector messages. */
function pumpAgentStderr(child: ReturnType<typeof spawn>) {
let buffered = "";
child.stderr?.setEncoding("utf8");
child.stderr?.on("data", (chunk: string) => {
buffered += chunk;
const lines = buffered.split("\n");
buffered = lines.pop() ?? "";
for (const line of lines) {
if (line.length === 0) continue;
if (line.includes("Debugger listening on")) {
writeBlock(paint("1;33", `[agent] ${line.trim()}`));
} else if (line.includes("address already in use")) {
writeBlock(paint("1;31", `[agent] ${line.trim()}`));
log("that inspector port is taken — pass a different --debug-port");
} else {
writeBlock(dim(`[agent:stderr] ${line}`));
}
}
});
}
main().catch((err) => {
// Tearing down rejects whatever request main() is awaiting; that is the
// teardown finishing its job, not a failure, and shutdown() owns the exit.
if (shuttingDown) return;
log(`fatal: ${err?.stack ?? err}`);
process.exit(1);
});

338
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@agentclientprotocol/claude-agent-acp",
"version": "0.64.1",
"version": "0.65.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@agentclientprotocol/claude-agent-acp",
"version": "0.64.1",
"version": "0.65.0",
"license": "Apache-2.0",
"dependencies": {
"@agentclientprotocol/sdk": "1.3.0",
@@ -227,43 +227,6 @@
"node": ">=12"
}
},
"node_modules/@emnapi/core": {
"version": "2.0.0-alpha.3",
"resolved": "https://registry.npmjs.org/@emnapi/core/-/core-2.0.0-alpha.3.tgz",
"integrity": "sha512-AZypUeJ/yByuxyS7BlSNRDOMLMlROYtjYdIAuBmJssVz1UJDSeYxLrdizhXCFYhedC5bqd/ASy8EuNXbVVXp9g==",
"dev": true,
"license": "MIT",
"optional": true,
"peer": true,
"dependencies": {
"@emnapi/wasi-threads": "2.0.1",
"tslib": "^2.4.0"
}
},
"node_modules/@emnapi/runtime": {
"version": "2.0.0-alpha.3",
"resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-2.0.0-alpha.3.tgz",
"integrity": "sha512-hFPAhMUjJD9BSyCANEISPOogeXC9Zo9ZQl7L6vKnaVsMkCtzznaW/naYypeyl0Gv5rYfWYsZbpixTMpjDJzQeA==",
"dev": true,
"license": "MIT",
"optional": true,
"peer": true,
"dependencies": {
"tslib": "^2.4.0"
}
},
"node_modules/@emnapi/wasi-threads": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-2.0.1.tgz",
"integrity": "sha512-9DsSk+o5NBX0CCJT8s0EROGSGxjR/tKu6aBTaVyq+SjAEQH4XcdcRxPBRzsBLizTTJ49MJjF+jgu3qnO9GLQcQ==",
"dev": true,
"license": "MIT",
"optional": true,
"peer": true,
"dependencies": {
"tslib": "^2.4.0"
}
},
"node_modules/@eslint-community/eslint-utils": {
"version": "4.10.1",
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.10.1.tgz",
@@ -380,13 +343,13 @@
}
},
"node_modules/@hono/node-server": {
"version": "1.19.17",
"resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.19.17.tgz",
"integrity": "sha512-dSneS5qhiauZWGDCeK4o695Xd9nUNjviSZCMQrj10eetr8Uln1ucn6bbphOM6UynAMMtNIzZNSpL9vnASJwrPQ==",
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-2.1.0.tgz",
"integrity": "sha512-XovyyCCnBzW+zKu+z/zq8hwNs4KOR5rEMAOxo2f40Q5xoOI37IMm6MIg2COOUtUApo0i6850MTBKH2u4QLGIqg==",
"license": "MIT",
"peer": true,
"engines": {
"node": ">=18.14.1"
"node": ">=20"
},
"peerDependencies": {
"hono": "^4"
@@ -527,32 +490,10 @@
}
}
},
"node_modules/@napi-rs/wasm-runtime": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.0.tgz",
"integrity": "sha512-kDoONqMa+VnZ4vvvu/ZUurpJ4gkZU57e7g69qpNgWhYcZFPUHZM2CEMKm+cG6ufDVALbjMvfmMjFVqaK7uEMnA==",
"dev": true,
"license": "MIT",
"optional": true,
"dependencies": {
"@tybys/wasm-util": "^0.10.3"
},
"engines": {
"node": "^20.19.0 || ^22.13.0 || >=23.5.0"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/Brooooooklyn"
},
"peerDependencies": {
"@emnapi/core": "^2.0.0-alpha.3",
"@emnapi/runtime": "^2.0.0-alpha.3"
}
},
"node_modules/@oxc-project/types": {
"version": "0.139.0",
"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.139.0.tgz",
"integrity": "sha512-r9gHphtCs+1M7J0pw6Sn/hh/Wpa/iQrOOkrNAlVLF/gHq+/CJmHIWKKUUhdWjcD6CIa8idarspCsASiXCXvFUw==",
"version": "0.142.0",
"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.142.0.tgz",
"integrity": "sha512-7W+2q5AKQVU36fkaryontrHn3YDt1RyUYXatw9i5H8ocYe2sPKSFB6eS8WNPeRKiN1qAWWZUPm7gwFzJGrccqQ==",
"dev": true,
"license": "MIT",
"funding": {
@@ -560,9 +501,9 @@
}
},
"node_modules/@rolldown/binding-android-arm64": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.1.5.tgz",
"integrity": "sha512-lZg8fqIv2v7FF237bwMgzGZEJvGL79/s5knJ/i6FmsGF4XXlzccZ4jb+TrFIxtSSxFtIpdsgrPZeMk1I9AFcyQ==",
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.2.tgz",
"integrity": "sha512-l7x215OGvo1s52JWmR8U/DAVzEDWBCIbTm28aeJV/WDTSHgcKXaZTuBT0hJMs5NggilfJTW3clZVvd24yfKJxA==",
"cpu": [
"arm64"
],
@@ -577,9 +518,9 @@
}
},
"node_modules/@rolldown/binding-darwin-arm64": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.1.5.tgz",
"integrity": "sha512-51Bnx9pNiMRKSUNtBfySkNJ9vMU9Hh3I1ozDd6gyPPYzaXCfnptUcEZxXGYFn+ul2dtcMUiqGR1Yai2K10uoTw==",
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.2.tgz",
"integrity": "sha512-9u9Xv6c1AJZT0FfwH5vrMG5Jjcwhc1MlyrPu0XfTqkzsmqfks2M6W/o5XwAJgVVN/jHpqqngC1WevHKKTIUtIA==",
"cpu": [
"arm64"
],
@@ -594,9 +535,9 @@
}
},
"node_modules/@rolldown/binding-darwin-x64": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.1.5.tgz",
"integrity": "sha512-Tm+gbfC0aHu1tBA/JvKQh32S0K6YgCHkiAF4/W6xX0K0RmNuc94VeK419dJoE65R5aRxmo+noZQSWrAMF6yb6g==",
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.2.tgz",
"integrity": "sha512-9W1mbGZAfW3oqd85bhBkmpyHCCzL1TeG/zFFP3vg7b0rlly8cxOcre5nXwz+LHazCwac2MNWgPdPCHndABjpWQ==",
"cpu": [
"x64"
],
@@ -611,9 +552,9 @@
}
},
"node_modules/@rolldown/binding-freebsd-x64": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.1.5.tgz",
"integrity": "sha512-JMzDKCCXq93YccG5gz3hvOs1oXRKAf0XYpfOS88e+wZrC8Iugj6j68867vrYZkvpDDpKn/KoKORThmchMpF6TA==",
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.2.tgz",
"integrity": "sha512-0p1lhiCSCyaerFwtrdZQUx7NqGk6LQnaRKWX7tFQqwQgvX0rjM15cIkm3pax1UpEakK14C4mOxx/jSqCBdBRqQ==",
"cpu": [
"x64"
],
@@ -628,9 +569,9 @@
}
},
"node_modules/@rolldown/binding-linux-arm-gnueabihf": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.1.5.tgz",
"integrity": "sha512-uML21j2K5TfPGutKxub+M+nLjZIrWjXQ5Grx4lCe/nimTj9B4L63zHpjXLl4y0L3mcm2htEQIb06oCG/szerNw==",
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.2.tgz",
"integrity": "sha512-e+cOJXrJ2L3zx6YzqPg+f6Wbk3V1cKB8bOhbaYdVYN3DdquzNdRAmrbETz1qnt5yp/c7JNlNjmITiA2cVneQ7w==",
"cpu": [
"arm"
],
@@ -645,9 +586,9 @@
}
},
"node_modules/@rolldown/binding-linux-arm64-gnu": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.1.5.tgz",
"integrity": "sha512-navSiuTMogvnQoZoM/v+l3ZWo50/NTwSHSzheABx/RCnmUPaKwq9qSo4Br2OYRs21+Fz8uFqITZM3H4opOB0/Q==",
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.2.tgz",
"integrity": "sha512-JsSMsj6sNat/MuhG5fnBD7QgbtpHKVe30x5/bAVirDHdhoQRXJkF6xc0Jqk8O4fiCUQAzMOoH9wZi3m60c8wtg==",
"cpu": [
"arm64"
],
@@ -665,9 +606,9 @@
}
},
"node_modules/@rolldown/binding-linux-arm64-musl": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.1.5.tgz",
"integrity": "sha512-lAryqH7IteztmCXQXk0etKj4wBQ7Gx5S6LjKhsgp9zb8I5bsuvU/2llH1hDQcjsFeqIsovMVN339/8pUDDBXxA==",
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.2.tgz",
"integrity": "sha512-B5G/zJdHaoJn9vD50eGHWkiWfmq8Uhi3IiLPJTzmZTrAalk1bztUikSXo0qga18ibE0IXboyeMUnhPjhAJ45wQ==",
"cpu": [
"arm64"
],
@@ -685,9 +626,9 @@
}
},
"node_modules/@rolldown/binding-linux-ppc64-gnu": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.1.5.tgz",
"integrity": "sha512-fsK/sNBnxzBlL4O1JNrZakVQxPspqpED5dLtNsZS9oOKmtSpdNIzxH2kkol5HYTWJN47sE20ztMJPxfZ89qGOg==",
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.2.tgz",
"integrity": "sha512-6mC/awzKka8W6EoekjegpfGkjz8jXWDX63pqu/HYVpyKtZfu65Jsh4QAH3Kej3CAv/c1oGX7psTmFEbr0mDxLA==",
"cpu": [
"ppc64"
],
@@ -705,9 +646,9 @@
}
},
"node_modules/@rolldown/binding-linux-s390x-gnu": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.1.5.tgz",
"integrity": "sha512-gLYb4BIadlfTOYT5gO503n8zQjXflgzpD0FcyKh0Mzx3rqCZKnHoJWV9xe1KXUJ5lx2JfcSHr/mhzS0PC/McAA==",
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.2.tgz",
"integrity": "sha512-412MX9fJLdA1IK28EZnc8jYv2HRTleOZgfLQumJ5zy7OeJLZlg/CETwFaXjNmGVxG51cFHpKLqb5LKvBC+HsHA==",
"cpu": [
"s390x"
],
@@ -725,9 +666,9 @@
}
},
"node_modules/@rolldown/binding-linux-x64-gnu": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.1.5.tgz",
"integrity": "sha512-FjcpEKUyJygHgs1o50VYNvkt5+7Le/VEdYt0AkRpkL33MnyQfwr8l5mXwMmfmTbyMPr5vJLC+8/Gd9gXnwU1QQ==",
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.2.tgz",
"integrity": "sha512-Q/+HI/ToJafZ1iCqGgVQXUEkIjufHCTF0gBQ2a5o3cg7GJ2h0qyq3nvvSmU+bGda2/7ygXpTY4TM6gO9OhQ0ZA==",
"cpu": [
"x64"
],
@@ -745,9 +686,9 @@
}
},
"node_modules/@rolldown/binding-linux-x64-musl": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.1.5.tgz",
"integrity": "sha512-Me+PfPI2TMeOQk0gYWfLQZtTktrmzbr8cDboqX83XKc7UrgAi55gF+2dUkWdxd19n55Essp2yeca+O9N5rBxHg==",
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.2.tgz",
"integrity": "sha512-ZKp/w41n6wCvxzxQHtQSbuphfX3Y4cCvbjkKHusrLx4lh+JWLTU7StSltO/DKARISzbj368d+qUaCjI8K2wzXw==",
"cpu": [
"x64"
],
@@ -765,9 +706,9 @@
}
},
"node_modules/@rolldown/binding-openharmony-arm64": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.1.5.tgz",
"integrity": "sha512-yc5WrLzXks6zCQfn9Oxr8pORKyl/pF+QjHmW/Qx3qu0oyrrNC+y2JLTU1E2rcWYAmzlnqngWXHQjy51VzW70Vw==",
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.2.tgz",
"integrity": "sha512-pxE6xD4KS3eAROkKK5yrhB9/3+vhlhVGMvlQLbdpzrBGDbKrnzx3RLwPaHvasLo6jgaiBLn7e04Df9C4tYhjmA==",
"cpu": [
"arm64"
],
@@ -781,63 +722,10 @@
"node": "^20.19.0 || >=22.12.0"
}
},
"node_modules/@rolldown/binding-wasm32-wasi": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.1.5.tgz",
"integrity": "sha512-VbQGPX2b4r48TAMIM2cjgluIM1HYutm4pcTEJsle7iEP7sB1dFqtPLBVbdLAZCxy1txCcPxf4QFf4v8uvltPqA==",
"cpu": [
"wasm32"
],
"dev": true,
"license": "MIT",
"optional": true,
"dependencies": {
"@emnapi/core": "1.11.1",
"@emnapi/runtime": "1.11.1",
"@napi-rs/wasm-runtime": "^1.1.6"
},
"engines": {
"node": "^20.19.0 || >=22.12.0"
}
},
"node_modules/@rolldown/binding-wasm32-wasi/node_modules/@emnapi/core": {
"version": "1.11.1",
"resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.11.1.tgz",
"integrity": "sha512-RSvbQmHzdKzNsLYa/wHrbc3KN4sYLKAdPZxqiM2HATqv/SBk2/ENSHpvXGaLOMcsAyz0poEGqkmmKYG3OWiJEQ==",
"dev": true,
"license": "MIT",
"optional": true,
"dependencies": {
"@emnapi/wasi-threads": "1.2.2",
"tslib": "^2.4.0"
}
},
"node_modules/@rolldown/binding-wasm32-wasi/node_modules/@emnapi/runtime": {
"version": "1.11.1",
"resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.1.tgz",
"integrity": "sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==",
"dev": true,
"license": "MIT",
"optional": true,
"dependencies": {
"tslib": "^2.4.0"
}
},
"node_modules/@rolldown/binding-wasm32-wasi/node_modules/@emnapi/wasi-threads": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.2.tgz",
"integrity": "sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA==",
"dev": true,
"license": "MIT",
"optional": true,
"dependencies": {
"tslib": "^2.4.0"
}
},
"node_modules/@rolldown/binding-win32-arm64-msvc": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.1.5.tgz",
"integrity": "sha512-gHv82k63z4qpV5+Q1y/12KrK0ltWBukVDI8nZcbT7Tt/ZlOIVwppazneq0F93oDxTo3IgAMEDIoQh3E2n6mVsw==",
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.2.tgz",
"integrity": "sha512-4MqEue5re+xIZzAWsB8sj0P1kqZySWqIuN4t6QaIO/YA6SFwySOLruvWQFzfmqk8LBK2P30KCSJwf6mJCZZ5/A==",
"cpu": [
"arm64"
],
@@ -852,9 +740,9 @@
}
},
"node_modules/@rolldown/binding-win32-x64-msvc": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.1.5.tgz",
"integrity": "sha512-tTZuDBPw85tEN5PQi1pnEBzDy0Z49HtScLAbD5t6hyeU92A95pRWaSMw1GZZi/RwgSgUIl0xrSlXIT/9QzvYSA==",
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.2.tgz",
"integrity": "sha512-NweNxxD0Nf9t8v7kodun45Ijp3EIwYY+uydPP6qBEYvfBqhIjN6dZMzlQja3tqX/aLs3F3Uz+AxDpKgRhpOZQg==",
"cpu": [
"x64"
],
@@ -923,17 +811,6 @@
"dev": true,
"license": "MIT"
},
"node_modules/@tybys/wasm-util": {
"version": "0.10.3",
"resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.3.tgz",
"integrity": "sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==",
"dev": true,
"license": "MIT",
"optional": true,
"dependencies": {
"tslib": "^2.4.0"
}
},
"node_modules/@types/chai": {
"version": "5.2.3",
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz",
@@ -1481,9 +1358,9 @@
}
},
"node_modules/brace-expansion": {
"version": "5.0.8",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.8.tgz",
"integrity": "sha512-JZyDyq3D4AUifKTPOB7DELf6XsB3WdPuNxCtob1vFXPsSXhdAiHBWJ/tJ8HAc9aH84BK+5JFZLNkJKx3G9kzQg==",
"version": "5.0.9",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz",
"integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -2155,9 +2032,9 @@
"license": "Unlicense"
},
"node_modules/fast-uri": {
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.4.tgz",
"integrity": "sha512-8JnbkQ4juDyvYs4mgFGQqg4yCYtFDtUtmp2QIQq11ZZe5CFQ5wcqm1rqDgAh/QdMySuBnPzMUiJUNZG5N/AiQw==",
"version": "3.1.5",
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.5.tgz",
"integrity": "sha512-gHwA1O9LDIcKunMKhObS/HimwtehO1nPUECKAu5TpKgaO19fcWEl4bliWe1jWxVFvIXztJjjQ4L8XQ1EU9f7Jw==",
"funding": [
{
"type": "github",
@@ -2256,9 +2133,9 @@
}
},
"node_modules/flatted": {
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.3.tgz",
"integrity": "sha512-/zipXxyO6rGvuNGDiULY9MvEGSkb2gaG4GGH4ygMi0ZZzyMHdUZBmntJmx5x1G2VuPytCwGN4xsJP6cw+sK+vQ==",
"version": "3.4.4",
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.4.tgz",
"integrity": "sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q==",
"dev": true,
"license": "ISC"
},
@@ -2412,9 +2289,9 @@
}
},
"node_modules/hono": {
"version": "4.12.32",
"resolved": "https://registry.npmjs.org/hono/-/hono-4.12.32.tgz",
"integrity": "sha512-XcuyW9qE2kJn07PkecMOBd5Vq/hMy7mmGw+idz1yblbg9N17ijJODrvPkn7/dwL3Kulj8LcRJ69DLOWf91dRUg==",
"version": "4.13.0",
"resolved": "https://registry.npmjs.org/hono/-/hono-4.13.0.tgz",
"integrity": "sha512-jhunvfHWxd7J5EFfSgH4xsYJzSe/lfqbUCxiyyeaQasUsXeEHXtzVid+7EOGByc5JnFa23SSFL3Y2RV/z1T+eQ==",
"license": "MIT",
"peer": true,
"engines": {
@@ -2487,9 +2364,9 @@
"peer": true
},
"node_modules/ip-address": {
"version": "10.3.1",
"resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.3.1.tgz",
"integrity": "sha512-1e9d3kb97NHJTIJDZW9rKqW2h6+dFa50Dy0fpPSMQp2ADje5gvKsXmdiK6dwY5t76TaTt5+P5N1Y/LoToIxP6g==",
"version": "10.4.0",
"resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.4.0.tgz",
"integrity": "sha512-oSK96Grm3aP6OrS263xVxbNDGVL7rzBtYdpGqlDG8iQdoenDoTs/nkki+DflYbAEE8Xl6o5YxhxlrKvI3nqKXQ==",
"license": "MIT",
"peer": true,
"engines": {
@@ -2543,9 +2420,9 @@
"license": "ISC"
},
"node_modules/jose": {
"version": "6.2.4",
"resolved": "https://registry.npmjs.org/jose/-/jose-6.2.4.tgz",
"integrity": "sha512-N8acGzVsQy6M/fjFcxtysNc4Q379TcM5dM/qKkNtsHFji88yANnXTr7BLeP75iPnFwBfQzM/jg2BZ9+HZrHCZA==",
"version": "6.2.8",
"resolved": "https://registry.npmjs.org/jose/-/jose-6.2.8.tgz",
"integrity": "sha512-Bsdjwm3Qsd/P0jR+BHDe3LytDfY7WBq2HmCCLIwuVRHMuEC9ae7/R474GIUdF1NgCyZjzVo/A9DOiOBtXq8ZoQ==",
"license": "MIT",
"peer": true,
"funding": {
@@ -3010,9 +2887,9 @@
"license": "MIT"
},
"node_modules/nanoid": {
"version": "3.3.16",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.16.tgz",
"integrity": "sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==",
"version": "3.3.17",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.17.tgz",
"integrity": "sha512-xQLf0A3HOMlgHq0n247/LRuAOYmB7dXJ/DvAxGvsSBij45XtBSmQycu+F8ODbHwns/XyFZagyL1+J0Offw1E0g==",
"dev": true,
"funding": [
{
@@ -3233,9 +3110,9 @@
}
},
"node_modules/postcss": {
"version": "8.5.24",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.24.tgz",
"integrity": "sha512-8RyVklq0owXUTa4xlpzu4l9AaVKIdQvAcOHZWaMh98HgySsUtxRVf/chRe3dsSLqb6i40BzGRzEUddRaI+9TSw==",
"version": "8.5.25",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.25.tgz",
"integrity": "sha512-DTPx3RWSSnWyzLxQnlH0rJP+EW5ekl16ZU4/psbIhA0e53kJfdgaN5vKM+xP7yJtXVu+nfdVFmlgFDEKAe4Pyw==",
"dev": true,
"funding": [
{
@@ -3369,13 +3246,13 @@
}
},
"node_modules/rolldown": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.1.5.tgz",
"integrity": "sha512-t9z29cJjXf/vxQ8dyhCSpt6H6aSwHTk8cT5I3iy6SMXuFpk5mB6PL6XfC8PCwrPTx93udwKUm9HRteAlTGBLiA==",
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.2.tgz",
"integrity": "sha512-opwpo1tQBAcpSUJDt94B7hhLNGOKjCdE//XXjeLrnx9b83bjnw45tXdg1b09yEw/VLFBJGZpwRULMmOZo7ol+A==",
"dev": true,
"license": "MIT",
"dependencies": {
"@oxc-project/types": "=0.139.0",
"@oxc-project/types": "=0.142.0",
"@rolldown/pluginutils": "^1.0.0"
},
"bin": {
@@ -3385,21 +3262,20 @@
"node": "^20.19.0 || >=22.12.0"
},
"optionalDependencies": {
"@rolldown/binding-android-arm64": "1.1.5",
"@rolldown/binding-darwin-arm64": "1.1.5",
"@rolldown/binding-darwin-x64": "1.1.5",
"@rolldown/binding-freebsd-x64": "1.1.5",
"@rolldown/binding-linux-arm-gnueabihf": "1.1.5",
"@rolldown/binding-linux-arm64-gnu": "1.1.5",
"@rolldown/binding-linux-arm64-musl": "1.1.5",
"@rolldown/binding-linux-ppc64-gnu": "1.1.5",
"@rolldown/binding-linux-s390x-gnu": "1.1.5",
"@rolldown/binding-linux-x64-gnu": "1.1.5",
"@rolldown/binding-linux-x64-musl": "1.1.5",
"@rolldown/binding-openharmony-arm64": "1.1.5",
"@rolldown/binding-wasm32-wasi": "1.1.5",
"@rolldown/binding-win32-arm64-msvc": "1.1.5",
"@rolldown/binding-win32-x64-msvc": "1.1.5"
"@rolldown/binding-android-arm64": "1.2.2",
"@rolldown/binding-darwin-arm64": "1.2.2",
"@rolldown/binding-darwin-x64": "1.2.2",
"@rolldown/binding-freebsd-x64": "1.2.2",
"@rolldown/binding-linux-arm-gnueabihf": "1.2.2",
"@rolldown/binding-linux-arm64-gnu": "1.2.2",
"@rolldown/binding-linux-arm64-musl": "1.2.2",
"@rolldown/binding-linux-ppc64-gnu": "1.2.2",
"@rolldown/binding-linux-s390x-gnu": "1.2.2",
"@rolldown/binding-linux-x64-gnu": "1.2.2",
"@rolldown/binding-linux-x64-musl": "1.2.2",
"@rolldown/binding-openharmony-arm64": "1.2.2",
"@rolldown/binding-win32-arm64-msvc": "1.2.2",
"@rolldown/binding-win32-x64-msvc": "1.2.2"
}
},
"node_modules/router": {
@@ -3649,9 +3525,9 @@
"license": "MIT"
},
"node_modules/tinyexec": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.2.4.tgz",
"integrity": "sha512-SHf/r48b7vOrjve9PxJo3MN5v5yuyjHvdUcrQffT3WXMUfnGmHDVbC4k3sHJaJTgZCwpUplIaAo5ANtMyp3YHg==",
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.0.tgz",
"integrity": "sha512-QKAl9m8gWWGHV8jZcPeym6j+XULi6tOf1mT83WYJ4Lk2ytW/uwAWkrP0uFsdoYMdueVJ0qs26wZ+23xeB4ibNQ==",
"dev": true,
"license": "MIT",
"engines": {
@@ -3758,14 +3634,6 @@
}
}
},
"node_modules/tslib": {
"version": "2.8.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
"dev": true,
"license": "0BSD",
"optional": true
},
"node_modules/type-check": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
@@ -3871,16 +3739,16 @@
}
},
"node_modules/vite": {
"version": "8.1.5",
"resolved": "https://registry.npmjs.org/vite/-/vite-8.1.5.tgz",
"integrity": "sha512-7ULLwsCdYx/nRyrpiEwvqb5TFHrMVZyBt+rg/OAXT7rgj/z+DtTDyKFeLAdDkubDVDKD8jOsndmy7m55XcfUsw==",
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/vite/-/vite-8.2.0.tgz",
"integrity": "sha512-pn+CFpM0lwDeKwmOq1ZaBK/9sjorZcgqxki6MbY/jPEVd9vichIlmlD4HmQ5wdP5EgqQCFRaACBxMC7uEGc6lQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"lightningcss": "^1.32.0",
"lightningcss": "^1.33.0",
"picomatch": "^4.0.5",
"postcss": "^8.5.17",
"rolldown": "~1.1.5",
"postcss": "^8.5.23",
"rolldown": "~1.2.0",
"tinyglobby": "^0.2.17"
},
"bin": {
@@ -3897,7 +3765,7 @@
},
"peerDependencies": {
"@types/node": "^20.19.0 || >=22.12.0",
"@vitejs/devtools": "^0.3.0",
"@vitejs/devtools": "^0.4.0",
"esbuild": "^0.27.0 || ^0.28.0",
"jiti": ">=1.21.0",
"less": "^4.0.0",

View File

@@ -3,7 +3,7 @@
"publishConfig": {
"access": "public"
},
"version": "0.64.1",
"version": "0.65.0",
"description": "An ACP-compatible coding agent powered by the Claude Agent SDK (TypeScript)",
"main": "dist/lib.js",
"types": "dist/lib.d.ts",
@@ -29,6 +29,7 @@
"build": "tsc",
"start": "node dist/index.js",
"dev": "npm run build && npm run start",
"example:simple-client": "node --experimental-strip-types --disable-warning=ExperimentalWarning examples/simple-client.ts",
"lint": "eslint src --ext .ts",
"lint:fix": "eslint src --ext .ts --fix",
"format": "prettier --write .",

View File

@@ -361,6 +361,26 @@ type Turn = {
* pre-hold behavior (pending wakes are not countable: notifications can
* batch into one followup). */
deferredSettle?: PromptResponse;
/** Uuids of `steer()`-injected messages the SDK has not replayed back yet.
*
* A steer is delivered at {@link STEER_PRIORITY} (`now`), so the CLI ABORTS
* the running cycle: it emits its own human-origin `result` —
* indistinguishable from a turn's terminal one — and the steered message runs
* as a SECOND cycle. Settling at that result would answer `session/prompt`
* mid-work, so a steered turn's results only RECORD their outcome
* (`steeredSettle`) and it settles at the SDK's `idle`, the only signal
* spanning both cycles (CLI 2.1.220).
*
* A non-empty set at an idle means the steered cycle hasn't started — the CLI
* replays a message only when it picks it up, always after the interrupted
* cycle's result — so that idle is swallowed. Drained by the replay handler.
*
* Residual: a message the CLI drops unreplayed parks the turn until
* `session/cancel` or the next prompt (both settle it). */
steeredEchoes?: Set<string>;
/** What a steered turn settles with once its steered work has run: the outcome
* of its latest result, so its usage covers every cycle the turn ran. */
steeredSettle?: PromptResponse;
resolve: (response: PromptResponse) => void;
reject: (error: unknown) => void;
};
@@ -525,11 +545,6 @@ type Session = {
* tool_use block streams; this set makes the two paths converge regardless of
* order. Pruned at `tool_result` time alongside `toolUseCache`. */
emittedToolCalls: Set<string>;
/** Last Markdown delivered through ACP's experimental `plan_update` lane,
* keyed by plan id. Live ExitPlanMode updates are owned by the permission
* path so the plan and referenced tool call are both delivered before the
* permission request; replay uses the same cache without a concurrent ask. */
emittedPlanContent?: Map<string, string>;
/** Registry of live background tasks, keyed by task id: populated at
* `task_started`, pruned when the task settles (a `task_notification` or
* a terminal `task_updated` patch), and reconciled against
@@ -694,6 +709,12 @@ function isHeldOpen(
return turn != null && turn.deferredSettle !== undefined && !turn.settled;
}
/** Whether a steer moved this turn's settlement off the next result and onto the
* SDK's `idle` (see Turn.steeredEchoes). Shared by the consumer's settle lanes. */
function isSteering(turn: Turn | null | undefined): turn is Turn & { steeredEchoes: Set<string> } {
return turn != null && turn.steeredEchoes !== undefined && !turn.settled;
}
/** Disarm the force-cancel backstop (see Session.forceCancelTimer). Every
* path that settles the active turn must run this so a timer can never fire
* on an already-settled turn — and must leave the field undefined, or the
@@ -1889,6 +1910,10 @@ export class ClaudeAcpAgent {
* calls). The steered message's own output streams via `session/update`, not
* this response.
*
* Pre-empting means ABORTING: the interrupted cycle emits a `result` of its
* own and the steered message runs as a second one, so the turn is marked
* (`Turn.steeredEchoes`) to settle at the SDK's `idle` instead of that result.
*
* When the session is idle, the opt-in path returns `promptRequired` WITHOUT
* calling `prompt()`, pushing SDK input, or mutating `turnQueue`: the content
* stays Host-owned so the Host can submit it through a standard
@@ -1909,7 +1934,7 @@ export class ClaudeAcpAgent {
// which is exactly the window in which steering is meaningful. This check
// and the active-path push below stay in one synchronous section so the
// turn cannot settle in the gap between deciding to inject and enqueueing.
const turnInFlight = (session.turnQueue ?? []).some((turn) => !turn.settled);
const turnInFlight = (session.turnQueue ?? []).find((turn) => !turn.settled);
if (!turnInFlight) {
const promptRequest: PromptRequest = {
sessionId,
@@ -1934,10 +1959,23 @@ export class ClaudeAcpAgent {
prompt: params.prompt,
};
const userMessage = promptToClaude(promptRequest);
userMessage.uuid = randomUUID();
const steeredUuid = randomUUID();
userMessage.uuid = steeredUuid;
// Deliver into the running turn rather than queuing behind it as a fresh
// prompt would.
userMessage.priority = STEER_PRIORITY;
// Mark before the push and in the same synchronous section as the in-flight
// check: the interrupt can have the CLI finalizing the aborted cycle by the
// time the consumer next runs, and an unmarked result would settle the turn
// (see Turn.steeredEchoes).
(turnInFlight.steeredEchoes ??= new Set()).add(steeredUuid);
// A turn already held for background subagents has a recorded outcome the
// steer supersedes: move it into the steer lane so one lane owns settlement.
// The idle handler re-applies the hold through the subagent gate.
if (turnInFlight.deferredSettle !== undefined) {
turnInFlight.steeredSettle = turnInFlight.deferredSettle;
turnInFlight.deferredSettle = undefined;
}
session.input.push(userMessage);
return { outcome: "injected" };
}
@@ -2268,6 +2306,14 @@ export class ClaudeAcpAgent {
* calling settleActive directly bypasses the hold and re-opens the
* out-of-turn permission deadlock (issue #866) through its lane. */
const settleOrDefer = (outcome: PromptResponse) => {
// No result ends a steered turn: the steer aborted the cycle this result
// may belong to, and the steered one is still to come. Record the outcome
// for the idle lane (see Turn.steeredEchoes); later cycles overwrite it,
// so the last result and its usage win.
if (isSteering(session.activeTurn)) {
session.activeTurn.steeredSettle = outcome;
return;
}
if (
session.activeTurn &&
!session.activeTurn.settled &&
@@ -2757,7 +2803,31 @@ export class ClaudeAcpAgent {
// this lagged idle (no active turn to settle): the idle
// still belongs to that settled turn, and skipping the
// decrement would leak the debt permanently.
// Deliberately BEFORE the steer lane below: an owed idle
// belongs to an earlier turn, and reading it as the steered
// sequence's turn-over signal would settle a turn whose
// steered cycle is still running. Steered results owe none.
session.owedTrailingIdles--;
} else if (isSteering(session.activeTurn)) {
// A steered turn settles here, not at a result: this idle is
// the only signal spanning the interrupted and steered cycles
// (see Turn.steeredEchoes). An idle before the steered echo,
// or before any result was recorded, means the answer is
// still ahead — swallow it, and never let it reach the #825
// fail below, which would reject a prompt about to answer.
//
// Plain Turn so the fields can be cleared below; isSteering
// narrows steeredEchoes to non-optional.
const steered: Turn = session.activeTurn;
if (steered.steeredEchoes?.size === 0 && steered.steeredSettle !== undefined) {
// Via the subagent gate, not settleActive: a steered turn
// can also have spawned background subagents, which own it
// from here (settles now if none is live, holds otherwise).
steered.deferredSettle = steered.steeredSettle;
steered.steeredEchoes = undefined;
steered.steeredSettle = undefined;
settleDeferredIfDrained();
}
} else if (
!session.cancelled &&
session.activeTurn &&
@@ -3206,7 +3276,16 @@ export class ClaudeAcpAgent {
// turn's OWN result — a followup result arriving inside the
// cancel window still gets its own trailer and must be counted,
// or that idle would later false-fail the next prompt.
if (isAutonomousResult || !session.cancelled || !session.activeTurn) {
// A second exclusion: a steered turn's own results (see
// Turn.steeredEchoes). One idle covers the whole interrupted +
// steered sequence and that idle settles the turn, so counting
// either result would leave a debt that swallows it. Autonomous
// results inside a steered turn keep their own trailers.
const owesTrailingIdle = isAutonomousResult || !isSteering(session.activeTurn);
if (
owesTrailingIdle &&
(isAutonomousResult || !session.cancelled || !session.activeTurn)
) {
session.owedTrailingIdles++;
}
@@ -3594,8 +3673,6 @@ export class ClaudeAcpAgent {
cwd: session.cwd,
taskState: session.taskState,
emittedToolCalls: session.emittedToolCalls,
emittedPlanContent: session.emittedPlanContent,
emitExitPlanUpdates: false,
messageId: currentStreamMessageId,
streamedToolInputs,
},
@@ -3661,6 +3738,23 @@ export class ClaudeAcpAgent {
// either. Its trailing-idle debt stands and is absorbed
// when the drain idle eventually arrives.
settleActive(session.activeTurn.deferredSettle);
} else if (
isSteering(session.activeTurn) &&
session.activeTurn.steeredSettle !== undefined
) {
// Same for a turn with an open steer (see
// Turn.steeredEchoes): the user moving on outranks the
// steered continuation, but its last result's stop reason
// stands. With no result yet it falls through to the
// end_turn hand-off below, owing nothing there.
//
// The steer lane normally pays for that result's trailing
// idle by settling on it; this hand-off settles instead,
// so count it here or it arrives un-owed against the fresh
// turn and false-fails it (issue #825). Harmless if it
// never comes: the debt absorbs one future idle.
session.owedTrailingIdles++;
settleActive(session.activeTurn.steeredSettle);
} else {
settleActive({ stopReason: "end_turn", usage: sessionUsage(session) });
}
@@ -3677,6 +3771,13 @@ export class ClaudeAcpAgent {
break;
}
if ("isReplay" in message && message.isReplay) {
// A steered message's echo matches no turn (steer() creates
// none), but it marks the steered cycle as running — how the idle
// lane tells "the answer is still ahead" from "the turn is over"
// (see Turn.steeredEchoes).
if (isSteering(session.activeTurn)) {
session.activeTurn.steeredEchoes.delete(message.uuid);
}
// Unrelated replay (e.g. the echo of an already-settled turn).
break;
}
@@ -3862,8 +3963,6 @@ export class ClaudeAcpAgent {
cwd: session.cwd,
taskState: session.taskState,
emittedToolCalls: session.emittedToolCalls,
emittedPlanContent: session.emittedPlanContent,
emitExitPlanUpdates: false,
messageId: messageIdForGrouping(message),
toolUseResult: message.type === "user" ? message.tool_use_result : undefined,
// On the wire since CLI 2.1.216 but not in SDKUserMessage's
@@ -4156,6 +4255,16 @@ export class ClaudeAcpAgent {
}
}
// A steered active turn (see Turn.steeredEchoes) settles "cancelled" in the
// consumer at the interrupt's trailing idle, like any live turn. But the
// steer lane pays for its last result's trailer by settling on it, which
// this cancel pre-empts, so count that trailer here or it arrives un-owed
// against the next prompt and false-fails it (issue #825). Over-counting
// when only one trailer comes absorbs a future idle.
if (isSteering(session.activeTurn) && session.activeTurn.steeredSettle !== undefined) {
session.owedTrailingIdles++;
}
// Arm a backstop before interrupting: if a turn is actively consuming the
// query and interrupt() doesn't make the SDK yield (e.g. a wedged TaskOutput
// block — issue #680), force the consumer to settle the active turn
@@ -4463,7 +4572,6 @@ export class ClaudeAcpAgent {
private async replaySessionHistory(sessionId: string): Promise<void> {
const toolUseCache: ToolUseCache = {};
const emittedPlanContent = new Map<string, string>();
const messages = await getSessionMessages(sessionId);
const forwardSubagentText =
this.sessions[sessionId]?.forwardSubagentText ??
@@ -4513,7 +4621,6 @@ export class ClaudeAcpAgent {
clientCapabilities: this.clientCapabilities,
cwd: this.sessions[sessionId]?.cwd,
taskState: this.sessions[sessionId]?.taskState,
emittedPlanContent,
messageId: replayMessageId,
parentToolUseId,
},
@@ -4592,21 +4699,6 @@ export class ClaudeAcpAgent {
if (!session) {
return;
}
const planUpdate = exitPlanUpdate(
sessionId,
toolName,
toolInput,
this.clientCapabilities,
(session.emittedPlanContent ??= new Map()),
parentToolUseId,
);
if (planUpdate) {
await this.client.sessionUpdate(planUpdate);
session.emittedPlanContent.set(
claudePlanId(parentToolUseId),
(toolInput as { plan: string }).plan,
);
}
if (session.emittedToolCalls.has(toolCallId)) {
return;
}
@@ -4617,7 +4709,6 @@ export class ClaudeAcpAgent {
toolInput,
supportsTerminalOutput,
session.cwd,
supportsPlanUpdates(this.clientCapabilities),
);
if (parentToolUseId) {
update._meta = {
@@ -4721,7 +4812,6 @@ export class ClaudeAcpAgent {
{ name: toolName, input: toolInput, id: toolUseID },
supportsTerminalOutput,
session?.cwd,
supportsPlanUpdates(this.clientCapabilities),
),
// `claudeCode` metas always carry `toolName` (see ToolUpdateMeta),
// so clients can rely on one shape everywhere.
@@ -5895,7 +5985,6 @@ export class ClaudeAcpAgent {
taskState,
toolUseCache: {},
emittedToolCalls: new Set(),
emittedPlanContent: new Map(),
liveBackgroundTasks: new Map(),
emittedAssistantText: false,
owedTrailingIdles: 0,
@@ -7074,7 +7163,6 @@ function toolCallNotification(
rawInput: unknown,
supportsTerminalOutput: boolean,
cwd?: string,
usePlanUpdate = false,
refine = false,
): SessionNotification["update"] {
if (refine) {
@@ -7083,7 +7171,7 @@ function toolCallNotification(
toolCallId: toolUse.id,
sessionUpdate: "tool_call_update",
rawInput,
...toolInfoFromToolUse(toolUse, supportsTerminalOutput, cwd, usePlanUpdate),
...toolInfoFromToolUse(toolUse, supportsTerminalOutput, cwd),
};
}
return {
@@ -7097,56 +7185,7 @@ function toolCallNotification(
sessionUpdate: "tool_call",
rawInput,
status: "pending",
...toolInfoFromToolUse(toolUse, supportsTerminalOutput, cwd, usePlanUpdate),
};
}
const CLAUDE_PLAN_ID = "claude-plan";
function claudePlanId(parentToolUseId?: string | null): string {
return parentToolUseId ? `${CLAUDE_PLAN_ID}:${parentToolUseId}` : CLAUDE_PLAN_ID;
}
function supportsPlanUpdates(clientCapabilities?: ClientCapabilities | null): boolean {
return clientCapabilities?.plan != null;
}
/** Build a Markdown plan update for ExitPlanMode when the client opts into the
* experimental plan capability. A stable per-session plan id lets a revised
* plan replace the previous draft instead of accumulating one plan per tool
* call. `rawInput.plan` remains on the switch_mode call used by the permission
* request; this only moves visual rendering out of that call. */
function exitPlanUpdate(
sessionId: string,
toolName: string,
toolInput: unknown,
clientCapabilities?: ClientCapabilities | null,
emittedPlanContent?: Map<string, string>,
parentToolUseId?: string | null,
): SessionNotification | undefined {
const planId = claudePlanId(parentToolUseId);
if (
toolName !== "ExitPlanMode" ||
!supportsPlanUpdates(clientCapabilities) ||
toolInput === null ||
typeof toolInput !== "object" ||
!("plan" in toolInput) ||
typeof toolInput.plan !== "string" ||
toolInput.plan.trim().length === 0 ||
emittedPlanContent?.get(planId) === toolInput.plan
) {
return undefined;
}
return {
sessionId,
update: {
sessionUpdate: "plan_update",
plan: {
type: "markdown",
planId,
content: toolInput.plan,
},
},
...toolInfoFromToolUse(toolUse, supportsTerminalOutput, cwd),
};
}
@@ -7238,11 +7277,6 @@ export function toAcpNotifications(
// tool_call/update decision falls back to `toolUseCache` presence (the
// historical single-source behavior).
emittedToolCalls?: Set<string>;
emittedPlanContent?: Map<string, string>;
// Live ExitPlanMode plan updates are sent from canUseTool immediately
// before requestPermission, which gives strict clients deterministic
// ordering. Replay has no concurrent permission request and emits here.
emitExitPlanUpdates?: boolean;
// Opaque id identifying the message these chunks belong to (ACP message ids
// are opaque strings — no particular format is required). Attached to
// user/agent message and thought chunks so clients can group streamed chunks
@@ -7263,7 +7297,6 @@ export function toAcpNotifications(
const taskState = options?.taskState ?? new Map();
const registerHooks = options?.registerHooks !== false;
const supportsTerminalOutput = options?.clientCapabilities?._meta?.["terminal_output"] === true;
const usePlanUpdate = supportsPlanUpdates(options?.clientCapabilities);
if (typeof content === "string") {
if (content.length === 0) {
return [];
@@ -7367,23 +7400,6 @@ export function toAcpNotifications(
// tool_result time once we have the task ID (for TaskCreate) and
// confirmation that the change took effect.
} else {
if (options?.emitExitPlanUpdates !== false) {
const planUpdate = exitPlanUpdate(
sessionId,
chunk.name,
chunk.input,
options?.clientCapabilities,
options?.emittedPlanContent,
options?.parentToolUseId,
);
if (planUpdate) {
output.push(planUpdate);
options?.emittedPlanContent?.set(
claudePlanId(options?.parentToolUseId),
(chunk.input as { plan: string }).plan,
);
}
}
// Only register hooks on first encounter to avoid double-firing
if (registerHooks && !alreadyCached) {
// Capture the tool name in the closure rather than re-reading the
@@ -7451,19 +7467,12 @@ export function toAcpNotifications(
rawInput,
supportsTerminalOutput,
options?.cwd,
usePlanUpdate,
true,
);
} else {
// First surface (streaming content_block_start or replay) — send as
// tool_call (with terminal_info for Bash).
update = toolCallNotification(
chunk,
rawInput,
supportsTerminalOutput,
options?.cwd,
usePlanUpdate,
);
update = toolCallNotification(chunk, rawInput, supportsTerminalOutput, options?.cwd);
}
}
break;
@@ -7666,8 +7675,6 @@ export function streamEventToAcpNotifications(
cwd?: string;
taskState?: TaskState;
emittedToolCalls?: Set<string>;
emittedPlanContent?: Map<string, string>;
emitExitPlanUpdates?: boolean;
messageId?: string;
streamedToolInputs?: StreamedToolInputCache;
},
@@ -7681,8 +7688,6 @@ export function streamEventToAcpNotifications(
cwd: options?.cwd,
taskState: options?.taskState,
emittedToolCalls: options?.emittedToolCalls,
emittedPlanContent: options?.emittedPlanContent,
emitExitPlanUpdates: options?.emitExitPlanUpdates,
messageId: options?.messageId,
};
switch (event.type) {

View File

@@ -1722,57 +1722,6 @@ describe("subagent transcript replay", () => {
});
});
describe("ExitPlanMode replay", () => {
it("replays Markdown through plan_update for capable clients without duplicating tool content", async () => {
const updates: SessionNotification[] = [];
const client = {
sessionUpdate: async (update: SessionNotification) => updates.push(update),
} as unknown as AcpClient;
const agent = new ClaudeAcpAgent(client, { log: () => {}, error: () => {} });
agent.clientCapabilities = { plan: {} };
vi.mocked(getSessionMessages).mockResolvedValueOnce([
{
type: "assistant",
uuid: "plan-message",
session_id: "s1",
parent_tool_use_id: null,
parent_agent_id: null,
message: {
id: "api-plan-message",
model: "claude-sonnet-4-5",
role: "assistant",
type: "message",
stop_reason: "tool_use",
content: [
{
type: "tool_use",
id: "exit-plan-tool",
name: "ExitPlanMode",
input: { plan: "# Replayed plan" },
},
],
},
},
] as Awaited<ReturnType<typeof getSessionMessages>>);
await (
agent as unknown as { replaySessionHistory(sessionId: string): Promise<void> }
).replaySessionHistory("s1");
expect(updates.map((u) => u.update.sessionUpdate)).toEqual(["plan_update", "tool_call"]);
expect(updates[0].update).toMatchObject({
sessionUpdate: "plan_update",
plan: { type: "markdown", planId: "claude-plan", content: "# Replayed plan" },
});
expect(updates[1].update).toMatchObject({
sessionUpdate: "tool_call",
toolCallId: "exit-plan-tool",
kind: "switch_mode",
content: [],
});
});
});
describe("escape markdown", () => {
it("should escape markdown characters", () => {
let text = "Hello *world*!";
@@ -2410,118 +2359,6 @@ describe("tool_call emitted before permission request", () => {
expect(events).toEqual(["permission"]);
});
it("delivers plan_update and tool_call before an ExitPlanMode permission-first request", async () => {
const { agent, events, updates, session } = setup();
agent.clientCapabilities = { plan: {} };
await agent.canUseTool("session-1")("ExitPlanMode", { plan: "# Permission-first plan" }, {
signal: new AbortController().signal,
suggestions: [],
toolUseID: "plan-tool-1",
} as any);
expect(events).toEqual(["update:plan_update", "update:tool_call", "permission"]);
expect(updates[0].update).toMatchObject({
sessionUpdate: "plan_update",
plan: {
type: "markdown",
planId: "claude-plan",
content: "# Permission-first plan",
},
});
expect(updates[1].update).toMatchObject({
sessionUpdate: "tool_call",
toolCallId: "plan-tool-1",
kind: "switch_mode",
content: [],
});
expect(session.emittedPlanContent?.get("claude-plan")).toBe("# Permission-first plan");
const streamed = toAcpNotifications(
[
{
type: "tool_use",
id: "plan-tool-1",
name: "ExitPlanMode",
input: { plan: "# Permission-first plan" },
},
],
"assistant",
"session-1",
session.toolUseCache,
{} as AcpClient,
console,
{
clientCapabilities: agent.clientCapabilities,
emittedToolCalls: session.emittedToolCalls,
emittedPlanContent: session.emittedPlanContent,
emitExitPlanUpdates: false,
},
);
expect(streamed.map((n) => n.update.sessionUpdate)).toEqual(["tool_call_update"]);
});
it("delivers a streamed tool_call, then plan_update, before the permission request", async () => {
const { agent, events, session } = setup();
agent.clientCapabilities = { plan: {} };
const streamed = toAcpNotifications(
[
{
type: "tool_use",
id: "plan-tool-2",
name: "ExitPlanMode",
input: { plan: "# Stream-first plan" },
},
],
"assistant",
"session-1",
session.toolUseCache,
agent.client,
console,
{
clientCapabilities: agent.clientCapabilities,
emittedToolCalls: session.emittedToolCalls,
emittedPlanContent: session.emittedPlanContent,
emitExitPlanUpdates: false,
},
);
for (const notification of streamed) {
await agent.client.sessionUpdate(notification);
}
await agent.canUseTool("session-1")("ExitPlanMode", { plan: "# Stream-first plan" }, {
signal: new AbortController().signal,
suggestions: [],
toolUseID: "plan-tool-2",
} as any);
expect(events).toEqual(["update:tool_call", "update:plan_update", "permission"]);
});
it("keeps the ExitPlanMode Markdown in the permission tool call for legacy clients", async () => {
const { agent, events, updates } = setup();
await agent.canUseTool("session-1")("ExitPlanMode", { plan: "# Legacy plan" }, {
signal: new AbortController().signal,
suggestions: [],
toolUseID: "plan-tool-legacy",
} as any);
expect(events).toEqual(["update:tool_call", "permission"]);
expect(updates[0].update).toMatchObject({
sessionUpdate: "tool_call",
toolCallId: "plan-tool-legacy",
kind: "switch_mode",
content: [
{
type: "content",
content: { type: "text", text: "# Legacy plan" },
},
],
});
});
it("refines the eagerly-emitted tool_call with a tool_call_update when the chunk streams", () => {
const { session } = setup();
// Permission flow already emitted the tool_call for this id.
@@ -2858,36 +2695,6 @@ describe("subagent permission attribution (issue #851)", () => {
});
});
it("scopes a subagent ExitPlanMode plan to the spawning tool call", async () => {
const { agent, updates, session } = setup();
agent.clientCapabilities = { plan: {} };
session.liveBackgroundTasks.set("agent-42", {
parentToolUseId: "toolu_parent",
isSubagent: true,
});
await agent.canUseTool("session-1")("ExitPlanMode", { plan: "# Subagent plan" }, {
signal: new AbortController().signal,
suggestions: [],
toolUseID: "toolu_sub_plan",
agentID: "agent-42",
} as any);
expect(updates[0].update).toMatchObject({
sessionUpdate: "plan_update",
plan: {
type: "markdown",
planId: "claude-plan:toolu_parent",
content: "# Subagent plan",
},
});
expect(updates[1].update).toMatchObject({
sessionUpdate: "tool_call",
toolCallId: "toolu_sub_plan",
_meta: { claudeCode: { parentToolUseId: "toolu_parent" } },
});
});
it("omits the attribution (and logs the miss) when the agent id has no recorded parent", async () => {
const { agent, updates, requests, log } = setup();
@@ -10027,6 +9834,31 @@ describe("turn steering (_session/steering)", () => {
};
}
/** The `result` the CLI emits for the cycle a priority:'now' steer aborted, as
* observed on CLI 2.1.220: `origin.kind` "human" (not autonomous, so it
* reaches the user-turn lifecycle) and `stop_reason` "tool_use" — the abort
* landed on a pending tool call. No test here depends on either: every
* non-error combination maps to the `end_turn` clients observe. */
function interruptedCycleResult() {
return { ...createResultMessage(), stop_reason: "tool_use", origin: { kind: "human" } };
}
/** The SDK's authoritative turn-over signal. */
function idleMessage() {
return { type: "system", subtype: "session_state_changed", state: "idle" };
}
/** Records every `agent_message_chunk` the client observes. */
function timelineClient(timeline: string[]) {
return {
sessionUpdate: async (notification: any) => {
if (notification.update?.sessionUpdate === "agent_message_chunk") {
timeline.push(notification.update.content?.text);
}
},
} as unknown as AcpClient;
}
const waitFor = async (cond: () => boolean) => {
for (let i = 0; i < 200; i++) {
if (cond()) return;
@@ -10222,6 +10054,249 @@ describe("turn steering (_session/steering)", () => {
expect(JSON.stringify(injected.message.content)).toContain("also handle X");
});
// A steer does not join the running cycle — it ABORTS it: the CLI interrupts
// the in-flight query as soon as a queued message carries priority 'now'. The
// interrupted cycle ends with an ordinary human-origin `result` and the
// steered message runs as a SECOND cycle. Treating that first result as
// terminal answers session/prompt mid-work: the client is told `end_turn`,
// then keeps receiving the turn's remaining tool calls and its actual answer
// as updates belonging to no turn.
it("keeps the turn open across the interrupt its own steer caused", async () => {
const timeline: string[] = [];
const agent = new ClaudeAcpAgent(timelineClient(timeline), {
log: () => {},
error: () => {},
});
injectGeneratorSession(agent, (input) => {
async function* messageGenerator() {
const iter = input[Symbol.asyncIterator]();
const u1 = await iter.next();
yield userEcho(u1.value); // turn becomes active
yield createAssistantText("working on it");
// The steered message is pushed at priority 'now'...
const steered = await iter.next();
// ...so the CLI aborts the query, ending the interrupted cycle with a
// result of its own. No idle follows it: one comes at the very end, for
// the whole interrupted + steered sequence.
yield interruptedCycleResult();
// Only now does the steered message run, as a second cycle. Its echo
// matches no queued turn (dropped as an unrelated replay), its output is
// the answer the user is waiting for, and its result has the last word
// on the turn's stop reason.
yield userEcho(steered.value);
yield createAssistantText("STEERED-OK");
yield createResultMessage();
yield idleMessage();
}
return messageGenerator();
});
const turn = agent
.prompt({ sessionId: "test-session", prompt: [{ type: "text", text: "start" }] })
.then((response) => {
timeline.push(`prompt:${response.stopReason}`);
return response;
});
await waitFor(() => !!agent.sessions["test-session"]?.activeTurn);
await expect(
agent.steer({ sessionId: "test-session", prompt: [{ type: "text", text: "also handle X" }] }),
).resolves.toEqual({ outcome: "injected" });
const response = await turn;
// Drain the rest of the stream so the timeline is complete either way — on
// an early settle the steered output arrives after `response`.
await agent.sessions["test-session"]?.consumer;
// The steered continuation belongs to the turn the client is waiting on, so
// all of it precedes that turn's response. A `prompt:` entry anywhere but
// last is the bug: updates outlived the stopReason.
expect(timeline).toEqual(["working on it", "STEERED-OK", "prompt:end_turn"]);
// Both cycles ran for this one prompt, so its usage covers both (2 × the
// mock result's 10 in / 5 out) rather than stopping at the interrupt.
expect(response.usage).toEqual({
inputTokens: 20,
outputTokens: 10,
cachedReadTokens: 0,
cachedWriteTokens: 0,
totalTokens: 30,
});
// Still exactly one response for one prompt, and nothing left behind.
expect(agent.sessions["test-session"].turnQueue).toHaveLength(0);
});
// The other steer ordering: the cycle had already finished when the steer
// landed, so nothing was aborted and its result is a natural one — followed by
// its own idle, before the steered message is picked up. Settling on that idle
// would answer the prompt with the steered work still ahead, so the turn waits
// for the steered message's echo (Turn.steeredEchoes).
it("does not settle a steered turn at an idle that precedes the steered echo", async () => {
const timeline: string[] = [];
const agent = new ClaudeAcpAgent(timelineClient(timeline), {
log: () => {},
error: () => {},
});
injectGeneratorSession(agent, (input) => {
async function* messageGenerator() {
const iter = input[Symbol.asyncIterator]();
const u1 = await iter.next();
yield userEcho(u1.value);
yield createAssistantText("working on it");
const steered = await iter.next();
// The cycle ends and goes idle before the steered message is dequeued.
yield interruptedCycleResult();
yield idleMessage();
// Then the steered message runs as its own cycle.
yield userEcho(steered.value);
yield createAssistantText("STEERED-OK");
yield createResultMessage();
yield idleMessage();
}
return messageGenerator();
});
const turn = agent
.prompt({ sessionId: "test-session", prompt: [{ type: "text", text: "start" }] })
.then((response) => {
timeline.push(`prompt:${response.stopReason}`);
return response;
});
await waitFor(() => !!agent.sessions["test-session"]?.activeTurn);
await agent.steer({
sessionId: "test-session",
prompt: [{ type: "text", text: "also handle X" }],
});
await turn;
await agent.sessions["test-session"]?.consumer;
expect(timeline).toEqual(["working on it", "STEERED-OK", "prompt:end_turn"]);
// The swallowed idle must not leave a phantom debt that would absorb a later
// turn's trailing idle (and blind the issue-#825 detector).
expect(agent.sessions["test-session"].owedTrailingIdles).toBe(0);
});
// A steer must not hold a prompt hostage: the next prompt's echo hands the
// steered turn off, reporting — like the subagent hold — the stop reason its
// last result recorded rather than a guessed one.
it("hands a steered turn off to the next prompt with its recorded outcome", async () => {
const timeline: string[] = [];
const agent = new ClaudeAcpAgent(timelineClient(timeline), {
log: () => {},
error: () => {},
});
injectGeneratorSession(agent, (input) => {
async function* messageGenerator() {
const iter = input[Symbol.asyncIterator]();
const u1 = await iter.next();
yield userEcho(u1.value);
yield createAssistantText("working on it");
await iter.next(); // the steered message, which this CLI never replays
yield interruptedCycleResult();
// The user moves on: the second prompt's echo arrives while the steered
// turn is still open.
const second = await iter.next();
yield userEcho(second.value);
yield createAssistantText("second turn");
yield createResultMessage();
yield idleMessage();
}
return messageGenerator();
});
const first = agent
.prompt({ sessionId: "test-session", prompt: [{ type: "text", text: "start" }] })
.then((response) => {
timeline.push(`first:${response.stopReason}`);
return response;
});
await waitFor(() => !!agent.sessions["test-session"]?.activeTurn);
await agent.steer({
sessionId: "test-session",
prompt: [{ type: "text", text: "also handle X" }],
});
const second = agent
.prompt({ sessionId: "test-session", prompt: [{ type: "text", text: "next" }] })
.then((response) => {
timeline.push(`second:${response.stopReason}`);
return response;
});
const firstResponse = await first;
await second;
await agent.sessions["test-session"]?.consumer;
// The steered turn ends at the hand-off — before the new turn's output — and
// carries the interrupted cycle's own usage, not the next turn's.
expect(timeline).toEqual(["working on it", "first:end_turn", "second turn", "second:end_turn"]);
expect(firstResponse.usage).toEqual({
inputTokens: 10,
outputTokens: 5,
cachedReadTokens: 0,
cachedWriteTokens: 0,
totalTokens: 15,
});
expect(agent.sessions["test-session"].turnQueue).toHaveLength(0);
});
// Cancelling a steered turn answers "cancelled" through the normal lane, but
// its last result's trailing idle went uncounted (the steer lane pays for its
// idles by settling on them, which the cancel pre-empted). That idle can lag
// past the next prompt's echo, where an un-owed idle reads as "the SDK went
// idle without a result" and false-fails a healthy prompt (#825).
it("cancels a steered turn without false-failing the next prompt", async () => {
const agent = createMockAgent();
let releaseAfterCancel = () => {};
const afterCancel = new Promise<void>((resolve) => (releaseAfterCancel = resolve));
injectGeneratorSession(agent, (input) => {
async function* messageGenerator() {
const iter = input[Symbol.asyncIterator]();
const u1 = await iter.next();
yield userEcho(u1.value);
yield createAssistantText("working on it");
await iter.next(); // the steered message
yield interruptedCycleResult();
await afterCancel;
yield idleMessage(); // the interrupt's trailer: settles the turn "cancelled"
const second = await iter.next();
yield userEcho(second.value); // activates the next turn, clears `cancelled`
yield idleMessage(); // the steered result's lagged trailer — must be absorbed
yield createAssistantText("second turn");
yield createResultMessage();
yield idleMessage();
}
return messageGenerator();
});
const first = agent.prompt({
sessionId: "test-session",
prompt: [{ type: "text", text: "start" }],
});
await waitFor(() => !!agent.sessions["test-session"]?.activeTurn);
await agent.steer({
sessionId: "test-session",
prompt: [{ type: "text", text: "also handle X" }],
});
// The interrupted cycle's result has been recorded on the turn (not settled).
await waitFor(() => agent.sessions["test-session"]?.activeTurn?.steeredSettle !== undefined);
await agent.cancel({ sessionId: "test-session" });
releaseAfterCancel();
await expect(first).resolves.toEqual(expect.objectContaining({ stopReason: "cancelled" }));
// The next prompt runs to completion instead of being rejected by the #825
// detector when the steered turn's lagged idle lands.
await expect(
agent.prompt({ sessionId: "test-session", prompt: [{ type: "text", text: "next" }] }),
).resolves.toEqual(expect.objectContaining({ stopReason: "end_turn" }));
expect(agent.sessions["test-session"].owedTrailingIdles).toBe(0);
});
it("always injects at 'now' priority, ignoring any client-supplied priority", async () => {
const agent = createMockAgent();
const captured: any[] = [];

View File

@@ -1,5 +1,5 @@
import { describe, it, expect, beforeEach, vi } from "vitest";
import { ClientCapabilities, SessionNotification } from "@agentclientprotocol/sdk";
import { SessionNotification } from "@agentclientprotocol/sdk";
import type { ModelInfo } from "@anthropic-ai/claude-agent-sdk";
import type { AcpClient, ClaudeAcpAgent as ClaudeAcpAgentType } from "../acp-agent.js";
import { makeMockQuery } from "./helpers.js";
@@ -1357,103 +1357,5 @@ describe("session config options", () => {
const optionIds = capturedPermissionRequest.options.map((o: any) => o.optionId);
expect(optionIds).toContain("auto");
});
it("sends plan_update before permission when the tool call was already streamed", async () => {
(agent as unknown as { clientCapabilities: ClientCapabilities }).clientCapabilities = {
plan: {},
};
const session = (agent as unknown as { sessions: Record<string, any> }).sessions[SESSION_ID];
session.emittedToolCalls.add("toolu_plan_update");
const canUseTool = (agent as any).canUseTool(SESSION_ID);
await expect(
canUseTool(
"ExitPlanMode",
{ plan: "# Approved plan" },
{
signal: new AbortController().signal,
suggestions: undefined,
toolUseID: "toolu_plan_update",
},
),
).rejects.toThrow("Tool use aborted");
expect(sessionUpdates).toEqual([
{
sessionId: SESSION_ID,
update: {
sessionUpdate: "plan_update",
plan: {
type: "markdown",
planId: "claude-plan",
content: "# Approved plan",
},
},
},
]);
expect(capturedPermissionRequest.toolCall).toMatchObject({
toolCallId: "toolu_plan_update",
kind: "switch_mode",
rawInput: { plan: "# Approved plan" },
content: [],
});
});
it("approves ExitPlanMode after publishing the capable-client plan", async () => {
(agent as unknown as { clientCapabilities: ClientCapabilities }).clientCapabilities = {
plan: {},
};
const session = (agent as unknown as { sessions: Record<string, any> }).sessions[SESSION_ID];
session.modes.currentModeId = "plan";
permissionResponse = { outcome: { outcome: "selected", optionId: "default" } };
const result = await (agent as any).canUseTool(SESSION_ID)(
"ExitPlanMode",
{ plan: "# Implement it" },
{
signal: new AbortController().signal,
suggestions: undefined,
toolUseID: "toolu_plan_approve",
},
);
expect(result.behavior).toBe("allow");
expect(session.modes.currentModeId).toBe("default");
expect(sessionUpdates.map((n) => n.update.sessionUpdate)).toEqual([
"plan_update",
"tool_call",
"current_mode_update",
"config_option_update",
]);
});
it("rejects ExitPlanMode without switching mode after publishing the plan", async () => {
(agent as unknown as { clientCapabilities: ClientCapabilities }).clientCapabilities = {
plan: {},
};
const session = (agent as unknown as { sessions: Record<string, any> }).sessions[SESSION_ID];
session.modes.currentModeId = "plan";
permissionResponse = { outcome: { outcome: "selected", optionId: "plan" } };
const result = await (agent as any).canUseTool(SESSION_ID)(
"ExitPlanMode",
{ plan: "# Keep planning" },
{
signal: new AbortController().signal,
suggestions: undefined,
toolUseID: "toolu_plan_reject",
},
);
expect(result).toMatchObject({
behavior: "deny",
message: "User rejected request to exit plan mode.",
});
expect(session.modes.currentModeId).toBe("plan");
expect(sessionUpdates.map((n) => n.update.sessionUpdate)).toEqual([
"plan_update",
"tool_call",
]);
});
});
});

View File

@@ -1698,176 +1698,6 @@ describe("toolInfoFromToolUse - ExitPlanMode", () => {
expect(info.kind).toBe("switch_mode");
expect(info.content).toEqual([]);
});
it("publishes Markdown through plan_update for capable clients and keeps the tool call compact", () => {
const toolUse = {
type: "tool_use" as const,
name: "ExitPlanMode",
id: "toolu_plan_capable",
input: { plan: "# Implement\n\nRun the tests." },
};
const emittedPlanContent = new Map<string, string>();
const notifications = toAcpNotifications(
[toolUse],
"assistant",
"test-session",
{},
{} as AcpClient,
{ log: () => {}, error: () => {} },
{
clientCapabilities: { plan: {} },
emittedPlanContent,
},
);
expect(notifications).toHaveLength(2);
expect(notifications[0].update).toEqual({
sessionUpdate: "plan_update",
plan: {
type: "markdown",
planId: "claude-plan",
content: "# Implement\n\nRun the tests.",
},
});
expect(notifications[1].update).toMatchObject({
sessionUpdate: "tool_call",
toolCallId: "toolu_plan_capable",
kind: "switch_mode",
rawInput: { plan: "# Implement\n\nRun the tests." },
content: [],
});
const repeated = toAcpNotifications(
[toolUse],
"assistant",
"test-session",
{},
{} as AcpClient,
{ log: () => {}, error: () => {} },
{
clientCapabilities: { plan: {} },
emittedPlanContent,
},
);
expect(repeated.filter((n) => n.update.sessionUpdate === "plan_update")).toHaveLength(0);
});
it("defers live plan_update to the permission path while keeping the tool call compact", () => {
const emittedPlanContent = new Map<string, string>();
const notifications = toAcpNotifications(
[
{
type: "tool_use" as const,
name: "ExitPlanMode",
id: "toolu_plan_live",
input: { plan: "# Live plan" },
},
],
"assistant",
"test-session",
{},
{} as AcpClient,
{ log: () => {}, error: () => {} },
{
clientCapabilities: { plan: {} },
emittedPlanContent,
emitExitPlanUpdates: false,
},
);
expect(notifications).toHaveLength(1);
expect(notifications[0].update).toMatchObject({
sessionUpdate: "tool_call",
toolCallId: "toolu_plan_live",
kind: "switch_mode",
content: [],
});
expect(emittedPlanContent.size).toBe(0);
});
it("does not create plan_update for an empty Markdown plan", () => {
const notifications = toAcpNotifications(
[
{
type: "tool_use" as const,
name: "ExitPlanMode",
id: "toolu_plan_empty",
input: { plan: " \n" },
},
],
"assistant",
"test-session",
{},
{} as AcpClient,
{ log: () => {}, error: () => {} },
{ clientCapabilities: { plan: {} } },
);
expect(notifications).toHaveLength(1);
expect(notifications[0].update.sessionUpdate).toBe("tool_call");
});
it("scopes replayed subagent plans by their parent tool call", () => {
const emittedPlanContent = new Map<string, string>();
const render = (parentToolUseId: string, id: string, plan: string) =>
toAcpNotifications(
[{ type: "tool_use" as const, name: "ExitPlanMode", id, input: { plan } }],
"assistant",
"test-session",
{},
{} as AcpClient,
{ log: () => {}, error: () => {} },
{
clientCapabilities: { plan: {} },
emittedPlanContent,
parentToolUseId,
},
);
const first = render("agent-parent-1", "toolu_subplan_1", "# First subagent plan");
const second = render("agent-parent-2", "toolu_subplan_2", "# Second subagent plan");
expect(first[0].update).toMatchObject({
sessionUpdate: "plan_update",
plan: { planId: "claude-plan:agent-parent-1" },
});
expect(second[0].update).toMatchObject({
sessionUpdate: "plan_update",
plan: { planId: "claude-plan:agent-parent-2" },
});
expect(emittedPlanContent.size).toBe(2);
});
it("keeps Markdown in the switch_mode tool call when plan_update is unsupported", () => {
const notifications = toAcpNotifications(
[
{
type: "tool_use" as const,
name: "ExitPlanMode",
id: "toolu_plan_fallback",
input: { plan: "# Fallback plan" },
},
],
"assistant",
"test-session",
{},
{} as AcpClient,
{ log: () => {}, error: () => {} },
);
expect(notifications).toHaveLength(1);
expect(notifications[0].update).toMatchObject({
sessionUpdate: "tool_call",
kind: "switch_mode",
content: [
{
type: "content",
content: { type: "text", text: "# Fallback plan" },
},
],
});
});
});
describe("toolInfoFromToolUse - undefined input regression", () => {

View File

@@ -130,7 +130,6 @@ export function toolInfoFromToolUse(
toolUse: any,
supportsTerminalOutput: boolean = false,
cwd?: string,
usePlanUpdate: boolean = false,
): ToolInfo {
const name = toolUse.name;
@@ -434,15 +433,9 @@ export function toolInfoFromToolUse(
return {
title: "Ready to code?",
kind: "switch_mode",
content:
!usePlanUpdate && planInput?.plan
? [
{
type: "content" as const,
content: { type: "text" as const, text: planInput.plan },
},
]
: [],
content: planInput?.plan
? [{ type: "content" as const, content: { type: "text" as const, text: planInput.plan } }]
: [],
};
}