Compare commits

...

118 Commits

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


##
[0.84.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.83.0...v0.84.0)
(2026-09-28)


### Features

* **deps:** update Claude SDK
([#1189](https://github.com/agentclientprotocol/claude-agent-acp/issues/1189))
([d5e6f33](d5e6f33046))

---
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-09-28 21:15:22 +02:00
Andrey Bragin
d5e6f33046 feat(deps): update Claude SDK (#1189) 2026-09-28 21:12:52 +02:00
acp-release-bot[bot]
691328a919 chore(main): release 0.83.0 (#1188)
🤖 I have created a release *beep* *boop*
---


##
[0.83.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.82.0...v0.83.0)
(2026-09-28)


### Features

* **deps:** Bump @anthropic-ai/claude-agent-sdk to 0.3.283
([#1186](https://github.com/agentclientprotocol/claude-agent-acp/issues/1186))
([49858b5](49858b5273))

---
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-09-28 17:55:23 +02:00
dependabot[bot]
49858b5273 feat(deps): Bump @anthropic-ai/claude-agent-sdk to 0.3.283 (#1186)
Bumps the minor group with 38 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
|
[@anthropic-ai/claude-agent-sdk](https://github.com/anthropics/claude-agent-sdk-typescript)
| `0.3.280` | `0.3.282` |
|
[@anthropic-ai/sdk](https://github.com/anthropics/anthropic-sdk-typescript)
| `0.127.0` | `0.128.0` |
| [prettier](https://github.com/prettier/prettier) | `3.9.8` | `3.9.9` |
|
[vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest)
| `5.0.1` | `5.0.2` |
| @anthropic-ai/claude-agent-sdk-darwin-arm64 | `0.3.280` | `0.3.282` |
| @anthropic-ai/claude-agent-sdk-darwin-x64 | `0.3.280` | `0.3.282` |
| @anthropic-ai/claude-agent-sdk-linux-arm64 | `0.3.280` | `0.3.282` |
| @anthropic-ai/claude-agent-sdk-linux-arm64-musl | `0.3.280` |
`0.3.282` |
| @anthropic-ai/claude-agent-sdk-linux-x64 | `0.3.280` | `0.3.282` |
| @anthropic-ai/claude-agent-sdk-linux-x64-musl | `0.3.280` | `0.3.282`
|
| @anthropic-ai/claude-agent-sdk-win32-arm64 | `0.3.280` | `0.3.282` |
| @anthropic-ai/claude-agent-sdk-win32-x64 | `0.3.280` | `0.3.282` |
|
[@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/typescript-sdk)
| `1.30.0` | `1.30.1` |
|
[@oxc-project/types](https://github.com/oxc-project/oxc/tree/HEAD/npm/oxc-types)
| `0.150.0` | `0.151.0` |
|
[@rolldown/binding-android-arm-eabi](https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown)
| `1.2.9` | `1.2.11` |
|
[@rolldown/binding-android-arm64](https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown)
| `1.2.9` | `1.2.11` |
|
[@rolldown/binding-darwin-arm64](https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown)
| `1.2.9` | `1.2.11` |
|
[@rolldown/binding-darwin-x64](https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown)
| `1.2.9` | `1.2.11` |
|
[@rolldown/binding-freebsd-x64](https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown)
| `1.2.9` | `1.2.11` |
|
[@rolldown/binding-linux-arm-gnueabihf](https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown)
| `1.2.9` | `1.2.11` |
|
[@rolldown/binding-linux-arm64-gnu](https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown)
| `1.2.9` | `1.2.11` |
|
[@rolldown/binding-linux-arm64-musl](https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown)
| `1.2.9` | `1.2.11` |
|
[@rolldown/binding-linux-ppc64-gnu](https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown)
| `1.2.9` | `1.2.11` |
|
[@rolldown/binding-linux-s390x-gnu](https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown)
| `1.2.9` | `1.2.11` |
|
[@rolldown/binding-linux-x64-gnu](https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown)
| `1.2.9` | `1.2.11` |
|
[@rolldown/binding-linux-x64-musl](https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown)
| `1.2.9` | `1.2.11` |
|
[@rolldown/binding-openharmony-arm64](https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown)
| `1.2.9` | `1.2.11` |
|
[@rolldown/binding-win32-arm64-msvc](https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown)
| `1.2.9` | `1.2.11` |
|
[@rolldown/binding-win32-x64-msvc](https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown)
| `1.2.9` | `1.2.11` |
|
[@vitest/mocker](https://github.com/vitest-dev/vitest/tree/HEAD/packages/mocker)
| `5.0.1` | `5.0.2` |
|
[@vitest/spy](https://github.com/vitest-dev/vitest/tree/HEAD/packages/spy)
| `5.0.1` | `5.0.2` |
| [hono](https://github.com/honojs/hono) | `4.13.8` | `4.13.10` |
| [magic-string](https://github.com/Rich-Harris/magic-string) | `1.4.1`
| `1.4.2` |
|
[rolldown](https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown)
| `1.2.9` | `1.2.11` |
| [tinybench](https://github.com/tinylibs/tinybench) | `6.1.4` | `6.2.0`
|
| [tinyexec](https://github.com/tinylibs/tinyexec) | `1.3.0` | `1.3.1` |
| [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) |
`8.3.0` | `8.3.1` |
|
[why-is-node-running](https://github.com/mafintosh/why-is-node-running)
| `2.3.0` | `3.2.2` |


Updates `@anthropic-ai/claude-agent-sdk` from 0.3.280 to 0.3.282
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/anthropics/claude-agent-sdk-typescript/releases">@​anthropic-ai/claude-agent-sdk's
releases</a>.</em></p>
<blockquote>
<h2>v0.3.282</h2>
<h2>What's changed</h2>
<ul>
<li>Added support for <code>strictKnownMarketplaces</code> and
<code>blockedMarketplaces</code> in host-supplied
<code>managedSettings</code>: the allowlist applies only where admin
policy sets none; the blocklist adds to the admin's</li>
<li>Added <code>@anthropic-ai/claude-agent-sdk/core</code>, a smaller
entry point for apps that bundle the SDK (query, MCP tool helpers,
session mutations, <code>resolveSettings</code>); it uses your installed
zod and MCP SDK</li>
<li>Added <code>prewarm()</code> and <code>SpareProcess.claim()</code>
(alpha): start a Claude Code process before its session is known and
bind it to a folder and its per-session options later</li>
<li>Fixed <code>readMcpResource()</code> relaying content
<code>_meta</code> keys under the CLI-reserved
<code>com.anthropic/</code> prefix; they are now dropped, as for tool
results</li>
<li>Updated to parity with Claude Code v2.1.282</li>
</ul>
<h2>Update</h2>
<pre lang="sh"><code>npm install @anthropic-ai/claude-agent-sdk@0.3.282
# or
yarn add @anthropic-ai/claude-agent-sdk@0.3.282
# or
pnpm add @anthropic-ai/claude-agent-sdk@0.3.282
# or
bun add @anthropic-ai/claude-agent-sdk@0.3.282
</code></pre>
<h2>v0.3.281</h2>
<h2>What's changed</h2>
<ul>
<li>Added optional <code>trigger</code>, <code>user_message_uuid</code>
and <code>timestamp</code> fields to the <code>conversation_reset</code>
message so clients can tell what reset the conversation, match a /clear
to its message, and show when the reset happened</li>
<li>Fixed permission and dialog callbacks still being invoked for
requests that arrived after <code>close()</code></li>
<li>Fixed control requests issued after a query closed hanging or
leaking, and permission prompts that could not be cancelled after a
cancelled request was redelivered</li>
<li>Fixed <code>session_state_changed</code> staying at
<code>requires_action</code> after an overlapping permission prompt and
sandbox network-access prompt were both answered</li>
<li>Improved SDK package size and load time: <code>sdk.mjs</code> no
longer bundles unused dependencies (1.47 MB → 0.97 MB)</li>
<li>Improved startup time for <code>query()</code> sessions with
in-process MCP servers (<code>createSdkMcpServer</code>) by running
their handshake inside the SDK; <code>initialize</code> may now wait up
to 250 ms for them</li>
<li>Improved SDK session start-up: the CLI now answers the host's
initialize request before starting its background start-up work</li>
<li>Changed the <code>Settings</code> type's <code>attribution</code>
field to <code>boolean | {...}</code>; TypeScript code that reads
<code>attribution.commit</code> from returned settings needs a type
narrow</li>
<li>Updated to parity with Claude Code v2.1.281</li>
</ul>
<h2>Update</h2>
<pre lang="sh"><code>npm install @anthropic-ai/claude-agent-sdk@0.3.281
# or
yarn add @anthropic-ai/claude-agent-sdk@0.3.281
# or
pnpm add @anthropic-ai/claude-agent-sdk@0.3.281
# or
bun add @anthropic-ai/claude-agent-sdk@0.3.281
</code></pre>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/anthropics/claude-agent-sdk-typescript/blob/main/CHANGELOG.md">@​anthropic-ai/claude-agent-sdk's
changelog</a>.</em></p>
<blockquote>
<h2>0.3.282</h2>
<ul>
<li>Added support for <code>strictKnownMarketplaces</code> and
<code>blockedMarketplaces</code> in host-supplied
<code>managedSettings</code>: the allowlist applies only where admin
policy sets none; the blocklist adds to the admin's</li>
<li>Added <code>@anthropic-ai/claude-agent-sdk/core</code>, a smaller
entry point for apps that bundle the SDK (query, MCP tool helpers,
session mutations, <code>resolveSettings</code>); it uses your installed
zod and MCP SDK</li>
<li>Added <code>prewarm()</code> and <code>SpareProcess.claim()</code>
(alpha): start a Claude Code process before its session is known and
bind it to a folder and its per-session options later</li>
<li>Fixed <code>readMcpResource()</code> relaying content
<code>_meta</code> keys under the CLI-reserved
<code>com.anthropic/</code> prefix; they are now dropped, as for tool
results</li>
<li>Updated to parity with Claude Code v2.1.282</li>
</ul>
<h2>0.3.281</h2>
<ul>
<li>Added optional <code>trigger</code>, <code>user_message_uuid</code>
and <code>timestamp</code> fields to the <code>conversation_reset</code>
message so clients can tell what reset the conversation, match a /clear
to its message, and show when the reset happened</li>
<li>Fixed permission and dialog callbacks still being invoked for
requests that arrived after <code>close()</code></li>
<li>Fixed control requests issued after a query closed hanging or
leaking, and permission prompts that could not be cancelled after a
cancelled request was redelivered</li>
<li>Fixed <code>session_state_changed</code> staying at
<code>requires_action</code> after an overlapping permission prompt and
sandbox network-access prompt were both answered</li>
<li>Improved SDK package size and load time: <code>sdk.mjs</code> no
longer bundles unused dependencies (1.47 MB → 0.97 MB)</li>
<li>Improved startup time for <code>query()</code> sessions with
in-process MCP servers (<code>createSdkMcpServer</code>) by running
their handshake inside the SDK; <code>initialize</code> may now wait up
to 250 ms for them</li>
<li>Improved SDK session start-up: the CLI now answers the host's
initialize request before starting its background start-up work</li>
<li>Changed the <code>Settings</code> type's <code>attribution</code>
field to <code>boolean | {...}</code>; TypeScript code that reads
<code>attribution.commit</code> from returned settings needs a type
narrow</li>
<li>Updated to parity with Claude Code v2.1.281</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="9e477a178c"><code>9e477a1</code></a>
chore: Update CHANGELOG.md</li>
<li><a
href="fb04f66354"><code>fb04f66</code></a>
chore: Update CHANGELOG.md</li>
<li>See full diff in <a
href="https://github.com/anthropics/claude-agent-sdk-typescript/compare/v0.3.280...v0.3.282">compare
view</a></li>
</ul>
</details>
<br />

Updates `@anthropic-ai/sdk` from 0.127.0 to 0.128.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/anthropics/anthropic-sdk-typescript/releases">@​anthropic-ai/sdk's
releases</a>.</em></p>
<blockquote>
<h2>sdk: v0.128.0</h2>
<h2>0.128.0 (2026-09-22)</h2>
<p>Full Changelog: <a
href="https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.127.0...sdk-v0.128.0">sdk-v0.127.0...sdk-v0.128.0</a></p>
<h3>Features</h3>
<ul>
<li><strong>api:</strong> add support for claude-opus-5-5, inline tool
definitions and MCP tool-list pinning (beta) (<a
href="eff27483d2">eff2748</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li><strong>api:</strong> share one evaluated_permission enum across
Managed Agents events (<a
href="0c1cc0fdf8">0c1cc0f</a>)</li>
<li><strong>tools:</strong> addTools() takes effect straight away (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/773">#773</a>)
(<a
href="1ccdad0d1b">1ccdad0</a>)</li>
<li><strong>tools:</strong> leave reply-only params off the tool
runner's compaction request (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/769">#769</a>)
(<a
href="8afc3364dc">8afc336</a>)</li>
</ul>
<h3>Chores</h3>
<ul>
<li><strong>docs:</strong> add descriptions to the Dreams API reference
(<a
href="ea4ddd1ee3">ea4ddd1</a>)</li>
<li><strong>docs:</strong> add descriptions to the User Profiles API
reference (<a
href="ea4ddd1ee3">ea4ddd1</a>)</li>
<li><strong>docs:</strong> add memory store descriptions to the Managed
Agents API reference (<a
href="ea4ddd1ee3">ea4ddd1</a>)</li>
<li><strong>docs:</strong> improve descriptions in the Dreams API
reference (<a
href="971c54a5dd">971c54a</a>)</li>
<li><strong>docs:</strong> simplify the session thread agent type
description (<a
href="ccf71a27bd">ccf71a2</a>)</li>
<li><strong>docs:</strong> update diagnostics field descriptions on beta
messages (<a
href="c0b8746679">c0b8746</a>)</li>
<li><strong>internal:</strong> add property-based tests for partial JSON
parsing (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/776">#776</a>)
(<a
href="3ffac0927f">3ffac09</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/anthropics/anthropic-sdk-typescript/blob/main/CHANGELOG.md">@​anthropic-ai/sdk's
changelog</a>.</em></p>
<blockquote>
<h2>0.128.0 (2026-09-22)</h2>
<p>Full Changelog: <a
href="https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.127.0...sdk-v0.128.0">sdk-v0.127.0...sdk-v0.128.0</a></p>
<h3>Features</h3>
<ul>
<li><strong>api:</strong> add support for claude-opus-5-5, inline tool
definitions and MCP tool-list pinning (beta) (<a
href="eff27483d2">eff2748</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li><strong>api:</strong> share one evaluated_permission enum across
Managed Agents events (<a
href="0c1cc0fdf8">0c1cc0f</a>)</li>
<li><strong>tools:</strong> addTools() takes effect straight away (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/773">#773</a>)
(<a
href="1ccdad0d1b">1ccdad0</a>)</li>
<li><strong>tools:</strong> leave reply-only params off the tool
runner's compaction request (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/769">#769</a>)
(<a
href="8afc3364dc">8afc336</a>)</li>
</ul>
<h3>Chores</h3>
<ul>
<li><strong>docs:</strong> add descriptions to the Dreams API reference
(<a
href="ea4ddd1ee3">ea4ddd1</a>)</li>
<li><strong>docs:</strong> add descriptions to the User Profiles API
reference (<a
href="ea4ddd1ee3">ea4ddd1</a>)</li>
<li><strong>docs:</strong> add memory store descriptions to the Managed
Agents API reference (<a
href="ea4ddd1ee3">ea4ddd1</a>)</li>
<li><strong>docs:</strong> improve descriptions in the Dreams API
reference (<a
href="971c54a5dd">971c54a</a>)</li>
<li><strong>docs:</strong> simplify the session thread agent type
description (<a
href="ccf71a27bd">ccf71a2</a>)</li>
<li><strong>docs:</strong> update diagnostics field descriptions on beta
messages (<a
href="c0b8746679">c0b8746</a>)</li>
<li><strong>internal:</strong> add property-based tests for partial JSON
parsing (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/776">#776</a>)
(<a
href="3ffac0927f">3ffac09</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="1926adb4d2"><code>1926adb</code></a>
Merge pull request <a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/1208">#1208</a>
from anthropics/release-please--branches--main--chan...</li>
<li><a
href="162c8b125d"><code>162c8b1</code></a>
chore: release main</li>
<li><a
href="3ffac0927f"><code>3ffac09</code></a>
chore(internal): add property-based tests for partial JSON parsing (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/776">#776</a>)</li>
<li><a
href="e40ce277c2"><code>e40ce27</code></a>
test(ecosystem): check that unused imports tree-shake to nothing</li>
<li><a
href="1ccdad0d1b"><code>1ccdad0</code></a>
fix(tools): addTools() takes effect straight away (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/773">#773</a>)</li>
<li><a
href="8afc3364dc"><code>8afc336</code></a>
fix(tools): leave reply-only params off the tool runner's compaction
request ...</li>
<li><a
href="eff27483d2"><code>eff2748</code></a>
feat(api): add support for claude-opus-5-5, inline tool definitions and
MCP t...</li>
<li><a
href="06e5f9b5d1"><code>06e5f9b</code></a>
codegen metadata</li>
<li><a
href="0c1cc0fdf8"><code>0c1cc0f</code></a>
fix(api): share one evaluated_permission enum across Managed Agents
events</li>
<li><a
href="c0b8746679"><code>c0b8746</code></a>
chore(docs): update diagnostics field descriptions on beta messages</li>
<li>Additional commits viewable in <a
href="https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.127.0...sdk-v0.128.0">compare
view</a></li>
</ul>
</details>
<br />

Updates `prettier` from 3.9.8 to 3.9.9
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/prettier/prettier/releases">prettier's
releases</a>.</em></p>
<blockquote>
<h2>3.9.9</h2>
<ul>
<li>Markdown: Fix text with <code>$</code> been incorrectly parsed as
math syntax (<a
href="https://redirect.github.com/prettier/prettier/pull/20140">#20140</a>
by <a href="https://github.com/fisker"><code>@​fisker</code></a>)</li>
</ul>
<p>🔗 <a
href="https://github.com/prettier/prettier/blob/3.9.9/CHANGELOG.md#399">Changelog</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/prettier/prettier/blob/main/CHANGELOG.md">prettier's
changelog</a>.</em></p>
<blockquote>
<h1>3.9.9</h1>
<p><a
href="https://github.com/prettier/prettier/compare/3.9.8...3.9.9">diff</a></p>
<h4>Markdown: Fix text with <code>$</code> been incorrectly parsed as
math syntax (<a
href="https://redirect.github.com/prettier/prettier/pull/20140">#20140</a>
by <a href="https://github.com/fisker"><code>@​fisker</code></a>)</h4>
<!-- raw HTML omitted -->
<pre lang="md"><code>&lt;!-- Input --&gt;
**Uses $FOO** from `a.sh` and `b.sh`, plus `$BAR` from `c.sh`, before
anything else runs here.
<p>&lt;!-- Prettier 3.9.8 --&gt;<br />
<strong>Uses $FOO</strong> from <code>a.sh</code> and <code>b.sh</code>,
plus <code>$BAR</code>from<code>c.sh</code>, before anything else runs
here.</p>
<p>&lt;!-- Prettier 3.9.9 --&gt;<br />
<strong>Uses $FOO</strong> from <code>a.sh</code> and <code>b.sh</code>,
plus <code>$BAR</code> from <code>c.sh</code>, before anything else runs
here.<br />
</code></pre></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="cdd17f2288"><code>cdd17f2</code></a>
Release 3.9.9</li>
<li><a
href="dc7b8968e6"><code>dc7b896</code></a>
Disable <code>singleDollarTextMath</code> in
<code>mdast-util-math</code> (<a
href="https://redirect.github.com/prettier/prettier/issues/20140">#20140</a>)</li>
<li><a
href="f9be58fb8e"><code>f9be58f</code></a>
Git blame ignore 3.9.8</li>
<li><a
href="88470cb79c"><code>88470cb</code></a>
Bump Prettier dependency to 3.9.8</li>
<li><a
href="9559cab39e"><code>9559cab</code></a>
Clean changelog_unreleased</li>
<li><a
href="4fc8ee8746"><code>4fc8ee8</code></a>
Update dependents count</li>
<li>See full diff in <a
href="https://github.com/prettier/prettier/compare/3.9.8...3.9.9">compare
view</a></li>
</ul>
</details>
<br />

Updates `vitest` from 5.0.1 to 5.0.2
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/vitest-dev/vitest/releases">vitest's
releases</a>.</em></p>
<blockquote>
<h2>v5.0.2</h2>
<h3>   🐞 Bug Fixes</h3>
<ul>
<li>Bind <code>process</code> in case global is overwritten  -  by <a
href="https://github.com/AriPerkkio"><code>@​AriPerkkio</code></a> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/11343">vitest-dev/vitest#11343</a>
<a href="https://github.com/vitest-dev/vitest/commit/0b79231ad"><!-- raw
HTML omitted -->(0b792)<!-- raw HTML omitted --></a></li>
<li><strong>detect-async-leaks</strong>:
<ul>
<li>Ignore <code>process.stdio</code> handles  -  by <a
href="https://github.com/AriPerkkio"><code>@​AriPerkkio</code></a> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/11333">vitest-dev/vitest#11333</a>
<a href="https://github.com/vitest-dev/vitest/commit/0fd6b9790"><!-- raw
HTML omitted -->(0fd6b)<!-- raw HTML omitted --></a></li>
</ul>
</li>
<li><strong>expect</strong>:
<ul>
<li>Fix <code>toMatchObject</code> with asymmetric matchers  -  by <a
href="https://github.com/ShreeBohara"><code>@​ShreeBohara</code></a>,
<strong>Claude Opus 5</strong>, <a
href="https://github.com/hi-ogawa"><code>@​hi-ogawa</code></a>,
<strong>Hiroshi Ogawa</strong> and <strong>Codex (GPT-5)</strong> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/11100">vitest-dev/vitest#11100</a>
<a href="https://github.com/vitest-dev/vitest/commit/42523289e"><!-- raw
HTML omitted -->(42523)<!-- raw HTML omitted --></a></li>
</ul>
</li>
<li><strong>jsdom</strong>:
<ul>
<li>Fix <code>Request</code> with <code>Blob</code> body on jsdom 28+
 -  by <a
href="https://github.com/harshit-d3v"><code>@​harshit-d3v</code></a> in
<a
href="https://redirect.github.com/vitest-dev/vitest/issues/11295">vitest-dev/vitest#11295</a>
<a href="https://github.com/vitest-dev/vitest/commit/d1c3ecc93"><!-- raw
HTML omitted -->(d1c3e)<!-- raw HTML omitted --></a></li>
</ul>
</li>
<li><strong>reporter</strong>:
<ul>
<li><code>agent</code> to respect <code>--silent</code>  -  by <a
href="https://github.com/Raj4478"><code>@​Raj4478</code></a> and <a
href="https://github.com/AriPerkkio"><code>@​AriPerkkio</code></a> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/11271">vitest-dev/vitest#11271</a>
<a href="https://github.com/vitest-dev/vitest/commit/5b95efb6d"><!-- raw
HTML omitted -->(5b95e)<!-- raw HTML omitted --></a></li>
</ul>
</li>
<li><strong>reporters</strong>:
<ul>
<li>Handle concurrent <code>createReport</code> calls  -  by <a
href="https://github.com/7rulnik"><code>@​7rulnik</code></a> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/11278">vitest-dev/vitest#11278</a>
<a href="https://github.com/vitest-dev/vitest/commit/e8e556ff7"><!-- raw
HTML omitted -->(e8e55)<!-- raw HTML omitted --></a></li>
<li><code>hanging-process</code> to use ESM entrypoint  -  by <a
href="https://github.com/AriPerkkio"><code>@​AriPerkkio</code></a> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/11316">vitest-dev/vitest#11316</a>
<a href="https://github.com/vitest-dev/vitest/commit/4e91e5668"><!-- raw
HTML omitted -->(4e91e)<!-- raw HTML omitted --></a></li>
</ul>
</li>
<li><strong>spy</strong>:
<ul>
<li>Fix stack overflow when spying <code>Set.prototype.add</code>  -  by
<a href="https://github.com/fengmk2"><code>@​fengmk2</code></a> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/11299">vitest-dev/vitest#11299</a>
<a href="https://github.com/vitest-dev/vitest/commit/a0a939653"><!-- raw
HTML omitted -->(a0a93)<!-- raw HTML omitted --></a></li>
</ul>
</li>
<li><strong>ui</strong>:
<ul>
<li>Persist authentication cookie beyond current browser session  -  by
<a href="https://github.com/hi-ogawa"><code>@​hi-ogawa</code></a>,
<strong>Hiroshi Ogawa</strong> and <strong>OpenCode
(gpt-5.6-sol)</strong> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/11066">vitest-dev/vitest#11066</a>
<a href="https://github.com/vitest-dev/vitest/commit/f88195e16"><!-- raw
HTML omitted -->(f8819)<!-- raw HTML omitted --></a></li>
</ul>
</li>
</ul>
<h5>    <a
href="https://github.com/vitest-dev/vitest/compare/v5.0.1...v5.0.2">View
changes on GitHub</a></h5>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="428e2e5043"><code>428e2e5</code></a>
chore: release v5.0.2 (<a
href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/11357">#11357</a>)</li>
<li><a
href="0b79231ad7"><code>0b79231</code></a>
fix: bind <code>process</code> in case global is overwritten (<a
href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/11343">#11343</a>)</li>
<li><a
href="597df569ab"><code>597df56</code></a>
docs: correct stale config defaults (<a
href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/11354">#11354</a>)</li>
<li><a
href="ea1c44fb58"><code>ea1c44f</code></a>
docs: <code>sequence.setupFiles</code> default is <code>'list'</code>
(<a
href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/11351">#11351</a>)</li>
<li><a
href="0fd6b97902"><code>0fd6b97</code></a>
fix(detect-async-leaks): ignore <code>process.stdio</code> handles (<a
href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/11333">#11333</a>)</li>
<li><a
href="4e91e56687"><code>4e91e56</code></a>
fix(reporters): <code>hanging-process</code> to use ESM entrypoint (<a
href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/11316">#11316</a>)</li>
<li><a
href="1a57929a49"><code>1a57929</code></a>
docs(browser): fix locators.exact default (<a
href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/11338">#11338</a>)</li>
<li><a
href="5b95efb6df"><code>5b95efb</code></a>
fix(reporter): <code>agent</code> to respect <code>--silent</code> (<a
href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/11271">#11271</a>)</li>
<li><a
href="f58a209779"><code>f58a209</code></a>
docs: correct benchmark.exclude and watch defaults (<a
href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/11268">#11268</a>)</li>
<li><a
href="d1c3ecc932"><code>d1c3ecc</code></a>
fix(jsdom): fix <code>Request</code> with <code>Blob</code> body on
jsdom 28+ (<a
href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/11295">#11295</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/vitest-dev/vitest/commits/v5.0.2/packages/vitest">compare
view</a></li>
</ul>
</details>
<br />

Updates `@anthropic-ai/claude-agent-sdk-darwin-arm64` from 0.3.280 to
0.3.282

Updates `@anthropic-ai/claude-agent-sdk-darwin-x64` from 0.3.280 to
0.3.282

Updates `@anthropic-ai/claude-agent-sdk-linux-arm64` from 0.3.280 to
0.3.282

Updates `@anthropic-ai/claude-agent-sdk-linux-arm64-musl` from 0.3.280
to 0.3.282

Updates `@anthropic-ai/claude-agent-sdk-linux-x64` from 0.3.280 to
0.3.282

Updates `@anthropic-ai/claude-agent-sdk-linux-x64-musl` from 0.3.280 to
0.3.282

Updates `@anthropic-ai/claude-agent-sdk-win32-arm64` from 0.3.280 to
0.3.282

Updates `@anthropic-ai/claude-agent-sdk-win32-x64` from 0.3.280 to
0.3.282

Updates `@modelcontextprotocol/sdk` from 1.30.0 to 1.30.1
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/modelcontextprotocol/typescript-sdk/releases">@​modelcontextprotocol/sdk's
releases</a>.</em></p>
<blockquote>
<h2>1.30.1</h2>
<h2>What's Changed</h2>
<ul>
<li>[v1.x] fix(server): read HTTP request bodies with a size limit and
bound JSON-RPC batch length by <a
href="https://github.com/maxisbey"><code>@​maxisbey</code></a> in <a
href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/pull/2717">modelcontextprotocol/typescript-sdk#2717</a></li>
<li>fix(auth): preserve resource URI without trailing slash (<a
href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/issues/1968">#1968</a>)
by <a
href="https://github.com/MukundaKatta"><code>@​MukundaKatta</code></a>
in <a
href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/pull/1972">modelcontextprotocol/typescript-sdk#1972</a></li>
<li>chore: bump version to 1.30.1 by <a
href="https://github.com/claude"><code>@​claude</code></a>[bot] in <a
href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/pull/2848">modelcontextprotocol/typescript-sdk#2848</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/MukundaKatta"><code>@​MukundaKatta</code></a>
made their first contribution in <a
href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/pull/1972">modelcontextprotocol/typescript-sdk#1972</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/modelcontextprotocol/typescript-sdk/compare/1.30.0...1.30.1">https://github.com/modelcontextprotocol/typescript-sdk/compare/1.30.0...1.30.1</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="289ac2c3af"><code>289ac2c</code></a>
chore: bump version to 1.30.1 (<a
href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/issues/2848">#2848</a>)</li>
<li><a
href="12b425678a"><code>12b4256</code></a>
fix(auth): preserve resource URI without trailing slash (<a
href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/issues/1968">#1968</a>)
(<a
href="https://redirect.github.com/modelcontextprotocol/typescript-sdk/issues/1972">#1972</a>)</li>
<li><a
href="a9f6eb709b"><code>a9f6eb7</code></a>
[v1.x] fix(server): read HTTP request bodies with a size limit and bound
JSON...</li>
<li>See full diff in <a
href="https://github.com/modelcontextprotocol/typescript-sdk/compare/1.30.0...1.30.1">compare
view</a></li>
</ul>
</details>
<br />

Updates `@oxc-project/types` from 0.150.0 to 0.151.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/oxc-project/oxc/releases">@​oxc-project/types's
releases</a>.</em></p>
<blockquote>
<h2>oxc crates_v0.151.0</h2>
<h3>🚀 Features</h3>
<ul>
<li>1fac655 coverage: Support new TypeScript fixture layout (<a
href="https://github.com/oxc-project/oxc/tree/HEAD/npm/oxc-types/issues/26226">#26226</a>)
(camc314)</li>
</ul>
<h3>🐛 Bug Fixes</h3>
<ul>
<li>cd7228f minifier: Add missing negation for boolean literal (<a
href="https://github.com/oxc-project/oxc/tree/HEAD/npm/oxc-types/issues/26847">#26847</a>)
(Armano)</li>
<li>32305e2 transformer: Skip enum reverse mappings for syntactic string
initializers (<a
href="https://github.com/oxc-project/oxc/tree/HEAD/npm/oxc-types/issues/26724">#26724</a>)
(Dunqing)</li>
<li>7811f0a parser: Preserve reparsed <code>await</code> tokens (<a
href="https://github.com/oxc-project/oxc/tree/HEAD/npm/oxc-types/issues/26619">#26619</a>)
(camc314)</li>
<li>9220158 transformer: Skip recovered using loop patterns (<a
href="https://github.com/oxc-project/oxc/tree/HEAD/npm/oxc-types/issues/26722">#26722</a>)
(camc314)</li>
<li>3130405 parser: Recover await using object binding patterns (<a
href="https://github.com/oxc-project/oxc/tree/HEAD/npm/oxc-types/issues/26721">#26721</a>)
(camc314)</li>
<li>827fdbd parser: Reject invalid modifiers on import aliases (<a
href="https://github.com/oxc-project/oxc/tree/HEAD/npm/oxc-types/issues/26622">#26622</a>)
(camc314)</li>
</ul>
<h3>⚡ Performance</h3>
<ul>
<li>3f1e3aa minifier: Preallocate stmts vec size to avoid excesive
reallocs (<a
href="https://github.com/oxc-project/oxc/tree/HEAD/npm/oxc-types/issues/26856">#26856</a>)
(Armano)</li>
<li>bd3f69e semantic: Reuse identifier hashes in enum member lookups (<a
href="https://github.com/oxc-project/oxc/tree/HEAD/npm/oxc-types/issues/26773">#26773</a>)
(camc314)</li>
<li>5f72954 minifier: Reduce allocations when processing if statements
(<a
href="https://github.com/oxc-project/oxc/tree/HEAD/npm/oxc-types/issues/26666">#26666</a>)
(Armano)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="bec650f15b"><code>bec650f</code></a>
release(crates): oxc v0.151.0 (<a
href="https://github.com/oxc-project/oxc/tree/HEAD/npm/oxc-types/issues/26875">#26875</a>)</li>
<li>See full diff in <a
href="https://github.com/oxc-project/oxc/commits/crates_v0.151.0/npm/oxc-types">compare
view</a></li>
</ul>
</details>
<br />

Updates `@rolldown/binding-android-arm-eabi` from 1.2.9 to 1.2.11
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rolldown/rolldown/releases">@​rolldown/binding-android-arm-eabi's
releases</a>.</em></p>
<blockquote>
<h2>v1.2.11</h2>
<h2>[1.2.11] - 2026-09-24</h2>
<h3>🚀 Features</h3>
<ul>
<li>watch: report only file events (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10974">#10974</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
</ul>
<h3>🐛 Bug Fixes</h3>
<ul>
<li>sourcemap: preserve names through <code>collapse_sourcemaps</code>
(<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/9486">#9486</a>)
by <a href="https://github.com/eoin"><code>@​eoin</code></a></li>
<li>watch: map metadata events by kind and missing paths as deleted (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10973">#10973</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
</ul>
<h3>🚜 Refactor</h3>
<ul>
<li>rolldown_fs_watcher: hand the handler file events instead of notify
results (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10980">#10980</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
<li>rolldown_fs_watcher: share one event handler adapter between the
notify watchers (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10979">#10979</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
<li>rolldown_fs_watcher: register every path with one watch mode (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10978">#10978</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
<li>rolldown_fs_watcher: tweak the backend traits and the event mapping
(<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10977">#10977</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
<li>watch: translate notify events inside FsWatcher (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10972">#10972</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
</ul>
<h3>📚 Documentation</h3>
<ul>
<li>watch: update the fs watcher layout and the dev coordinator message
(<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10981">#10981</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
<li>watch: document the event translation in FsWatcher (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10975">#10975</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
</ul>
<h3>◀️ Revert</h3>
<ul>
<li>&quot;perf(dev/lazy): fetch a lazy route in one request&quot; (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10789">#10789</a>)
(<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10982">#10982</a>)
by <a href="https://github.com/h-a-n-a"><code>@​h-a-n-a</code></a></li>
</ul>
<h3>❤️ New Contributors</h3>
<ul>
<li><a href="https://github.com/eoin"><code>@​eoin</code></a> made their
first contribution in <a
href="https://redirect.github.com/rolldown/rolldown/pull/9486">#9486</a></li>
</ul>
<p>Co-authored-by: shulaoda <a
href="mailto:165626830+shulaoda@users.noreply.github.com">165626830+shulaoda@users.noreply.github.com</a></p>
<h2>v1.2.10</h2>
<h2>[1.2.10] - 2026-09-23</h2>
<h3>🚀 Features</h3>
<ul>
<li>rolldown_plugin_esm_external_require: prefer 'module.exports' over a
namespace spread (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10901">#10901</a>)
by <a href="https://github.com/isker"><code>@​isker</code></a></li>
<li>watch: support directories in addWatchFile (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10944">#10944</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
<li>label code-splitting timing rows (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10896">#10896</a>)
by <a
href="https://github.com/IWANABETHATGUY"><code>@​IWANABETHATGUY</code></a></li>
<li>separate code-splitting group timing rows (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10892">#10892</a>)
by <a
href="https://github.com/IWANABETHATGUY"><code>@​IWANABETHATGUY</code></a></li>
<li>clarify callback owners in the timing report (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10890">#10890</a>)
by <a
href="https://github.com/IWANABETHATGUY"><code>@​IWANABETHATGUY</code></a></li>
<li>add checks.bundlerTimings with deprecated pluginTimings alias (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10883">#10883</a>)
by <a
href="https://github.com/IWANABETHATGUY"><code>@​IWANABETHATGUY</code></a></li>
</ul>
<h3>🐛 Bug Fixes</h3>
<ul>
<li>code-splitting: initialize leaves behind a re-exported namespace
import (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10694">#10694</a>)
by <a href="https://github.com/hyfdev"><code>@​hyfdev</code></a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rolldown/rolldown/blob/main/CHANGELOG.md">@​rolldown/binding-android-arm-eabi's
changelog</a>.</em></p>
<blockquote>
<h2>[1.2.11] - 2026-09-24</h2>
<h3>🚀 Features</h3>
<ul>
<li>watch: report only file events (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10974">#10974</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
</ul>
<h3>🐛 Bug Fixes</h3>
<ul>
<li>sourcemap: preserve names through <code>collapse_sourcemaps</code>
(<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/9486">#9486</a>)
by <a href="https://github.com/eoin"><code>@​eoin</code></a></li>
<li>watch: map metadata events by kind and missing paths as deleted (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10973">#10973</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
</ul>
<h3>🚜 Refactor</h3>
<ul>
<li>rolldown_fs_watcher: hand the handler file events instead of notify
results (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10980">#10980</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
<li>rolldown_fs_watcher: share one event handler adapter between the
notify watchers (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10979">#10979</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
<li>rolldown_fs_watcher: register every path with one watch mode (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10978">#10978</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
<li>rolldown_fs_watcher: tweak the backend traits and the event mapping
(<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10977">#10977</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
<li>watch: translate notify events inside FsWatcher (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10972">#10972</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
</ul>
<h3>📚 Documentation</h3>
<ul>
<li>watch: update the fs watcher layout and the dev coordinator message
(<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10981">#10981</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
<li>watch: document the event translation in FsWatcher (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10975">#10975</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
</ul>
<h3>◀️ Revert</h3>
<ul>
<li>&quot;perf(dev/lazy): fetch a lazy route in one request&quot; (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10789">#10789</a>)
(<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10982">#10982</a>)
by <a href="https://github.com/h-a-n-a"><code>@​h-a-n-a</code></a></li>
</ul>
<h3>❤️ New Contributors</h3>
<ul>
<li><a href="https://github.com/eoin"><code>@​eoin</code></a> made their
first contribution in <a
href="https://redirect.github.com/rolldown/rolldown/pull/9486">#9486</a></li>
</ul>
<h2>[1.2.10] - 2026-09-23</h2>
<h3>🚀 Features</h3>
<ul>
<li>rolldown_plugin_esm_external_require: prefer 'module.exports' over a
namespace spread (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10901">#10901</a>)
by <a href="https://github.com/isker"><code>@​isker</code></a></li>
<li>watch: support directories in addWatchFile (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10944">#10944</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
<li>label code-splitting timing rows (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10896">#10896</a>)
by <a
href="https://github.com/IWANABETHATGUY"><code>@​IWANABETHATGUY</code></a></li>
<li>separate code-splitting group timing rows (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10892">#10892</a>)
by <a
href="https://github.com/IWANABETHATGUY"><code>@​IWANABETHATGUY</code></a></li>
<li>clarify callback owners in the timing report (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10890">#10890</a>)
by <a
href="https://github.com/IWANABETHATGUY"><code>@​IWANABETHATGUY</code></a></li>
<li>add checks.bundlerTimings with deprecated pluginTimings alias (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10883">#10883</a>)
by <a
href="https://github.com/IWANABETHATGUY"><code>@​IWANABETHATGUY</code></a></li>
</ul>
<h3>🐛 Bug Fixes</h3>
<ul>
<li>code-splitting: initialize leaves behind a re-exported namespace
import (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10694">#10694</a>)
by <a href="https://github.com/hyfdev"><code>@​hyfdev</code></a></li>
<li>node: record the WASI target on the WebContainer binding fallback
(<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10952">#10952</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
<li>dev: force incremental build on in DevEngine::new (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10958">#10958</a>)
by <a
href="https://github.com/o-alexandrov"><code>@​o-alexandrov</code></a></li>
<li>tree-shaking: propagate side effects through cycles (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10893">#10893</a>)
by <a
href="https://github.com/IWANABETHATGUY"><code>@​IWANABETHATGUY</code></a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8df4219851"><code>8df4219</code></a>
release: v1.2.11 (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10987">#10987</a>)</li>
<li><a
href="6f85455383"><code>6f85455</code></a>
revert: &quot;perf(dev/lazy): fetch a lazy route in one request&quot;
(<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10789">#10789</a>)
(<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10982">#10982</a>)</li>
<li><a
href="78699253af"><code>7869925</code></a>
feat(watch): report only file events (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10974">#10974</a>)</li>
<li><a
href="3b8e06e99b"><code>3b8e06e</code></a>
release: v1.2.10 (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10969">#10969</a>)</li>
<li><a
href="ec5bab8832"><code>ec5bab8</code></a>
feat(rolldown_plugin_esm_external_require): prefer 'module.exports' over
a na...</li>
<li><a
href="bb1db15db2"><code>bb1db15</code></a>
chore(deps): update napi (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10959">#10959</a>)</li>
<li><a
href="374639ef58"><code>374639e</code></a>
fix(node): record the WASI target on the WebContainer binding fallback
(<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10952">#10952</a>)</li>
<li><a
href="cfc9d19df0"><code>cfc9d19</code></a>
refactor(watch): let FsWatcher own the watched paths (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10948">#10948</a>)</li>
<li><a
href="1551cf8a09"><code>1551cf8</code></a>
feat(watch): support directories in addWatchFile (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10944">#10944</a>)</li>
<li><a
href="b12f077c66"><code>b12f077</code></a>
test: handle Windows paths in sourcemap callback tests (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10942">#10942</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/rolldown/rolldown/commits/v1.2.11/packages/rolldown">compare
view</a></li>
</ul>
</details>
<br />

Updates `@rolldown/binding-android-arm64` from 1.2.9 to 1.2.11
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rolldown/rolldown/releases">@​rolldown/binding-android-arm64's
releases</a>.</em></p>
<blockquote>
<h2>v1.2.11</h2>
<h2>[1.2.11] - 2026-09-24</h2>
<h3>🚀 Features</h3>
<ul>
<li>watch: report only file events (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10974">#10974</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
</ul>
<h3>🐛 Bug Fixes</h3>
<ul>
<li>sourcemap: preserve names through <code>collapse_sourcemaps</code>
(<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/9486">#9486</a>)
by <a href="https://github.com/eoin"><code>@​eoin</code></a></li>
<li>watch: map metadata events by kind and missing paths as deleted (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10973">#10973</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
</ul>
<h3>🚜 Refactor</h3>
<ul>
<li>rolldown_fs_watcher: hand the handler file events instead of notify
results (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10980">#10980</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
<li>rolldown_fs_watcher: share one event handler adapter between the
notify watchers (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10979">#10979</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
<li>rolldown_fs_watcher: register every path with one watch mode (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10978">#10978</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
<li>rolldown_fs_watcher: tweak the backend traits and the event mapping
(<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10977">#10977</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
<li>watch: translate notify events inside FsWatcher (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10972">#10972</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
</ul>
<h3>📚 Documentation</h3>
<ul>
<li>watch: update the fs watcher layout and the dev coordinator message
(<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10981">#10981</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
<li>watch: document the event translation in FsWatcher (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10975">#10975</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
</ul>
<h3>◀️ Revert</h3>
<ul>
<li>&quot;perf(dev/lazy): fetch a lazy route in one request&quot; (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10789">#10789</a>)
(<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10982">#10982</a>)
by <a href="https://github.com/h-a-n-a"><code>@​h-a-n-a</code></a></li>
</ul>
<h3>❤️ New Contributors</h3>
<ul>
<li><a href="https://github.com/eoin"><code>@​eoin</code></a> made their
first contribution in <a
href="https://redirect.github.com/rolldown/rolldown/pull/9486">#9486</a></li>
</ul>
<p>Co-authored-by: shulaoda <a
href="mailto:165626830+shulaoda@users.noreply.github.com">165626830+shulaoda@users.noreply.github.com</a></p>
<h2>v1.2.10</h2>
<h2>[1.2.10] - 2026-09-23</h2>
<h3>🚀 Features</h3>
<ul>
<li>rolldown_plugin_esm_external_require: prefer 'module.exports' over a
namespace spread (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10901">#10901</a>)
by <a href="https://github.com/isker"><code>@​isker</code></a></li>
<li>watch: support directories in addWatchFile (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10944">#10944</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
<li>label code-splitting timing rows (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10896">#10896</a>)
by <a
href="https://github.com/IWANABETHATGUY"><code>@​IWANABETHATGUY</code></a></li>
<li>separate code-splitting group timing rows (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10892">#10892</a>)
by <a
href="https://github.com/IWANABETHATGUY"><code>@​IWANABETHATGUY</code></a></li>
<li>clarify callback owners in the timing report (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10890">#10890</a>)
by <a
href="https://github.com/IWANABETHATGUY"><code>@​IWANABETHATGUY</code></a></li>
<li>add checks.bundlerTimings with deprecated pluginTimings alias (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10883">#10883</a>)
by <a
href="https://github.com/IWANABETHATGUY"><code>@​IWANABETHATGUY</code></a></li>
</ul>
<h3>🐛 Bug Fixes</h3>
<ul>
<li>code-splitting: initialize leaves behind a re-exported namespace
import (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10694">#10694</a>)
by <a href="https://github.com/hyfdev"><code>@​hyfdev</code></a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rolldown/rolldown/blob/main/CHANGELOG.md">@​rolldown/binding-android-arm64's
changelog</a>.</em></p>
<blockquote>
<h2>[1.2.11] - 2026-09-24</h2>
<h3>🚀 Features</h3>
<ul>
<li>watch: report only file events (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10974">#10974</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
</ul>
<h3>🐛 Bug Fixes</h3>
<ul>
<li>sourcemap: preserve names through <code>collapse_sourcemaps</code>
(<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/9486">#9486</a>)
by <a href="https://github.com/eoin"><code>@​eoin</code></a></li>
<li>watch: map metadata events by kind and missing paths as deleted (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10973">#10973</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
</ul>
<h3>🚜 Refactor</h3>
<ul>
<li>rolldown_fs_watcher: hand the handler file events instead of notify
results (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10980">#10980</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
<li>rolldown_fs_watcher: share one event handler adapter between the
notify watchers (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10979">#10979</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
<li>rolldown_fs_watcher: register every path with one watch mode (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10978">#10978</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
<li>rolldown_fs_watcher: tweak the backend traits and the event mapping
(<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10977">#10977</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
<li>watch: translate notify events inside FsWatcher (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10972">#10972</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
</ul>
<h3>📚 Documentation</h3>
<ul>
<li>watch: update the fs watcher layout and the dev coordinator message
(<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10981">#10981</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
<li>watch: document the event translation in FsWatcher (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10975">#10975</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
</ul>
<h3>◀️ Revert</h3>
<ul>
<li>&quot;perf(dev/lazy): fetch a lazy route in one request&quot; (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10789">#10789</a>)
(<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10982">#10982</a>)
by <a href="https://github.com/h-a-n-a"><code>@​h-a-n-a</code></a></li>
</ul>
<h3>❤️ New Contributors</h3>
<ul>
<li><a href="https://github.com/eoin"><code>@​eoin</code></a> made their
first contribution in <a
href="https://redirect.github.com/rolldown/rolldown/pull/9486">#9486</a></li>
</ul>
<h2>[1.2.10] - 2026-09-23</h2>
<h3>🚀 Features</h3>
<ul>
<li>rolldown_plugin_esm_external_require: prefer 'module.exports' over a
namespace spread (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10901">#10901</a>)
by <a href="https://github.com/isker"><code>@​isker</code></a></li>
<li>watch: support directories in addWatchFile (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10944">#10944</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
<li>label code-splitting timing rows (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10896">#10896</a>)
by <a
href="https://github.com/IWANABETHATGUY"><code>@​IWANABETHATGUY</code></a></li>
<li>separate code-splitting group timing rows (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10892">#10892</a>)
by <a
href="https://github.com/IWANABETHATGUY"><code>@​IWANABETHATGUY</code></a></li>
<li>clarify callback owners in the timing report (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10890">#10890</a>)
by <a
href="https://github.com/IWANABETHATGUY"><code>@​IWANABETHATGUY</code></a></li>
<li>add checks.bundlerTimings with deprecated pluginTimings alias (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10883">#10883</a>)
by <a
href="https://github.com/IWANABETHATGUY"><code>@​IWANABETHATGUY</code></a></li>
</ul>
<h3>🐛 Bug Fixes</h3>
<ul>
<li>code-splitting: initialize leaves behind a re-exported namespace
import (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10694">#10694</a>)
by <a href="https://github.com/hyfdev"><code>@​hyfdev</code></a></li>
<li>node: record the WASI target on the WebContainer binding fallback
(<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10952">#10952</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
<li>dev: force incremental build on in DevEngine::new (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10958">#10958</a>)
by <a
href="https://github.com/o-alexandrov"><code>@​o-alexandrov</code></a></li>
<li>tree-shaking: propagate side effects through cycles (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10893">#10893</a>)
by <a
href="https://github.com/IWANABETHATGUY"><code>@​IWANABETHATGUY</code></a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8df4219851"><code>8df4219</code></a>
release: v1.2.11 (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10987">#10987</a>)</li>
<li><a
href="6f85455383"><code>6f85455</code></a>
revert: &quot;perf(dev/lazy): fetch a lazy route in one request&quot;
(<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10789">#10789</a>)
(<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10982">#10982</a>)</li>
<li><a
href="78699253af"><code>7869925</code></a>
feat(watch): report only file events (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10974">#10974</a>)</li>
<li><a
href="3b8e06e99b"><code>3b8e06e</code></a>
release: v1.2.10 (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10969">#10969</a>)</li>
<li><a
href="ec5bab8832"><code>ec5bab8</code></a>
feat(rolldown_plugin_esm_external_require): prefer 'module.exports' over
a na...</li>
<li><a
href="bb1db15db2"><code>bb1db15</code></a>
chore(deps): update napi (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10959">#10959</a>)</li>
<li><a
href="374639ef58"><code>374639e</code></a>
fix(node): record the WASI target on the WebContainer binding fallback
(<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10952">#10952</a>)</li>
<li><a
href="cfc9d19df0"><code>cfc9d19</code></a>
refactor(watch): let FsWatcher own the watched paths (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10948">#10948</a>)</li>
<li><a
href="1551cf8a09"><code>1551cf8</code></a>
feat(watch): support directories in addWatchFile (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10944">#10944</a>)</li>
<li><a
href="b12f077c66"><code>b12f077</code></a>
test: handle Windows paths in sourcemap callback tests (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10942">#10942</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/rolldown/rolldown/commits/v1.2.11/packages/rolldown">compare
view</a></li>
</ul>
</details>
<br />

Updates `@rolldown/binding-darwin-arm64` from 1.2.9 to 1.2.11
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rolldown/rolldown/releases">@​rolldown/binding-darwin-arm64's
releases</a>.</em></p>
<blockquote>
<h2>v1.2.11</h2>
<h2>[1.2.11] - 2026-09-24</h2>
<h3>🚀 Features</h3>
<ul>
<li>watch: report only file events (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/10974">#10974</a>)
by <a
href="https://github.com/shulaoda"><code>@​shulaoda</code></a></li>
</ul>
<h3>🐛 Bug Fixes</h3>
<ul>
<li>sourcemap: preserve names through <code>collapse_sourcemaps</code>
(<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown/issues/9486">#9486</a>)
by <a href="https://github.com/eoin"><code>@​eoin</code></a></li>
<li>watch: map metadata events by kind and missing paths as deleted (<a
href="https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown...

_Description has been truncated_

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2026-09-28 17:37:12 +02:00
dependabot[bot]
77ceab0339 chore(deps): Bump diff from 8.0.4 to 9.0.0 (#1187)
Bumps [diff](https://github.com/kpdecker/jsdiff) from 8.0.4 to 9.0.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/kpdecker/jsdiff/blob/master/release-notes.md">diff's
changelog</a>.</em></p>
<blockquote>
<h2>9.0.0</h2>
<p>(All changes part of PR <a
href="https://redirect.github.com/kpdecker/jsdiff/pull/672">#672</a>.)</p>
<ul>
<li>
<p><strong>ES5 support is dropped</strong>. <code>parsePatch</code> now
uses <code>TextDecoder</code> and <code>Uint8Array</code>, which are not
available in ES5, and TypeScript is now compiled with the
&quot;es6&quot; <code>target</code>. From now on, I intend to freely use
any features that are deemed &quot;Widely available&quot; by <a
href="https://web.dev/baseline">Baseline</a>. Users who need ES5 support
should stick to version 8.</p>
</li>
<li>
<p><strong>C-style quoted strings in filename headers are now properly
supported</strong>.</p>
<p>When the name of either the old or new file in a patch contains
&quot;special characters&quot;, both GNU <code>diff</code> and Git quote
the filename in the patch's headers and escape special characters using
the same escape sequences that are used in string literals in C,
including octal escapes for all non-ASCII characters. Previously, jsdiff
had very little support for this; <code>parsePatch</code> would remove
the quotes, and unescape any escaped backslashes, but would not unescape
other escape sequences. <code>formatPatch</code>, meanwhile, did not
quote or escape special characters at all.</p>
<p>Now, <code>parsePatch</code> parses all the possible escape sequences
that GNU diff (or Git) ever output, and <code>formatPatch</code> quotes
and escapes filenames containing special characters in the same way GNU
diff does.</p>
</li>
<li>
<p><strong><code>formatPatch</code> now omits file headers when
<code>oldFileName</code> or <code>newFileName</code> in the provided
patch object are <code>undefined</code></strong>, regardless of the
<code>headerOptions</code> parameter. (Previously, it would treat the
absence of <code>oldFileName</code> or <code>newFileName</code> as
indicating the filename was the word &quot;undefined&quot; and emit
headers <code>--- undefined</code> / <code>+++ undefined</code>.)</p>
</li>
<li>
<p><strong><code>formatPatch</code> no longer outputs trailing tab
characters at the end of <code>---</code>/<code>+++</code>
headers.</strong></p>
<p>Previously, if <code>formatPatch</code> was passed a patch object to
serialize that had empty strings for the <code>oldHeader</code> or
<code>newHeader</code> property, it would include a trailing tab
character after the filename in the <code>---</code> and/or
<code>+++</code> file header. Now, this scenario is treated the same as
when <code>oldHeader</code>/<code>newHeader</code> is
<code>undefined</code> - i.e. the trailing tab is omitted.</p>
</li>
<li>
<p><strong><code>formatPatch</code> no longer mutates its input</strong>
when serializing a patch containing a hunk where either the old or new
content contained zero lines. (Such a hunk occurs only when the hunk has
no context lines and represents a pure insertion or pure deletion, which
for instance will occur whenever one of the two files being diffed is
completely empty.) Previously <code>formatPatch</code> would provide the
correct output but also mutate the <code>oldLines</code> or
<code>newLines</code> property on the hunk, changing the meaning of the
underlying patch.</p>
</li>
<li>
<p><strong>Git-style patches are now supported by
<code>parsePatch</code>, <code>formatPatch</code>, and
<code>reversePatch</code></strong>.</p>
<p>Patches output by <code>git diff</code> can include some features
that are unlike those output by GNU <code>diff</code>, and therefore not
handled by an ordinary unified diff format parser. An ordinary diff
simply describes the differences between the <em>content</em> of two
files, but Git diffs can also indicate, via &quot;extended
headers&quot;, the creation or deletion of (potentially empty) files,
indicate that a file was renamed, and contain information about file
mode changes. Furthermore, when these changes appear in a diff in the
absence of a content change (e.g. when an empty file is created, or a
file is renamed without content changes), the patch will contain no
associated <code>---</code>/<code>+++</code> file headers nor any
hunks.</p>
<p>jsdiff previously did not support parsing Git's extended headers, nor
hunkless patches. Now <code>parsePatch</code> parses some of the
extended headers, parses hunkless Git patches, and can determine
filenames (e.g. from the extended headers) when parsing a patch that
includes no <code>---</code> or <code>+++</code> file headers. The
additional information conveyed by the extended headers we support is
recorded on new fields on the result object returned by
<code>parsePatch</code>. See <code>isGit</code> and subsequent
properties in the docs in the README.md file.</p>
<p><code>formatPatch</code> now outputs extended headers based on these
new Git-specific properties, and <code>reversePatch</code> respects them
as far as possible (with one unavoidable caveat noted in the README.md
file).</p>
</li>
<li>
<p><strong>Unpaired file headers now cause <code>parsePatch</code> to
throw</strong>.</p>
<p>It remains acceptable to have a patch with no file headers whatsoever
(e.g. one that begins with a <code>@@</code> hunk header on the very
first line), but a patch with <em>only</em> a <code>---</code> header or
only a <code>+++</code> header is now considered an error.</p>
</li>
<li>
<p><strong><code>parsePatch</code> is now more tolerant of
&quot;trailing garbage&quot;</strong></p>
<p>That is: after a patch, or between files/indexes in a patch, it is
now acceptable to have arbitrary lines of &quot;garbage&quot; (so long
as they unambiguously have no syntactic meaning - e.g. trailing garbage
that leads with a <code>+</code>, <code>-</code>, or <code> </code> and
thus is interpretable as part of a hunk still triggers a throw).</p>
<p>This means we no longer reject patches output by tools that include
extra data in &quot;garbage&quot; lines not understood by generic
unified diff parsers. (For example, SVN patches can include
&quot;Property changes on:&quot; lines that generic unified diff parsers
should discard as garbage; jsdiff previously threw errors when
encountering them.)</p>
<p>This change brings jsdiff's behaviour more in line with GNU
<code>patch</code>, which is highly permissive of
&quot;garbage&quot;.</p>
</li>
<li>
<p><strong>The <code>oldFileName</code> and <code>newFileName</code>
fields of <code>StructuredPatch</code> are now typed as <code>string |
undefined</code> instead of <code>string</code></strong>. This type
change reflects the (pre-existing) reality that <code>parsePatch</code>
can produce patches without filenames (e.g. when parsing a patch that
simply contains hunks with no file headers).</p>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="ed13aca03a"><code>ed13aca</code></a>
Update version in package.json and in release notes (<a
href="https://redirect.github.com/kpdecker/jsdiff/issues/683">#683</a>)</li>
<li><a
href="7a49317b50"><code>7a49317</code></a>
Bump dependencies again (<a
href="https://redirect.github.com/kpdecker/jsdiff/issues/682">#682</a>)</li>
<li><a
href="afe5aecad1"><code>afe5aec</code></a>
Add Git support, and otherwise variously improve &amp; fix parsePatch
(and other ...</li>
<li><a
href="2e46779d88"><code>2e46779</code></a>
Fix a typo (<a
href="https://redirect.github.com/kpdecker/jsdiff/issues/679">#679</a>)</li>
<li>See full diff in <a
href="https://github.com/kpdecker/jsdiff/compare/8.0.4...v9.0.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=diff&package-manager=npm_and_yarn&previous-version=8.0.4&new-version=9.0.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)


</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-28 16:56:18 +02:00
acp-release-bot[bot]
18de376240 chore(main): release 0.82.0 (#1180)
🤖 I have created a release *beep* *boop*
---


##
[0.82.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.81.2...v0.82.0)
(2026-09-28)


### Features

* AIR tool call contract, exact git patches, plan file, and fixes for
every client
([#1153](https://github.com/agentclientprotocol/claude-agent-acp/issues/1153))
([875d75f](875d75f2a4))


### Bug Fixes

* use ACP auth errors without access updates
([#1179](https://github.com/agentclientprotocol/claude-agent-acp/issues/1179))
([e6681d2](e6681d2a57))

---
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-09-28 18:01:31 +04:00
nikita-ashihmin
875d75f2a4 feat: AIR tool call contract, exact git patches, plan file, and fixes for every client (#1153)
## Summary

One PR with separate commits (the earlier stack #1168 and #1169 is
folded back in).

### Exact git patches
- `src/diff.ts` builds exact git patches for Edit and Write: real line
numbers, file modes, CRLF, the final-newline marker, a size limit
(including a bound for `replace_all`), binary detection, and an
asynchronous diff with a time budget. The approval preview mirrors the
input normalisation of the bundled CLI.
- No creation patch over an existing file or for an Edit of an existing
empty file, and no patch for a Write that changed nothing.

### For every client
Clients that do not declare `_meta.jetbrains.air` (Zed, plain ACP
clients) get the same information as on `main`.
- A `tool_call_update` omits top-level fields that did not change since
the last report of the same tool call (ACP merge semantics). The `_meta`
of each report stays complete.
- Bug fixes: a failed approval preview no longer blanks the approval
diff; a permission denial replaces a pinned approval patch; the
compaction summary is not repeated when the streamed text is identical;
streamed subagent text is not sent twice; async task fields are recorded
only after a successful send; late updates of a finished native subagent
are dropped; the updates of a fresh Claude context after a clear-context
restart reach the ACP session.

### For AIR only
- One fact in one field: input in `rawInput`, the file text of an edit
only in the diff (`diffPatch`), output once, no display copies of the
input (`rawInputRendering`), `_meta.claudeCode` reduced to `toolName`,
`parentToolUseId` and the `toolResponse` markers, per-key `_meta`
filtering.
- Plan file mode (`planFile`): ExitPlanMode carries only
`rawInput.planFilePath`; AIR follows the file that Claude writes.
- AIR-only keys move under `_meta.jetbrains.air.*` and are no longer
sent to other clients.

### Structure and docs
- `src/tool-calls/`: one reporter per tool, one `ClientCapabilities`,
one `AcpToolCallRenderer`, the field tracker and the changed-meta
filter.
- `docs/air-extensions.md` replaces the per-extension AIR docs.

## Tests
- `npm run build`, `npm run check`, `npm run test:run`: 1995 passed.
- Scenario tests for plain, Zed, and AIR clients: the SDK mock honours
the adapter's session id, every update must reach its ACP session, every
message is validated against the ACP JSON schema with all formats
checked, plain and Zed are compared with a recorded `main` baseline, AIR
keeps compact golden recordings.
2026-09-28 17:58:00 +04:00
Sergey Shkredov
e6681d2a57 fix: use ACP auth errors without access updates (#1179)
Authentication failures now use the ACP authRequired error only. The
adapter does not send a second access failure or login text as a chat
message. Provider verification and cloud credential errors use the
service category because signing in cannot resolve them. Checks: npm run
check; npm run build; npm run test:run (1468 passed, 28 skipped).
2026-09-25 15:11:37 +02:00
acp-release-bot[bot]
5dbb453c63 chore(main): release 0.81.2 (#1171)
🤖 I have created a release *beep* *boop*
---


##
[0.81.2](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.81.1...v0.81.2)
(2026-09-24)


### Bug Fixes

* announce resumed subagent generations when they start
([#1173](https://github.com/agentclientprotocol/claude-agent-acp/issues/1173))
([b495e55](b495e55a22))
* continue clear-context plans approved in a background followup
([#1170](https://github.com/agentclientprotocol/claude-agent-acp/issues/1170))
([a2c362c](a2c362c948))

---
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-09-24 12:15:27 +02:00
Shobhit agnihotri
b495e55a22 fix: announce resumed subagent generations when they start (#1173)
### Summary
Fixes #1158.

When a native subagent session is resumed for subsequent turn execution
(`task_started`), `this.parentByToolUse.get(task.toolUseId)` returns
`undefined` because `finishTask` deletes the mapping at the completion
of earlier generations. Because `knownParentSessionId` evaluated to
`undefined`, `if (knownParentSessionId || !task.toolUseId)` evaluated to
`false`, postponing the subagent announcement until `finishTask`.

### Changes
- In `src/native-subagents.ts`: Added fallback `const
knownParentSessionId = this.parentByToolUse.get(task.toolUseId) ??
previous?.parentSessionId;` so resumed subagents recognize their
existing session parent at `task_started`.
- In `src/tests/native-subagents.test.ts`: Added unit test confirming
`subagent_spawned` is emitted immediately upon `taskStarted` for resumed
sessions.

### Verification
- `npm test src/tests/native-subagents.test.ts` (all 8 tests passing).
- `npx tsc --noEmit` (clean, 0 type errors).

---------

Co-authored-by: shobhitagnihotri69 <shobhitagnihotri69@users.noreply.github.com>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 10:04:58 +00:00
Ben Brandt
a2c362c948 fix: continue clear-context plans approved in a background followup (#1170)
Fixes #1167.

## Problem

In plan mode the model often runs Explore agents in the background. The
user turn's result then comes back while those agents are still running,
so `session/prompt` is held open (#864/#866). When an agent finishes,
the model writes the plan and calls `ExitPlanMode` in the
**task-notification followup**. The user accepts it with a clear-context
option.

The interrupted cycle's `[ede_diagnostic] … stop_reason=tool_use` result
carries that cycle's `task-notification` origin. That sends it into the
autonomous-result branch, which:
1. sends the `usage_update` with `_claude/origin: task-notification`.
This is the "background task finished at the same time" update from the
report; it's actually the same cycle.
2. settles the held turn with `end_turn` and returns early, before the
ExitPlanMode restart check runs.

The plan is never continued, the mode stays `plan`, and nothing tells
the client.

## Fix

- The diagnostic match now lives in one shared function,
`isExitPlanInterruptionResult()` in `exit-plan.ts`. Both the user-result
path and the new check call it; the user path behaves as before.
- In the autonomous branch, when the active turn is held and the result
is the recorded ExitPlanMode interruption:
- **Clear-context option:** drop the held turn's stored outcome, then
run the usual fresh-context restart. The fresh query doesn't have the
old background tasks, so the stale hold would otherwise settle the moved
turn with `end_turn` before the plan runs. The continuation's own result
settles the turn.
- **"No, keep planning":** settle `cancelled` with the user turn's own
usage, through `settleOrDefer`, so the turn stays open while other
spawned subagents are still running.

## Tests

There are two new tests in the deferred-settlement block. Each runs a
held turn whose task-notification followup calls `ExitPlanMode`: one for
the clear-context restart, one for keep-planning. The restart test also
fails if the held outcome isn't dropped.

## Known limitations (unchanged by this PR)

- **Background agents are killed by the restart.** Upstream `/clear`
keeps background agent tasks running (`hasAgentTaskSurvivingClear`). The
adapter's restart closes the old query, so any other running subagents
are killed, just as on the existing user-turn restart path.
- **Plans approved after the turn has ended are still dropped.** If
`ExitPlanMode` runs after the turn has already settled, there's no open
turn to continue, and the plan is dropped as before. A client-visible
notice for that case would be a follow-up.

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

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 17:10:28 +02:00
acp-release-bot[bot]
b264b52bee chore(main): release 0.81.1 (#1162)
🤖 I have created a release *beep* *boop*
---


##
[0.81.1](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.81.0...v0.81.1)
(2026-09-23)


### Bug Fixes

* gate login result text on error state
([#1103](https://github.com/agentclientprotocol/claude-agent-acp/issues/1103))
([6e97e07](6e97e071c5))
* honor permissions.disableBypassPermissionsMode
([#1165](https://github.com/agentclientprotocol/claude-agent-acp/issues/1165))
([281e47e](281e47eb81))
* include model on usage updates
([#1032](https://github.com/agentclientprotocol/claude-agent-acp/issues/1032))
([da11f1f](da11f1feb2))
* keep the agent starting when the managed-policy tier cannot be read
([#1146](https://github.com/agentclientprotocol/claude-agent-acp/issues/1146))
([58c5db1](58c5db1fdc))
* mark informational chunks with metadata
([#1055](https://github.com/agentclientprotocol/claude-agent-acp/issues/1055))
([bd059c1](bd059c10e0))
* offer bypass alongside auto in plan approval
([#1164](https://github.com/agentclientprotocol/claude-agent-acp/issues/1164))
([43c27e9](43c27e97aa))
* preserve context usage when quota is exhausted
([#1132](https://github.com/agentclientprotocol/claude-agent-acp/issues/1132))
([39062b6](39062b63ff))
* preserve native Vertex endpoint defaults
([#1104](https://github.com/agentclientprotocol/claude-agent-acp/issues/1104))
([29a4e98](29a4e98477))
* publish effective mode after plan approval
([#1163](https://github.com/agentclientprotocol/claude-agent-acp/issues/1163))
([a2f4239](a2f4239543))
* recreate resumed sessions when any session option changes
([#1097](https://github.com/agentclientprotocol/claude-agent-acp/issues/1097))
([df38ccc](df38cccae0))
* render Write tool calls that use path/file_text aliases
([#1161](https://github.com/agentclientprotocol/claude-agent-acp/issues/1161))
([90cde4b](90cde4b397))
* replay marker-only slash skill prompts
([#1035](https://github.com/agentclientprotocol/claude-agent-acp/issues/1035))
([97394d9](97394d93b6))
* **session:** recreate query when configured skills change
([#968](https://github.com/agentclientprotocol/claude-agent-acp/issues/968))
([388a0f5](388a0f5191)),
closes
[#955](https://github.com/agentclientprotocol/claude-agent-acp/issues/955)
* settle steered turns on the result that answers the steer
([#1166](https://github.com/agentclientprotocol/claude-agent-acp/issues/1166))
([9392c69](9392c69cc6))

---
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-09-23 12:37:06 +02:00
Emre K.
da11f1feb2 fix: include model on usage updates (#1032)
## Summary
- include the current assistant model id on `usage_update` notifications
as `model`
- mirror the same value in `_meta["_claude/model"]` so clients that
prefer extension metadata can consume it
- preserve existing `_meta` entries such as `_claude/origin` and
rate-limit metadata

Fixes #1021

## Verification
- `npm run build`
- `npm run check`
- `npm run test:run -- src/tests/acp-agent.test.ts -t
'usage_update|effective model|origin handling'`
- `npm run test:run` *(fails only in existing root-environment
`resolve-permission-mode` expectations: `bypassPermissions` falls back
to `default` when run as root; unrelated to usage updates)*

---------

Signed-off-by: Emre Koca <110906681+kocaemre@users.noreply.github.com>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 10:06:29 +00:00
Jake Gaylor
df38cccae0 fix: recreate resumed sessions when any session option changes (#1097)
A warm `session/resume` or `session/load` currently ignores changed
`maxTurns` and `maxBudgetUsd`: the session fingerprint compares only cwd
and MCP servers, so the SDK query retains its old options. A client can
request a tighter limit and receive success while the old limit remains
active.

Include these two SDK execution limits in the session fingerprint.
Adding, changing or removing a limit recreates the query with the
supplied options and the same session ID. Identical limits reuse the
existing query; object key order does not trigger recreation. Budget
accounting across recreated SDK processes remains the client's
responsibility.

Validation:
- Four regression cases failed before the fix; six new cases cover both
methods, both limits, tightening/removal, and unchanged reuse.
- `npm run check` and `npm run build` passed.
- Focused suites: 551 passed, 9 skipped.
- Full suite with `--maxWorkers=2`: 1,240 passed, 27 skipped. An initial
unrestricted run hit one existing provider-switch test's 5s timeout and
macOS `EMFILE` watcher errors; bounding workers passed without changing
tests or timeouts.

Prepared while integrating typed runtime limits in
BinaryBourbon/fountain#1732. No live SDK budget-enforcement claim is
made by these adapter tests.

---------

Signed-off-by: Jake Gaylor <jhgaylor@gmail.com>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 12:01:37 +02:00
Josiah Hunsinger
39062b63ff fix: preserve context usage when quota is exhausted (#1132)
Synthetic usage-limit frames from the Claude SDK carry an all-zero usage
object. When one follows a real assistant response, the ACP bridge
currently overwrites the latest context measurement and emits a final
`usage_update` with `used: 0`.

Keep the previous measurement for a synthetic usage-limit frame when one
exists. A fresh quota-limited turn remains zero.

Includes a regression test covering a 170,910-token context followed by
a synthetic spend-limit frame.

Verified with:
- `npx vitest run src/tests/acp-agent.test.ts`
- `npm run check`
- `npm run build`

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 09:50:20 +00:00
Emre K.
29a4e98477 fix: preserve native Vertex endpoint defaults (#1104)
## Summary
- keep `ANTHROPIC_VERTEX_BASE_URL` unset when `providers/set` selects
Vertex's native default endpoint
- retain explicit `ANTHROPIC_VERTEX_BASE_URL` only for custom Vertex
gateways/endpoints
- add a regression test for the default Vertex endpoint env mapping

Closes #1087

## Test Plan
- `npm run test:run -- src/tests/providers.test.ts` — passed (21 tests)
- `npm run check` — passed (`eslint src --ext .ts` + `prettier --check
.`)
- `npm run build` — passed (`tsc`)
- `git diff --check origin/main..HEAD` — passed

Note: `claude -p` delegation was attempted for candidate discovery but
this cron shell's Claude Code auth is not logged in (`Not logged in ·
Please run /login`), so the implementation/validation above was done
directly with local tests.

Signed-off-by: Emre K <110906681+kocaemre@users.noreply.github.com>
2026-09-23 11:40:40 +02:00
Emre K.
6e97e071c5 fix: gate login result text on error state (#1103)
## Summary
- Fixes #1092 by treating `Please run /login` in a `success` result as
auth-required only when the result is actually error-shaped.
- Applies the same error-state guard to goal-command failure detection
so quoted login text in a normal answer does not roll back the active
goal.
- Adds a regression test for a successful model answer that mentions
`/login` without publishing a session failure.

## Test Plan
- [x] `npm run test:run -- src/tests/acp-agent.test.ts -t
'login|auth_required'`
- [x] `npm run build`
- [x] `npm run check`
- [ ] `npm run test:run` (blocked locally by pre-existing root
permission-mode assertions: `resolvePermissionMode("bypassPermissions")`
and `resolvePermissionMode("bypass")` resolve to `default` when running
as root)

Signed-off-by: Emre K <110906681+kocaemre@users.noreply.github.com>
2026-09-23 11:39:03 +02:00
Yuanlin Lin
2b0201a801 test: tolerate minute-aligned scheduled wakeups (#1044)
## Summary

- allow the scheduled-wakeup live audit to wait through the full
minute-alignment window
- keep a small buffer for the autonomous model turn to complete
- raise the Vitest case timeout accordingly

`ScheduleWakeup(delaySeconds=60)` is persisted as a minute-aligned cron
entry. Depending on where scheduling lands within a minute, delivery can
take close to two minutes. The previous 75-second predicate timeout can
therefore fail even though the idle ACP stream delivers the wakeup
correctly. I reproduced both outcomes against current `main`: one run
timed out at 75 seconds, while a second run delivered `LIVE_WAKE_OK`
through the idle ACP stream.

Related: #838

## Verification

- `npm run check`
- `npm run build`
- `npm run test:run` (971 passed, 27 skipped)
- live SDK/ACP probe on Agent SDK 0.3.238 observed `SCHEDULED` followed
by autonomous `LIVE_WAKE_OK` while idle
2026-09-23 09:37:49 +00:00
Emre K.
97394d93b6 fix: replay marker-only slash skill prompts (#1035)
## Summary

- reconstructs marker-only model-bound slash skill prompts during
history replay
- keeps client/local command metadata hidden when local stdout/stderr is
present
- adds regression coverage for both string and content-array transcript
shapes

Closes #998.

## Verification

- `npm run test:run -- src/tests/acp-agent.test.ts -t
'stripLocalCommandMetadata'`
- `npm run test:run -- src/tests/acp-agent.test.ts`
- `npm run build`
- `npm run check`
- `git diff --check`

I also ran `npm run test:run`. It completed with 965 passing tests, 27
skipped, and the same two root-environment `resolve-permission-mode`
failures seen when running as root: `bypassPermissions` is intentionally
downgraded to `default` in that environment. The changed replay/metadata
tests passed.

Signed-off-by: Emre Koca <1328630750+kocaemre@users.noreply.github.com>
Co-authored-by: Emre Koca <1328630750+kocaemre@users.noreply.github.com>
2026-09-23 11:37:38 +02:00
ranzhenyu
388a0f5191 fix(session): recreate query when configured skills change (#968)
## Summary

- include normalized Claude SDK `skills` in the resumed-session
fingerprint
- preserve the distinct semantics of omitted, `'all'`, empty, and
explicit skill selections
- avoid unnecessary Query recreation for reordered or duplicate skill
names
- keep unrelated `_meta.claudeCode.options` fields out of the
fingerprint
- recreate the Query with the same native session ID when skills change
- merge the latest `origin/main` so the change is validated against the
current session logic and SDK 0.3.238

## Testing

- clean Linux Node 22 environment with
`@anthropic-ai/claude-agent-sdk@0.3.238`
- `npm run build`
- `npm run lint`
- `npm run check`
- targeted lifecycle tests: `425 passed, 9 skipped`
- full test suite: `978 passed, 27 skipped`
- successful lifecycle case: `newSession(['pdf']) ->
resumeSession(['docx'])`

Closes #955
2026-09-23 09:37:00 +00:00
Ben Brandt
9392c69cc6 fix: settle steered turns on the result that answers the steer (#1166)
Fixes #1114.

## Problem

A steered turn settles only at an SDK `idle`, and only once the steer's
echo has been replayed and an outcome recorded. Two ways that never
happens, both from #1114:

- **Missing echo.** If the CLI never replays the steered message, every
idle is swallowed and `session/prompt` parks until cancel or the next
prompt.
- **Owed-idle debt eats the settling idle.** If the steer aborts an
autonomous followup, that followup's result counts a trailing idle, but
the abort folds it into the one idle that spans both cycles. The debt
lane absorbs that idle and the steered turn never settles.

## Fix

1. **Exact lane: settle on the result that answers the steer.** A result
whose `user_message_uuids` (falling back to `user_message_uuid`) names
one of the turn's steers retires that steer's echo, even if the CLI
never replayed it. Once no steer is outstanding, the turn leaves the
steer lane and settles at that result through the ordinary lanes,
including the subagent hold and failure lanes. It owes its trailing idle
like any other settling result. No timer.
2. **Idle fallback, for producers that don't stamp results: count only a
result recorded after the last echo.** Before this, the outcome of the
cycle the steer interrupted (or a held turn's outcome that `steer()`
moved over) made the turn look ready as soon as the echo landed.
`steeredAwaitingResult` is set when an echo drains and cleared when a
result is recorded.
3. **A ready steered turn takes the idle ahead of owed-idle debt.** Its
outcome is final, so whichever idle arrives settles it correctly. The
debt is left standing: a separate trailing idle still absorbs the idle
it belongs to, and one that never comes is cleared by the existing sweep
at the next `running` transition. A steered turn that isn't ready still
goes through the debt lane first, so an earlier turn's late idle can
never settle a steered cycle that's still running.

## Live verification (CLI 2.1.280, SDK 0.3.280)

A probe with the adapter's query options (`replay-user-messages`,
partial messages) steered a running turn three ways: mid-generation at
`now`, mid-tool-call at `now`, and mid-tool-call at `later`. All three
had the same frame order:

```
RESULT stamp=ORIG stamps=[ORIG]      <- interrupted (or finished) original cycle
lifecycle ORIG cancelled|completed
lifecycle STEER started
ECHO STEER
RESULT stamp=STEER stamps=[STEER]    <- steered cycle
lifecycle STEER completed
STATE idle                           <- the only idle
```

So the interrupted cycle's result never names the steer, and the steered
cycle's result always does. `later` doesn't fold the steer into the
running turn either; it runs as its own cycle after the original
finishes, with no idle in between.

## Tests

Three new tests in `turn steering (_session/steering)`:

- **Echo missing, stamped result:** the turn settles at the result
before any idle, and the idle that follows is absorbed. Hangs on `main`.
- **Steer aborts an autonomous followup, only one idle:** the turn
settles. Hangs on `main`.
- **Owed idle arrives after the echo but before the steered result:**
the turn must not settle on it, and it ends with both cycles' usage.
Passes on `main`, but fails with the post-echo readiness check removed,
so it guards against settling early on a pre-steer outcome.

`npm run build`, `npm run test:run` and `npm run check` pass.

## Remaining gap

If the echo never replays and the result carries no stamp (older
producers), the turn still waits for cancel or the next prompt, as
documented before.

Supersedes #1115 and #1063. Thanks to @KlausUllrich for the #1114
analysis and the result-acknowledgement idea, which this builds on.

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

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 11:33:24 +02:00
Ben Brandt
281e47eb81 fix: honor permissions.disableBypassPermissionsMode (#1165)
## Problem

Claude Code refuses `bypassPermissions` when any settings tier sets
`permissions.disableBypassPermissionsMode` to `"disable"`. The adapter
ignored the setting: it still listed the Bypass mode, passed
`allowDangerouslySkipPermissions`, and accepted `defaultMode:
"bypassPermissions"` as the starting mode.

## Change

Fold the setting into `allowBypass` at session creation. That single
value already drives the mode catalog, the SDK flag and the spawn-time
mode clamp, so all three now agree with the CLI. Like the CLI, the
setting is honored from any tier. It can only take away a permission, so
project settings are trusted for it.

## Validation

- `npm run build`, `npm run check` and `npm run test:run` pass.
- New tests set the option in user settings and in project settings.
Both fail without the fix.

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

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 10:56:40 +02:00
Ben Brandt
43c27e97aa fix: offer bypass alongside auto in plan approval (#1164)
Supersedes #1140 by @s-cork. Their commit is kept as-is (rebased onto
`main`), plus one follow-up commit. The fork is org-owned, so
maintainers can't push to it.

## Problem

ExitPlanMode always led with Auto and dropped bypass, even when the
session advertised `bypassPermissions`. Clients that deliberately run in
full-access mode lost that choice at plan approval.

Claude Code itself offers one elevated choice and prefers bypass over
Auto. It can do that because the CLI only offers bypass to users who
launched with it. The adapter advertises bypass for every non-root
session, so copying that priority would hide Auto for almost everyone.

## Change

- Offer both Auto and bypass whenever the session advertises them
(@s-cork's commit).
- Follow-up: remember the mode the session left when it entered plan
mode (`SessionModeManager.syncConfig`, which every mode change goes
through, including plan approval since #1163). If that was
`bypassPermissions`, bypass comes first and is also what the
clear-context option uses. Otherwise Auto leads, as before. A remembered
bypass mode is ignored if the session no longer advertises it.

This also fills the gap where the clear-context choice only ever came in
the Auto flavour.

Partially addresses #1077.

## Validation

- `npm run build`, `npm run check` and `npm run test:run` pass.
- New tests cover the pre-plan mode tracking and the option order with
and without a pre-plan bypass mode, including the clear-context row.

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

---------

Co-authored-by: stu <stucork@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 10:56:06 +02:00
Emre K.
bd059c10e0 fix: mark informational chunks with metadata (#1055)
## Summary

- tag SDK `informational` notices with `_meta.claudeCode.kind =
"informational"`
- include the notice `level` so clients can separate hook/status notices
from model text
- keep the existing rendered text unchanged for clients that ignore
`_meta`

Fixes #1042

## Test plan

- `npm test -- --run src/tests/acp-agent.test.ts -t informational`
- `npm run build`
- `npm run check`
- `IS_SANDBOX=1 npm run test:run`
- `git diff --check`

---------

Signed-off-by: Emre Koca <110906681+kocaemre@users.noreply.github.com>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 10:55:36 +02:00
PerryLink
58c5db1fdc fix: keep the agent starting when the managed-policy tier cannot be read (#1146)
Fixes #1124.

## The defect

`src/index.ts` awaited `resolveSettings` at module scope with nothing
around it:

```ts
const policy = await resolveSettings({ settingSources: [] });
for (const [key, value] of Object.entries(policy.effective.env ?? {})) {
  process.env[key] = value;
}
```

That is a top-level `await` in an ESM entry point, so a rejection aborts
module evaluation and the process exits before serving any ACP traffic.
The client only sees a process that exited 1 with no protocol messages.
Two neighbours make this the only call that can do it, and both are
still true on \`main\`:

- `SettingsManager.loadAllSettings` (`src/settings.ts:105-113`) wraps
the same SDK call in `try`/`catch` and falls back to `{}`.
- The `process.on("unhandledRejection", ...)` handler is registered at
\`src/index.ts:62\`, after this await, so it does not cover it.

Reading the managed tier is best-effort by nature — on a host with no
MDM and no managed policy the result is empty and the agent behaves
identically — so a transient `EINTR`/`EMFILE`/`EAGAIN` while reading it
should leave the agent running with no policy env rather than stop it
from starting.

## The change

The guard lives in a new `src/managed-policy.ts` rather than inline, for
one reason: `src/index.ts` is an ESM entry point with top-level side
effects, so nothing in it can be imported by a test. Extracting the tier
read makes the failure path testable, which is what the regression test
below exercises.

`applyManagedPolicyEnv` mirrors `loadAllSettings`: it takes the SDK call
through a parameter defaulting to `resolveSettings` and a target env
defaulting to `process.env`, reports the failure on stderr, and returns
without applying anything. `src/index.ts` becomes:

```ts
await applyManagedPolicyEnv();
```

`console.error` is correct here: this runs before stdout is redirected,
so the ACP stream stays clean.

## Verification

Four tests in `src/tests/managed-policy.test.ts` cover the applied case,
an empty tier, a tier with no `env` table, and the failure path — the
last one asserts the promise **resolves** rather than rejects, with the
target env untouched, which is the property the entry point depends on.

```
                        before                    after
tests                  17 failed | 1366 passed    17 failed | 1370 passed
```

The 17 failures are pre-existing in this checkout and untouched by this
change; the four added tests account for the difference. `eslint src
--ext .ts`, `tsc`, and `prettier --check` (with the repository's
`.prettierrc.json`) are clean on the three files.

## Note

I have not established whether those 17 pre-existing failures are
host-specific or real, so I am not claiming anything about them or
changing anything for them.
2026-09-23 08:47:45 +00:00
Ben Brandt
a2f4239543 fix: publish effective mode after plan approval (#1163)
Supersedes #1139 by @s-cork. Their commit is kept as-is (rebased onto
`main`), plus one follow-up commit. The fork is org-owned, so
maintainers can't push to it.

## Problem

Approving a plan through ExitPlanMode changes the SDK permission mode,
but ACP clients keep showing Plan. When Auto isn't available for the
current model, clients should also see the fallback mode that actually
applies.

## Change

- After an ExitPlanMode permission is allowed, send
`current_mode_update` and `config_option_update` with the session mode
as it stands after `applyPermissionFallback`. Rejection and
clear-context handling don't change.
- Follow-up: wrap those two notifications in a try/catch. The plan is
already approved at that point, so a rejected `sessionUpdate` is logged
and no longer turns the approval into a failed permission request. This
matches `publishFallbackWarning`.

Partially addresses #1077. It doesn't fix session restoration after a
clear-context approval.

## Validation

- `npm run build`, `npm run check` and `npm run test:run` pass.
- Regression tests cover the ordinary default, bypass and Auto
approvals, plus Auto falling back to acceptEdits. They check both the
stored mode and both ACP notifications.
- A new test rejects the mode notification and checks that the approval
still returns `allow` with the `setMode` update. It fails without the
follow-up fix.

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

---------

Co-authored-by: stu <stucork@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 10:42:20 +02:00
Ben Brandt
90cde4b397 fix: render Write tool calls that use path/file_text aliases (#1161)
Claude Code 2.1.280 (SDK 0.3.280, bumped in #1157) now accepts Write
calls where the model sends `path` instead of `file_path`, or
`file_text`/`file_content` instead of `content`. The CLI renames these
for its own validation, but the streamed `tool_use` block keeps the
model's original field names. So we showed the call as "Preparing file…"
with no diff or location, even though the write went through.

`toolInfoFromToolUse` now reads those fields the same way the CLI does.
When both spellings are present, the canonical fields win.

Nothing else in the 0.3.280 / 2.1.280 changelog needed an adapter
change. I checked Opus 5.5 model rows, the hand-back frame header,
`requires_action` during MCP elicitation, and headless elicitation
cancellation.

## Test plan
- New `toolInfoFromToolUse - Write input aliases` tests
- `npm run build`, `npm run check`, `npm run test:run`

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

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 08:34:20 +00:00
acp-release-bot[bot]
d571358e26 chore(main): release 0.81.0 (#1156)
🤖 I have created a release *beep* *boop*
---


##
[0.81.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.80.0...v0.81.0)
(2026-09-22)


### Features

* **deps:** update Claude SDK
([#1157](https://github.com/agentclientprotocol/claude-agent-acp/issues/1157))
([eb989e9](eb989e93f4))
* Send experimental session notices for live advisories
([#1155](https://github.com/agentclientprotocol/claude-agent-acp/issues/1155))
([79851b8](79851b8668))

---
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-09-22 19:04:53 +02:00
Andrey Bragin
eb989e93f4 feat(deps): update Claude SDK (#1157) 2026-09-22 16:56:10 +00:00
Ben Brandt
79851b8668 feat: Send experimental session notices for live advisories (#1155) 2026-09-22 13:46:49 +00:00
acp-release-bot[bot]
16c9d1a3af chore(main): release 0.80.0 (#1151)
🤖 I have created a release *beep* *boop*
---


##
[0.80.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.79.0...v0.80.0)
(2026-09-22)


### Features

* **deps:** Bump claude-agent-sdk to 0.3.278
([#1147](https://github.com/agentclientprotocol/claude-agent-acp/issues/1147))
([5bc3b4e](5bc3b4e560))


### Bug Fixes

* close interrupted compaction lifecycles
([#1154](https://github.com/agentclientprotocol/claude-agent-acp/issues/1154))
([a05aca6](a05aca6b81))
* prefer terminal output deltas
([#1150](https://github.com/agentclientprotocol/claude-agent-acp/issues/1150))
([c6f9668](c6f9668c12))

---
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-09-22 15:15:55 +02:00
Ben Brandt
a05aca6b81 fix: close interrupted compaction lifecycles (#1154)
## Summary

Close unfinished ACP compactions before interrupted prompts settle.
Previously, force cancellation could return `stopReason: cancelled`
while leaving the compaction `in_progress`; SDK stream teardown and
conversation reset had similar cleanup gaps.

- Add shared, idempotent interruption cleanup for cancellation,
force-cancel recovery, provider failures, SDK EOF/errors, and
conversation reset.
- Close compactions before resolving echo-less `/compact` commands,
which may still be queued while their compaction is running.
- Discard abandoned pending summaries and ignore late compaction
openings, completions, chunks, and hooks until an identified live turn
resumes.
- Preserve normal early-summary buffering across ordinary result
boundaries.
- Add regression coverage for terminal-before-response ordering,
echo-less cancellation, late SDK events, fresh-turn recovery,
EOF/errors, reset, and best-effort delivery failures.

After interruption, hooks without a command identity are conservatively
omitted until a new live turn is identified, rather than risking
attribution to the wrong compaction. Older echo-less commands without
dispatch identity may likewise omit the ambiguous compaction lifecycle
until turn activation.

This fixes an implementation gap found while auditing the [Session
Compaction
RFD](https://github.com/agentclientprotocol/agent-client-protocol/blob/main/docs/rfds/session-compaction.mdx).
No protocol or RFD changes are included.

## Validation

- [x] `npm run test:run` — 1,397 passed, 28 skipped
- [x] `npm run build`
- [x] `npm run check` — ESLint and Prettier
- [x] `git diff --check`

Tests use mocked SDK streams; no live provider calls were made.
2026-09-22 14:19:42 +02:00
dependabot[bot]
5bc3b4e560 feat(deps): Bump claude-agent-sdk to 0.3.278 (#1147)
Bumps the minor group with 11 updates:

| Package | From | To |
| --- | --- | --- |
|
[@anthropic-ai/claude-agent-sdk](https://github.com/anthropics/claude-agent-sdk-typescript)
| `0.3.274` | `0.3.276` |
|
[@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node)
| `26.5.1` | `26.6.1` |
| [prettier](https://github.com/prettier/prettier) | `3.9.7` | `3.9.8` |
| @anthropic-ai/claude-agent-sdk-darwin-arm64 | `0.3.274` | `0.3.276` |
| @anthropic-ai/claude-agent-sdk-darwin-x64 | `0.3.274` | `0.3.276` |
| @anthropic-ai/claude-agent-sdk-linux-arm64 | `0.3.274` | `0.3.276` |
| @anthropic-ai/claude-agent-sdk-linux-arm64-musl | `0.3.274` |
`0.3.276` |
| @anthropic-ai/claude-agent-sdk-linux-x64 | `0.3.274` | `0.3.276` |
| @anthropic-ai/claude-agent-sdk-linux-x64-musl | `0.3.274` | `0.3.276`
|
| @anthropic-ai/claude-agent-sdk-win32-arm64 | `0.3.274` | `0.3.276` |
| @anthropic-ai/claude-agent-sdk-win32-x64 | `0.3.274` | `0.3.276` |

Updates `@anthropic-ai/claude-agent-sdk` from 0.3.274 to 0.3.276
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/anthropics/claude-agent-sdk-typescript/releases">@​anthropic-ai/claude-agent-sdk's
releases</a>.</em></p>
<blockquote>
<h2>v0.3.276</h2>
<h2>What's changed</h2>
<ul>
<li>Updated to parity with Claude Code v2.1.276</li>
</ul>
<h2>Update</h2>
<pre lang="sh"><code>npm install @anthropic-ai/claude-agent-sdk@0.3.276
# or
yarn add @anthropic-ai/claude-agent-sdk@0.3.276
# or
pnpm add @anthropic-ai/claude-agent-sdk@0.3.276
# or
bun add @anthropic-ai/claude-agent-sdk@0.3.276
</code></pre>
<h2>v0.3.275</h2>
<h2>What's changed</h2>
<ul>
<li>Fixed a deferred tool call's result being emitted with internal keys
such as <code>toolUseResult</code> instead of
<code>tool_use_result</code> when the tool re-runs at the start of a
resumed turn</li>
<li>Fixed <code>getSessionMessages()</code> and
<code>forkSession()</code> sometimes missing a turn's assistant message
when called right after the turn's <code>result</code> message</li>
<li>Fixed <code>forkSession({ upToMessageId })</code> rejecting a
client-supplied <code>SDKUserMessage.uuid</code> that is not in UUID
format</li>
<li>Fixed <code>forkSession</code> rejecting the id that
<code>getSessionMessages</code> returns for a message sent while Claude
was working, and a fork showing a re-run prompt twice</li>
<li>Fixed <code>getSessionMessages()</code> omitting a task notification
or other queued message that Claude read while running a tool; it now
comes back where Claude read it</li>
<li>Updated to parity with Claude Code v2.1.275</li>
</ul>
<h2>Update</h2>
<pre lang="sh"><code>npm install @anthropic-ai/claude-agent-sdk@0.3.275
# or
yarn add @anthropic-ai/claude-agent-sdk@0.3.275
# or
pnpm add @anthropic-ai/claude-agent-sdk@0.3.275
# or
bun add @anthropic-ai/claude-agent-sdk@0.3.275
</code></pre>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/anthropics/claude-agent-sdk-typescript/blob/main/CHANGELOG.md">@​anthropic-ai/claude-agent-sdk's
changelog</a>.</em></p>
<blockquote>
<h2>0.3.276</h2>
<ul>
<li>Updated to parity with Claude Code v2.1.276</li>
</ul>
<h2>0.3.275</h2>
<ul>
<li>Fixed a deferred tool call's result being emitted with internal keys
such as <code>toolUseResult</code> instead of
<code>tool_use_result</code> when the tool re-runs at the start of a
resumed turn</li>
<li>Fixed <code>getSessionMessages()</code> and
<code>forkSession()</code> sometimes missing a turn's assistant message
when called right after the turn's <code>result</code> message</li>
<li>Fixed <code>forkSession({ upToMessageId })</code> rejecting a
client-supplied <code>SDKUserMessage.uuid</code> that is not in UUID
format</li>
<li>Fixed <code>forkSession</code> rejecting the id that
<code>getSessionMessages</code> returns for a message sent while Claude
was working, and a fork showing a re-run prompt twice</li>
<li>Fixed <code>getSessionMessages()</code> omitting a task notification
or other queued message that Claude read while running a tool; it now
comes back where Claude read it</li>
<li>Updated to parity with Claude Code v2.1.275</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="4919e0693e"><code>4919e06</code></a>
chore: Update CHANGELOG.md</li>
<li><a
href="e51cd0b1ba"><code>e51cd0b</code></a>
chore: Update CHANGELOG.md</li>
<li>See full diff in <a
href="https://github.com/anthropics/claude-agent-sdk-typescript/compare/v0.3.274...v0.3.276">compare
view</a></li>
</ul>
</details>
<br />

Updates `@types/node` from 26.5.1 to 26.6.1
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node">compare
view</a></li>
</ul>
</details>
<br />

Updates `prettier` from 3.9.7 to 3.9.8
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/prettier/prettier/releases">prettier's
releases</a>.</em></p>
<blockquote>
<h2>3.9.8</h2>
<ul>
<li>Markdown: Don't let Liquid objects interrupt paragraphs (<a
href="https://redirect.github.com/prettier/prettier/pull/20087">#20087</a>
by <a href="https://github.com/seiyab"><code>@​seiyab</code></a>)</li>
</ul>
<p>🔗 <a
href="https://github.com/prettier/prettier/blob/3.9.8/CHANGELOG.md#398">Changelog</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/prettier/prettier/blob/main/CHANGELOG.md">prettier's
changelog</a>.</em></p>
<blockquote>
<h1>3.9.8</h1>
<p><a
href="https://github.com/prettier/prettier/compare/3.9.7...3.9.8">diff</a></p>
<h4>Markdown: Don't let Liquid objects interrupt paragraphs (<a
href="https://redirect.github.com/prettier/prettier/pull/20087">#20087</a>
by <a href="https://github.com/seiyab"><code>@​seiyab</code></a>)</h4>
<!-- raw HTML omitted -->
<pre lang="markdown"><code>&lt;!-- Input --&gt;
If `module` is not a
[`WebAssembly.Module`](https://github.com/prettier/prettier/blob/main/en-US/docs/WebAssembly/Reference/JavaScript_interface/Module)
object instance, a
{{jsxref(&quot;TypeError&quot;)}} is thrown.
<p>&lt;!-- Prettier 3.9.7 --&gt;
If <code>module</code> is not a <a
href="https://github.com/prettier/prettier/blob/main/en-US/docs/WebAssembly/Reference/JavaScript_interface/Module"><code>WebAssembly.Module</code></a>
object instance, a</p>
<p>{{jsxref(&quot;TypeError&quot;)}} is thrown.</p>
<p>&lt;!-- Prettier 3.9.8 --&gt;
If <code>module</code> is not a <a
href="https://github.com/prettier/prettier/blob/main/en-US/docs/WebAssembly/Reference/JavaScript_interface/Module"><code>WebAssembly.Module</code></a>
object instance, a
{{jsxref(&quot;TypeError&quot;)}} is thrown.
</code></pre></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="4f2ab6765d"><code>4f2ab67</code></a>
Release 3.9.8</li>
<li><a
href="3d82af8b15"><code>3d82af8</code></a>
Update Regex related dependencies (<a
href="https://redirect.github.com/prettier/prettier/issues/20082">#20082</a>)</li>
<li><a
href="5ec8db1745"><code>5ec8db1</code></a>
[3.9.x] Markdown: Don't let Liquid objects interrupt paragraphs (<a
href="https://redirect.github.com/prettier/prettier/issues/20087">#20087</a>)</li>
<li><a
href="5b142ed2bc"><code>5b142ed</code></a>
Release Release <code>@​prettier/plugin-hermes</code><a
href="https://github.com/0"><code>@​0</code></a>.2.3,
<code>@​prettier/plugin-oxc</code><a
href="https://github.com/0"><code>@​0</code></a>.2.3, an...</li>
<li><a
href="0df8eb86b5"><code>0df8eb8</code></a>
Bump Prettier dependency to 3.9.7</li>
<li><a
href="3cf6c8c058"><code>3cf6c8c</code></a>
Clean changelog_unreleased</li>
<li>See full diff in <a
href="https://github.com/prettier/prettier/compare/3.9.7...3.9.8">compare
view</a></li>
</ul>
</details>
<br />

Updates `@anthropic-ai/claude-agent-sdk-darwin-arm64` from 0.3.274 to
0.3.276

Updates `@anthropic-ai/claude-agent-sdk-darwin-x64` from 0.3.274 to
0.3.276

Updates `@anthropic-ai/claude-agent-sdk-linux-arm64` from 0.3.274 to
0.3.276

Updates `@anthropic-ai/claude-agent-sdk-linux-arm64-musl` from 0.3.274
to 0.3.276

Updates `@anthropic-ai/claude-agent-sdk-linux-x64` from 0.3.274 to
0.3.276

Updates `@anthropic-ai/claude-agent-sdk-linux-x64-musl` from 0.3.274 to
0.3.276

Updates `@anthropic-ai/claude-agent-sdk-win32-arm64` from 0.3.274 to
0.3.276

Updates `@anthropic-ai/claude-agent-sdk-win32-x64` from 0.3.274 to
0.3.276


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

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

---

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

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


</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2026-09-22 14:15:02 +02:00
nikita-ashihmin
c6f9668c12 fix: prefer terminal output deltas (#1150)
When a client advertises terminal_output_delta, send Bash output through
that channel. Keep the completion update free of duplicate raw output
while preserving the existing terminal_output fallback.\n\nTracks
IJAI-2376.
2026-09-22 09:29:18 +04:00
acp-release-bot[bot]
d421f56a6c chore(main): release 0.79.0 (#1142)
🤖 I have created a release *beep* *boop*
---


##
[0.79.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.78.0...v0.79.0)
(2026-09-17)


### Features

* Update to claude agent sdk 0.3.274
([#1143](https://github.com/agentclientprotocol/claude-agent-acp/issues/1143))
([d0fa8e0](d0fa8e0385))


### Bug Fixes

* show shell commands in permission prompts
([#1070](https://github.com/agentclientprotocol/claude-agent-acp/issues/1070))
([bbae5c2](bbae5c2c09))

---
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-09-17 16:50:53 +02:00
Ben Brandt
d0fa8e0385 feat: Update to claude agent sdk 0.3.274 (#1143)
- **Update deps**
- **fix: Hold through placeholder task results**
2026-09-17 14:47:26 +00:00
hwisu
bbae5c2c09 fix: show shell commands in permission prompts (#1070)
## Summary
- use the canonical tool-call title for permission prompts, so shell
approvals show the exact command instead of the model-authored
description
- map `PowerShell` through the same shell presentation path as `Bash`
- complete the PowerShell terminal lifecycle with matching
`terminal_info`, `terminal_output`, and `terminal_exit` metadata,
including failed commands
- add focused regression coverage without changing the existing Bash
lifecycle tests

Fixes #1068

## PowerShell input and result contract
`PowerShell` is a distinct tool name, but its documented input fields
match `Bash`: the executable command is in `command`, while
`description` is an optional human-readable summary. The Claude Code
hooks reference documents the shared `command`, `description`,
`timeout`, and `run_in_background` fields, and the tools reference
likewise states that PowerShell hooks receive the command in
`tool_input.command`.

Anthropic closed
[claude-code#83647](https://github.com/anthropics/claude-code/issues/83647#issuecomment-5310033500)
after documenting this equivalence. Reusing the SDK's exported
`BashInput` shape for the common input fields is therefore intentional;
the SDK currently does not export a separate `PowerShellInput` type.

PowerShell results do not need a PowerShell-specific output assumption
here. The result mapper first shape-checks structured stdout/stderr and
otherwise falls back to the standard raw `tool_result` string or
content-block array. Routing PowerShell through that existing mapper
preserves this fallback while completing the adapter's capability-gated
terminal sequence:

1. initial `tool_call` with `terminal_info`
2. `tool_call_update` with `terminal_output`
3. final `tool_call_update` with `terminal_exit`

All three events use the original tool-use ID, so the client can
reconcile and close the terminal. Failed PowerShell results also bypass
the generic error renderer and finish the terminal with a non-zero
display exit code.

The permission presentation introduced in #1004 already handled `Bash`
and `PowerShell` together when choosing a description-based permission
title, but the canonical tool presentation and terminal result paths
only handled `Bash`. This PR completes both paths.

References:
- [Claude Code hooks: PowerShell
input](https://code.claude.com/docs/en/hooks#powershell)
- [Claude Code tools reference: PowerShell
tool](https://code.claude.com/docs/en/tools-reference#powershell-tool)
- [Anthropic schema
confirmation](https://github.com/anthropics/claude-code/issues/83647#issuecomment-5310033500)

## Verification
- `npm run check`
- `npm run build`
- `npm run test:run -- src/tests/tools.test.ts -t "PowerShell terminal
output"` (1 passed)
- full suite with an empty temporary Claude config:
`CLAUDE_CONFIG_DIR=<empty temporary directory> npm run test:run` (1070
passed, 27 skipped)

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2026-09-17 13:34:05 +00:00
acp-release-bot[bot]
becd854dd8 chore(main): release 0.78.0 (#1130)
🤖 I have created a release *beep* *boop*
---


##
[0.78.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.77.0...v0.78.0)
(2026-09-15)


### Features

* Add experimental ACP compaction update support
([#1134](https://github.com/agentclientprotocol/claude-agent-acp/issues/1134))
([543a9a2](543a9a2f97))


### Bug Fixes

* keep the picked option when AskUserQuestion custom text is also
supplied
([#1131](https://github.com/agentclientprotocol/claude-agent-acp/issues/1131))
([8823ea6](8823ea6fcb))


### Performance Improvements

* report file changes from Claude checkpoints
([#1138](https://github.com/agentclientprotocol/claude-agent-acp/issues/1138))
([91f1699](91f1699366))
* supply AIR diff counts from Claude structured patches
([#1122](https://github.com/agentclientprotocol/claude-agent-acp/issues/1122))
([735950a](735950a83e))

---
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-09-16 00:59:23 +04:00
nikita-ashihmin
91f1699366 perf: report file changes from Claude checkpoints (#1138)
## Summary

- replace the hidden model-authored file audit turn with Claude native
file checkpointing
- preview changed paths with rewindFiles at the terminal turn boundary
while preserving the existing AIR metadata contract
- enable checkpointing only for clients that negotiate
agentFileChangeReport and fail open after two seconds
- retain legacy audit filtering so persisted sessions do not replay old
hidden audit turns

This follows Claude Code checkpoint semantics. It tracks changes made
through supported Claude file tools; Bash and most subagent changes may
not be included.

Reference: https://code.claude.com/docs/en/checkpointing

## Validation

- npm run build
- npm run check
- env -u ANTHROPIC_BASE_URL npm run test:run (1368 passed, 28 skipped)
2026-09-16 00:54:39 +04:00
nikita-ashihmin
735950a83e perf: supply AIR diff counts from Claude structured patches (#1122)
Claude supplies structured patches for Edit and Write, but ACP diff
blocks previously carried only the reconstructed texts. AIR had to
compare those texts again to display added and removed counts.

Count patch operations in the existing conversion loop and publish
`_meta.jetbrains.air.diffStats` on each diff block. This uses the same
contract as https://github.com/agentclientprotocol/codex-acp/pull/501.
Each block has its own counts. No extra traversal, full file comparison,
or navigation calculation is needed.

Omit statistics when patches are absent or inconsistent, so clients
retain their existing fallback. Exclude EOF markers from the displayed
texts. Document the extension and cover per-block counts, Edit and Write
hooks, EOF changes, and fallback behavior.

Validation:
- `npm run build`
- `npm run check`
- `env -u ANTHROPIC_BASE_URL npm run test:run` (the local endpoint
override affects unrelated provider tests)
2026-09-15 12:39:39 +04:00
Ben Brandt
543a9a2f97 feat: Add experimental ACP compaction update support (#1134) 2026-09-14 17:38:11 +02:00
Ben Brandt
8823ea6fcb fix: keep the picked option when AskUserQuestion custom text is also supplied (#1131)
## Summary

For a single-select `AskUserQuestion`, a non-empty custom-answer field
(`question_<n>_custom`) replaced the selected option. A client that
renders that box as a notes step (as in #1050, seen via Devin/Windsurf)
therefore returned only the typed text and the selection never reached
the model.

- The pick now stays in `answers`, and the typed text travels beside it
as the tool's own per-question `annotations[question].notes`. That is
the slot the CLI itself uses for free text attached to a selection and
renders to the model as `"Q"="A" notes: ...`, so no new answer format is
invented.
- Custom text with no pick is still the answer on its own (the CLI's
"Other").
- Multi-select folding from #1031 is unchanged: the text still joins the
checked options with CLI-style quoting.
- `annotations` is only added to `updatedInput` when non-empty.
- The single-select field description now says the box can also add a
note to the chosen option.

Supersedes #1054, which conflicted with #1031 and glued label and text
into one string.

The "empty notes field won't submit" part of #1050 is client-side:
nothing in the requested schema is marked required.

Closes #1050

## Test plan

- `npm run check`
- `npm run build`
- `npm run test:run` (1325 passed, 27 skipped)
- New test: pick + custom text yields `answers: { Q: "A" }` and
`annotations: { Q: { notes } }`
- New test: custom text alone on a single-select stays the answer

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

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-14 15:36:19 +02:00
acp-release-bot[bot]
dfe823b958 chore(main): release 0.77.0 (#1118)
🤖 I have created a release *beep* *boop*
---


##
[0.77.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.76.0...v0.77.0)
(2026-09-14)


### ⚠ BREAKING CHANGES

* claudeCode.options.agent is no longer forwarded to Claude Code, and
the agent-picker exports DEFAULT_AGENT_ID, AGENT_CONFIG_ID,
BUILTIN_AGENT_NAMES, and discoverCustomAgents are removed. Consumers
relying on main-thread agent selection must stop passing that option.

### Features

* Add tool names to tool calls
([#1128](https://github.com/agentclientprotocol/claude-agent-acp/issues/1128))
([67c7c9b](67c7c9b117))
* **deps:** Bump @anthropic-ai/claude-agent-sdk to 0.3.270
([#1123](https://github.com/agentclientprotocol/claude-agent-acp/issues/1123))
([d3205ab](d3205ab11f))


### Bug Fixes

* keep multi-select answers when a custom answer is typed
([#1031](https://github.com/agentclientprotocol/claude-agent-acp/issues/1031))
([1a4512c](1a4512c711))
* parse TaskList output without ambiguous regex
([#1006](https://github.com/agentclientprotocol/claude-agent-acp/issues/1006))
([b274923](b274923ef8))
* strip injected system reminders from replayed prompts
([#1040](https://github.com/agentclientprotocol/claude-agent-acp/issues/1040))
([15ba608](15ba608a79))


### Code Refactoring

* remove agent config option
([#1112](https://github.com/agentclientprotocol/claude-agent-acp/issues/1112))
([6b7473b](6b7473b1af))

---
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-09-14 15:11:57 +02:00
Ben Brandt
3d99cafe4a fix: honor host opt-out for allowDangerouslySkipPermissions (#1129)
## Summary

Closes #1119. Supersedes #1120 by @amansk (their commits are included on
this branch; the fork does not allow maintainer edits, so review fixes
landed here instead).

Hosts that never use `bypassPermissions` can opt a session out by
sending `_meta.claudeCode.options.allowDangerouslySkipPermissions:
false` on `session/new` (and again on `session/load`). When omitted or
`true`, behavior is unchanged: bypass is available on non-root sessions.

## Design

Bypass availability is decided once per session in `createSession`:

```ts
const allowBypass =
  ALLOW_BYPASS && sessionMeta?.claudeCode?.options?.allowDangerouslySkipPermissions !== false;
```

and threaded to the three places that must agree:

- the SDK `allowDangerouslySkipPermissions` flag (the actual
enforcement; the CLI refuses bypass without it)
- the spawn-time mode clamp in `resolvePermissionMode`, so a
`permissions.defaultMode` of `bypassPermissions` (or a mode carried
across a clear-context restart) becomes `default` before `query()`
rather than failing at spawn
- the session mode catalog in `SessionModeManager.initialize`, so the
client is never offered a mode the CLI would reject

## Changes from #1120

- Fold the host opt-out into `resolvePermissionMode` via an
`allowBypass` parameter instead of a second inline clamp; drop the
separate `resolveAllowDangerouslySkipPermissions` helper
- Make `allowBypass` a required `initialize` parameter and remove the
module-global `ALLOW_BYPASS` fallback from `session-mode.ts`
- Fix `tsc` errors in the new tests (`modes` is optional on
`NewSessionResponse`), which broke the CI build job
- Move the settings-driven clamp test onto the shared
`acp-agent-settings` fixture (isolated cwd, no double module reload,
passes as root)
- Document the opt-out in `docs/permission-extension.md`

## Testing

- `npm run check`, `npm run build` — pass
- `npm run test:run` — pass (the branch is based before #1123, so the
SDK version guard in `model-presentation.test.ts` only passes with the
pinned 0.3.257; it clears on rebase)

Co-authored-by: Cursor Agent <cursoragent@cursor.com>

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

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Amandeep Khurana <amansk@gmail.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-14 15:11:30 +02:00
Sergio-3
1a4512c711 fix: keep multi-select answers when a custom answer is typed (#1031)
## Summary

`applyAskElicitationResponse` drops a multi-select question's checked
options as soon as
that question's custom-answer field is non-empty: the typed text
replaces the selection
instead of joining it, so the checked options never reach the model.

Versions: reproduced on v0.69.0, code unchanged on v0.70.0 and current
`main` (996d488);
`@agentclientprotocol/sdk` 1.3.0; Node 22. Noticed through Zed 1.16.1,
which does return
both fields, but the repro below is adapter-local and needs no client.

## Where the two fields diverge

`askUserQuestionsToCreateRequest` publishes, per question, two
**independent optional**
fields: `question_<n>` and `question_<n>_custom`. Neither is `required`,
and nothing in
the schema makes them exclusive. The
`_meta._askUserQuestionCustomAnswer` marker from #929
identifies the companion field's role (`{ questionId, isCustomAnswer }`)
— it doesn't ask a
client to clear the selection when the box is filled. So a client that
returns both is
doing nothing wrong, and the fold has no ground to keep only one of
them.

Before #774 the two coexisted: selections in `answers`, the custom text
in a separate
top-level `response` field. Scoping the custom answer per question
(fixing #770) turned
that coexistence into an overwrite:

```js
const custom = content[questionCustomFieldKey(index)];
if (typeof custom === "string" && custom.trim() !== "") {
  answers[question.question] = custom.trim();
  return;                     // <- selections discarded
}
```

For a **single-select** question replacing is right — the user typed an
answer instead of
picking one — and that stays. For a **multi-select** question the
options were never
mutually exclusive, so the typed answer should join them.

Restoring `response` isn't the alternative: it is a single form-level
field, so using it
for per-question custom answers would reintroduce exactly the collapse
#770 reported.

## Reproduction (no client, no model, no network)

```js
import { applyAskElicitationResponse } from "@agentclientprotocol/claude-agent-acp/dist/elicitation.js";

const q = [{ question: "Which features?", header: "F", multiSelect: true,
             options: [{ label: "Alpha" }, { label: "Bravo" }] }];
const fold = (content) =>
  applyAskElicitationResponse({ action: "accept", content }, { questions: q }, q)
    .updatedInput.answers;

fold({ question_0: ["Alpha", "Bravo"] });                          // { "Which features?": "Alpha, Bravo" }  (control)
fold({ question_0: ["Alpha", "Bravo"], question_0_custom: "Charlie" });
// actual:   { "Which features?": "Charlie" }
// expected: { "Which features?": "Alpha, Bravo, Charlie" }
```

## Change

Multi-select questions join the custom answer onto their selections;
single-select keeps
replacing. The selection normalization is deliberately untouched, so a
multi-select
question with a non-empty custom answer is the only input that folds
differently than
before. Comma-joining follows the documented shape of `answers`
("multi-select answers are
comma-separated"), which also means a label containing a comma stays
exactly as ambiguous
as it already was.

The `"Other"` box described itself as *"Type your own answer instead of
choosing an option
above"*; it now describes both roles, since for a multi-select question
it is no longer an
either/or.

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-14 12:59:43 +00:00
José Gurruchaga
b274923ef8 fix: parse TaskList output without ambiguous regex (#1006)
## Summary

- Replace the ambiguous regex used to parse textual `TaskList` output
with linear string parsing.
- Preserve support for owners, multiple dependencies, and malformed
suffixes treated as subject text.
- Add a regression test covering adversarial input.

This addresses a potential ReDoS reported by CodeQL without changing the
structured JSON path.

Closes #1005.

## Testing

- `npm run test:run`
- `npm run build`
- `npm run check`
2026-09-14 12:18:15 +00:00
Shane
15ba608a79 fix: strip injected system reminders from replayed prompts (#1040)
## Summary

- strip `<system-reminder>` blocks from replayed user messages, through
the marker scanner that already handles the local-command tags
- what the user actually typed is preserved; a reminder-only message
strips to nothing and is skipped
- regression coverage for the string shape, the content-array shape, and
`replaySessionHistory` end to end

## Why

`stripLocalCommandMetadata` exists for a stated reason: *"The live
prompt loop drops them; replay must strip them too or they leak into the
UI on session/load."* Injected reminders are the same class of leak and
are not covered by it.

The CLI appends `<system-reminder>` blocks to a user turn to steer the
model — a worktree that was deleted, a background task that started
elsewhere. They are persisted in the same text block as the prose the
user typed, and they are not `isMeta`, so `getSessionMessages` returns
them. Live, nothing reaches the client: the prompt loop's user-message
skip covers the whole message. On `session/load` the block is replayed
verbatim, so a client renders a paragraph of instructions the user never
wrote, followed by their one-line prompt.

Reproduced against `main` with a real transcript: a reminder about a
deleted worktree, followed by a five-word prompt, arrives as a single
`user_message_chunk` containing both. With this change the chunk is the
five words.

## Not included, deliberately

- **`<task-notification>` envelopes.** They still replay as user
messages, but #1028 is already doing that properly, keyed on the
SDK-provided `origin.kind` rather than the text — the better trust
boundary, since a user can type the tag themselves.
- **`[Request interrupted by user]`.** Also still replayed as a user
message. It is untagged prose and it is the only trace a cancelled turn
leaves, so whether it should be dropped, typed, or marked in `_meta`
reads as your product call rather than a bug fix. Happy to open a
follow-up if you want it handled.

The exported name `stripLocalCommandMetadata` is left alone — it is part
of `lib.ts` — so only the shared marker list and the doc comment grew.

## The one false positive

A user who literally types `<system-reminder>…</system-reminder>` in a
prompt loses that span on replay, while seeing it live. It is the same
trade already accepted for `<command-name>`, the surrounding prose still
survives, and text is the only signal available here — unlike task
notifications, reminders carry no `origin` to key on. Flagging it rather
than leaving it for review to find.

## Verification

- `npm run build`
- `npm run check`
- `env -u ANTHROPIC_BASE_URL npm run test:run` — 974 passed, 27 skipped
- the three new tests fail on `main` and pass with the change

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

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 12:09:17 +00:00
dependabot[bot]
d3205ab11f feat(deps): Bump @anthropic-ai/claude-agent-sdk to 0.3.270 (#1123)
Bumps the minor group with 8 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
|
[@anthropic-ai/claude-agent-sdk](https://github.com/anthropics/claude-agent-sdk-typescript)
| `0.3.257` | `0.3.263` |
|
[@anthropic-ai/sdk](https://github.com/anthropics/anthropic-sdk-typescript)
| `0.122.0` | `0.124.0` |
|
[@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node)
| `26.4.0` | `26.5.0` |
|
[@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin)
| `8.69.0` | `8.70.0` |
|
[@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser)
| `8.69.0` | `8.70.0` |
| [eslint](https://github.com/eslint/eslint) | `10.9.1` | `10.10.0` |
| [hono](https://github.com/honojs/hono) | `4.13.5` | `4.13.7` |
| [jose](https://github.com/panva/jose) | `6.2.10` | `6.2.12` |


Updates `@anthropic-ai/claude-agent-sdk` from 0.3.257 to 0.3.263
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/anthropics/claude-agent-sdk-typescript/releases">@​anthropic-ai/claude-agent-sdk's
releases</a>.</em></p>
<blockquote>
<h2>v0.3.263</h2>
<h2>What's changed</h2>
<ul>
<li>Updated to parity with Claude Code v2.1.263</li>
</ul>
<h2>Update</h2>
<pre lang="sh"><code>npm install @anthropic-ai/claude-agent-sdk@0.3.263
# or
yarn add @anthropic-ai/claude-agent-sdk@0.3.263
# or
pnpm add @anthropic-ai/claude-agent-sdk@0.3.263
# or
bun add @anthropic-ai/claude-agent-sdk@0.3.263
</code></pre>
<h2>v0.3.261</h2>
<h2>What's changed</h2>
<ul>
<li>Added <code>pluginDelivery: 'initialize'</code> to send
<code>plugins</code> over stdin so the launch command line no longer
grows with the plugin count (fixes Windows start failures with many
plugins)</li>
<li>Fixed <code>query()</code> throwing &quot;Object not
disposable&quot; in runtimes without a native
<code>Symbol.dispose</code>, such as Node ≤22 <code>vm</code> contexts
(Jest's <code>node</code> environment, vitest
<code>vmThreads</code>/<code>vmForks</code>) and Node &lt;18.18</li>
<li>Updated to parity with Claude Code v2.1.261</li>
</ul>
<h2>Update</h2>
<pre lang="sh"><code>npm install @anthropic-ai/claude-agent-sdk@0.3.261
# or
yarn add @anthropic-ai/claude-agent-sdk@0.3.261
# or
pnpm add @anthropic-ai/claude-agent-sdk@0.3.261
# or
bun add @anthropic-ai/claude-agent-sdk@0.3.261
</code></pre>
<h2>v0.3.260</h2>
<h2>What's changed</h2>
<ul>
<li>Added optional <code>user_message_uuid</code> to
<code>thinking_tokens</code> system messages, linking thinking progress
to the user message that triggered the turn</li>
<li>Added optional <code>first_content_frame_ms</code>,
<code>first_stream_post_ms</code>, <code>first_stream_post_ack_ms</code>
and <code>first_stream_post_wall_ms</code> fields to the success result
message for remote-session latency breakdowns</li>
<li>Fixed <code>managedSettings</code> <code>disableAutoMode:
&quot;disable&quot;</code> (either spelling) being dropped by the
restrictive-only filter instead of turning auto mode off for the spawned
session</li>
<li>Fixed <code>rewindFiles()</code> reporting success when no files
could be restored (for example when checkpoint backups are missing); it
now fails</li>
<li>Changed <code>error_max_structured_output_retries</code> results to
append the last StructuredOutput tool error; validation errors now name
the offending key, allowed values, and actual length or count</li>
<li>Changed <code>rate_limit_event</code> to also re-emit during an
exceeded window on repeat 429s (about once per 30 seconds per limit
window), so stream consumers can refresh stale rate-limit state</li>
<li>Updated to parity with Claude Code v2.1.260</li>
</ul>
<h2>Update</h2>
<pre lang="sh"><code>&lt;/tr&gt;&lt;/table&gt; 
</code></pre>
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/anthropics/claude-agent-sdk-typescript/blob/main/CHANGELOG.md">@​anthropic-ai/claude-agent-sdk's
changelog</a>.</em></p>
<blockquote>
<h2>0.3.263</h2>
<ul>
<li>Updated to parity with Claude Code v2.1.263</li>
</ul>
<h2>0.3.262</h2>
<ul>
<li>Updated to parity with Claude Code v2.1.262</li>
</ul>
<h2>0.3.261</h2>
<ul>
<li>Added <code>pluginDelivery: 'initialize'</code> to send
<code>plugins</code> over stdin so the launch command line no longer
grows with the plugin count (fixes Windows start failures with many
plugins)</li>
<li>Fixed <code>query()</code> throwing &quot;Object not
disposable&quot; in runtimes without a native
<code>Symbol.dispose</code>, such as Node ≤22 <code>vm</code> contexts
(Jest's <code>node</code> environment, vitest
<code>vmThreads</code>/<code>vmForks</code>) and Node &lt;18.18</li>
<li>Updated to parity with Claude Code v2.1.261</li>
</ul>
<h2>0.3.260</h2>
<ul>
<li>Added optional <code>user_message_uuid</code> to
<code>thinking_tokens</code> system messages, linking thinking progress
to the user message that triggered the turn</li>
<li>Added optional <code>first_content_frame_ms</code>,
<code>first_stream_post_ms</code>, <code>first_stream_post_ack_ms</code>
and <code>first_stream_post_wall_ms</code> fields to the success result
message for remote-session latency breakdowns</li>
<li>Fixed <code>managedSettings</code> <code>disableAutoMode:
&quot;disable&quot;</code> (either spelling) being dropped by the
restrictive-only filter instead of turning auto mode off for the spawned
session</li>
<li>Fixed <code>rewindFiles()</code> reporting success when no files
could be restored (for example when checkpoint backups are missing); it
now fails</li>
<li>Changed <code>error_max_structured_output_retries</code> results to
append the last StructuredOutput tool error; validation errors now name
the offending key, allowed values, and actual length or count</li>
<li>Changed <code>rate_limit_event</code> to also re-emit during an
exceeded window on repeat 429s (about once per 30 seconds per limit
window), so stream consumers can refresh stale rate-limit state</li>
<li>Updated to parity with Claude Code v2.1.260</li>
</ul>
<h2>0.3.259</h2>
<ul>
<li>Added <code>user_message_uuids</code> beside
<code>user_message_uuid</code> on a turn's first reply frame and result:
every user message the turn answered, so a reply to several merged
messages can be matched to each</li>
<li>Added <code>permissionPrompts: 'none'</code> option to auto-deny
permission prompts in sessions with nobody to answer them, without
disabling auto mode's classifier</li>
<li>Updated to parity with Claude Code v2.1.259</li>
</ul>
<h2>0.3.258</h2>
<ul>
<li>Updated to parity with Claude Code v2.1.258</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="69f318f92f"><code>69f318f</code></a>
chore: Update CHANGELOG.md</li>
<li><a
href="a96f6b5cbe"><code>a96f6b5</code></a>
chore: Update CHANGELOG.md</li>
<li><a
href="a79d677cbd"><code>a79d677</code></a>
chore: Update CHANGELOG.md</li>
<li><a
href="e3d162bdf0"><code>e3d162b</code></a>
chore: Update CHANGELOG.md</li>
<li><a
href="eefd0df145"><code>eefd0df</code></a>
chore: Update CHANGELOG.md</li>
<li>See full diff in <a
href="https://github.com/anthropics/claude-agent-sdk-typescript/compare/v0.3.257...v0.3.263">compare
view</a></li>
</ul>
</details>
<br />

Updates `@anthropic-ai/sdk` from 0.122.0 to 0.124.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/anthropics/anthropic-sdk-typescript/releases">@​anthropic-ai/sdk's
releases</a>.</em></p>
<blockquote>
<h2>sdk: v0.124.0</h2>
<h2>0.124.0 (2026-09-04)</h2>
<p>Full Changelog: <a
href="https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.123.0...sdk-v0.124.0">sdk-v0.123.0...sdk-v0.124.0</a></p>
<h3>Features</h3>
<ul>
<li><strong>api:</strong> add Claude Tag category and user breakdowns to
usage reports (<a
href="669ff22431">669ff22</a>)</li>
<li><strong>api:</strong> add named types for organization compliance
settings state (<a
href="54be8da717">54be8da</a>)</li>
<li><strong>api:</strong> add support for sending a workspace ID on more
endpoints (<a
href="a11e6f1d3b">a11e6f1</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li>repair custom-code merge in messages resources (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/455">#455</a>)
(<a
href="7ac43b92e7">7ac43b9</a>)</li>
<li><strong>tools:</strong> create agent-toolset files and directories
owner-only (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/485">#485</a>)
(<a
href="a9c2298873">a9c2298</a>)</li>
</ul>
<h3>Chores</h3>
<ul>
<li><strong>internal:</strong> bundle the mock server spec and update
breaking-change detection (<a
href="8752d02422">8752d02</a>)</li>
<li><strong>internal:</strong> codegen related update (<a
href="a63afbc47d">a63afbc</a>)</li>
<li><strong>tests:</strong> reword the skip reason on the path-level
query param tests (<a
href="999bee5bb8">999bee5</a>)</li>
</ul>
<h3>Documentation</h3>
<ul>
<li><strong>api:</strong> update a few doc strings (<a
href="2ef3d59b81">2ef3d59</a>)</li>
</ul>
<h2>sdk: v0.123.0</h2>
<h2>0.123.0 (2026-09-01)</h2>
<p>Full Changelog: <a
href="https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.122.0...sdk-v0.123.0">sdk-v0.122.0...sdk-v0.123.0</a></p>
<h3>Features</h3>
<ul>
<li><strong>api:</strong> beta user profiles: add
external_user_onboarded_at, remove relationship in favor of access_type
(<a
href="3efb1a1a81">3efb1a1</a>)</li>
<li><strong>api:</strong> manual updates (<a
href="c6f0bdaff6">c6f0bda</a>)</li>
<li><strong>api:</strong> organization compliance settings, user-profile
order_by, memory-store and toolset schema updates (<a
href="8e2f0c2f7e">8e2f0c2</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li>keep credential file access out of non-Node bundles (<a
href="ab6a4b2814">ab6a4b2</a>)</li>
</ul>
<h3>Chores</h3>
<ul>
<li><strong>internal:</strong> codegen related update (<a
href="788ea8bdaa">788ea8b</a>)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/anthropics/anthropic-sdk-typescript/blob/main/CHANGELOG.md">@​anthropic-ai/sdk's
changelog</a>.</em></p>
<blockquote>
<h2>0.124.0 (2026-09-04)</h2>
<p>Full Changelog: <a
href="https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.123.0...sdk-v0.124.0">sdk-v0.123.0...sdk-v0.124.0</a></p>
<h3>Features</h3>
<ul>
<li><strong>api:</strong> add Claude Tag category and user breakdowns to
usage reports (<a
href="669ff22431">669ff22</a>)</li>
<li><strong>api:</strong> add named types for organization compliance
settings state (<a
href="54be8da717">54be8da</a>)</li>
<li><strong>api:</strong> add support for sending a workspace ID on more
endpoints (<a
href="a11e6f1d3b">a11e6f1</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li>repair custom-code merge in messages resources (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/455">#455</a>)
(<a
href="7ac43b92e7">7ac43b9</a>)</li>
<li><strong>tools:</strong> create agent-toolset files and directories
owner-only (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/485">#485</a>)
(<a
href="a9c2298873">a9c2298</a>)</li>
</ul>
<h3>Chores</h3>
<ul>
<li><strong>internal:</strong> bundle the mock server spec and update
breaking-change detection (<a
href="8752d02422">8752d02</a>)</li>
<li><strong>internal:</strong> codegen related update (<a
href="a63afbc47d">a63afbc</a>)</li>
<li><strong>tests:</strong> reword the skip reason on the path-level
query param tests (<a
href="999bee5bb8">999bee5</a>)</li>
</ul>
<h3>Documentation</h3>
<ul>
<li><strong>api:</strong> update a few doc strings (<a
href="2ef3d59b81">2ef3d59</a>)</li>
</ul>
<h2>0.123.0 (2026-09-01)</h2>
<p>Full Changelog: <a
href="https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.122.0...sdk-v0.123.0">sdk-v0.122.0...sdk-v0.123.0</a></p>
<h3>Features</h3>
<ul>
<li><strong>api:</strong> beta user profiles: add
external_user_onboarded_at, remove relationship in favor of access_type
(<a
href="3efb1a1a81">3efb1a1</a>)</li>
<li><strong>api:</strong> manual updates (<a
href="c6f0bdaff6">c6f0bda</a>)</li>
<li><strong>api:</strong> organization compliance settings, user-profile
order_by, memory-store and toolset schema updates (<a
href="8e2f0c2f7e">8e2f0c2</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li>keep credential file access out of non-Node bundles (<a
href="ab6a4b2814">ab6a4b2</a>)</li>
</ul>
<h3>Chores</h3>
<ul>
<li><strong>internal:</strong> codegen related update (<a
href="788ea8bdaa">788ea8b</a>)</li>
</ul>
<h3>Documentation</h3>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="ba14b1f4fd"><code>ba14b1f</code></a>
Merge pull request <a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/1177">#1177</a>
from anthropics/release-please--branches--main--chan...</li>
<li><a
href="f99c1a7942"><code>f99c1a7</code></a>
chore: release main</li>
<li><a
href="54be8da717"><code>54be8da</code></a>
feat(api): add named types for organization compliance settings
state</li>
<li><a
href="999bee5bb8"><code>999bee5</code></a>
chore(tests): reword the skip reason on the path-level query param
tests</li>
<li><a
href="a9c2298873"><code>a9c2298</code></a>
fix(tools): create agent-toolset files and directories owner-only (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/485">#485</a>)</li>
<li><a
href="2637d1198b"><code>2637d11</code></a>
chore(examples): refresh platform model IDs (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/376">#376</a>)</li>
<li><a
href="669ff22431"><code>669ff22</code></a>
feat(api): add Claude Tag category and user breakdowns to usage
reports</li>
<li><a
href="a9090aff65"><code>a9090af</code></a>
Build SDK</li>
<li><a
href="8752d02422"><code>8752d02</code></a>
chore(internal): bundle the mock server spec and update breaking-change
detec...</li>
<li><a
href="a63afbc47d"><code>a63afbc</code></a>
chore(internal): codegen related update</li>
<li>Additional commits viewable in <a
href="https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.122.0...sdk-v0.124.0">compare
view</a></li>
</ul>
</details>
<br />

Updates `@types/node` from 26.4.0 to 26.5.0
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node">compare
view</a></li>
</ul>
</details>
<br />

Updates `@typescript-eslint/eslint-plugin` from 8.69.0 to 8.70.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/releases">@​typescript-eslint/eslint-plugin's
releases</a>.</em></p>
<blockquote>
<h2>v8.70.0</h2>
<h2>8.70.0 (2026-09-07)</h2>
<h3>🚀 Features</h3>
<ul>
<li><strong>eslint-plugin:</strong> [no-generated-empty-object-type] add
rule (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12730">#12730</a>)</li>
<li><strong>website:</strong> generate per-page social preview cards (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12734">#12734</a>)</li>
</ul>
<h3>🩹 Fixes</h3>
<ul>
<li>use stable release of pnpm 12 (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12808">#12808</a>)</li>
<li>update pnpm to 12.3.4 and dedupe Docusaurus packages (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12829">#12829</a>)</li>
<li><strong>eslint-plugin:</strong> [member-ordering] don't report
fields that read fields declared before them (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12729">#12729</a>)</li>
<li><strong>eslint-plugin:</strong> [no-unnecessary-condition] no false
positive on RHS of a nested logical expression (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12728">#12728</a>)</li>
<li><strong>eslint-plugin:</strong> [no-deprecated] report deprecated
imported values used in object shorthand properties (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12780">#12780</a>)</li>
<li><strong>project-service:</strong> avoid discarded tsserver logs (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12748">#12748</a>)</li>
<li><strong>typescript-estree:</strong> clarify the
parserOptions.project error message (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12817">#12817</a>)</li>
</ul>
<h3>❤️ Thank You</h3>
<ul>
<li>Barry <a
href="https://github.com/barry166"><code>@​barry166</code></a></li>
<li>Evyatar Daud <a
href="https://github.com/StyleShit"><code>@​StyleShit</code></a></li>
<li>Josh Goldberg</li>
<li>Josh Goldberg ✨ <a
href="https://github.com/JoshuaKGoldberg"><code>@​JoshuaKGoldberg</code></a></li>
<li>Kirk Waiblinger <a
href="https://github.com/kirkwaiblinger"><code>@​kirkwaiblinger</code></a></li>
<li>Ulrich Stark <a
href="https://github.com/ulrichstark"><code>@​ulrichstark</code></a></li>
<li>송재욱</li>
</ul>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.70.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md">@​typescript-eslint/eslint-plugin's
changelog</a>.</em></p>
<blockquote>
<h2>8.70.0 (2026-09-07)</h2>
<h3>🚀 Features</h3>
<ul>
<li><strong>eslint-plugin:</strong> [no-generated-empty-object-type] add
rule (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12730">#12730</a>)</li>
</ul>
<h3>🩹 Fixes</h3>
<ul>
<li><strong>eslint-plugin:</strong> [no-deprecated] report deprecated
imported values used in object shorthand properties (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12780">#12780</a>)</li>
<li><strong>eslint-plugin:</strong> [no-unnecessary-condition] no false
positive on RHS of a nested logical expression (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12728">#12728</a>)</li>
<li><strong>eslint-plugin:</strong> [member-ordering] don't report
fields that read fields declared before them (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12729">#12729</a>)</li>
</ul>
<h3>❤️ Thank You</h3>
<ul>
<li>Josh Goldberg ✨ <a
href="https://github.com/JoshuaKGoldberg"><code>@​JoshuaKGoldberg</code></a></li>
<li>Ulrich Stark <a
href="https://github.com/ulrichstark"><code>@​ulrichstark</code></a></li>
</ul>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.70.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="7ee76085c2"><code>7ee7608</code></a>
chore(release): publish 8.70.0</li>
<li><a
href="f66bdcac30"><code>f66bdca</code></a>
test(eslint-plugin): [member-ordering] use <code>RuleTester</code>
directly in `optional...</li>
<li><a
href="4586535ab2"><code>4586535</code></a>
fix(eslint-plugin): [no-deprecated] report deprecated imported values
used in...</li>
<li><a
href="f8e1e4e2f7"><code>f8e1e4e</code></a>
fix(eslint-plugin): [no-unnecessary-condition] no false positive on RHS
of a ...</li>
<li><a
href="889cece8bb"><code>889cece</code></a>
fix(eslint-plugin): [member-ordering] don't report fields that read
fields de...</li>
<li><a
href="1a5a8b124b"><code>1a5a8b1</code></a>
feat(eslint-plugin): [no-generated-empty-object-type] add rule (<a
href="https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin/issues/12730">#12730</a>)</li>
<li>See full diff in <a
href="https://github.com/typescript-eslint/typescript-eslint/commits/v8.70.0/packages/eslint-plugin">compare
view</a></li>
</ul>
</details>
<br />

Updates `@typescript-eslint/parser` from 8.69.0 to 8.70.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/releases">@​typescript-eslint/parser's
releases</a>.</em></p>
<blockquote>
<h2>v8.70.0</h2>
<h2>8.70.0 (2026-09-07)</h2>
<h3>🚀 Features</h3>
<ul>
<li><strong>eslint-plugin:</strong> [no-generated-empty-object-type] add
rule (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12730">#12730</a>)</li>
<li><strong>website:</strong> generate per-page social preview cards (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12734">#12734</a>)</li>
</ul>
<h3>🩹 Fixes</h3>
<ul>
<li>use stable release of pnpm 12 (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12808">#12808</a>)</li>
<li>update pnpm to 12.3.4 and dedupe Docusaurus packages (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12829">#12829</a>)</li>
<li><strong>eslint-plugin:</strong> [member-ordering] don't report
fields that read fields declared before them (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12729">#12729</a>)</li>
<li><strong>eslint-plugin:</strong> [no-unnecessary-condition] no false
positive on RHS of a nested logical expression (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12728">#12728</a>)</li>
<li><strong>eslint-plugin:</strong> [no-deprecated] report deprecated
imported values used in object shorthand properties (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12780">#12780</a>)</li>
<li><strong>project-service:</strong> avoid discarded tsserver logs (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12748">#12748</a>)</li>
<li><strong>typescript-estree:</strong> clarify the
parserOptions.project error message (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12817">#12817</a>)</li>
</ul>
<h3>❤️ Thank You</h3>
<ul>
<li>Barry <a
href="https://github.com/barry166"><code>@​barry166</code></a></li>
<li>Evyatar Daud <a
href="https://github.com/StyleShit"><code>@​StyleShit</code></a></li>
<li>Josh Goldberg</li>
<li>Josh Goldberg ✨ <a
href="https://github.com/JoshuaKGoldberg"><code>@​JoshuaKGoldberg</code></a></li>
<li>Kirk Waiblinger <a
href="https://github.com/kirkwaiblinger"><code>@​kirkwaiblinger</code></a></li>
<li>Ulrich Stark <a
href="https://github.com/ulrichstark"><code>@​ulrichstark</code></a></li>
<li>송재욱</li>
</ul>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.70.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md">@​typescript-eslint/parser's
changelog</a>.</em></p>
<blockquote>
<h2>8.70.0 (2026-09-07)</h2>
<p>This was a version bump only for parser to align it with other
projects, there were no code changes.</p>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.70.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="7ee76085c2"><code>7ee7608</code></a>
chore(release): publish 8.70.0</li>
<li>See full diff in <a
href="https://github.com/typescript-eslint/typescript-eslint/commits/v8.70.0/packages/parser">compare
view</a></li>
</ul>
</details>
<br />

Updates `eslint` from 10.9.1 to 10.10.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/eslint/eslint/releases">eslint's
releases</a>.</em></p>
<blockquote>
<h2>v10.10.0</h2>
<h2>Features</h2>
<ul>
<li><a
href="264b4346d1"><code>264b434</code></a>
feat: add <code>d</code> and <code>v</code> flags to
<code>no-unexpected-multiline</code> (<a
href="https://redirect.github.com/eslint/eslint/issues/21305">#21305</a>)
(Gihyeon Jeong / 정기현)</li>
<li><a
href="c6cc6c592f"><code>c6cc6c5</code></a>
feat: check <code>Object.prototype</code> property names in
<code>new-cap</code> (<a
href="https://redirect.github.com/eslint/eslint/issues/21269">#21269</a>)
(crimsonjay0)</li>
<li><a
href="5661fa65fd"><code>5661fa6</code></a>
feat: no-extra-bind false negatives with class fields and static blocks
(<a
href="https://redirect.github.com/eslint/eslint/issues/21260">#21260</a>)
(synthex-byte)</li>
</ul>
<h2>Bug Fixes</h2>
<ul>
<li><a
href="bb47dc6da2"><code>bb47dc6</code></a>
fix: update dependency file-entry-cache to v11 (<a
href="https://redirect.github.com/eslint/eslint/issues/20801">#20801</a>)
(Milos Djermanovic)</li>
<li><a
href="427ac0a014"><code>427ac0a</code></a>
fix: use format strings in debug calls (<a
href="https://redirect.github.com/eslint/eslint/issues/21247">#21247</a>)
(Francesco Trotta)</li>
<li><a
href="9d8153223d"><code>9d81532</code></a>
fix: support <code>__proto__</code> in <code>/* exported */</code>
comments (<a
href="https://redirect.github.com/eslint/eslint/issues/21261">#21261</a>)
(sethamus)</li>
<li><a
href="87e0a08243"><code>87e0a08</code></a>
fix: prefer-object-has-own autofix breaks when Object is shadowed (<a
href="https://redirect.github.com/eslint/eslint/issues/21282">#21282</a>)
(김채영)</li>
<li><a
href="8e2cb14221"><code>8e2cb14</code></a>
fix: <code>new-cap</code> false positive for <code>UTC</code> calls with
<code>properties: false</code> (<a
href="https://redirect.github.com/eslint/eslint/issues/21275">#21275</a>)
(Pixel)</li>
<li><a
href="9f4a364ab0"><code>9f4a364</code></a>
fix: Ignore static imports in no-unreachable (<a
href="https://redirect.github.com/eslint/eslint/issues/21276">#21276</a>)
(Taha Kotil)</li>
</ul>
<h2>Documentation</h2>
<ul>
<li><a
href="2417cad57d"><code>2417cad</code></a>
docs: Update README (GitHub Actions Bot)</li>
<li><a
href="9cecb8a0a2"><code>9cecb8a</code></a>
docs: document <code>\c</code> control letter escapes in
no-control-regex (<a
href="https://redirect.github.com/eslint/eslint/issues/21286">#21286</a>)
(한국)</li>
<li><a
href="8724829f69"><code>8724829</code></a>
docs: update compat table links (<a
href="https://redirect.github.com/eslint/eslint/issues/21263">#21263</a>)
(fnx)</li>
<li><a
href="5634542be5"><code>5634542</code></a>
docs: Clarify eqeqeq suggestion behavior (<a
href="https://redirect.github.com/eslint/eslint/issues/21256">#21256</a>)
(Müslüm Yılmaz)</li>
</ul>
<h2>Chores</h2>
<ul>
<li><a
href="b3d876b460"><code>b3d876b</code></a>
chore: disable npm audit in ecosystem tests (<a
href="https://redirect.github.com/eslint/eslint/issues/21306">#21306</a>)
(Francesco Trotta)</li>
<li><a
href="1696682791"><code>1696682</code></a>
ci: restore EMFILE test on Node.js 26 (<a
href="https://redirect.github.com/eslint/eslint/issues/21297">#21297</a>)
(Marry (Subin Yang))</li>
<li><a
href="2c7f5d6f47"><code>2c7f5d6</code></a>
chore: update github/codeql-action action to v4.37.9 (<a
href="https://redirect.github.com/eslint/eslint/issues/21296">#21296</a>)
(renovate[bot])</li>
<li><a
href="3c753f18b4"><code>3c753f1</code></a>
chore: update eslint (<a
href="https://redirect.github.com/eslint/eslint/issues/21289">#21289</a>)
(renovate[bot])</li>
<li><a
href="1c734690bf"><code>1c73469</code></a>
chore: update ecosystem plugins (<a
href="https://redirect.github.com/eslint/eslint/issues/21280">#21280</a>)
(ESLint Bot)</li>
<li><a
href="08a02be429"><code>08a02be</code></a>
test: add error locations to <code>no-extra-boolean-cast</code> (<a
href="https://redirect.github.com/eslint/eslint/issues/21266">#21266</a>)
(lumir)</li>
<li><a
href="77bb1db8e7"><code>77bb1db</code></a>
chore: update github/codeql-action action to v4.37.8 (<a
href="https://redirect.github.com/eslint/eslint/issues/21270">#21270</a>)
(renovate[bot])</li>
<li><a
href="007e81ac0a"><code>007e81a</code></a>
ci: skip EMFILE test on Node.js 26 (<a
href="https://redirect.github.com/eslint/eslint/issues/21265">#21265</a>)
(lumir)</li>
<li><a
href="0430280e7c"><code>0430280</code></a>
chore: improve ecosystem tests compatibility on Windows (<a
href="https://redirect.github.com/eslint/eslint/issues/21178">#21178</a>)
(crimsonjay0)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="3f20a57c62"><code>3f20a57</code></a>
10.10.0</li>
<li><a
href="f4e5284803"><code>f4e5284</code></a>
Build: changelog update for 10.10.0</li>
<li><a
href="bb47dc6da2"><code>bb47dc6</code></a>
fix: update dependency file-entry-cache to v11 (<a
href="https://redirect.github.com/eslint/eslint/issues/20801">#20801</a>)</li>
<li><a
href="427ac0a014"><code>427ac0a</code></a>
fix: use format strings in debug calls (<a
href="https://redirect.github.com/eslint/eslint/issues/21247">#21247</a>)</li>
<li><a
href="b3d876b460"><code>b3d876b</code></a>
chore: disable npm audit in ecosystem tests (<a
href="https://redirect.github.com/eslint/eslint/issues/21306">#21306</a>)</li>
<li><a
href="9d8153223d"><code>9d81532</code></a>
fix: support <code>__proto__</code> in <code>/* exported */</code>
comments (<a
href="https://redirect.github.com/eslint/eslint/issues/21261">#21261</a>)</li>
<li><a
href="264b4346d1"><code>264b434</code></a>
feat: add <code>d</code> and <code>v</code> flags to
<code>no-unexpected-multiline</code> (<a
href="https://redirect.github.com/eslint/eslint/issues/21305">#21305</a>)</li>
<li><a
href="1696682791"><code>1696682</code></a>
ci: restore EMFILE test on Node.js 26 (<a
href="https://redirect.github.com/eslint/eslint/issues/21297">#21297</a>)</li>
<li><a
href="2c7f5d6f47"><code>2c7f5d6</code></a>
chore: update github/codeql-action action to v4.37.9 (<a
href="https://redirect.github.com/eslint/eslint/issues/21296">#21296</a>)</li>
<li><a
href="87e0a08243"><code>87e0a08</code></a>
fix: prefer-object-has-own autofix breaks when Object is shadowed (<a
href="https://redirect.github.com/eslint/eslint/issues/21282">#21282</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/eslint/eslint/compare/v10.9.1...v10.10.0">compare
view</a></li>
</ul>
</details>
<br />

Updates `@anthropic-ai/claude-agent-sdk-darwin-arm64` from 0.3.257 to
0.3.263

Updates `@anthropic-ai/claude-agent-sdk-darwin-x64` from 0.3.257 to
0.3.263

Updates `@anthropic-ai/claude-agent-sdk-linux-arm64` from 0.3.257 to
0.3.263

Updates `@anthropic-ai/claude-agent-sdk-linux-arm64-musl` from 0.3.257
to 0.3.263

Updates `@anthropic-ai/claude-agent-sdk-linux-x64` from 0.3.257 to
0.3.263

Updates `@anthropic-ai/claude-agent-sdk-linux-x64-musl` from 0.3.257 to
0.3.263

Updates `@anthropic-ai/claude-agent-sdk-win32-arm64` from 0.3.257 to
0.3.263

Updates `@anthropic-ai/claude-agent-sdk-win32-x64` from 0.3.257 to
0.3.263

Updates `@eslint/plugin-kit` from 0.7.2 to 0.7.3
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/eslint/rewrite/releases">@​eslint/plugin-kit's
releases</a>.</em></p>
<blockquote>
<h2>plugin-kit: v0.7.3</h2>
<h2><a
href="https://github.com/eslint/rewrite/compare/plugin-kit-v0.7.2...plugin-kit-v0.7.3">0.7.3</a>
(2026-09-01)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>preserve <code>__proto__</code> in <code>ConfigCommentParser</code>
results (<a
href="https://redirect.github.com/eslint/rewrite/issues/501">#501</a>)
(<a
href="18773d9e41">18773d9</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/eslint/rewrite/blob/main/packages/plugin-kit/CHANGELOG.md">@​eslint/plugin-kit's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/eslint/rewrite/compare/plugin-kit-v0.7.2...plugin-kit-v0.7.3">0.7.3</a>
(2026-09-01)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>preserve <code>__proto__</code> in <code>ConfigCommentParser</code>
results (<a
href="https://redirect.github.com/eslint/rewrite/issues/501">#501</a>)
(<a
href="18773d9e41">18773d9</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="a4466ca3f8"><code>a4466ca</code></a>
chore: release main (<a
href="https://github.com/eslint/rewrite/tree/HEAD/packages/plugin-kit/issues/504">#504</a>)</li>
<li><a
href="f83339de1a"><code>f83339d</code></a>
docs: clarify parameter description in <code>getText</code> (<a
href="https://github.com/eslint/rewrite/tree/HEAD/packages/plugin-kit/issues/505">#505</a>)</li>
<li><a
href="714ffde559"><code>714ffde</code></a>
docs: Update README sponsors</li>
<li><a
href="18773d9e41"><code>18773d9</code></a>
fix: preserve <code>__proto__</code> in <code>ConfigCommentParser</code>
results (<a
href="https://github.com/eslint/rewrite/tree/HEAD/packages/plugin-kit/issues/501">#501</a>)</li>
<li><a
href="caffae71f6"><code>caffae7</code></a>
docs: Update README sponsors</li>
<li><a
href="ae1ba2585b"><code>ae1ba25</code></a>
docs: Update README sponsors</li>
<li><a
href="50051c603e"><code>50051c6</code></a>
docs: Update README sponsors</li>
<li><a
href="ea835245e2"><code>ea83524</code></a>
docs: Update README sponsors</li>
<li><a
href="29956ae008"><code>29956ae</code></a>
docs: Update README sponsors</li>
<li><a
href="f6d5bdff38"><code>f6d5bdf</code></a>
docs: Update README sponsors</li>
<li>Additional commits viewable in <a
href="https://github.com/eslint/rewrite/commits/plugin-kit-v0.7.3/packages/plugin-kit">compare
view</a></li>
</ul>
</details>
<br />

Updates `@typescript-eslint/project-service` from 8.69.0 to 8.70.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/releases">@​typescript-eslint/project-service's
releases</a>.</em></p>
<blockquote>
<h2>v8.70.0</h2>
<h2>8.70.0 (2026-09-07)</h2>
<h3>🚀 Features</h3>
<ul>
<li><strong>eslint-plugin:</strong> [no-generated-empty-object-type] add
rule (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12730">#12730</a>)</li>
<li><strong>website:</strong> generate per-page social preview cards (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12734">#12734</a>)</li>
</ul>
<h3>🩹 Fixes</h3>
<ul>
<li>use stable release of pnpm 12 (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12808">#12808</a>)</li>
<li>update pnpm to 12.3.4 and dedupe Docusaurus packages (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12829">#12829</a>)</li>
<li><strong>eslint-plugin:</strong> [member-ordering] don't report
fields that read fields declared before them (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12729">#12729</a>)</li>
<li><strong>eslint-plugin:</strong> [no-unnecessary-condition] no false
positive on RHS of a nested logical expression (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12728">#12728</a>)</li>
<li><strong>eslint-plugin:</strong> [no-deprecated] report deprecated
imported values used in object shorthand properties (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12780">#12780</a>)</li>
<li><strong>project-service:</strong> avoid discarded tsserver logs (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12748">#12748</a>)</li>
<li><strong>typescript-estree:</strong> clarify the
parserOptions.project error message (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12817">#12817</a>)</li>
</ul>
<h3>❤️ Thank You</h3>
<ul>
<li>Barry <a
href="https://github.com/barry166"><code>@​barry166</code></a></li>
<li>Evyatar Daud <a
href="https://github.com/StyleShit"><code>@​StyleShit</code></a></li>
<li>Josh Goldberg</li>
<li>Josh Goldberg ✨ <a
href="https://github.com/JoshuaKGoldberg"><code>@​JoshuaKGoldberg</code></a></li>
<li>Kirk Waiblinger <a
href="https://github.com/kirkwaiblinger"><code>@​kirkwaiblinger</code></a></li>
<li>Ulrich Stark <a
href="https://github.com/ulrichstark"><code>@​ulrichstark</code></a></li>
<li>송재욱</li>
</ul>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.70.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/project-service/CHANGELOG.md">@​typescript-eslint/project-service's
changelog</a>.</em></p>
<blockquote>
<h2>8.70.0 (2026-09-07)</h2>
<h3>🩹 Fixes</h3>
<ul>
<li><strong>project-service:</strong> avoid discarded tsserver logs (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12748">#12748</a>)</li>
</ul>
<h3>❤️ Thank You</h3>
<ul>
<li>Barry <a
href="https://github.com/barry166"><code>@​barry166</code></a></li>
<li>Evyatar Daud <a
href="https://github.com/StyleShit"><code>@​StyleShit</code></a></li>
<li>Josh Goldberg</li>
</ul>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.70.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="7ee76085c2"><code>7ee7608</code></a>
chore(release): publish 8.70.0</li>
<li><a
href="d2d07eb2ac"><code>d2d07eb</code></a>
fix(project-service): avoid discarded tsserver logs (<a
href="https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/project-service/issues/12748">#12748</a>)</li>
<li>See full diff in <a
href="https://github.com/typescript-eslint/typescript-eslint/commits/v8.70.0/packages/project-service">compare
view</a></li>
</ul>
</details>
<br />

Updates `@typescript-eslint/scope-manager` from 8.69.0 to 8.70.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/releases">@​typescript-eslint/scope-manager's
releases</a>.</em></p>
<blockquote>
<h2>v8.70.0</h2>
<h2>8.70.0 (2026-09-07)</h2>
<h3>🚀 Features</h3>
<ul>
<li><strong>eslint-plugin:</strong> [no-generated-empty-object-type] add
rule (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12730">#12730</a>)</li>
<li><strong>website:</strong> generate per-page social preview cards (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12734">#12734</a>)</li>
</ul>
<h3>🩹 Fixes</h3>
<ul>
<li>use stable release of pnpm 12 (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12808">#12808</a>)</li>
<li>update pnpm to 12.3.4 and dedupe Docusaurus packages (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12829">#12829</a>)</li>
<li><strong>eslint-plugin:</strong> [member-ordering] don't report
fields that read fields declared before them (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12729">#12729</a>)</li>
<li><strong>eslint-plugin:</strong> [no-unnecessary-condition] no false
positive on RHS of a nested logical expression (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12728">#12728</a>)</li>
<li><strong>eslint-plugin:</strong> [no-deprecated] report deprecated
imported values used in object shorthand properties (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12780">#12780</a>)</li>
<li><strong>project-service:</strong> avoid discarded tsserver logs (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12748">#12748</a>)</li>
<li><strong>typescript-estree:</strong> clarify the
parserOptions.project error message (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12817">#12817</a>)</li>
</ul>
<h3>❤️ Thank You</h3>
<ul>
<li>Barry <a
href="https://github.com/barry166"><code>@​barry166</code></a></li>
<li>Evyatar Daud <a
href="https://github.com/StyleShit"><code>@​StyleShit</code></a></li>
<li>Josh Goldberg</li>
<li>Josh Goldberg ✨ <a
href="https://github.com/JoshuaKGoldberg"><code>@​JoshuaKGoldberg</code></a></li>
<li>Kirk Waiblinger <a
href="https://github.com/kirkwaiblinger"><code>@​kirkwaiblinger</code></a></li>
<li>Ulrich Stark <a
href="https://github.com/ulrichstark"><code>@​ulrichstark</code></a></li>
<li>송재욱</li>
</ul>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.70.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/scope-manager/CHANGELOG.md">@​typescript-eslint/scope-manager's
changelog</a>.</em></p>
<blockquote>
<h2>8.70.0 (2026-09-07)</h2>
<p>This was a version bump only for scope-manager to align it with other
projects, there were no code changes.</p>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.70.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="7ee76085c2"><code>7ee7608</code></a>
chore(release): publish 8.70.0</li>
<li>See full diff in <a
href="https://github.com/typescript-eslint/typescript-eslint/commits/v8.70.0/packages/scope-manager">compare
view</a></li>
</ul>
</details>
<br />

Updates `@typescript-eslint/tsconfig-utils` from 8.69.0 to 8.70.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/releases">@​typescript-eslint/tsconfig-utils's
releases</a>.</em></p>
<blockquote>
<h2>v8.70.0</h2>
<h2>8.70.0 (2026-09-07)</h2>
<h3>🚀 Features</h3>
<ul>
<li><strong>eslint-plugin:</strong> [no-generated-empty-object-type] add
rule (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12730">#12730</a>)</li>
<li><strong>website:</strong> generate per-page social preview cards (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12734">#12734</a>)</li>
</ul>
<h3>🩹 Fixes</h3>
<ul>
<li>use stable release of pnpm 12 (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12808">#12808</a>)</li>
<li>update pnpm to 12.3.4 and dedupe Docusaurus packages (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12829">#12829</a>)</li>
<li><strong>eslint-plugin:</strong> [member-ordering] don't report
fields that read fields declared before them (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12729">#12729</a>)</li>
<li><strong>eslint-plugin:</strong> [no-unnecessary-condition] no false
positive on RHS of a nested logical expression (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12728">#12728</a>)</li>
<li><strong>eslint-plugin:</strong> [no-deprecated] report deprecated
imported values used in object shorthand properties (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12780">#12780</a>)</li>
<li><strong>project-service:</strong> avoid discarded tsserver logs (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12748">#12748</a>)</li>
<li><strong>typescript-estree:</strong> clarify the
parserOptions.project error message (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12817">#12817</a>)</li>
</ul>
<h3>❤️ Thank You</h3>
<ul>
<li>Barry <a
href="https://github.com/barry166"><code>@​barry166</code></a></li>
<li>Evyatar Daud <a
href="https://github.com/StyleShit"><code>@​StyleShit</code></a></li>
<li>Josh Goldberg</li>
<li>Josh Goldberg ✨ <a
href="https://github.com/JoshuaKGoldberg"><code>@​JoshuaKGoldberg</code></a></li>
<li>Kirk Waiblinger <a
href="https://github.com/kirkwaiblinger"><code>@​kirkwaiblinger</code></a></li>
<li>Ulrich Stark <a
href="https://github.com/ulrichstark"><code>@​ulrichstark</code></a></li>
<li>송재욱</li>
</ul>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.70.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/tsconfig-utils/CHANGELOG.md">@​typescript-eslint/tsconfig-utils's
changelog</a>.</em></p>
<blockquote>
<h2>8.70.0 (2026-09-07)</h2>
<p>This was a version bump only for tsconfig-utils to align it with
other projects, there were no code changes.</p>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.70.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="7ee76085c2"><code>7ee7608</code></a>
chore(release): publish 8.70.0</li>
<li>See full diff in <a
href="https://github.com/typescript-eslint/typescript-eslint/commits/v8.70.0/packages/tsconfig-utils">compare
view</a></li>
</ul>
</details>
<br />

Updates `@typescript-eslint/type-utils` from 8.69.0 to 8.70.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/releases">@​typescript-eslint/type-utils's
releases</a>.</em></p>
<blockquote>
<h2>v8.70.0</h2>
<h2>8.70.0 (2026-09-07)</h2>
<h3>🚀 Features</h3>
<ul>
<li><strong>eslint-plugin:</strong> [no-generated-empty-object-type] add
rule (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12730">#12730</a>)</li>
<li><strong>website:</strong> generate per-page social preview cards (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12734">#12734</a>)</li>
</ul>
<h3>🩹 Fixes</h3>
<ul>
<li>use stable release of pnpm 12 (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12808">#12808</a>)</li>
<li>update pnpm to 12.3.4 and dedupe Docusaurus packages (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12829">#12829</a>)</li>
<li><strong>eslint-plugin:</strong> [member-ordering] don't report
fields that read fields declared before them (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12729">#12729</a>)</li>
<li><strong>eslint-plugin:</strong> [no-unnecessary-condition] no false
positive on RHS of a nested logical expression (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12728">#12728</a>)</li>
<li><strong>eslint-plugin:</strong> [no-deprecated] report deprecated
imported values used in object shorthand properties (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12780">#12780</a>)</li>
<li><strong>project-service:</strong> avoid discarded tsserver logs (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12748">#12748</a>)</li>
<li><strong>typescript-estree:</strong> clarify the
parserOptions.project error message (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12817">#12817</a>)</li>
</ul>
<h3>❤️ Thank You</h3>
<ul>
<li>Barry <a
href="https://github.com/barry166"><code>@​barry166</code></a></li>
<li>Evyatar Daud <a
href="https://github.com/StyleShit"><code>@​StyleShit</code></a></li>
<li>Josh Goldberg</li>
<li>Josh Goldberg ✨ <a
href="https://github.com/JoshuaKGoldberg"><code>@​JoshuaKGoldberg</code></a></li>
<li>Kirk Waiblinger <a
href="https://github.com/kirkwaiblinger"><code>@​kirkwaiblinger</code></a></li>
<li>Ulrich Stark <a
href="https://github.com/ulrichstark"><code>@​ulrichstark</code></a></li>
<li>송재욱</li>
</ul>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.70.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/type-utils/CHANGELOG.md">@​typescript-eslint/type-utils's
changelog</a>.</em></p>
<blockquote>
<h2>8.70.0 (2026-09-07)</h2>
<p>This was a version bump only for type-utils to align it with other
projects, there were no code changes.</p>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.70.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="7ee76085c2"><code>7ee7608</code></a>
chore(release): publish 8.70.0</li>
<li>See full diff in <a
href="https://github.com/typescript-eslint/typescript-eslint/commits/v8.70.0/packages/type-utils">compare
view</a></li>
</ul>
</details>
<br />

Updates `@typescript-eslint/types` from 8.69.0 to 8.70.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/releases">@​typescript-eslint/types's
releases</a>.</em></p>
<blockquote>
<h2>v8.70.0</h2>
<h2>8.70.0 (2026-09-07)</h2>
<h3>🚀 Features</h3>
<ul>
<li><strong>eslint-plugin:</strong> [no-generated-empty-object-type] add
rule (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12730">#12730</a>)</li>
<li><strong>website:</strong> generate per-page social preview cards (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12734">#12734</a>)</li>
</ul>
<h3>🩹 Fixes</h3>
<ul>
<li>use stable release of pnpm 12 (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12808">#12808</a>)</li>
<li>update pnpm to 12.3.4 and dedupe Docusaurus packages (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12829">#12829</a>)</li>
<li><strong>eslint-plugin:</strong> [member-ordering] don't report
fields that read fields declared before them (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12729">#12729</a>)</li>
<li><strong>eslint-plugin:</strong> [no-unnecessary-condition] no false
positive on RHS of a nested logical expression (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12728">#12728</a>)</li>
<li><strong>eslint-plugin:</strong> [no-deprecated] report deprecated
imported values used in object shorthand properties (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12780">#12780</a>)</li>
<li><strong>project-service:</strong> avoid discarded tsserver logs (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12748">#12748</a>)</li>
<li><strong>typescript-estree:</strong> clarify the
parserOptions.project error message (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12817">#12817</a>)</li>
</ul>
<h3>❤️ Thank You</h3>
<ul>
<li>Barry <a
href="https://github.com/barry166"><code>@​barry166</code></a></li>
<li>Evyatar Daud <a
href="https://github.com/StyleShit"><code>@​StyleShit</code></a></li>
<li>Josh Goldberg</li>
<li>Josh Goldberg ✨ <a
href="https://github.com/JoshuaKGoldberg"><code>@​JoshuaKGoldberg</code></a></li>
<li>Kirk Waiblinger <a
href="https://github.com/kirkwaiblinger"><code>@​kirkwaiblinger</code></a></li>
<li>Ulrich Stark <a
href="https://github.com/ulrichstark"><code>@​ulrichstark</code></a></li>
<li>송재욱</li>
</ul>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.70.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/types/CHANGELOG.md">@​typescript-eslint/types's
changelog</a>.</em></p>
<blockquote>
<h2>8.70.0 (2026-09-07)</h2>
<p>This was a version bump only for types to align it with other
projects, there were no code changes.</p>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.70.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="7ee76085c2"><code>7ee7608</code></a>
chore(release): publish 8.70.0</li>
<li>See full diff in <a
href="https://github.com/typescript-eslint/typescript-eslint/commits/v8.70.0/packages/types">compare
view</a></li>
</ul>
</details>
<br />

Updates `@typescript-eslint/typescript-estree` from 8.69.0 to 8.70.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/releases">@​typescript-eslint/typescript-estree's
releases</a>.</em></p>
<blockquote>
<h2>v8.70.0</h2>
<h2>8.70.0 (2026-09-07)</h2>
<h3>🚀 Features</h3>
<ul>
<li><strong>eslint-plugin:</strong> [no-generated-empty-object-type] add
rule (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12730">#12730</a>)</li>
<li><strong>website:</strong> generate per-page social preview cards (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12734">#12734</a>)</li>
</ul>
<h3>🩹 Fixes</h3>
<ul>
<li>use stable release of pnpm 12 (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12808">#12808</a>)</li>
<li>update pnpm to 12.3.4 and dedupe Docusaurus packages (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12829">#12829</a>)</li>
<li><strong>eslint-plugin:</strong> [member-ordering] don't report
fields that read fields declared before them (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12729">#12729</a>)</li>
<li><strong>eslint-plugin:</strong> [no-unnecessary-condition] no false
positive on RHS of a nested logical expression (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12728">#12728</a>)</li>
<li><strong>eslint-plugin:</strong> [no-deprecated] report deprecated
imported values used in object shorthand properties (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12780">#12780</a>)</li>
<li><strong>project-service:</strong> avoid discarded tsserver logs (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12748">#12748</a>)</li>
<li><strong>typescript-estree:</strong> clarify the
parserOptions.project error message (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12817">#12817</a>)</li>
</ul>
<h3>❤️ Thank You</h3>
<ul>
<li>Barry <a
href="https://github.com/barry166"><code>@​barry166</code></a></li>
<li>Evyatar Daud <a
href="https://github.com/StyleShit"><code>@​StyleShit</code></a></li>
<li>Josh Goldberg</li>
<li>Josh Goldberg ✨ <a
href="https://github.com/JoshuaKGoldberg"><code>@​JoshuaKGoldberg</code></a></li>
<li>Kirk Waiblinger <a
href="https://github.com/kirkwaiblinger"><code>@​kirkwaibling...

_Description has been truncated_

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-14 13:14:44 +02:00
Ben Brandt
67c7c9b117 feat: Add tool names to tool calls (#1128)
Supports the new tool call name RFD
2026-09-14 11:11:52 +00:00
Andrey Bragin
4deace4037 ci: poll for package availability after publish before triggering registry update (#1121) 2026-09-11 11:46:03 +02:00
nikita-ashihmin
6b7473b1af refactor!: remove agent config option (#1112)
## Why

The main-thread agent option is a rarely used, provider-specific
parameter. It is not used by ACP clients or their settings, and
maintaining a public picker for it adds config state, discovery calls,
restart propagation, and live-switch handling for functionality that
clients do not need.

Removing it keeps the session configuration contract focused on settings
that ACP clients actually use. This does not remove ACP subagent
sessions or the Agent/Task tool behavior; it only removes the unused
main-thread agent selector and parameter plumbing.

## Summary

- remove the main-thread Agent session config picker and custom-agent
discovery
- remove live agent switching and session state used only by that picker
- ignore claudeCode.options.agent and stop restoring it during context
resets
- document agent as ignored in the exported NewSessionMeta contract
- preserve ACP subagent sessions and Agent/Task tool behavior

## Breaking change

BREAKING CHANGE: claudeCode.options.agent is no longer forwarded to
Claude Code, and the agent-picker exports DEFAULT_AGENT_ID,
AGENT_CONFIG_ID, BUILTIN_AGENT_NAMES, and discoverCustomAgents are
removed. Consumers relying on main-thread agent selection must stop
passing that option.

## Testing

- npm run check
- npm run build
- npx vitest run src/tests/create-session-options.test.ts (62 passed)
2026-09-11 01:23:11 +04:00
acp-release-bot[bot]
c2e4815029 chore(main): release 0.76.0 (#1101)
🤖 I have created a release *beep* *boop*
---


##
[0.76.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.75.1...v0.76.0)
(2026-09-09)


### Features

* advertise recommended config values
([#1111](https://github.com/agentclientprotocol/claude-agent-acp/issues/1111))
([2b666c3](2b666c3d35))
* **deps-dev:** Bump vitest from 4.1.11 to 5.0.0
([#1099](https://github.com/agentclientprotocol/claude-agent-acp/issues/1099))
([194e195](194e195b05))
* **deps:** Bump fast-uri from 3.1.6 to 3.1.7
([#1100](https://github.com/agentclientprotocol/claude-agent-acp/issues/1100))
([d870ebd](d870ebd2fd))

---
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-09-10 01:12:57 +04:00
nikita-ashihmin
2b666c3d35 feat: advertise recommended config values (#1111)
Clients that negotiate the AIR `recommendedValue` capability receive
concrete model and effort choices instead of ambiguous default rows. The
SDK's default model is mapped only to an exact selectable model
(including equivalent context suffix spellings); unavailable
recommendations retain the legacy default. Recommendations remain
independent of explicit selections.

The adapter applies the displayed effort to the SDK at startup and on
model switches, preserving supported user pins and re-reading per-model
settings for automatic choices. Permission modes and clients without the
capability retain their existing configuration behavior. Model and
effort configuration logic is extracted into dedicated modules.

Terse SDK model labels are enriched with concrete versions from model
metadata: for example, `Fable` becomes `Fable 5.1`, `Sonnet` becomes
`Sonnet 5`, and `Opus (1M context)` becomes `Opus 5`. Custom names are
preserved, and collisions fall back to the original labels. An SDK
version guard requires review on upgrades, and an opt-in live
initialization test verifies the upstream model contract without sending
a prompt.

Validation:
- `npm run check`
- `npm run build`
- `env -u ANTHROPIC_BASE_URL npm run test:run` — 1253 passed, 28 skipped
- `RUN_INTEGRATION_TESTS=true npx vitest run
src/tests/model-presentation.test.ts` — 4 passed
- Regression coverage for unavailable model generations/context windows,
startup effort, per-model settings, unsupported effort pins, and
duplicate Opus labels
2026-09-10 01:10:31 +04:00
Andrey Bragin
45f8b34020 ci: don't wait for CI workflow when publishing preview releases, replace --dry-run with real publication (#1113) 2026-09-09 13:08:08 +02:00
Andrey Bragin
cc528fb5e9 ci: testing preview publication (#1105) 2026-09-08 14:33:32 +02:00
Andrey Bragin
0dd58685b1 ci: set up preview publishing (#1084)
Today nothing reaches npm between two release-please releases, so trying
a merged
but unreleased change means building from source. This adds a
continuously
published preview channel.

Every CI-green push to `main` that is not a release merge publishes
`<package.json version, patch bumped>-preview.N` under the `preview`
dist-tag,
tags the commit `v<version>`, and dispatches the same agent registry
update a
stable release does. With `main` at 0.73.0 that gives
`0.73.1-preview.1`,
`0.73.1-preview.2`, and so on; `N` restarts at 1 whenever a release
moves the
base. `latest` is untouched.

## Approach

- **Added to `publish.yml` rather than a new workflow.** npm binds a
trusted
publisher to one repo + workflow filename, and a package gets only one.
A
  separate file would fail OIDC and cost the stable path its publisher.
- **Gated on the `CI` workflow succeeding** (`workflow_run`), so a red
commit is
never published. release-please's release merge is excluded by the head
commit's author and subject — its `releases_created` output is not
reachable
  from a different workflow run.
- **`N` is the max of the npm registry and local git tags.** npm
reserves
versions forever, even after `unpublish`, so a reused `N` is a hard
failure;
but the registry is CDN-served and lags, which the tags cover. A
registry read
  failure aborts rather than guessing.
- **Base is patch+1, not release-please's prediction**, which moves
mid-flight
  and would reset `N` under already-published previews.
- **The version is applied to the CI working tree only**, never
committed —
`package.json` and the release-please manifest stay release-please's to
own.
- **`--tag preview` is mandatory:** `npm publish` defaults to `latest`
even for a
  semver prerelease.
- **Three jobs.** `publish-npm-preview` mirrors `publish-npm` and only
publishes
(no repo write access); `publish-tag-preview` only tags, so a failed tag
is
retryable with _Re-run failed jobs_ without re-publishing an immutable
version;
`trigger-registry-update` is shared with the stable path. Both
downstream jobs
gate on a `published` output the publish step sets, not on job status —
the tag
push happens after the publish, so a red job can still mean npm has the
  version.

## Next step

The publish is `npm publish --dry-run` for now. The `workflow_run`
trigger and
the `release` environment's protected-branch policy mean this job cannot
run off
the default branch at all, so merging this is the only way to exercise
the
trigger, the gate and the version calculation — and with `published`
unset, the
rehearsal neither tags nor touches the registry.

Once one run looks right, a follow-up drops `--dry-run` and adds
`echo "published=true" >> "$GITHUB_OUTPUT"` to that step. Nothing else
changes.
2026-09-08 14:16:37 +02:00
dependabot[bot]
d870ebd2fd feat(deps): Bump fast-uri from 3.1.6 to 3.1.7 (#1100)
Bumps [fast-uri](https://github.com/fastify/fast-uri) from 3.1.6 to
3.1.7.
<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.7</h2>
<h2>⚠️ Security Warning</h2>
<p>This is a security release that fixes the following high-severity
security advisories:</p>
<ul>
<li><a
href="https://github.com/fastify/fast-uri/security/advisories/GHSA-qw65-cvwx-89v3">GHSA-qw65-cvwx-89v3</a>
— authority injection via an unvalidated port in
<code>serialize()</code></li>
<li><a
href="https://github.com/fastify/fast-uri/security/advisories/GHSA-58mr-gqgx-xq4g">GHSA-58mr-gqgx-xq4g</a>
— host confusion via unbalanced or misplaced IP-literal brackets</li>
</ul>
<p>Users of the v3.x release line should upgrade to v3.1.7.</p>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/fastify/fast-uri/compare/v3.1.6...v3.1.7">https://github.com/fastify/fast-uri/compare/v3.1.6...v3.1.7</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="412e40abd4"><code>412e40a</code></a>
Bumped v3.1.7</li>
<li><a
href="9f4c943e4d"><code>9f4c943</code></a>
fix: backport port and IP-literal validation to v3.x (<a
href="https://redirect.github.com/fastify/fast-uri/issues/216">#216</a>)</li>
<li><a
href="1eb3ce436f"><code>1eb3ce4</code></a>
fix: treat unterminated bracket hosts as reg-names again (<a
href="https://redirect.github.com/fastify/fast-uri/issues/214">#214</a>)</li>
<li>See full diff in <a
href="https://github.com/fastify/fast-uri/compare/v3.1.6...v3.1.7">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.6&new-version=3.1.7)](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-09-07 12:21:15 -07:00
dependabot[bot]
194e195b05 feat(deps-dev): Bump vitest from 4.1.11 to 5.0.0 (#1099)
Bumps
[vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest)
from 4.1.11 to 5.0.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/vitest-dev/vitest/releases">vitest's
releases</a>.</em></p>
<blockquote>
<h2>v5.0.0</h2>
<p>Vitest 5 is officially out! This release focuses on performance and
brings a lot of new features while fixing long-standing bugs. See our <a
href="https://vitest.dev/blog/vitest-5.html">blog post</a> for the
official announcement.</p>
<h3>   🚨 Breaking Changes</h3>
<ul>
<li>Replace <code>loupe.inspect</code> with pretty-format  -  by <a
href="https://github.com/hi-ogawa"><code>@​hi-ogawa</code></a>,
<strong>Claude Opus 5 (1M context)</strong> and <strong>OpenAI
Codex</strong> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/9609">vitest-dev/vitest#9609</a>
<a href="https://github.com/vitest-dev/vitest/commit/3f802da4b"><!-- raw
HTML omitted -->(3f802)<!-- raw HTML omitted --></a></li>
<li>Remove quotes from string values in <code>test.for/each</code> title
<code>$</code> variable (take 2)  -  by <a
href="https://github.com/hi-ogawa"><code>@​hi-ogawa</code></a> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/10170">vitest-dev/vitest#10170</a>
<a href="https://github.com/vitest-dev/vitest/commit/04d37e9d7"><!-- raw
HTML omitted -->(04d37)<!-- raw HTML omitted --></a></li>
<li>Default <code>attachmentsDir</code> from
<code>.vitest-attachements/</code> to <code>.vitest/attachments/</code>
 -  by <a
href="https://github.com/MdSadiqMd"><code>@​MdSadiqMd</code></a> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/10186">vitest-dev/vitest#10186</a>
<a href="https://github.com/vitest-dev/vitest/commit/1ba7338c3"><!-- raw
HTML omitted -->(1ba73)<!-- raw HTML omitted --></a></li>
<li>Remove <code>sequential</code> test/suite options in favor of
<code>concurrent</code>  -  by <a
href="https://github.com/hi-ogawa"><code>@​hi-ogawa</code></a> and
<strong>OpenAI Codex</strong> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/10198">vitest-dev/vitest#10198</a>
<a href="https://github.com/vitest-dev/vitest/commit/9229f2edc"><!-- raw
HTML omitted -->(9229f)<!-- raw HTML omitted --></a></li>
<li>Represent locator as an object instead of a string  -  by <a
href="https://github.com/sheremet-va"><code>@​sheremet-va</code></a> in
<a
href="https://redirect.github.com/vitest-dev/vitest/issues/10212">vitest-dev/vitest#10212</a>
<a href="https://github.com/vitest-dev/vitest/commit/80f07edf6"><!-- raw
HTML omitted -->(80f07)<!-- raw HTML omitted --></a></li>
<li>Inline <code>expect</code> package  -  by <a
href="https://github.com/sheremet-va"><code>@​sheremet-va</code></a> in
<a
href="https://redirect.github.com/vitest-dev/vitest/issues/10221">vitest-dev/vitest#10221</a>
<a href="https://github.com/vitest-dev/vitest/commit/ad16223e7"><!-- raw
HTML omitted -->(ad162)<!-- raw HTML omitted --></a></li>
<li>Remove deprecated entry points  -  by <a
href="https://github.com/sheremet-va"><code>@​sheremet-va</code></a> in
<a
href="https://redirect.github.com/vitest-dev/vitest/issues/10222">vitest-dev/vitest#10222</a>
<a href="https://github.com/vitest-dev/vitest/commit/994c6ddb9"><!-- raw
HTML omitted -->(994c6)<!-- raw HTML omitted --></a></li>
<li>Require Node.js 22 and Vite 6.4  -  by <a
href="https://github.com/sheremet-va"><code>@​sheremet-va</code></a> in
<a
href="https://redirect.github.com/vitest-dev/vitest/issues/10178">vitest-dev/vitest#10178</a>
<a href="https://github.com/vitest-dev/vitest/commit/3876283e8"><!-- raw
HTML omitted -->(38762)<!-- raw HTML omitted --></a></li>
<li>Fail <code>expect.poll</code> when function didn't resolve in time
 -  by <a href="https://github.com/hi-ogawa"><code>@​hi-ogawa</code></a>
and <strong>OpenAI Codex</strong> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/10233">vitest-dev/vitest#10233</a>
<a href="https://github.com/vitest-dev/vitest/commit/4df048c11"><!-- raw
HTML omitted -->(4df04)<!-- raw HTML omitted --></a></li>
<li>Throw an error if hoistable methods are outside the top level scope
 -  by <a
href="https://github.com/sheremet-va"><code>@​sheremet-va</code></a> in
<a
href="https://redirect.github.com/vitest-dev/vitest/issues/10460">vitest-dev/vitest#10460</a>
<a href="https://github.com/vitest-dev/vitest/commit/d0b4fddcb"><!-- raw
HTML omitted -->(d0b4f)<!-- raw HTML omitted --></a></li>
<li><code>toHaveTextContent</code> is strict, add
<code>toMatchTextContent</code> as alternative  -  by <a
href="https://github.com/sheremet-va"><code>@​sheremet-va</code></a> in
<a
href="https://redirect.github.com/vitest-dev/vitest/issues/10473">vitest-dev/vitest#10473</a>
<a href="https://github.com/vitest-dev/vitest/commit/18f303079"><!-- raw
HTML omitted -->(18f30)<!-- raw HTML omitted --></a></li>
<li>Don't lookup config file from ancestor directories  -  by <a
href="https://github.com/hi-ogawa"><code>@​hi-ogawa</code></a>,
<strong>OpenAI Codex</strong> and <strong>Hiroshi Ogawa</strong> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/10428">vitest-dev/vitest#10428</a>
<a href="https://github.com/vitest-dev/vitest/commit/945d9090e"><!-- raw
HTML omitted -->(945d9)<!-- raw HTML omitted --></a></li>
<li>Inline <code>@vitest/runner</code> package, do not publish it
anymore  -  by <a
href="https://github.com/sheremet-va"><code>@​sheremet-va</code></a> in
<a
href="https://redirect.github.com/vitest-dev/vitest/issues/10511">vitest-dev/vitest#10511</a>
<a href="https://github.com/vitest-dev/vitest/commit/6d6e46b1e"><!-- raw
HTML omitted -->(6d6e4)<!-- raw HTML omitted --></a></li>
<li>Allow mutating happy-dom/jsdom window object  -  by <a
href="https://github.com/hi-ogawa"><code>@​hi-ogawa</code></a>,
<strong>Hiroshi Ogawa</strong> and <strong>OpenAI Codex</strong> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/10373">vitest-dev/vitest#10373</a>
<a href="https://github.com/vitest-dev/vitest/commit/206e8cff8"><!-- raw
HTML omitted -->(206e8)<!-- raw HTML omitted --></a></li>
<li>Expose <code>concurrencyId</code>/<code>workerId</code> on
TestModule's diagnostics, make id 1-based  -  by <a
href="https://github.com/sheremet-va"><code>@​sheremet-va</code></a> in
<a
href="https://redirect.github.com/vitest-dev/vitest/issues/10516">vitest-dev/vitest#10516</a>
<a href="https://github.com/vitest-dev/vitest/commit/bdd985433"><!-- raw
HTML omitted -->(bdd98)<!-- raw HTML omitted --></a></li>
<li>Add <code>screenshotDirectory</code> config to
<code>browser.expect.toMatchScreenshot</code>  -  by <a
href="https://github.com/macarie"><code>@​macarie</code></a> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/10592">vitest-dev/vitest#10592</a>
<a href="https://github.com/vitest-dev/vitest/commit/a60ded0fb"><!-- raw
HTML omitted -->(a60de)<!-- raw HTML omitted --></a></li>
<li>Update <code>@sinonjs/fake-timers</code> and support mocking
<code>Temporal</code>  -  by <a
href="https://github.com/hi-ogawa"><code>@​hi-ogawa</code></a>,
<strong>Hiroshi Ogawa</strong> and <strong>OpenCode
(gpt-5.6-sol)</strong> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/10654">vitest-dev/vitest#10654</a>
<a href="https://github.com/vitest-dev/vitest/commit/f8b1532fe"><!-- raw
HTML omitted -->(f8b15)<!-- raw HTML omitted --></a></li>
<li>Remove webdriverio package  -  by <a
href="https://github.com/sheremet-va"><code>@​sheremet-va</code></a> in
<a
href="https://redirect.github.com/vitest-dev/vitest/issues/10675">vitest-dev/vitest#10675</a>
<a href="https://github.com/vitest-dev/vitest/commit/5fed68f72"><!-- raw
HTML omitted -->(5fed6)<!-- raw HTML omitted --></a></li>
<li>Clear mocks by default before each test  -  by <a
href="https://github.com/sheremet-va"><code>@​sheremet-va</code></a> in
<a
href="https://redirect.github.com/vitest-dev/vitest/issues/10613">vitest-dev/vitest#10613</a>
<a href="https://github.com/vitest-dev/vitest/commit/0f6463bf2"><!-- raw
HTML omitted -->(0f646)<!-- raw HTML omitted --></a></li>
<li>Don't emit localStorage warnings on Node 26, fail gracefully when
worker fails to start  -  by <a
href="https://github.com/sheremet-va"><code>@​sheremet-va</code></a> in
<a
href="https://redirect.github.com/vitest-dev/vitest/issues/10293">vitest-dev/vitest#10293</a>
<a href="https://github.com/vitest-dev/vitest/commit/334edef92"><!-- raw
HTML omitted -->(334ed)<!-- raw HTML omitted --></a></li>
<li>Separate config resolution from the server creation  -  by <a
href="https://github.com/sheremet-va"><code>@​sheremet-va</code></a> in
<a
href="https://redirect.github.com/vitest-dev/vitest/issues/10554">vitest-dev/vitest#10554</a>
<a href="https://github.com/vitest-dev/vitest/commit/1c0ec3444"><!-- raw
HTML omitted -->(1c0ec)<!-- raw HTML omitted --></a></li>
<li>Inline projects extend the root config by default  -  by <a
href="https://github.com/sheremet-va"><code>@​sheremet-va</code></a> in
<a
href="https://redirect.github.com/vitest-dev/vitest/issues/10750">vitest-dev/vitest#10750</a>
<a href="https://github.com/vitest-dev/vitest/commit/fec001ad3"><!-- raw
HTML omitted -->(fec00)<!-- raw HTML omitted --></a></li>
<li>Enable mocking Temporal without fake timers  -  by <a
href="https://github.com/fabon-f"><code>@​fabon-f</code></a>,
<strong>Hiroshi Ogawa</strong> and <strong>OpenCode
(gpt-5.6-sol)</strong> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/10757">vitest-dev/vitest#10757</a>
<a href="https://github.com/vitest-dev/vitest/commit/ac2d46b42"><!-- raw
HTML omitted -->(ac2d4)<!-- raw HTML omitted --></a></li>
<li>Support nested projects  -  by <a
href="https://github.com/sheremet-va"><code>@​sheremet-va</code></a> in
<a
href="https://redirect.github.com/vitest-dev/vitest/issues/10846">vitest-dev/vitest#10846</a>
<a href="https://github.com/vitest-dev/vitest/commit/ec367cf2a"><!-- raw
HTML omitted -->(ec367)<!-- raw HTML omitted --></a></li>
<li>Use <code>&gt;</code> as separator in <code>-t</code>, calculate
<code>only</code> once  -  by <a
href="https://github.com/sheremet-va"><code>@​sheremet-va</code></a> in
<a
href="https://redirect.github.com/vitest-dev/vitest/issues/10686">vitest-dev/vitest#10686</a>
<a href="https://github.com/vitest-dev/vitest/commit/a0b20bc86"><!-- raw
HTML omitted -->(a0b20)<!-- raw HTML omitted --></a></li>
<li>Fail the test when an asynchronous assertion is not awaited  -  by
<a href="https://github.com/sheremet-va"><code>@​sheremet-va</code></a>
in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/10868">vitest-dev/vitest#10868</a>
<a href="https://github.com/vitest-dev/vitest/commit/86d4a9da9"><!-- raw
HTML omitted -->(86d4a)<!-- raw HTML omitted --></a></li>
<li>Share the Vite server between inline projects  -  by <a
href="https://github.com/sheremet-va"><code>@​sheremet-va</code></a> in
<a
href="https://redirect.github.com/vitest-dev/vitest/issues/10848">vitest-dev/vitest#10848</a>
<a href="https://github.com/vitest-dev/vitest/commit/d87c96ee4"><!-- raw
HTML omitted -->(d87c9)<!-- raw HTML omitted --></a></li>
<li>Parse files statically in vitest list by default  -  by <a
href="https://github.com/sheremet-va"><code>@​sheremet-va</code></a> in
<a
href="https://redirect.github.com/vitest-dev/vitest/issues/11088">vitest-dev/vitest#11088</a>
<a href="https://github.com/vitest-dev/vitest/commit/51e949416"><!-- raw
HTML omitted -->(51e94)<!-- raw HTML omitted --></a></li>
<li><strong>benchmark</strong>:
<ul>
<li>Rewrite the public API  -  by <a
href="https://github.com/sheremet-va"><code>@​sheremet-va</code></a> in
<a
href="https://redirect.github.com/vitest-dev/vitest/issues/10113">vitest-dev/vitest#10113</a>
<a href="https://github.com/vitest-dev/vitest/commit/19f6e8947"><!-- raw
HTML omitted -->(19f6e)<!-- raw HTML omitted --></a></li>
</ul>
</li>
<li><strong>browser</strong>:
<ul>
<li>Iframe scale  -  by <a
href="https://github.com/macarie"><code>@​macarie</code></a> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/9745">vitest-dev/vitest#9745</a>
<a href="https://github.com/vitest-dev/vitest/commit/b639852cc"><!-- raw
HTML omitted -->(b6398)<!-- raw HTML omitted --></a></li>
<li>Enable <code>locators.exact</code> by default  -  by <a
href="https://github.com/sheremet-va"><code>@​sheremet-va</code></a> in
<a
href="https://redirect.github.com/vitest-dev/vitest/issues/10430">vitest-dev/vitest#10430</a>
<a href="https://github.com/vitest-dev/vitest/commit/e203202f9"><!-- raw
HTML omitted -->(e2032)<!-- raw HTML omitted --></a></li>
<li>Require <code>sessionId</code> for orchestrator html request  -  by
<a href="https://github.com/hi-ogawa"><code>@​hi-ogawa</code></a>,
<strong>Hiroshi Ogawa</strong> and <strong>OpenAI Codex</strong> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/10522">vitest-dev/vitest#10522</a>
<a href="https://github.com/vitest-dev/vitest/commit/79b7d8fcc"><!-- raw
HTML omitted -->(79b7d)<!-- raw HTML omitted --></a></li>
<li>Save failure screenshots in <code>attachmentsDir</code>  -  by <a
href="https://github.com/macarie"><code>@​macarie</code></a> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/10917">vitest-dev/vitest#10917</a>
<a href="https://github.com/vitest-dev/vitest/commit/3b5bbd8b4"><!-- raw
HTML omitted -->(3b5bb)<!-- raw HTML omitted --></a></li>
</ul>
</li>
<li><strong>coverage</strong>:
<ul>
<li><code>include/exclude</code> globs too eager  -  by <a
href="https://github.com/AriPerkkio"><code>@​AriPerkkio</code></a> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/9818">vitest-dev/vitest#9818</a>
<a href="https://github.com/vitest-dev/vitest/commit/edacb0fd4"><!-- raw
HTML omitted -->(edacb)<!-- raw HTML omitted --></a></li>
<li>Allow <code>thresholds.perFile</code> to accept an object  -  by <a
href="https://github.com/vladlenskiy"><code>@​vladlenskiy</code></a> and
<a href="https://github.com/AriPerkkio"><code>@​AriPerkkio</code></a> in
<a
href="https://redirect.github.com/vitest-dev/vitest/issues/10190">vitest-dev/vitest#10190</a>
<a href="https://github.com/vitest-dev/vitest/commit/13b78d98b"><!-- raw
HTML omitted -->(13b78)<!-- raw HTML omitted --></a></li>
</ul>
</li>
<li><strong>expect</strong>:
<ul>
<li>Fix <code>toThrow(&quot;&quot;)</code> behavior by reverting <a
href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/6710">#6710</a>
 -  by <a href="https://github.com/hi-ogawa"><code>@​hi-ogawa</code></a>
in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/9643">vitest-dev/vitest#9643</a>
and <a
href="https://redirect.github.com/vitest-dev/vitest/issues/6710">vitest-dev/vitest#6710</a>
<a href="https://github.com/vitest-dev/vitest/commit/6c3e4bdbf"><!-- raw
HTML omitted -->(6c3e4)<!-- raw HTML omitted --></a></li>
</ul>
</li>
<li><strong>mocker</strong>:
<ul>
<li>Deserialize automock as automock  -  by <a
href="https://github.com/nami8824"><code>@​nami8824</code></a> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/10192">vitest-dev/vitest#10192</a>
<a href="https://github.com/vitest-dev/vitest/commit/2f892712d"><!-- raw
HTML omitted -->(2f892)<!-- raw HTML omitted --></a></li>
</ul>
</li>
<li><strong>reporters</strong>:
<ul>
<li><code>blob</code> reporter and <code>--merge-reports</code> default
to <code>.vitest/blob/</code>  -  by <a
href="https://github.com/AriPerkkio"><code>@​AriPerkkio</code></a> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/10232">vitest-dev/vitest#10232</a>
<a href="https://github.com/vitest-dev/vitest/commit/d22b029ae"><!-- raw
HTML omitted -->(d22b0)<!-- raw HTML omitted --></a></li>
<li>Write json and junit reporter output files to <code>.vitest</code>
by default  -  by <a
href="https://github.com/hi-ogawa"><code>@​hi-ogawa</code></a>,
<strong>Hiroshi Ogawa</strong>, <strong>OpenCode (gpt-5.6-sol)</strong>
and <a
href="https://github.com/AriPerkkio"><code>@​AriPerkkio</code></a> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/10621">vitest-dev/vitest#10621</a>
<a href="https://github.com/vitest-dev/vitest/commit/58577290a"><!-- raw
HTML omitted -->(58577)<!-- raw HTML omitted --></a></li>
</ul>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="f441c6fab2"><code>f441c6f</code></a>
chore: release v5.0.0 (<a
href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/11130">#11130</a>)</li>
<li><a
href="d46a747226"><code>d46a747</code></a>
fix: treat test.describe as a suite during static collection (<a
href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/11128">#11128</a>)</li>
<li><a
href="584cf30843"><code>584cf30</code></a>
fix: add a warning if inline project has duplicate plugins due to
unexpected ...</li>
<li><a
href="f08ce4b714"><code>f08ce4b</code></a>
fix: apply queued mocks from doMock() in queue order (fixes <a
href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/10706">#10706</a>)
(<a
href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/11127">#11127</a>)</li>
<li><a
href="897f51fd24"><code>897f51f</code></a>
chore: release v5.0.0-rc.4 (<a
href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/11107">#11107</a>)</li>
<li><a
href="1339b0655d"><code>1339b06</code></a>
chore(deps): update all non-major dependencies (<a
href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/11104">#11104</a>)</li>
<li><a
href="51e9494166"><code>51e9494</code></a>
feat!: parse files statically in vitest list by default (<a
href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/11088">#11088</a>)</li>
<li><a
href="2122ffdfb4"><code>2122ffd</code></a>
fix: propagate --maxWorkers to projects (<a
href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/11102">#11102</a>)</li>
<li><a
href="dc10f5f8fb"><code>dc10f5f</code></a>
fix(browser): report the action error when a task times out (<a
href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/11101">#11101</a>)</li>
<li><a
href="d4fe1986fe"><code>d4fe198</code></a>
feat: promote clearCache out of experimental (<a
href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/11086">#11086</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/vitest-dev/vitest/commits/v5.0.0/packages/vitest">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=vitest&package-manager=npm_and_yarn&previous-version=4.1.11&new-version=5.0.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)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-07 12:20:39 -07:00
acp-release-bot[bot]
3e23c5b960 chore(main): release 0.75.1 (#1091)
🤖 I have created a release *beep* *boop*
---


##
[0.75.1](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.75.0...v0.75.1)
(2026-09-05)


### Bug Fixes

* restore session forks and speed up loading
([#1089](https://github.com/agentclientprotocol/claude-agent-acp/issues/1089))
([f5e79f5](f5e79f55f8))

---
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-09-05 18:35:31 +04:00
nikita-ashihmin
f5e79f55f8 fix: restore session forks and speed up loading (#1089)
## Summary

- resolve AIR fork points from the complete persisted transcript when
the target is outside the active parent chain
- support message fingerprints and repeated assistant content when
resolving persisted fork points
- restore resumed models from the same local assistant transcript record
Claude Code uses
- remove all automatic `getContextUsage` control requests; use
`compact_metadata.post_tokens` after compaction
- add structured timing logs for fork, load, replay, and session
creation phases

## Performance

Cold-loading the reproduced 69-message forked session dropped from 20–29
seconds to 1.9 seconds. Transcript model lookup took 5 ms and replay
took 14 ms; the remaining time was SDK initialization.

## Tests

- `env -u ANTHROPIC_BASE_URL npm run test:run` (1230 passed, 27 skipped)
- `npm run build`
- `npm run lint`
- Prettier check for all changed files
- real ACP cold-load probe against the reproduced forked session
2026-09-05 16:43:25 +04:00
acp-release-bot[bot]
a0122dae4c chore(main): release 0.75.0 (#1083)
🤖 I have created a release *beep* *boop*
---


##
[0.75.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.74.0...v0.75.0)
(2026-09-05)


### Features

* **auth:** report the agent's auth identity over ACP (authStatus
extension)
([#1080](https://github.com/agentclientprotocol/claude-agent-acp/issues/1080))
([eb5ca9f](eb5ca9fd17))
* render usage statistics as Markdown
([#1085](https://github.com/agentclientprotocol/claude-agent-acp/issues/1085))
([2081767](20817678f6))
* surface context compaction as an ACP tool lifecycle
([#991](https://github.com/agentclientprotocol/claude-agent-acp/issues/991))
([f74a517](f74a51758d))

---
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-09-05 10:53:44 +02:00
nikita-ashihmin
20817678f6 feat: render usage statistics as Markdown (#1085)
## Summary

- recognize Claude Code local /usage output
- render subscription limits and MCP contributions as structured
Markdown with progress bars
- keep usage parsing and rendering in a dedicated module with unit
coverage
- preserve existing handling for other local commands and unknown future
usage formats

## Testing

- npm run check
- npm run build
- env -u ANTHROPIC_BASE_URL npm run test:run (1210 passed, 27 skipped)
2026-09-05 12:00:43 +04:00
nikita-ashihmin
f74a51758d feat: surface context compaction as an ACP tool lifecycle (#991)
## Summary

- surface Claude context compaction as a synthetic ACP tool lifecycle
instead of assistant text
- emit provider-neutral `_meta.contextCompaction` metadata with schema
version 1
- handle status, stream heartbeat, compact-boundary, terminal-only,
failure, and duplicate terminal event shapes
- keep the generated compaction summary internal to the agent

## Protocol

Compaction tool calls use `kind: "think"`, title `Compact conversation`,
standard ACP lifecycle statuses, and optional metadata fields `trigger`,
`preTokens`, `postTokens`, `durationMs`, and `error`.

## Testing

- `npm run test:run` (769 passed, 26 skipped)
- `npm run build`
- `npm run check`
2026-09-04 16:28:48 +04:00
Dmitry Kozhevnikov
eb5ca9fd17 feat(auth): report the agent's auth identity over ACP (authStatus extension) (#1080) 2026-09-04 11:55:57 +00:00
acp-release-bot[bot]
847a3b6429 chore(main): release 0.74.0 (#1082) 2026-09-04 13:03:43 +02:00
Dmitry Kozhevnikov
da9f7e5695 feat(auth): refuse claude.ai subscriptions under --hide-claude-auth (#1079)
Stacked on #1071. The first three commits are that PR; review the last
commit here.

## What

`--hide-claude-auth` hid the claude.ai login method from `initialize`,
but nothing stopped a session from billing a subscription that was
already stored. This moves the decision into `src/hide-claude-auth.ts`
with two layers:

1. Session creation refuses an account that holds no credential this
integration accepts, so a logged-out session never exists.
2. A sign-out during the session ends the query. The next turn recreates
it, so the next `initialize` reports the real account.

A per-turn guard repeats the check on the account the SDK cached at
`initialize`. It reads no process and costs microseconds. It covers a
session created under a provider override that `providers/disable` later
removed.

"Bills a subscription" is an allowlist of `apiKeySource` values that
outrank a stored subscription, so an unknown SDK value keeps the guard
on. The guard fails open when the account cannot be read at all, and
warns once per session.

## Client-visible additions (all additive)

- The `authRequired` JSON-RPC error carries `data.reason:
"claude_subscription_not_supported"` when the guard blocks a turn. Same
error code and same message string as before. A plain sign-out still
carries no `data`.
- `PublishedSessionFailure` gains an optional `reason`, emitted in the
failure `_meta` only when set. `hasActiveSessionError` matches on it, so
the subscription refusal and a plain sign-out cannot suppress each
other.

## Behavior changes not behind the flag

- `providers/set` and `providers/disable` no longer reject the whole
call when one session cannot be recreated. The session gets a
per-session failure row, the switch goes on to the next session. The
affected session is the one signal for that case; AIR never reaches it,
because it sends `providers/set` only while a pooled client is created,
before any session exists.
- `authenticate` validates a gateway payload that is present. A call
with no `_meta.gateway` keeps its historical meaning: no override,
success.
- A failed session creation closes the query it spawned instead of
leaking the CLI process.

## Compatibility

Checked against Zed and the JetBrains clients (`plugins/llm`, AIR main
and stable). No consumer sends a gateway `authenticate` without a
payload, none passes `--hide-claude-auth` by default, every one already
handles the `auth_required` JSON-RPC rejection, and every `_meta` /
error `data` parser ignores unknown fields.

## Test plan

- `npm run build`, `npm run check`: clean.
- `npm run test:run`: 1153 passed, 27 skipped.
- New tests in `src/tests/authorization.test.ts` cover the guard end to
end: creation refusal, per-turn refusal, sign-out respawn, provider
override on/off, gateway payload validation, degraded guard.

## Follow-up commit in this PR

- `fix(auth): start a fresh query when a signed-out session cannot be
resumed` — when the CLI never persisted the session, `resume` answers
`resourceNotFound`; the respawn now starts a fresh query under the same
ACP session id instead of failing every later prompt.

Tests after it: 1156 passed, 27 skipped.

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

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 09:56:28 +00:00
acp-release-bot[bot]
ea7076c0bc chore(main): release 0.73.0 (#1067)
🤖 I have created a release *beep* *boop*
---


##
[0.73.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.72.0...v0.73.0)
(2026-09-01)


### Features

* **deps:** update Claude SDK
([#1066](https://github.com/agentclientprotocol/claude-agent-acp/issues/1066))
([b4e3aaa](b4e3aaa727))

---
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-09-01 22:25:37 +02:00
Andrey Bragin
b4e3aaa727 feat(deps): update Claude SDK (#1066) 2026-09-01 22:22:35 +02:00
acp-release-bot[bot]
d3eff19157 chore(main): release 0.72.0 (#1064)
🤖 I have created a release *beep* *boop*
---


##
[0.72.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.71.0...v0.72.0)
(2026-09-01)


### Features

* **deps:** Update to @anthropic-ai/claude-agent-sdk 0.3.252
([#1062](https://github.com/agentclientprotocol/claude-agent-acp/issues/1062))
([9aaf066](9aaf0663bf))


### Bug Fixes

* Adopt per-model effort settings and user_message_uuid result
attribution
([#1065](https://github.com/agentclientprotocol/claude-agent-acp/issues/1065))
([a04d354](a04d35496c))

---
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-09-01 20:50:15 +02:00
Ben Brandt
a04d35496c fix: Adopt per-model effort settings and user_message_uuid result attribution (#1065)
- Seed the Effort picker from the CLI's persisted per-model effort
  (settings.modelSettings) with the legacy top-level effortLevel as
  fallback, and stop pinning settings-derived seeds at the flag layer —
  only explicit ACP picker choices pin effort now, so the CLI's own
  per-model restore survives model switches.
- Re-seed effort from the new model's persisted entry on unpinned model
  switches instead of dragging the old model's value along.
- Use the result's user_message_uuid (SDK 0.3.246+) as an exact join
key:
the empty-interruption diagnostic handler consumes exactly the token it
  names (and no longer swallows a live turn's stamped failure), and
  ensureActiveTurn consumes the named orphan / skips the dup-over-loss
one-skip when the stamp refutes it. Older producers keep the heuristics.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-01 18:46:59 +00:00
dependabot[bot]
9aaf0663bf feat(deps): Update to @anthropic-ai/claude-agent-sdk 0.3.252 (#1062)
Bumps the minor group with 17 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
|
[@agentclientprotocol/sdk](https://github.com/agentclientprotocol/typescript-sdk)
| `1.3.0` | `1.4.0` |
|
[@anthropic-ai/claude-agent-sdk](https://github.com/anthropics/claude-agent-sdk-typescript)
| `0.3.238` | `0.3.251` |
| [zod](https://github.com/colinhacks/zod) | `4.4.3` | `4.5.2` |
|
[@anthropic-ai/sdk](https://github.com/anthropics/anthropic-sdk-typescript)
| `0.120.0` | `0.122.0` |
|
[@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node)
| `26.2.0` | `26.4.0` |
|
[@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin)
| `8.67.0` | `8.68.0` |
|
[@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser)
| `8.67.0` | `8.68.0` |
| [eslint](https://github.com/eslint/eslint) | `10.8.1` | `10.9.1` |
|
[@jridgewell/sourcemap-codec](https://github.com/jridgewell/sourcemaps/tree/HEAD/packages/sourcemap-codec)
| `1.5.5` | `1.6.0` |
|
[express-rate-limit](https://github.com/express-rate-limit/express-rate-limit)
| `8.6.2` | `8.7.0` |
| [hono](https://github.com/honojs/hono) | `4.13.2` | `4.13.5` |
| [ip-address](https://github.com/beaugunderson/ip-address) | `10.5.0` |
`10.7.0` |
| [jose](https://github.com/panva/jose) | `6.2.9` | `6.2.10` |
| [negotiator](https://github.com/jshttp/negotiator) | `1.0.0` | `1.1.0`
|
| [picomatch](https://github.com/micromatch/picomatch) | `4.0.5` |
`4.0.7` |
|
[rolldown](https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown)
| `1.2.5` | `1.2.6` |
|
[standardwebhooks](https://github.com/standard-webhooks/standard-webhooks)
| `1.0.0` | `1.1.1` |


Updates `@agentclientprotocol/sdk` from 1.3.0 to 1.4.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/agentclientprotocol/typescript-sdk/releases">@​agentclientprotocol/sdk's
releases</a>.</em></p>
<blockquote>
<h2>v1.4.0</h2>
<h2><a
href="https://github.com/agentclientprotocol/typescript-sdk/compare/v1.3.0...v1.4.0">1.4.0</a>
(2026-08-20)</h2>
<h3>Features</h3>
<ul>
<li>Stabilize elicitation APIs (<a
href="https://redirect.github.com/agentclientprotocol/typescript-sdk/issues/242">#242</a>)
(<a
href="dc3b0e420f">dc3b0e4</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li><strong>jsonrpc:</strong> report malformed input (<a
href="https://redirect.github.com/agentclientprotocol/typescript-sdk/issues/230">#230</a>)
(<a
href="0819dbebfb">0819dbe</a>)</li>
<li><strong>server:</strong> preserve routed outbound messages (<a
href="https://redirect.github.com/agentclientprotocol/typescript-sdk/issues/231">#231</a>)
(<a
href="5f58a95a10">5f58a95</a>)</li>
<li><strong>v2:</strong> enforce initialization lifecycle (<a
href="https://redirect.github.com/agentclientprotocol/typescript-sdk/issues/235">#235</a>)
(<a
href="b7d6e81fea">b7d6e81</a>)</li>
<li><strong>v2:</strong> enforce method contracts (<a
href="https://redirect.github.com/agentclientprotocol/typescript-sdk/issues/229">#229</a>)
(<a
href="01010146a7">0101014</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/agentclientprotocol/typescript-sdk/blob/main/CHANGELOG.md">@​agentclientprotocol/sdk's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/agentclientprotocol/typescript-sdk/compare/v1.3.0...v1.4.0">1.4.0</a>
(2026-08-20)</h2>
<h3>Features</h3>
<ul>
<li>Stabilize elicitation APIs (<a
href="https://redirect.github.com/agentclientprotocol/typescript-sdk/issues/242">#242</a>)
(<a
href="dc3b0e420f">dc3b0e4</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li><strong>jsonrpc:</strong> report malformed input (<a
href="https://redirect.github.com/agentclientprotocol/typescript-sdk/issues/230">#230</a>)
(<a
href="0819dbebfb">0819dbe</a>)</li>
<li><strong>server:</strong> preserve routed outbound messages (<a
href="https://redirect.github.com/agentclientprotocol/typescript-sdk/issues/231">#231</a>)
(<a
href="5f58a95a10">5f58a95</a>)</li>
<li><strong>v2:</strong> enforce initialization lifecycle (<a
href="https://redirect.github.com/agentclientprotocol/typescript-sdk/issues/235">#235</a>)
(<a
href="b7d6e81fea">b7d6e81</a>)</li>
<li><strong>v2:</strong> enforce method contracts (<a
href="https://redirect.github.com/agentclientprotocol/typescript-sdk/issues/229">#229</a>)
(<a
href="01010146a7">0101014</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="e6463f4440"><code>e6463f4</code></a>
chore(main): release 1.4.0 (<a
href="https://redirect.github.com/agentclientprotocol/typescript-sdk/issues/237">#237</a>)</li>
<li><a
href="dc3b0e420f"><code>dc3b0e4</code></a>
feat: Stabilize elicitation APIs (<a
href="https://redirect.github.com/agentclientprotocol/typescript-sdk/issues/242">#242</a>)</li>
<li><a
href="b7d6e81fea"><code>b7d6e81</code></a>
fix(v2): enforce initialization lifecycle (<a
href="https://redirect.github.com/agentclientprotocol/typescript-sdk/issues/235">#235</a>)</li>
<li><a
href="7585334c5b"><code>7585334</code></a>
chore(deps): bump the minor group with 19 updates (<a
href="https://redirect.github.com/agentclientprotocol/typescript-sdk/issues/241">#241</a>)</li>
<li><a
href="01010146a7"><code>0101014</code></a>
fix(v2): enforce method contracts (<a
href="https://redirect.github.com/agentclientprotocol/typescript-sdk/issues/229">#229</a>)</li>
<li><a
href="e1054d0122"><code>e1054d0</code></a>
chore(deps): bump crate-ci/typos from 1.48.0 to 1.49.0 (<a
href="https://redirect.github.com/agentclientprotocol/typescript-sdk/issues/238">#238</a>)</li>
<li><a
href="611e1fea6a"><code>611e1fe</code></a>
chore(deps): bump the minor group with 17 updates (<a
href="https://redirect.github.com/agentclientprotocol/typescript-sdk/issues/239">#239</a>)</li>
<li><a
href="5ae784b010"><code>5ae784b</code></a>
chore(deps-dev): bump nanoid from 3.3.16 to 3.3.18 (<a
href="https://redirect.github.com/agentclientprotocol/typescript-sdk/issues/240">#240</a>)</li>
<li><a
href="f838f942e0"><code>f838f94</code></a>
chore: verify generated protocol sources (<a
href="https://redirect.github.com/agentclientprotocol/typescript-sdk/issues/232">#232</a>)</li>
<li><a
href="5f58a95a10"><code>5f58a95</code></a>
fix(server): preserve routed outbound messages (<a
href="https://redirect.github.com/agentclientprotocol/typescript-sdk/issues/231">#231</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/agentclientprotocol/typescript-sdk/compare/v1.3.0...v1.4.0">compare
view</a></li>
</ul>
</details>
<br />

Updates `@anthropic-ai/claude-agent-sdk` from 0.3.238 to 0.3.251
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/anthropics/claude-agent-sdk-typescript/releases">@​anthropic-ai/claude-agent-sdk's
releases</a>.</em></p>
<blockquote>
<h2>v0.3.251</h2>
<h2>What's changed</h2>
<ul>
<li>Updated to parity with Claude Code v2.1.251</li>
</ul>
<h2>Update</h2>
<pre lang="sh"><code>npm install @anthropic-ai/claude-agent-sdk@0.3.251
# or
yarn add @anthropic-ai/claude-agent-sdk@0.3.251
# or
pnpm add @anthropic-ai/claude-agent-sdk@0.3.251
# or
bun add @anthropic-ai/claude-agent-sdk@0.3.251
</code></pre>
<h2>v0.3.250</h2>
<h2>What's changed</h2>
<ul>
<li>Updated to parity with Claude Code v2.1.250</li>
</ul>
<h2>Update</h2>
<pre lang="sh"><code>npm install @anthropic-ai/claude-agent-sdk@0.3.250
# or
yarn add @anthropic-ai/claude-agent-sdk@0.3.250
# or
pnpm add @anthropic-ai/claude-agent-sdk@0.3.250
# or
bun add @anthropic-ai/claude-agent-sdk@0.3.250
</code></pre>
<h2>v0.3.248</h2>
<h2>What's changed</h2>
<ul>
<li>Added a per-server <code>timeout</code> for SDK-hosted MCP servers
(<code>createSdkMcpServer({ timeout })</code>), overriding
<code>MCP_TOOL_TIMEOUT</code> for that server's tool calls</li>
</ul>
<h2>Update</h2>
<pre lang="sh"><code>npm install @anthropic-ai/claude-agent-sdk@0.3.248
# or
yarn add @anthropic-ai/claude-agent-sdk@0.3.248
# or
pnpm add @anthropic-ai/claude-agent-sdk@0.3.248
# or
bun add @anthropic-ai/claude-agent-sdk@0.3.248
</code></pre>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/anthropics/claude-agent-sdk-typescript/blob/main/CHANGELOG.md">@​anthropic-ai/claude-agent-sdk's
changelog</a>.</em></p>
<blockquote>
<h2>0.3.251</h2>
<ul>
<li>Updated to parity with Claude Code v2.1.251</li>
</ul>
<h2>0.3.250</h2>
<ul>
<li>Updated to parity with Claude Code v2.1.250</li>
</ul>
<h2>0.3.249</h2>
<ul>
<li>Updated to parity with Claude Code v2.1.249</li>
</ul>
<h2>0.3.248</h2>
<ul>
<li>Added a per-server <code>timeout</code> for SDK-hosted MCP servers
(<code>createSdkMcpServer({ timeout })</code>), overriding
<code>MCP_TOOL_TIMEOUT</code> for that server's tool calls</li>
</ul>
<h2>0.3.247</h2>
<ul>
<li>Added an optional <code>ambient</code> flag to
<code>task_started</code>, <code>task_notification</code> and
<code>background_tasks_changed</code> task entries so hosts can exclude
housekeeping tasks from activity indicators</li>
<li>Fixed the <code>permissionMode</code> on per-turn
<code>system/init</code> frames reporting the mode at turn start instead
of the live mode, so a mode switch right after submitting no longer
sends a stale value</li>
</ul>
<h2>0.3.246</h2>
<ul>
<li>Added optional <code>user_message_uuid</code> to error result
messages and to the first assistant message or <code>stream_event</code>
of each turn, linking a reply or failure to the user message that
triggered it</li>
<li>Added <code>modelUsage[*].costBasis</code> (<code>'list' | 'managed'
| 'unknown'</code>) reporting which price table each model's
<code>costUSD</code> was computed from</li>
<li>Added <code>modelPricing</code> support in the
<code>managedSettings</code> option for hosts that set
<code>CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST</code>; an admin-managed
settings source that sets <code>modelPricing</code> still wins</li>
<li>Added <code>perTaskStopAffordance</code> option: when set,
<code>interrupt()</code> aborts only the current turn and keeps
background agents and workflows running; otherwise (and for one-shot
string prompts) they stop</li>
</ul>
<h2>0.3.245</h2>
<ul>
<li>Updated to parity with Claude Code v2.1.245</li>
</ul>
<h2>0.3.244</h2>
<ul>
<li>Updated to parity with Claude Code v2.1.244</li>
</ul>
<h2>0.3.243</h2>
<ul>
<li>Added optional <code>queued_turn_count</code> to result messages:
the number of queued user sends still pending when the result was
produced, so hosts know whether another turn and result will follow</li>
<li>Fixed <code>mcp_status</code> reporting a remote MCP server as
connected after its connection dropped; it now reports pending while
reconnecting, then connected or failed</li>
<li>Fixed managed <code>disableAllHooks</code> also disabling hook
callbacks registered through the <code>hooks</code> option; they now
keep running, matching <code>allowManagedHooksOnly</code></li>
<li>Changed Read tool PDF results: the <code>document</code> block (or
page <code>image</code> blocks for <code>pages</code> reads) now arrives
inside the <code>tool_result</code> content instead of as a separate
<code>user</code> message after it</li>
<li>Updated to parity with Claude Code v2.1.243</li>
</ul>
<h2>0.3.242</h2>
<ul>
<li>Updated to parity with Claude Code v2.1.242</li>
</ul>
<h2>0.3.241</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="75667f1f76"><code>75667f1</code></a>
chore: Update CHANGELOG.md</li>
<li><a
href="0ec415863a"><code>0ec4158</code></a>
chore: Update CHANGELOG.md</li>
<li><a
href="0518a194af"><code>0518a19</code></a>
chore: Update CHANGELOG.md</li>
<li><a
href="40b4c54986"><code>40b4c54</code></a>
chore: Update CHANGELOG.md</li>
<li><a
href="86e1856fc3"><code>86e1856</code></a>
chore: Update CHANGELOG.md</li>
<li><a
href="9d56dae014"><code>9d56dae</code></a>
chore: Update CHANGELOG.md</li>
<li><a
href="dca08feed8"><code>dca08fe</code></a>
chore: Update CHANGELOG.md</li>
<li><a
href="0ebd333363"><code>0ebd333</code></a>
chore: Update CHANGELOG.md</li>
<li><a
href="48275071e8"><code>4827507</code></a>
chore: Update CHANGELOG.md</li>
<li><a
href="bfa6b84596"><code>bfa6b84</code></a>
chore: Update CHANGELOG.md</li>
<li>Additional commits viewable in <a
href="https://github.com/anthropics/claude-agent-sdk-typescript/compare/v0.3.238...v0.3.251">compare
view</a></li>
</ul>
</details>
<br />

Updates `zod` from 4.4.3 to 4.5.2
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/colinhacks/zod/releases">zod's
releases</a>.</em></p>
<blockquote>
<h2>v4.5.2</h2>
<h2>Commits:</h2>
<ul>
<li>a354314ac04fdd5484aa62dd5c3a4b553211a0e4 fix(docs): keep blog posts
out of the docs collection (<a
href="https://redirect.github.com/colinhacks/zod/issues/6484">#6484</a>)</li>
<li>d378c42aff6869f0929058a7923cd775880f5c4c ci: drop canary publishing
from the release workflow (<a
href="https://redirect.github.com/colinhacks/zod/issues/6487">#6487</a>)</li>
<li>212b941791e7faae078e17645eb612824fd8f79a fix(v4): let a prototype
method getter answer a bare call so vi.spyOn works (<a
href="https://redirect.github.com/colinhacks/zod/issues/6488">#6488</a>)</li>
<li>e7576f542a7bc7ef3cc5eeec237714fd0e6b6e98 docs(blog): let the page
show through the navbar in dark mode (<a
href="https://redirect.github.com/colinhacks/zod/issues/6489">#6489</a>)</li>
<li>fedb06fafe33a66ce0b5c236ad2557e0a5a170fe fix(docs): match the blog
TOC hover bar to the 2px active indicator</li>
<li>6c932fcb2eea6eb671710ea058ca9fdc382ada89 chore: bump devcontainer
image to Node 24 (<a
href="https://redirect.github.com/colinhacks/zod/issues/6470">#6470</a>)</li>
<li>6635d9dd367a664109de83c021995821f48efa29 docs(blog): soften the
&quot;method memoization&quot; attribution</li>
<li>019ae299cc75daa132bf1acf59086a520abf6b85 fix(docs): drop ISR on the
docs route so the home page hydrates</li>
<li>652bb438aa4c626c1cd7948c6849c4691239fca7 chore(docs): drop the
scroll log from the route-change scroller</li>
<li>571c8e8a3d73b4305f4abfdd6977773cc12f2bf5 fix(docs): render blog tabs
with the stock fumadocs tab card</li>
<li>9a193aa24b4efa3b315b91d4c56c8bc385b8513f 4.5.2</li>
</ul>
<h2>v4.5.1</h2>
<h2>Commits:</h2>
<ul>
<li>2e862dbf89da2835e5206a8fd3d3be61afe3cf7f ci: gate the GitHub release
and JSR publish on the version being live on npm</li>
<li>8e03380510db36fa6fda979fc78a375fdea8021c 4.5.1</li>
</ul>
<h2>v4.5.0</h2>
<p>Zod 4.5 is now available.</p>
<pre lang="sh"><code>npm install zod@latest
</code></pre>
<p>At a glance:</p>
<ul>
<li><a
href="https://github.com/colinhacks/zod/blob/HEAD%5Bhttps://github.com/colinhacks/zod/blob/HEAD%60https://github.com/colinhacks/zod/blob/HEADzhttps://github.com/colinhacks/zod/blob/HEAD.https://github.com/colinhacks/zod/blob/HEADchttps://github.com/colinhacks/zod/blob/HEADohttps://github.com/colinhacks/zod/blob/HEADmhttps://github.com/colinhacks/zod/blob/HEADphttps://github.com/colinhacks/zod/blob/HEADihttps://github.com/colinhacks/zod/blob/HEADlhttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEAD(https://github.com/colinhacks/zod/blob/HEAD)https://github.com/colinhacks/zod/blob/HEAD%60https://github.com/colinhacks/zod/blob/HEAD%5Dhttps://github.com/colinhacks/zod/blob/HEAD(https://github.com/colinhacks/zod/blob/HEAD#https://github.com/colinhacks/zod/blob/HEADzhttps://github.com/colinhacks/zod/blob/HEADchttps://github.com/colinhacks/zod/blob/HEADohttps://github.com/colinhacks/zod/blob/HEADmhttps://github.com/colinhacks/zod/blob/HEADphttps://github.com/colinhacks/zod/blob/HEADihttps://github.com/colinhacks/zod/blob/HEADlhttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEAD)https://github.com/colinhacks/zod/blob/HEAD">https://github.com/colinhacks/zod/blob/HEAD[https://github.com/colinhacks/zod/blob/HEAD`https://github.com/colinhacks/zod/blob/HEADzhttps://github.com/colinhacks/zod/blob/HEAD.https://github.com/colinhacks/zod/blob/HEADchttps://github.com/colinhacks/zod/blob/HEADohttps://github.com/colinhacks/zod/blob/HEADmhttps://github.com/colinhacks/zod/blob/HEADphttps://github.com/colinhacks/zod/blob/HEADihttps://github.com/colinhacks/zod/blob/HEADlhttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEAD(https://github.com/colinhacks/zod/blob/HEAD)https://github.com/colinhacks/zod/blob/HEAD`https://github.com/colinhacks/zod/blob/HEAD]https://github.com/colinhacks/zod/blob/HEAD(https://github.com/colinhacks/zod/blob/HEAD#https://github.com/colinhacks/zod/blob/HEADzhttps://github.com/colinhacks/zod/blob/HEADchttps://github.com/colinhacks/zod/blob/HEADohttps://github.com/colinhacks/zod/blob/HEADmhttps://github.com/colinhacks/zod/blob/HEADphttps://github.com/colinhacks/zod/blob/HEADihttps://github.com/colinhacks/zod/blob/HEADlhttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEAD)https://github.com/colinhacks/zod/blob/HEAD</a>
— the flagship feature of Zod 4.5</li>
<li><a
href="https://github.com/colinhacks/zod/blob/HEAD%5Bhttps://github.com/colinhacks/zod/blob/HEAD%60https://github.com/colinhacks/zod/blob/HEADzhttps://github.com/colinhacks/zod/blob/HEAD.https://github.com/colinhacks/zod/blob/HEADchttps://github.com/colinhacks/zod/blob/HEADrhttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEADdhttps://github.com/colinhacks/zod/blob/HEADihttps://github.com/colinhacks/zod/blob/HEADthttps://github.com/colinhacks/zod/blob/HEADChttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADrhttps://github.com/colinhacks/zod/blob/HEADdhttps://github.com/colinhacks/zod/blob/HEAD(https://github.com/colinhacks/zod/blob/HEAD)https://github.com/colinhacks/zod/blob/HEAD%60https://github.com/colinhacks/zod/blob/HEAD%5Dhttps://github.com/colinhacks/zod/blob/HEAD(https://github.com/colinhacks/zod/blob/HEAD#https://github.com/colinhacks/zod/blob/HEADzhttps://github.com/colinhacks/zod/blob/HEADchttps://github.com/colinhacks/zod/blob/HEADrhttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEADdhttps://github.com/colinhacks/zod/blob/HEADihttps://github.com/colinhacks/zod/blob/HEADthttps://github.com/colinhacks/zod/blob/HEADchttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADrhttps://github.com/colinhacks/zod/blob/HEADdhttps://github.com/colinhacks/zod/blob/HEAD)https://github.com/colinhacks/zod/blob/HEAD">https://github.com/colinhacks/zod/blob/HEAD[https://github.com/colinhacks/zod/blob/HEAD`https://github.com/colinhacks/zod/blob/HEADzhttps://github.com/colinhacks/zod/blob/HEAD.https://github.com/colinhacks/zod/blob/HEADchttps://github.com/colinhacks/zod/blob/HEADrhttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEADdhttps://github.com/colinhacks/zod/blob/HEADihttps://github.com/colinhacks/zod/blob/HEADthttps://github.com/colinhacks/zod/blob/HEADChttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADrhttps://github.com/colinhacks/zod/blob/HEADdhttps://github.com/colinhacks/zod/blob/HEAD(https://github.com/colinhacks/zod/blob/HEAD)https://github.com/colinhacks/zod/blob/HEAD`https://github.com/colinhacks/zod/blob/HEAD]https://github.com/colinhacks/zod/blob/HEAD(https://github.com/colinhacks/zod/blob/HEAD#https://github.com/colinhacks/zod/blob/HEADzhttps://github.com/colinhacks/zod/blob/HEADchttps://github.com/colinhacks/zod/blob/HEADrhttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEADdhttps://github.com/colinhacks/zod/blob/HEADihttps://github.com/colinhacks/zod/blob/HEADthttps://github.com/colinhacks/zod/blob/HEADchttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADrhttps://github.com/colinhacks/zod/blob/HEADdhttps://github.com/colinhacks/zod/blob/HEAD)https://github.com/colinhacks/zod/blob/HEAD</a>
— 12–19 digits plus Luhn checksum</li>
<li><a
href="https://github.com/colinhacks/zod/blob/HEAD%5Bhttps://github.com/colinhacks/zod/blob/HEAD%60https://github.com/colinhacks/zod/blob/HEADzhttps://github.com/colinhacks/zod/blob/HEAD.https://github.com/colinhacks/zod/blob/HEADphttps://github.com/colinhacks/zod/blob/HEADrhttps://github.com/colinhacks/zod/blob/HEADohttps://github.com/colinhacks/zod/blob/HEADphttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEADrhttps://github.com/colinhacks/zod/blob/HEADthttps://github.com/colinhacks/zod/blob/HEADihttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEADshttps://github.com/colinhacks/zod/blob/HEAD(https://github.com/colinhacks/zod/blob/HEAD)https://github.com/colinhacks/zod/blob/HEAD%60https://github.com/colinhacks/zod/blob/HEAD%5Dhttps://github.com/colinhacks/zod/blob/HEAD(https://github.com/colinhacks/zod/blob/HEAD#https://github.com/colinhacks/zod/blob/HEADzhttps://github.com/colinhacks/zod/blob/HEADphttps://github.com/colinhacks/zod/blob/HEADrhttps://github.com/colinhacks/zod/blob/HEADohttps://github.com/colinhacks/zod/blob/HEADphttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEADrhttps://github.com/colinhacks/zod/blob/HEADthttps://github.com/colinhacks/zod/blob/HEADihttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEADshttps://github.com/colinhacks/zod/blob/HEAD)https://github.com/colinhacks/zod/blob/HEAD">https://github.com/colinhacks/zod/blob/HEAD[https://github.com/colinhacks/zod/blob/HEAD`https://github.com/colinhacks/zod/blob/HEADzhttps://github.com/colinhacks/zod/blob/HEAD.https://github.com/colinhacks/zod/blob/HEADphttps://github.com/colinhacks/zod/blob/HEADrhttps://github.com/colinhacks/zod/blob/HEADohttps://github.com/colinhacks/zod/blob/HEADphttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEADrhttps://github.com/colinhacks/zod/blob/HEADthttps://github.com/colinhacks/zod/blob/HEADihttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEADshttps://github.com/colinhacks/zod/blob/HEAD(https://github.com/colinhacks/zod/blob/HEAD)https://github.com/colinhacks/zod/blob/HEAD`https://github.com/colinhacks/zod/blob/HEAD]https://github.com/colinhacks/zod/blob/HEAD(https://github.com/colinhacks/zod/blob/HEAD#https://github.com/colinhacks/zod/blob/HEADzhttps://github.com/colinhacks/zod/blob/HEADphttps://github.com/colinhacks/zod/blob/HEADrhttps://github.com/colinhacks/zod/blob/HEADohttps://github.com/colinhacks/zod/blob/HEADphttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEADrhttps://github.com/colinhacks/zod/blob/HEADthttps://github.com/colinhacks/zod/blob/HEADihttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEADshttps://github.com/colinhacks/zod/blob/HEAD)https://github.com/colinhacks/zod/blob/HEAD</a>
— the multi-property counterpart to <code>z.property()</code></li>
<li><a
href="https://github.com/colinhacks/zod/blob/HEAD%5Bhttps://github.com/colinhacks/zod/blob/HEAD%60https://github.com/colinhacks/zod/blob/HEADzhttps://github.com/colinhacks/zod/blob/HEAD.https://github.com/colinhacks/zod/blob/HEADdhttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEADphttps://github.com/colinhacks/zod/blob/HEADPhttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADrhttps://github.com/colinhacks/zod/blob/HEADthttps://github.com/colinhacks/zod/blob/HEADihttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADlhttps://github.com/colinhacks/zod/blob/HEAD(https://github.com/colinhacks/zod/blob/HEAD)https://github.com/colinhacks/zod/blob/HEAD%60https://github.com/colinhacks/zod/blob/HEAD%5Dhttps://github.com/colinhacks/zod/blob/HEAD(https://github.com/colinhacks/zod/blob/HEAD#https://github.com/colinhacks/zod/blob/HEADzhttps://github.com/colinhacks/zod/blob/HEADdhttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEADphttps://github.com/colinhacks/zod/blob/HEADphttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADrhttps://github.com/colinhacks/zod/blob/HEADthttps://github.com/colinhacks/zod/blob/HEADihttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADlhttps://github.com/colinhacks/zod/blob/HEAD)https://github.com/colinhacks/zod/blob/HEAD/https://github.com/colinhacks/zod/blob/HEAD%5Bhttps://github.com/colinhacks/zod/blob/HEAD%60https://github.com/colinhacks/zod/blob/HEAD.https://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEADxhttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADchttps://github.com/colinhacks/zod/blob/HEADthttps://github.com/colinhacks/zod/blob/HEADPhttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADrhttps://github.com/colinhacks/zod/blob/HEADthttps://github.com/colinhacks/zod/blob/HEADihttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADlhttps://github.com/colinhacks/zod/blob/HEAD(https://github.com/colinhacks/zod/blob/HEAD)https://github.com/colinhacks/zod/blob/HEAD%60https://github.com/colinhacks/zod/blob/HEAD%5Dhttps://github.com/colinhacks/zod/blob/HEAD(https://github.com/colinhacks/zod/blob/HEAD#https://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEADxhttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADchttps://github.com/colinhacks/zod/blob/HEADthttps://github.com/colinhacks/zod/blob/HEADphttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADrhttps://github.com/colinhacks/zod/blob/HEADthttps://github.com/colinhacks/zod/blob/HEADihttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADlhttps://github.com/colinhacks/zod/blob/HEAD)https://github.com/colinhacks/zod/blob/HEAD">https://github.com/colinhacks/zod/blob/HEAD[https://github.com/colinhacks/zod/blob/HEAD`https://github.com/colinhacks/zod/blob/HEADzhttps://github.com/colinhacks/zod/blob/HEAD.https://github.com/colinhacks/zod/blob/HEADdhttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEADphttps://github.com/colinhacks/zod/blob/HEADPhttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADrhttps://github.com/colinhacks/zod/blob/HEADthttps://github.com/colinhacks/zod/blob/HEADihttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADlhttps://github.com/colinhacks/zod/blob/HEAD(https://github.com/colinhacks/zod/blob/HEAD)https://github.com/colinhacks/zod/blob/HEAD`https://github.com/colinhacks/zod/blob/HEAD]https://github.com/colinhacks/zod/blob/HEAD(https://github.com/colinhacks/zod/blob/HEAD#https://github.com/colinhacks/zod/blob/HEADzhttps://github.com/colinhacks/zod/blob/HEADdhttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEADphttps://github.com/colinhacks/zod/blob/HEADphttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADrhttps://github.com/colinhacks/zod/blob/HEADthttps://github.com/colinhacks/zod/blob/HEADihttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADlhttps://github.com/colinhacks/zod/blob/HEAD)https://github.com/colinhacks/zod/blob/HEAD/https://github.com/colinhacks/zod/blob/HEAD[https://github.com/colinhacks/zod/blob/HEAD`https://github.com/colinhacks/zod/blob/HEAD.https://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEADxhttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADchttps://github.com/colinhacks/zod/blob/HEADthttps://github.com/colinhacks/zod/blob/HEADPhttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADrhttps://github.com/colinhacks/zod/blob/HEADthttps://github.com/colinhacks/zod/blob/HEADihttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADlhttps://github.com/colinhacks/zod/blob/HEAD(https://github.com/colinhacks/zod/blob/HEAD)https://github.com/colinhacks/zod/blob/HEAD`https://github.com/colinhacks/zod/blob/HEAD]https://github.com/colinhacks/zod/blob/HEAD(https://github.com/colinhacks/zod/blob/HEAD#https://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEADxhttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADchttps://github.com/colinhacks/zod/blob/HEADthttps://github.com/colinhacks/zod/blob/HEADphttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADrhttps://github.com/colinhacks/zod/blob/HEADthttps://github.com/colinhacks/zod/blob/HEADihttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADlhttps://github.com/colinhacks/zod/blob/HEAD)https://github.com/colinhacks/zod/blob/HEAD</a></li>
<li><a
href="https://github.com/colinhacks/zod/blob/HEAD%5Bhttps://github.com/colinhacks/zod/blob/HEAD%60https://github.com/colinhacks/zod/blob/HEADzhttps://github.com/colinhacks/zod/blob/HEAD.https://github.com/colinhacks/zod/blob/HEADvhttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADlhttps://github.com/colinhacks/zod/blob/HEADihttps://github.com/colinhacks/zod/blob/HEADdhttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADthttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEAD(https://github.com/colinhacks/zod/blob/HEAD)https://github.com/colinhacks/zod/blob/HEAD:https://github.com/colinhacks/zod/blob/HEAD">https://github.com/colinhacks/zod/blob/HEAD[https://github.com/colinhacks/zod/blob/HEAD`https://github.com/colinhacks/zod/blob/HEADzhttps://github.com/colinhacks/zod/blob/HEAD.https://github.com/colinhacks/zod/blob/HEADvhttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADlhttps://github.com/colinhacks/zod/blob/HEADihttps://github.com/colinhacks/zod/blob/HEADdhttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADthttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEAD(https://github.com/colinhacks/zod/blob/HEAD)https://github.com/colinhacks/zod/blob/HEAD:https://github.com/colinhacks/zod/blob/HEAD</a>
<a
href="https://github.com/colinhacks/zod/blob/HEADbhttps://github.com/colinhacks/zod/blob/HEADohttps://github.com/colinhacks/zod/blob/HEADohttps://github.com/colinhacks/zod/blob/HEADlhttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADnhttps://github.com/colinhacks/zod/blob/HEAD%60https://github.com/colinhacks/zod/blob/HEAD%5Dhttps://github.com/colinhacks/zod/blob/HEAD(https://github.com/colinhacks/zod/blob/HEAD#https://github.com/colinhacks/zod/blob/HEADzhttps://github.com/colinhacks/zod/blob/HEADvhttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADlhttps://github.com/colinhacks/zod/blob/HEADihttps://github.com/colinhacks/zod/blob/HEADdhttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADthttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEAD)https://github.com/colinhacks/zod/blob/HEAD">https://github.com/colinhacks/zod/blob/HEADbhttps://github.com/colinhacks/zod/blob/HEADohttps://github.com/colinhacks/zod/blob/HEADohttps://github.com/colinhacks/zod/blob/HEADlhttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADnhttps://github.com/colinhacks/zod/blob/HEAD`https://github.com/colinhacks/zod/blob/HEAD]https://github.com/colinhacks/zod/blob/HEAD(https://github.com/colinhacks/zod/blob/HEAD#https://github.com/colinhacks/zod/blob/HEADzhttps://github.com/colinhacks/zod/blob/HEADvhttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADlhttps://github.com/colinhacks/zod/blob/HEADihttps://github.com/colinhacks/zod/blob/HEADdhttps://github.com/colinhacks/zod/blob/HEADahttps://github.com/colinhacks/zod/blob/HEADthttps://github.com/colinhacks/zod/blob/HEADehttps://github.com/colinhacks/zod/blob/HEAD)https://github.com/colinhacks/zod/blob/HEAD</a>
— a fast-path to verify input validity without a full parse (up to 16x
faster on invalid data)</li>
<li><a
href="https://github.com/colinhacks/zod/blob/HEAD/#9x-reduction-in-schema-memory-footprint">9x
reduction in memory footprint</a></li>
<li><a href="https://zod.dev/error-customization#locales">New
locales</a>: Bengali (<code>bn</code>), Central Kurdish
(<code>ckb</code>), Hindi (<code>hi</code>), Kannada (<code>kn</code>),
Norwegian Nynorsk (<code>nn</code>), Brazilian Portuguese
(<code>pt-BR</code>), Slovak (<code>sk</code>), Turkmen
(<code>tk</code>)</li>
</ul>
<h2><code>z.compile()</code></h2>
<p>You can now pre-compile any Zod schema using
<code>z.compile(schema)</code>. This dramatically speeds up parsing
performance.</p>
<pre lang="ts"><code>import * as z from &quot;zod&quot;;
<p>const Player = z.object({
username: z.string(),
bio: z.string(),
xp: z.number(),
// ...20 more properties...
&lt;/tr&gt;&lt;/table&gt;
</code></pre></p>
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="9a193aa24b"><code>9a193aa</code></a>
4.5.2</li>
<li><a
href="571c8e8a3d"><code>571c8e8</code></a>
fix(docs): render blog tabs with the stock fumadocs tab card</li>
<li><a
href="652bb438aa"><code>652bb43</code></a>
chore(docs): drop the scroll log from the route-change scroller</li>
<li><a
href="019ae299cc"><code>019ae29</code></a>
fix(docs): drop ISR on the docs route so the home page hydrates</li>
<li><a
href="6635d9dd36"><code>6635d9d</code></a>
docs(blog): soften the &quot;method memoization&quot; attribution</li>
<li><a
href="6c932fcb2e"><code>6c932fc</code></a>
chore: bump devcontainer image to Node 24 (<a
href="https://redirect.github.com/colinhacks/zod/issues/6470">#6470</a>)</li>
<li><a
href="fedb06fafe"><code>fedb06f</code></a>
fix(docs): match the blog TOC hover bar to the 2px active indicator</li>
<li><a
href="e7576f542a"><code>e7576f5</code></a>
docs(blog): let the page show through the navbar in dark mode (<a
href="https://redirect.github.com/colinhacks/zod/issues/6489">#6489</a>)</li>
<li><a
href="212b941791"><code>212b941</code></a>
fix(v4): let a prototype method getter answer a bare call so vi.spyOn
works (...</li>
<li><a
href="d378c42aff"><code>d378c42</code></a>
ci: drop canary publishing from the release workflow (<a
href="https://redirect.github.com/colinhacks/zod/issues/6487">#6487</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/colinhacks/zod/compare/v4.4.3...v4.5.2">compare
view</a></li>
</ul>
</details>
<br />

Updates `@anthropic-ai/sdk` from 0.120.0 to 0.122.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/anthropics/anthropic-sdk-typescript/releases">@​anthropic-ai/sdk's
releases</a>.</em></p>
<blockquote>
<h2>sdk: v0.122.0</h2>
<h2>0.122.0 (2026-08-27)</h2>
<p>Full Changelog: <a
href="https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.121.0...sdk-v0.122.0">sdk-v0.121.0...sdk-v0.122.0</a></p>
<h3>Features</h3>
<ul>
<li><strong>api:</strong> beta files/skills namespaces use GA shapes;
drop dated beta header pins (<a
href="45d693a66b">45d693a</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li><strong>client:</strong> classify cross-realm DOMException
abort/timeout errors correctly (<a
href="1bd639515e">1bd6395</a>)</li>
<li><strong>client:</strong> use configured logger for SSE parse errors
(<a
href="80eeaf7b01">80eeaf7</a>)</li>
<li><strong>sessions:</strong> make event accumulator forward-compatible
with new event types (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/410">#410</a>)
(<a
href="2d084fdaeb">2d084fd</a>)</li>
<li><strong>tools:</strong> let read return a view_range of a file over
the size cap (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/427">#427</a>)
(<a
href="56b32601f6">56b3260</a>)</li>
<li><strong>uploads:</strong> default bare Blob filename on skills
endpoints (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/422">#422</a>)
(<a
href="e1116491dd">e111649</a>)</li>
<li><strong>webhooks:</strong> require headers to be passed to
<code>unwrap()</code> (<a
href="3230804e63">3230804</a>)</li>
</ul>
<h3>Chores</h3>
<ul>
<li><strong>internal:</strong> codegen related update (<a
href="c2f327a30d">c2f327a</a>)</li>
</ul>
<h3>Documentation</h3>
<ul>
<li><strong>api:</strong> clarify pagination on the organization
rate-limit list endpoints (<a
href="d6015b90b3">d6015b9</a>)</li>
<li>document TypeScript 5.0 as the minimum supported version (<a
href="788e721793">788e721</a>)</li>
</ul>
<h2>sdk: v0.121.0</h2>
<h2>0.121.0 (2026-08-26)</h2>
<p>Full Changelog: <a
href="https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.120.0...sdk-v0.121.0">sdk-v0.120.0...sdk-v0.121.0</a></p>
<h3>Features</h3>
<ul>
<li><strong>api:</strong> add <code>updates</code> thinking display mode
(beta) (<a
href="22274eaf96">22274ea</a>)</li>
<li><strong>api:</strong> add missing anthropic-beta values (<a
href="0779f02666">0779f02</a>)</li>
<li><strong>api:</strong> add support for Organization API endpoints (<a
href="8b61e7a4d4">8b61e7a</a>)</li>
<li><strong>helpers:</strong> support Standard Schema for structured
outputs and tools (<a
href="788007889c">7880078</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li><strong>tools:</strong> keep the tool runner going on pause_turn (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/288">#288</a>)
(<a
href="f040dc9d39">f040dc9</a>)</li>
<li><strong>types:</strong> don't reference NodeJS.ProcessEnv from
published types (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/367">#367</a>)
(<a
href="fd38dfdc48">fd38dfd</a>)</li>
</ul>
<h3>Chores</h3>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/anthropics/anthropic-sdk-typescript/blob/main/CHANGELOG.md">@​anthropic-ai/sdk's
changelog</a>.</em></p>
<blockquote>
<h2>0.122.0 (2026-08-27)</h2>
<p>Full Changelog: <a
href="https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.121.0...sdk-v0.122.0">sdk-v0.121.0...sdk-v0.122.0</a></p>
<h3>Features</h3>
<ul>
<li>
<p><strong>api:</strong> beta files/skills namespaces use GA shapes;
drop dated beta header pins (<a
href="45d693a66b">45d693a</a>)</p>
<p>The beta Files and Skills namespaces (<code>client.beta.files</code>,
<code>client.beta.skills</code>) no longer send the
<code>files-api-2025-04-14</code> / <code>skills-2025-10-02</code>
headers and return the same shapes as <code>client.files</code> /
<code>client.skills</code> (with <code>Beta</code>-prefixed type names).
Requests that still send those headers on raw HTTP keep receiving the
beta shapes.</p>
<p>Changes in the beta namespaces:</p>
<ul>
<li><code>client.beta.skills.delete()</code> now deletes a Skill
together with all of its versions (previously refused while any version
existed). It returns <code>BetaDeletedSkill</code> (was
<code>SkillDeleteResponse</code>).</li>
<li>Beta Messages type <code>BetaSkill</code> (the <code>{type,
skill_id, version}</code> entry in <code>BetaContainer.skills</code>) is
renamed <code>BetaContainerSkill</code>; the request-side
<code>BetaSkillParams</code> keeps its name. <code>BetaSkill</code> now
names the Skill object returned by
<code>client.beta.skills.create()</code> / <code>retrieve()</code> /
<code>list()</code> (replacing <code>SkillCreateResponse</code> /
<code>SkillRetrieveResponse</code> / <code>SkillListResponse</code>),
and skill versions are <code>BetaSkillVersion</code> /
<code>BetaDeletedSkillVersion</code> (replacing
<code>Version*Response</code>).</li>
<li><code>client.beta.files.list()</code> returns a
<code>BetaFileMetadataPageCursor</code>
(<code>PageCursor&lt;BetaFileMetadata&gt;</code> with <code>data</code>
/ <code>next_page</code>) and <code>FileListParams</code> paginates with
<code>page</code> / <code>ids</code> (was
<code>BetaFileMetadataPage</code>, a
<code>Page&lt;BetaFileMetadata&gt;</code> with <code>data</code>,
<code>has_more</code>, <code>first_id</code>, <code>last_id</code> and
<code>before_id</code> / <code>after_id</code>); <code>for await</code>
auto-pagination is unchanged. <code>BetaSkill</code> uses
<code>display_name</code> (was <code>display_title</code>, also in
<code>SkillCreateParams</code>) and <code>latest_version_id</code> (was
<code>latest_version</code>), and <code>BetaSkillVersion</code> is
addressed by its <code>skver_…</code> <code>id</code> (the
Unix-timestamp <code>version</code> field is gone).</li>
</ul>
<p>Migration guides: <a
href="https://platform.claude.com/docs/en/build-with-claude/files#migrate-from-files-api-2025-04-14">Migrate
from <code>files-api-2025-04-14</code></a> · <a
href="https://platform.claude.com/docs/en/build-with-claude/skills-guide#migrate-from-skills-2025-10-02">Migrate
from <code>skills-2025-10-02</code></a></p>
</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li><strong>client:</strong> classify cross-realm DOMException
abort/timeout errors correctly (<a
href="1bd639515e">1bd6395</a>)</li>
<li><strong>client:</strong> use configured logger for SSE parse errors
(<a
href="80eeaf7b01">80eeaf7</a>)</li>
<li><strong>sessions:</strong> make event accumulator forward-compatible
with new event types (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/410">#410</a>)
(<a
href="2d084fdaeb">2d084fd</a>)</li>
<li><strong>tools:</strong> let read return a view_range of a file over
the size cap (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/427">#427</a>)
(<a
href="56b32601f6">56b3260</a>)</li>
<li><strong>uploads:</strong> default bare Blob filename on skills
endpoints (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/422">#422</a>)
(<a
href="e1116491dd">e111649</a>)</li>
<li><strong>webhooks:</strong> require headers to be passed to
<code>unwrap()</code> (<a
href="3230804e63">3230804</a>)</li>
</ul>
<h3>Chores</h3>
<ul>
<li><strong>internal:</strong> codegen related update (<a
href="c2f327a30d">c2f327a</a>)</li>
</ul>
<h3>Documentation</h3>
<ul>
<li><strong>api:</strong> clarify pagination on the organization
rate-limit list endpoints (<a
href="d6015b90b3">d6015b9</a>)</li>
<li>document TypeScript 5.0 as the minimum supported version (<a
href="788e721793">788e721</a>)</li>
</ul>
<h2>0.121.0 (2026-08-26)</h2>
<p>Full Changelog: <a
href="https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.120.0...sdk-v0.121.0">sdk-v0.120.0...sdk-v0.121.0</a></p>
<h3>Features</h3>
<ul>
<li><strong>api:</strong> add <code>updates</code> thinking display mode
(beta) (<a
href="22274eaf96">22274ea</a>)</li>
<li><strong>api:</strong> add missing anthropic-beta values (<a
href="0779f02666">0779f02</a>)</li>
<li><strong>api:</strong> add support for Organization API endpoints (<a
href="8b61e7a4d4">8b61e7a</a>)</li>
<li><strong>helpers:</strong> support Standard Schema for structured
outputs and tools (<a
href="788007889c">7880078</a>)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="7f3898c525"><code>7f3898c</code></a>
chore: release main</li>
<li><a
href="956ccb55b6"><code>956ccb5</code></a>
docs(api): clarify pagination on the organization rate-limit list
endpoints</li>
<li><a
href="2131d80a5e"><code>2131d80</code></a>
fix(tools): let read return a view_range of a file over the size cap (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/427">#427</a>)</li>
<li><a
href="f830c8f561"><code>f830c8f</code></a>
fix(aws,bedrock): prefer env credentials over AWS_PROFILE (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/436">#436</a>)</li>
<li><a
href="4d50ddfb4f"><code>4d50ddf</code></a>
test(ecosystem): expect cross-realm timeout errors to classify
correctly</li>
<li><a
href="acdd669d75"><code>acdd669</code></a>
fix(client): classify cross-realm DOMException abort/timeout errors
correctly</li>
<li><a
href="0a14622ea9"><code>0a14622</code></a>
test(tools): pin that read, edit and the memory tool preserve CRLF and
CR lin...</li>
<li><a
href="17035dea97"><code>17035de</code></a>
docs: document TypeScript 5.0 as the minimum supported version</li>
<li><a
href="2f95d8a6f7"><code>2f95d8a</code></a>
fix(client): use configured logger for SSE parse errors</li>
<li><a
href="33f5103009"><code>33f5103</code></a>
feat(api): beta files/skills namespaces use GA shapes; drop dated beta
header...</li>
<li>Additional commits viewable in <a
href="https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.120.0...sdk-v0.122.0">compare
view</a></li>
</ul>
</details>
<br />

Updates `@types/node` from 26.2.0 to 26.4.0
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node">compare
view</a></li>
</ul>
</details>
<br />

Updates `@typescript-eslint/eslint-plugin` from 8.67.0 to 8.68.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/releases">@​typescript-eslint/eslint-plugin's
releases</a>.</em></p>
<blockquote>
<h2>v8.68.0</h2>
<h2>8.68.0 (2026-08-24)</h2>
<h3>🚀 Features</h3>
<ul>
<li><strong>eslint-plugin:</strong> [strict-void-return] add fix
suggestions (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12086">#12086</a>)</li>
<li><strong>utils:</strong> support ESLint rule meta.languages (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12663">#12663</a>)</li>
</ul>
<h3>🩹 Fixes</h3>
<ul>
<li><strong>eslint-plugin:</strong> [unified-signatures] deduplicate
types in report (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12656">#12656</a>)</li>
<li><strong>eslint-plugin:</strong> [return-await] prevent autofix from
breaking code in arrow-functions (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12707">#12707</a>)</li>
<li><strong>eslint-plugin:</strong> [unified-signatures] report
identical signatures (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12678">#12678</a>)</li>
<li><strong>eslint-plugin:</strong> [no-unnecessary-type-assertion]
prevent stack overflow in recursive types (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12711">#12711</a>)</li>
<li><strong>eslint-plugin:</strong> [no-floating-promises] setting
<code>ignoreVoid: false</code> results in false negative in
ArrowFunctionExpression (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12646">#12646</a>)</li>
<li><strong>eslint-plugin:</strong> [no-empty-object-type] ignore
suggestions that result in invalid interfaces and export defaults (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12739">#12739</a>)</li>
<li><strong>website:</strong> playground crashes on <code>extends</code>
configs (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12608">#12608</a>)</li>
<li><strong>website:</strong> account for thanks.dev and out-of-band
donors in sponsors list (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12735">#12735</a>)</li>
</ul>
<h3>❤️ Thank You</h3>
<ul>
<li>Evyatar Daud <a
href="https://github.com/StyleShit"><code>@​StyleShit</code></a></li>
<li>Hugo <a
href="https://github.com/hugop95"><code>@​hugop95</code></a></li>
<li>Josh Goldberg ✨</li>
<li>Niki <a
href="https://github.com/phaux"><code>@​phaux</code></a></li>
<li>Thiago Barbosa</li>
<li>Younsang Na <a
href="https://github.com/nayounsang"><code>@​nayounsang</code></a></li>
</ul>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.68.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md">@​typescript-eslint/eslint-plugin's
changelog</a>.</em></p>
<blockquote>
<h2>8.68.0 (2026-08-24)</h2>
<h3>🚀 Features</h3>
<ul>
<li><strong>eslint-plugin:</strong> [strict-void-return] add fix
suggestions (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12086">#12086</a>)</li>
</ul>
<h3>🩹 Fixes</h3>
<ul>
<li><strong>eslint-plugin:</strong> [no-empty-object-type] ignore
suggestions that result in invalid interfaces and export defaults (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12739">#12739</a>)</li>
<li><strong>eslint-plugin:</strong> [no-floating-promises] setting
<code>ignoreVoid: false</code> results in false negative in
ArrowFunctionExpression (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12646">#12646</a>)</li>
<li><strong>eslint-plugin:</strong> [no-unnecessary-type-assertion]
prevent stack overflow in recursive types (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12711">#12711</a>)</li>
<li><strong>eslint-plugin:</strong> [unified-signatures] report
identical signatures (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12678">#12678</a>)</li>
<li><strong>eslint-plugin:</strong> [return-await] prevent autofix from
breaking code in arrow-functions (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12707">#12707</a>)</li>
<li><strong>eslint-plugin:</strong> [unified-signatures] deduplicate
types in report (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12656">#12656</a>)</li>
</ul>
<h3>❤️ Thank You</h3>
<ul>
<li>Evyatar Daud <a
href="https://github.com/StyleShit"><code>@​StyleShit</code></a></li>
<li>Hugo <a
href="https://github.com/hugop95"><code>@​hugop95</code></a></li>
<li>Niki <a
href="https://github.com/phaux"><code>@​phaux</code></a></li>
<li>Younsang Na <a
href="https://github.com/nayounsang"><code>@​nayounsang</code></a></li>
</ul>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.68.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8f4e00a4e8"><code>8f4e00a</code></a>
chore(release): publish 8.68.0</li>
<li><a
href="db30514e0f"><code>db30514</code></a>
feat(eslint-plugin): [strict-void-return] add fix suggestions (<a
href="https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin/issues/12086">#12086</a>)</li>
<li><a
href="9690339c4e"><code>9690339</code></a>
test(eslint-plugin): [prefer-optional-chain] use
<code>createRuleTesterWithTypes</code> ...</li>
<li><a
href="abe9011a43"><code>abe9011</code></a>
fix(eslint-plugin): [no-empty-object-type] ignore suggestions that
result in ...</li>
<li><a
href="79c16e7840"><code>79c16e7</code></a>
chore(eslint-plugin): extract FunctionSignature and enum comparison
utils (<a
href="https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin/issues/1">#1</a>...</li>
<li><a
href="2442e3048b"><code>2442e30</code></a>
test(eslint-plugin): [no-floating-promises] format test snippets (<a
href="https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin/issues/12723">#12723</a>)</li>
<li><a
href="3596323c63"><code>3596323</code></a>
fix(eslint-plugin): [no-floating-promises] setting <code>ignoreVoid:
false</code> result...</li>
<li><a
href="956a3397d9"><code>956a339</code></a>
fix(eslint-plugin): [no-unnecessary-type-assertion] prevent stack
overflow in...</li>
<li><a
href="55f6d5d4ca"><code>55f6d5d</code></a>
chore: enable source maps (<a
href="https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin/issues/12677">#12677</a>)</li>
<li><a
href="3aefb6a27d"><code>3aefb6a</code></a>
test: improve vitest performance with <code>isolate: false</code> (<a
href="https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin/issues/12703">#12703</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/typescript-eslint/typescript-eslint/commits/v8.68.0/packages/eslint-plugin">compare
view</a></li>
</ul>
</details>
<br />

Updates `@typescript-eslint/parser` from 8.67.0 to 8.68.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/releases">@​typescript-eslint/parser's
releases</a>.</em></p>
<blockquote>
<h2>v8.68.0</h2>
<h2>8.68.0 (2026-08-24)</h2>
<h3>🚀 Features</h3>
<ul>
<li><strong>eslint-plugin:</strong> [strict-void-return] add fix
suggestions (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12086">#12086</a>)</li>
<li><strong>utils:</strong> support ESLint rule meta.languages (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12663">#12663</a>)</li>
</ul>
<h3>🩹 Fixes</h3>
<ul>
<li><strong>eslint-plugin:</strong> [unified-signatures] deduplicate
types in report (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12656">#12656</a>)</li>
<li><strong>eslint-plugin:</strong> [return-await] prevent autofix from
breaking code in arrow-functions (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12707">#12707</a>)</li>
<li><strong>eslint-plugin:</strong> [unified-signatures] report
identical signatures (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12678">#12678</a>)</li>
<li><strong>eslint-plugin:</strong> [no-unnecessary-type-assertion]
prevent stack overflow in recursive types (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12711">#12711</a>)</li>
<li><strong>eslint-plugin:</strong> [no-floating-promises] setting
<code>ignoreVoid: false</code> results in false negative in
ArrowFunctionExpression (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12646">#12646</a>)</li>
<li><strong>eslint-plugin:</strong> [no-empty-object-type] ignore
suggestions that result in invalid interfaces and export defaults (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12739">#12739</a>)</li>
<li><strong>website:</strong> playground crashes on <code>extends</code>
configs (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12608">#12608</a>)</li>
<li><strong>website:</strong> account for thanks.dev and out-of-band
donors in sponsors list (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12735">#12735</a>)</li>
</ul>
<h3>❤️ Thank You</h3>
<ul>
<li>Evyatar Daud <a
href="https://github.com/StyleShit"><code>@​StyleShit</code></a></li>
<li>Hugo <a
href="https://github.com/hugop95"><code>@​hugop95</code></a></li>
<li>Josh Goldberg ✨</li>
<li>Niki <a
href="https://github.com/phaux"><code>@​phaux</code></a></li>
<li>Thiago Barbosa</li>
<li>Younsang Na <a
href="https://github.com/nayounsang"><code>@​nayounsang</code></a></li>
</ul>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.68.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md">@​typescript-eslint/parser's
changelog</a>.</em></p>
<blockquote>
<h2>8.68.0 (2026-08-24)</h2>
<p>This was a version bump only for parser to align it with other
projects, there were no code changes.</p>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.68.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website...

_Description has been truncated_

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2026-09-01 20:21:24 +02:00
acp-release-bot[bot]
889346fcf5 chore(main): release 0.71.0 (#1016)
🤖 I have created a release *beep* *boop*
---


##
[0.71.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.70.0...v0.71.0)
(2026-08-31)


### Features

* add ai generated session title
([#984](https://github.com/agentclientprotocol/claude-agent-acp/issues/984))
([d334766](d334766ef9))
* align Claude modes and clear-context planning
([#1004](https://github.com/agentclientprotocol/claude-agent-acp/issues/1004))
([996d488](996d488589))
* **deps:** Bump @anthropic-ai/claude-agent-sdk to 0.3.238
([#1018](https://github.com/agentclientprotocol/claude-agent-acp/issues/1018))
([ee9f300](ee9f300db4))
* expose native subagents and async tasks
([#1017](https://github.com/agentclientprotocol/claude-agent-acp/issues/1017))
([14d192d](14d192d108))
* expose permission mode kinds
([#1025](https://github.com/agentclientprotocol/claude-agent-acp/issues/1025))
([caf609b](caf609b56c))
* report per-model token usage on prompt responses
([#1037](https://github.com/agentclientprotocol/claude-agent-acp/issues/1037))
([fad4d10](fad4d10e46))
* support message-specific ACP session forks
([#1046](https://github.com/agentclientprotocol/claude-agent-acp/issues/1046))
([c3ff343](c3ff343884))


### Bug Fixes

* change min zod version to 4.x to avoid failing directory imports on
'v4'
([#1057](https://github.com/agentclientprotocol/claude-agent-acp/issues/1057))
([7c66108](7c6610835f))
* defer steering while user input is pending
([#1045](https://github.com/agentclientprotocol/claude-agent-acp/issues/1045))
([8710ce1](8710ce1cbc))

---
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-09-01 19:31:24 +02:00
Briliantov Vadim
0cbbaf33d9 fix(LLM-25012): OAuth2 Authentication for MCP Server Connections (#1059) 2026-09-01 17:31:21 +00:00
Andrey Bragin
7c6610835f fix: change min zod version to 4.x to avoid failing directory imports on 'v4' (#1057)
Currently, `package.json` allows zod version `3.x`. But
`agentclientprotocol/sdk` and our code use explicit `zod/v4` imports.
But `v4` became a proper ES module only in `4.x`. Before that, it was
just a directory. So if a user has zod 3.x, running this ACP server will
fail with `ERR_UNSUPPORTED_DIR_IMPORT`.
2026-08-31 14:11:17 +02:00
nikita-ashihmin
c3ff343884 feat: support message-specific ACP session forks (#1046)
## Summary

- keep the standard latest-turn ACP fork behavior
- accept an optional AIR fork point at `_meta.jetbrains.air.fork`
- translate the ACP `messageId` to the Claude transcript UUID
- use the current Agent SDK `forkSession(..., { upToMessageId })` API
- resume the new SDK session with the same working directory and
additional directories

No Agent SDK dependency update is required. Version `0.3.238` already
provides the required API.

## Tests

- `npm run build`
- `npm run lint`
- `env -u ANTHROPIC_BASE_URL npm run test:run` — 981 passed, 27 skipped
2026-08-28 10:33:14 +02:00
nikita-ashihmin
14d192d108 feat: expose native subagents and async tasks (#1017)
## Summary

- negotiate native ACP subagent sessions and AIR async task support
- map Claude Agent/Task lifecycle to independent child session streams
- publish background workflow, monitor, MCP, and backgrounded shell work
as async tasks
- attach background shell tasks to their originating tool calls so
clients can update one command card and open its output log
- stream task progress and preserve running, paused, completed, failed,
and stopped states
- keep synchronous shell work, generic tools, and task notifications out
of user message chunks
- preserve typed session failures and root permission/elicitation
requests
- preserve the legacy generic Agent/Task representation and flattened
transcript opt-ins for clients without native subagent capability

## Compatibility

The published ACP SDK does not yet contain PR #1992 types, so the change
isolates the temporary structural cast in `src/acp-subagents.ts`.
Clients that do not negotiate native subagent sessions retain the
existing generic tool-call fallback, including the historical
`_meta["subagent-transcript"]` capability and `forwardSubagentText`
session option. Async tasks use the negotiated `asyncTasks` AIR
capability and remain invisible to clients that do not advertise it.
Claude does not expose a safe targeted child-cancel primitive, therefore
child `cancel` and `close` capabilities remain disabled.

## Validation

- `npm run check`
- `npm run build`
- `env -u ANTHROPIC_BASE_URL npm run test:run` (830 passed, 20 skipped)
- `npm run test:run -- src/tests/async-tasks.test.ts` (5 passed)

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-27 14:11:13 +02:00
nikita-ashihmin
8710ce1cbc fix: defer steering while user input is pending (#1045)
## Problem

The ACP steering extension injects follow-up user messages into a
running Claude SDK turn. Until now, every injected message used priority
`now`. That is normally desirable because it makes Claude react
immediately, but `now` is interrupting delivery: the SDK aborts the
currently running cycle before processing the new message.

This becomes unsafe while the SDK is blocked in a user-input callback,
such as a permission request or elicitation. Interrupting that cycle
makes the SDK send `$/cancel_request` for the pending ACP request. The
client then removes the permission/elicitation card before the user can
answer it. Depending on timing, the original ACP prompt can remain
pending because the callback and interrupted cycle no longer complete
through their normal lifecycle.

The failure sequence was:

1. Claude requests permission or opens an elicitation.
2. The ACP client displays a user-input card and waits for an answer.
3. The user sends a steering message while that card is still open.
4. The adapter injects the message with priority `now`.
5. The Claude SDK interrupts the cycle and emits `$/cancel_request` for
the open card.
6. The card disappears, and the original prompt may be left waiting
indefinitely.

## Fix

Track the number of permission/elicitation requests currently awaiting
user input for each session. Steering now selects its internal SDK
delivery priority as follows:

- `later` while at least one user-input request is pending, so the
steering message is queued without interrupting or cancelling the open
request;
- `now` at all other times, preserving the existing immediate steering
behavior.

The state is a counter rather than a boolean because multiple background
subagents can have concurrent permission requests. The `finally` cleanup
keeps the count correct for accepted, declined, cancelled, aborted, and
failed requests.

All ACP-backed user-input paths are covered:

- regular tool permission requests;
- the built-in `AskUserQuestion` form elicitation;
- MCP form/URL elicitations;
- refusal-fallback user dialogs.

## Regression coverage

Added parameterized tests that hold each user-input path open, inject a
steering message, and verify that the SDK message uses priority `later`.
The existing steering regression test continues to verify priority `now`
when no user input is pending. The tests also verify that the
pending-user-input state is cleared after the request settles.

Fixes IJAI-1191.

## Validation

- `npm run check`
- `npm run build`
- `env -u ANTHROPIC_BASE_URL npm run test:run` — 975 passed, 27 skipped

`ANTHROPIC_BASE_URL` was removed only for the test command because the
Codex environment injects a local proxy URL, while four provider tests
intentionally assert the native `https://api.anthropic.com` default.
2026-08-26 13:57:22 +02:00
dnikolskaia-boop
fad4d10e46 feat: report per-model token usage on prompt responses (#1037)
Add per turn model usage in the same way as in codex-acp, so that we can
estimate in AI Assistant AI Credit consumption by agent.
2026-08-26 10:51:25 +00:00
nikita-ashihmin
caf609b56c feat: expose permission mode kinds (#1025)
## Summary

- expose semantic permission mode kinds through ACP mode metadata
- extract session mode policy and synchronization into a dedicated
manager
- cover mode initialization, selection, fallback, and permission
integration

## Tests

- `npm run check`
- `npm run build`
- `env -u ANTHROPIC_BASE_URL npm run test:run` (971 passed, 27 skipped)
2026-08-24 22:44:55 +04:00
nikita-ashihmin
996d488589 feat: align Claude modes and clear-context planning (#1004)
## Summary
- translate Claude SDK permission suggestions and tool-specific
decisions into ACP v1 presentation and editable option metadata
- align Claude session permission modes and clear-context plan handling
- split permission effects, modes, normalization, option construction,
presentation, and response handling into focused modules
- document the permission extension and add unit plus live-audit
coverage for native edge cases

## Tests
- `npm run check`
- `npm run build`
- `env -u ANTHROPIC_BASE_URL npm run test:run` (931 passed, 27 skipped)
2026-08-22 14:59:03 +04:00
dependabot[bot]
ee9f300db4 feat(deps): Bump @anthropic-ai/claude-agent-sdk to 0.3.238 (#1018)
Bumps the minor group with 6 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
|
[@anthropic-ai/claude-agent-sdk](https://github.com/anthropics/claude-agent-sdk-typescript)
| `0.3.232` | `0.3.233` |
| [@tsconfig/node22](https://github.com/tsconfig/bases/tree/HEAD/bases)
| `22.0.5` | `22.0.6` |
| [@hono/node-server](https://github.com/honojs/node-server) | `2.1.0` |
`2.1.1` |
| [@tsconfig/node10](https://github.com/tsconfig/bases/tree/HEAD/bases)
| `1.0.12` | `1.0.13` |
| [es-module-lexer](https://github.com/guybedford/es-module-lexer) |
`2.3.1` | `2.3.2` |
| [jose](https://github.com/panva/jose) | `6.2.8` | `6.2.9` |


Updates `@anthropic-ai/claude-agent-sdk` from 0.3.232 to 0.3.233
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/anthropics/claude-agent-sdk-typescript/releases">@​anthropic-ai/claude-agent-sdk's
releases</a>.</em></p>
<blockquote>
<h2>v0.3.233</h2>
<h2>What's changed</h2>
<ul>
<li>Notification hooks now fire for pending permission prompts on the
SDK path, matching the interactive REPL behavior</li>
<li>Todo/task-tracking tools
(<code>TaskCreate</code>/<code>TaskGet</code>/<code>TaskUpdate</code>/<code>TaskList</code>,
<code>TodoWrite</code>) are no longer in the default tool surface on
Opus 4.8, Sonnet 5, Fable 5, Mythos 5, and newer models; name them in
the <code>tools</code> option or reference them in
<code>allowedTools</code> (or set
<code>CLAUDE_CODE_ENABLE_TODO_TOOLS=1</code>) to keep them</li>
</ul>
<h2>Update</h2>
<pre lang="sh"><code>npm install @anthropic-ai/claude-agent-sdk@0.3.233
# or
yarn add @anthropic-ai/claude-agent-sdk@0.3.233
# or
pnpm add @anthropic-ai/claude-agent-sdk@0.3.233
# or
bun add @anthropic-ai/claude-agent-sdk@0.3.233
</code></pre>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/anthropics/claude-agent-sdk-typescript/blob/main/CHANGELOG.md">@​anthropic-ai/claude-agent-sdk's
changelog</a>.</em></p>
<blockquote>
<h2>0.3.233</h2>
<ul>
<li>Notification hooks now fire for pending permission prompts on the
SDK path, matching the interactive REPL behavior</li>
<li>Todo/task-tracking tools
(<code>TaskCreate</code>/<code>TaskGet</code>/<code>TaskUpdate</code>/<code>TaskList</code>,
<code>TodoWrite</code>) are no longer in the default tool surface on
Opus 4.8, Sonnet 5, Fable 5, Mythos 5, and newer models; name them in
the <code>tools</code> option or reference them in
<code>allowedTools</code> (or set
<code>CLAUDE_CODE_ENABLE_TODO_TOOLS=1</code>) to keep them</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="73a28abad0"><code>73a28ab</code></a>
chore: Update CHANGELOG.md</li>
<li>See full diff in <a
href="https://github.com/anthropics/claude-agent-sdk-typescript/compare/v0.3.232...v0.3.233">compare
view</a></li>
</ul>
</details>
<br />

Updates `@tsconfig/node22` from 22.0.5 to 22.0.6
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/tsconfig/bases/commits/HEAD/bases">compare
view</a></li>
</ul>
</details>
<br />

Updates `@anthropic-ai/claude-agent-sdk-darwin-arm64` from 0.3.232 to
0.3.233

Updates `@anthropic-ai/claude-agent-sdk-darwin-x64` from 0.3.232 to
0.3.233

Updates `@anthropic-ai/claude-agent-sdk-linux-arm64` from 0.3.232 to
0.3.233

Updates `@anthropic-ai/claude-agent-sdk-linux-arm64-musl` from 0.3.232
to 0.3.233

Updates `@anthropic-ai/claude-agent-sdk-linux-x64` from 0.3.232 to
0.3.233

Updates `@anthropic-ai/claude-agent-sdk-linux-x64-musl` from 0.3.232 to
0.3.233

Updates `@anthropic-ai/claude-agent-sdk-win32-arm64` from 0.3.232 to
0.3.233

Updates `@anthropic-ai/claude-agent-sdk-win32-x64` from 0.3.232 to
0.3.233

Updates `@hono/node-server` from 2.1.0 to 2.1.1
<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.1</h2>
<h2>What's Changed</h2>
<ul>
<li>perf: lazily materialize request headers by <a
href="https://github.com/BlankParticle"><code>@​BlankParticle</code></a>
in <a
href="https://redirect.github.com/honojs/node-server/pull/389">honojs/node-server#389</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/honojs/node-server/compare/v2.1.0...v2.1.1">https://github.com/honojs/node-server/compare/v2.1.0...v2.1.1</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="73c03adfb0"><code>73c03ad</code></a>
2.1.1</li>
<li><a
href="5515aa0a37"><code>5515aa0</code></a>
perf: lazily materialize request headers (<a
href="https://redirect.github.com/honojs/node-server/issues/389">#389</a>)</li>
<li>See full diff in <a
href="https://github.com/honojs/node-server/compare/v2.1.0...v2.1.1">compare
view</a></li>
</ul>
</details>
<br />

Updates `@tsconfig/node10` from 1.0.12 to 1.0.13
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/tsconfig/bases/commits/HEAD/bases">compare
view</a></li>
</ul>
</details>
<br />

Updates `es-module-lexer` from 2.3.1 to 2.3.2
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/guybedford/es-module-lexer/releases">es-module-lexer's
releases</a>.</em></p>
<blockquote>
<h2>2.3.2</h2>
<h2>What's Changed</h2>
<ul>
<li>perf(lexer): skip identifier and number runs by <a
href="https://github.com/BridgeAR"><code>@​BridgeAR</code></a> in <a
href="https://redirect.github.com/guybedford/es-module-lexer/pull/227">guybedford/es-module-lexer#227</a></li>
<li>fix: annotate asm.js integer return type by <a
href="https://github.com/Justineo"><code>@​Justineo</code></a> in <a
href="https://redirect.github.com/guybedford/es-module-lexer/pull/230">guybedford/es-module-lexer#230</a></li>
<li>Add side effects to package.json by <a
href="https://github.com/denisx"><code>@​denisx</code></a> in <a
href="https://redirect.github.com/guybedford/es-module-lexer/pull/183">guybedford/es-module-lexer#183</a></li>
<li>fix: forward the sourcename through the pre-init parse path by <a
href="https://github.com/hdimer"><code>@​hdimer</code></a> in <a
href="https://redirect.github.com/guybedford/es-module-lexer/pull/236">guybedford/es-module-lexer#236</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/Justineo"><code>@​Justineo</code></a>
made their first contribution in <a
href="https://redirect.github.com/guybedford/es-module-lexer/pull/230">guybedford/es-module-lexer#230</a></li>
<li><a href="https://github.com/denisx"><code>@​denisx</code></a> made
their first contribution in <a
href="https://redirect.github.com/guybedford/es-module-lexer/pull/183">guybedford/es-module-lexer#183</a></li>
<li><a href="https://github.com/hdimer"><code>@​hdimer</code></a> made
their first contribution in <a
href="https://redirect.github.com/guybedford/es-module-lexer/pull/236">guybedford/es-module-lexer#236</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/guybedford/es-module-lexer/compare/2.3.1...2.3.2">https://github.com/guybedford/es-module-lexer/compare/2.3.1...2.3.2</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="08ee1be867"><code>08ee1be</code></a>
fix: forward the sourcename through the pre-init parse path (<a
href="https://redirect.github.com/guybedford/es-module-lexer/issues/236">#236</a>)</li>
<li><a
href="5a824a13a6"><code>5a824a1</code></a>
Update package.json (<a
href="https://redirect.github.com/guybedford/es-module-lexer/issues/183">#183</a>)</li>
<li><a
href="8274d0331a"><code>8274d03</code></a>
fix: annotate asm.js integer return type (<a
href="https://redirect.github.com/guybedford/es-module-lexer/issues/230">#230</a>)</li>
<li><a
href="2abc49eafc"><code>2abc49e</code></a>
perf(lexer): skip identifier and number runs (<a
href="https://redirect.github.com/guybedford/es-module-lexer/issues/227">#227</a>)</li>
<li>See full diff in <a
href="https://github.com/guybedford/es-module-lexer/compare/2.3.1...2.3.2">compare
view</a></li>
</ul>
</details>
<br />

Updates `jose` from 6.2.8 to 6.2.9
<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.9</h2>
<h3>Fixes</h3>
<ul>
<li>reject a JWE whose generated Key Management Parameters collide (<a
href="6ed19a6a97">6ed19a6</a>)</li>
<li><strong>types:</strong> undeprecate PBES2 p2c parameter (<a
href="33bf832986">33bf832</a>)</li>
</ul>
</blockquote>
</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.8...v6.2.9">6.2.9</a>
(2026-08-15)</h2>
<h3>Fixes</h3>
<ul>
<li>reject a JWE whose generated Key Management Parameters collide (<a
href="6ed19a6a97">6ed19a6</a>)</li>
<li><strong>types:</strong> undeprecate PBES2 p2c parameter (<a
href="33bf832986">33bf832</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="f3a3c780b9"><code>f3a3c78</code></a>
chore(release): 6.2.9</li>
<li><a
href="33bf832986"><code>33bf832</code></a>
fix(types): undeprecate PBES2 p2c parameter</li>
<li><a
href="6ed19a6a97"><code>6ed19a6</code></a>
fix: reject a JWE whose generated Key Management Parameters collide</li>
<li><a
href="944840d167"><code>944840d</code></a>
ci: use shared release workflows</li>
<li><a
href="05bccf2399"><code>05bccf2</code></a>
chore: bump packages</li>
<li><a
href="f7392d1217"><code>f7392d1</code></a>
test: account for workerd nodejs_compat flag default changes</li>
<li><a
href="4e944be71e"><code>4e944be</code></a>
ci: drop the wait-for-npm machinery</li>
<li><a
href="4285b6f411"><code>4285b6f</code></a>
chore(deps-dev): bump undici</li>
<li><a
href="cb114ecde7"><code>cb114ec</code></a>
chore: cleanup after release</li>
<li>See full diff in <a
href="https://github.com/panva/jose/compare/v6.2.8...v6.2.9">compare
view</a></li>
</ul>
</details>
<br />


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

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

---

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

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


</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2026-08-20 23:55:54 +00:00
Andrey Bragin
d334766ef9 feat: add ai generated session title (#984)
Claude Code's automatic title generation never runs under the Agent SDK,
so `SDKSessionInfo.summary` degrades to the raw first prompt — meaning
we were publishing up to 256 characters of the user's opening message as
the session title.

This PR asks the SDK for a real title instead. On the first completed
turn we send the `generate_session_title` control request with the
trailing 1000 characters of the session's own user + assistant text,
fired in the background off the `idle` handler so turn-end never waits
on the ~2 s small-model call, and publish the result through the
existing `session_info_update`.

A title is generated once per session, and any title already in the
session file — a user `/rename` or one we generated earlier, which the
SDK folds into the same field — is adopted rather than
overwritten.`persist: true` writes it to the transcript, so
`session/list` and `session/load` show the same name.

The SDK method is undeclared in `sdk.d.ts`, so it's called behind a
`typeof` check and a `try/catch` that degrades to the previous
behaviour.
2026-08-19 17:25:52 +02:00
acp-release-bot[bot]
d0aafb1ca2 chore(main): release 0.70.0 (#1010)
🤖 I have created a release *beep* *boop*
---


##
[0.70.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.69.0...v0.70.0)
(2026-08-17)


### Features

* switch providers for loaded Claude sessions
([#1002](https://github.com/agentclientprotocol/claude-agent-acp/issues/1002))
([50a9543](50a95434e9))

---
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-18 15:15:59 +02:00
Sergey Shkredov
50a95434e9 feat: switch providers for loaded Claude sessions (#1002)
### Problem

Provider routing is captured when the Claude SDK `Query` is created. As
a result, `providers/set` and `providers/disable` updated newly created
sessions but an already loaded ACP session continued using its previous
backend.

User and project Claude settings could also override the ACP-selected
URL or credentials after the subprocess environment was assembled,
making the configured proxy ineffective.

### Solution

- Serialize provider changes and wait for submitted turns to settle.
- Close and recreate every loaded SDK query with the same Claude session
ID, cwd, MCP configuration, and ACP creation parameters.
- Block new/load/resume/prompt requests only while a provider update is
in progress.
- Apply the active ACP route in both the subprocess environment and
programmatic settings tier.
- Clear competing Anthropic, Bedrock, Vertex, OAuth, API-key, and
`apiKeyHelper` routing while an ACP override is active; preserve
unrelated settings.
- Restore native/environment routing when the provider is disabled.
- Add opt-in routing diagnostics through `CLAUDE_AGENT_LOGS` without
logging request content or secret headers.

### Tests

Added coverage for:

- native behavior when Providers API is unused;
- live recreation of loaded sessions;
- waiting for active turns;
- multiple loaded sessions across native → proxy A → proxy B → native;
- user settings precedence and preservation of unrelated settings;
- Anthropic, Bedrock, Vertex, legacy gateway auth, and logout behavior.

Verification:

- `npm test`: 789 passed, 20 skipped
- `npm run build`
- `npm run check`
- `git diff --check`

---------

Co-authored-by: Junie <junie@jetbrains.com>
2026-08-17 14:49:34 +02:00
acp-release-bot[bot]
59a7e9367b chore(main): release 0.69.0 (#1007)
🤖 I have created a release *beep* *boop*
---


##
[0.69.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.68.0...v0.69.0)
(2026-08-16)


### Features

* report changed files to AIR
([#1001](https://github.com/agentclientprotocol/claude-agent-acp/issues/1001))
([450d6b1](450d6b19dc))

---
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-16 11:18:05 +02:00
Sergey Ignatov
450d6b19dc feat: report changed files to AIR (#1001)
## Summary

- negotiate the opt-in AIR `_meta.jetbrains.air.agentFileChangeReport`
capability
- assign a unique `requestId` to each prompt and return canonical,
workspace-bounded changed paths in response metadata
- add a hidden Stop hook and an internal MCP reporting tool so Claude
can report files changed through shell commands, Git operations, and
generators

The audit is best-effort and is inactive unless the client advertises
the capability.

## Safety

- accept reports only for the active session and matching turn request
- canonicalize filesystem aliases, including `/tmp` to `/private/tmp` on
macOS
- reject paths outside the session working directory and deduplicate
valid paths

## Tests

- `npm run test:run`
- `npm run build`
- `npm run check`
2026-08-16 11:15:49 +02:00
acp-release-bot[bot]
5de5d4a2c8 chore(main): release 0.68.0 (#1000)
🤖 I have created a release *beep* *boop*
---


##
[0.68.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.67.0...v0.68.0)
(2026-08-14)


### Features

* align typed session failures with AIR protocol
([#992](https://github.com/agentclientprotocol/claude-agent-acp/issues/992))
([0581b9c](0581b9cf39))

---
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-14 17:32:04 +04:00
nikita-ashihmin
0581b9cf39 feat: align typed session failures with AIR protocol (#992)
## Summary

- align `_meta.jetbrains.air.sessionFailure` with AIR's
transcript-record protocol: `id`, `revision`, broad `category`, explicit
`severity`, `title`, optional `details`, and `actions`
- forward Claude's actual user-facing assistant/result text as `title`;
use adapter-authored fallback text only when Claude provides no message
(transport failure, worker EOF, or an internal invariant)
- reduce categories to `connection`, `access`, `limit`, `request`,
`service`, and `unknown`
- limit suggested actions to `retry`, `login`, and `new_session`
- update one transcript record through `id + revision`, keep resolved
entries in history, and remove clear/tombstone updates
- suppress duplicate assistant failure prose only for clients that
negotiated typed failures; preserve legacy ACP behavior otherwise
- restore synthetic usage-limit failures from session history with their
exact stored Claude text
- document negotiation, delivery carriers, identity/revision behavior,
mappings, recovery, and compatibility in the extension spec

## Validation

- `npm run check`
- `npm run build`
- `npm run test:run` — 777 passed, 26 skipped
- `git diff --check`

## Tracking

[IJAI-993](https://youtrack.jetbrains.com/issue/IJAI-993)
2026-08-14 17:29:39 +04:00
Sergey Shkredov
11dd73b871 Restore native provider state after overrides (#996)
### Summary
- expose one `main` provider slot because Anthropic, Bedrock, and Vertex
routing are mutually exclusive
- advertise all three supported API types on that slot and replace the
active configuration on each `providers/set`
- restore native Claude routing when the slot is disabled
- keep provider headers out of list responses and preserve per-protocol
validation

### Testing
- `npm run test:run` (767 passed, 20 skipped)
- `npm run build`
- `npm run check`

Co-authored-by: Junie <junie@jetbrains.com>
2026-08-14 10:13:38 +00:00
acp-release-bot[bot]
e4dba808ea chore(main): release 0.67.0 (#975)
🤖 I have created a release *beep* *boop*
---


##
[0.67.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.66.0...v0.67.0)
(2026-08-14)


### Features

* **deps:** Update to @anthropic-ai/claude-agent-sdk v0.3.232
([#993](https://github.com/agentclientprotocol/claude-agent-acp/issues/993))
([de0d0e2](de0d0e2b7d))
* expose typed session failures for AIR
([#979](https://github.com/agentclientprotocol/claude-agent-acp/issues/979))
([8157ee1](8157ee113e))
* publish the model fallback as a warning advisory
([#990](https://github.com/agentclientprotocol/claude-agent-acp/issues/990))
([35aaddb](35aaddb3d5))
* surface resolved model name in default model option description
([#982](https://github.com/agentclientprotocol/claude-agent-acp/issues/982))
([ec73cd8](ec73cd8560))
* surface Skill tool calls with name and kind in _meta
([#986](https://github.com/agentclientprotocol/claude-agent-acp/issues/986))
([1f09e9a](1f09e9a3ca))


### Bug Fixes

* preserve task plans across prompts
([#974](https://github.com/agentclientprotocol/claude-agent-acp/issues/974))
([1afa940](1afa940a2c))
* show a pending title while Claude prepares a file
([#978](https://github.com/agentclientprotocol/claude-agent-acp/issues/978))
([3df1ede](3df1ede89f))

---
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-14 00:40:45 +00:00
dependabot[bot]
de0d0e2b7d feat(deps): Update to @anthropic-ai/claude-agent-sdk v0.3.232 (#993)
Bumps the minor group with 12 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
|
[@anthropic-ai/claude-agent-sdk](https://github.com/anthropics/claude-agent-sdk-typescript)
| `0.3.220` | `0.3.226` |
|
[@anthropic-ai/sdk](https://github.com/anthropics/anthropic-sdk-typescript)
| `0.115.0` | `0.116.0` |
|
[@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node)
| `26.1.2` | `26.2.0` |
|
[@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin)
| `8.65.0` | `8.66.0` |
|
[@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser)
| `8.65.0` | `8.66.0` |
| [eslint](https://github.com/eslint/eslint) | `10.8.0` | `10.8.1` |
|
[express-rate-limit](https://github.com/express-rate-limit/express-rate-limit)
| `8.6.1` | `8.6.2` |
| [hono](https://github.com/honojs/hono) | `4.13.0` | `4.13.2` |
| [ip-address](https://github.com/beaugunderson/ip-address) | `10.4.0` |
`10.5.0` |
| [postcss](https://github.com/postcss/postcss) | `8.5.25` | `8.5.26` |
|
[rolldown](https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown)
| `1.2.2` | `1.2.4` |
| [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) |
`8.2.0` | `8.2.1` |


Updates `@anthropic-ai/claude-agent-sdk` from 0.3.220 to 0.3.226
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/anthropics/claude-agent-sdk-typescript/releases">@​anthropic-ai/claude-agent-sdk's
releases</a>.</em></p>
<blockquote>
<h2>v0.3.226</h2>
<h2>What's changed</h2>
<ul>
<li>Updated to parity with Claude Code v2.1.226</li>
</ul>
<h2>Update</h2>
<pre lang="sh"><code>npm install @anthropic-ai/claude-agent-sdk@0.3.226
# or
yarn add @anthropic-ai/claude-agent-sdk@0.3.226
# or
pnpm add @anthropic-ai/claude-agent-sdk@0.3.226
# or
bun add @anthropic-ai/claude-agent-sdk@0.3.226
</code></pre>
<h2>v0.3.225</h2>
<h2>What's changed</h2>
<ul>
<li>Fixed background subagents in headless/SDK sessions never resuming
when a background shell command or Monitor they left running completed,
so the subagent never saw the result</li>
</ul>
<h2>Update</h2>
<pre lang="sh"><code>npm install @anthropic-ai/claude-agent-sdk@0.3.225
# or
yarn add @anthropic-ai/claude-agent-sdk@0.3.225
# or
pnpm add @anthropic-ai/claude-agent-sdk@0.3.225
# or
bun add @anthropic-ai/claude-agent-sdk@0.3.225
</code></pre>
<h2>v0.3.224</h2>
<h2>What's changed</h2>
<ul>
<li>Added <code>crossSessionInbound</code> and <code>dialogExpiry</code>
settings: cross-session messages sent to a session running with bypassed
permissions are held for your approval, and messages to other sessions
auto-deliver</li>
<li>Added <code>subkind: 'peer-send-message'</code> to the
<code>task-notification</code> member of <code>SDKMessageOrigin</code>,
marking a notification raised by a cross-session
<code>SendMessage</code></li>
<li>Added <code>source: 'archive'</code> plugin config variant to
<code>Settings</code>, with <code>url</code> and optional
<code>sha256</code>, for installing plugins from a zip over HTTPS</li>
<li>Added sandbox credential-masking fields to <code>Settings</code>:
<code>decode: 'jwt'</code> with <code>maskClaims</code>,
<code>extract</code>/<code>onExtractNoMatch</code> on
<code>envVars</code>, and <code>awsPairs</code>/<code>sigv4</code> for
AWS SigV4 re-signing</li>
<li>Fixed long (&gt;200 char) project paths resolving to another
project's session directory under a shared sanitized prefix; session
list/get/rename/tag/fork/delete and <code>/resume</code> no longer cross
projects</li>
</ul>
<h2>Update</h2>
<pre lang="sh"><code>npm install @anthropic-ai/claude-agent-sdk@0.3.224
# or
yarn add @anthropic-ai/claude-agent-sdk@0.3.224
# or
&lt;/tr&gt;&lt;/table&gt; 
</code></pre>
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/anthropics/claude-agent-sdk-typescript/blob/main/CHANGELOG.md">@​anthropic-ai/claude-agent-sdk's
changelog</a>.</em></p>
<blockquote>
<h2>0.3.226</h2>
<ul>
<li>Updated to parity with Claude Code v2.1.226</li>
</ul>
<h2>0.3.225</h2>
<ul>
<li>Fixed background subagents in headless/SDK sessions never resuming
when a background shell command or Monitor they left running completed,
so the subagent never saw the result</li>
</ul>
<h2>0.3.224</h2>
<ul>
<li>Added <code>crossSessionInbound</code> and <code>dialogExpiry</code>
settings: cross-session messages sent to a session running with bypassed
permissions are held for your approval, and messages to other sessions
auto-deliver</li>
<li>Added <code>subkind: 'peer-send-message'</code> to the
<code>task-notification</code> member of <code>SDKMessageOrigin</code>,
marking a notification raised by a cross-session
<code>SendMessage</code></li>
<li>Added <code>source: 'archive'</code> plugin config variant to
<code>Settings</code>, with <code>url</code> and optional
<code>sha256</code>, for installing plugins from a zip over HTTPS</li>
<li>Added sandbox credential-masking fields to <code>Settings</code>:
<code>decode: 'jwt'</code> with <code>maskClaims</code>,
<code>extract</code>/<code>onExtractNoMatch</code> on
<code>envVars</code>, and <code>awsPairs</code>/<code>sigv4</code> for
AWS SigV4 re-signing</li>
<li>Fixed long (&gt;200 char) project paths resolving to another
project's session directory under a shared sanitized prefix; session
list/get/rename/tag/fork/delete and <code>/resume</code> no longer cross
projects</li>
</ul>
<h2>0.3.223</h2>
<ul>
<li>Added <code>resumeDropsTurn</code> option: with
<code>resumeSessionAt</code>, declares the turn a truncating resume
intends to drop; the CLI refuses the resume if anything else would be
discarded</li>
<li>Result messages for repeated 529 overload failures now include
<code>api_error_status: 529</code>, so SDK consumers can detect overload
terminations structurally instead of matching message text</li>
<li>Bare headless (<code>-p</code> / SDK <code>query()</code> without
<code>canUseTool</code>) now emits <code>system/permission_denied</code>
stream events when a tool call is auto-denied</li>
<li>Documented <code>usage</code> vs <code>modelUsage</code> on
stream-json results: <code>usage</code> is main-loop-only and per-turn;
<code>modelUsage</code> is cumulative, covers all query-pipeline calls,
and is the field for cost accounting</li>
</ul>
<h2>0.3.222</h2>
<ul>
<li>Fixed <code>query({ sessionStore, resume })</code> not carrying user
<code>settings.json</code> (<code>apiKeyHelper</code>, <code>env</code>,
<code>hooks</code>, <code>permissions</code>) into the resumed
subprocess</li>
</ul>
<h2>0.3.221</h2>
<ul>
<li>Improved <code>skills</code> option validation: malformed names
(delimiters or control characters) and wildcard-form names are rejected
with a clear error; use <code>skills: 'all'</code> to enable every
skill</li>
<li>Fixed external MCP servers passed via the <code>mcpServers</code>
option not being connected before the first turn, which caused the model
to emit tool calls as literal text</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="d13c50c54d"><code>d13c50c</code></a>
chore: Update CHANGELOG.md</li>
<li><a
href="4cae4b7634"><code>4cae4b7</code></a>
chore: Update CHANGELOG.md</li>
<li><a
href="86e3e9464e"><code>86e3e94</code></a>
chore: Update CHANGELOG.md</li>
<li><a
href="064793e6da"><code>064793e</code></a>
chore: Update CHANGELOG.md</li>
<li><a
href="6e143f440c"><code>6e143f4</code></a>
chore: Update CHANGELOG.md</li>
<li><a
href="31fbbfd403"><code>31fbbfd</code></a>
chore: Update CHANGELOG.md</li>
<li>See full diff in <a
href="https://github.com/anthropics/claude-agent-sdk-typescript/compare/v0.3.220...v0.3.226">compare
view</a></li>
</ul>
</details>
<br />

Updates `@anthropic-ai/sdk` from 0.115.0 to 0.116.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/anthropics/anthropic-sdk-typescript/releases">@​anthropic-ai/sdk's
releases</a>.</em></p>
<blockquote>
<h2>sdk: v0.116.0</h2>
<h2>0.116.0 (2026-08-07)</h2>
<p>Full Changelog: <a
href="https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.115.0...sdk-v0.116.0">sdk-v0.115.0...sdk-v0.116.0</a></p>
<h3>Features</h3>
<ul>
<li><strong>api:</strong> add
<code>mid-conversation-tool-changes-2026-07-01</code> beta (<a
href="70e04f689b">70e04f6</a>)</li>
<li><strong>api:</strong> add support for session budgets, advisor tool,
pinned inference location and skills auto-loading from GitHub (<a
href="1336a4a903">1336a4a</a>)</li>
<li><strong>tools:</strong> make bash timeout and abort errors matchable
by class (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/259">#259</a>)
(<a
href="201b12e8ac">201b12e</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li><strong>client:</strong> use hardcoded User-Agent strings instead of
constructor names (<a
href="0b97f04042">0b97f04</a>)</li>
</ul>
<h3>Chores</h3>
<ul>
<li><strong>api:</strong> remove retired Claude Opus 4.1 models (<a
href="11b685c66f">11b685c</a>)</li>
<li><strong>docs:</strong> small updates to descriptions (<a
href="413cc5f120">413cc5f</a>)</li>
<li><strong>docs:</strong> updates to a few documentation strings (<a
href="c38a1de5fc">c38a1de</a>)</li>
<li><strong>internal/deps:</strong> bump <code>@​babel/core</code> and
<code>@​babel/helpers</code> to 7.29.7 (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/261">#261</a>)
(<a
href="3164934680">3164934</a>)</li>
<li><strong>internal/deps:</strong> install tsc-multi from the npm
registry (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/265">#265</a>)
(<a
href="c787f9022c">c787f90</a>)</li>
<li><strong>internal:</strong> codegen related update (<a
href="73b3d61009">73b3d61</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/anthropics/anthropic-sdk-typescript/blob/main/CHANGELOG.md">@​anthropic-ai/sdk's
changelog</a>.</em></p>
<blockquote>
<h2>0.116.0 (2026-08-07)</h2>
<p>Full Changelog: <a
href="https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.115.0...sdk-v0.116.0">sdk-v0.115.0...sdk-v0.116.0</a></p>
<h3>Features</h3>
<ul>
<li><strong>api:</strong> add
<code>mid-conversation-tool-changes-2026-07-01</code> beta (<a
href="70e04f689b">70e04f6</a>)</li>
<li><strong>api:</strong> add support for session budgets, advisor tool,
pinned inference location and skills auto-loading from GitHub (<a
href="1336a4a903">1336a4a</a>)</li>
<li><strong>tools:</strong> make bash timeout and abort errors matchable
by class (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/259">#259</a>)
(<a
href="201b12e8ac">201b12e</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li><strong>client:</strong> use hardcoded User-Agent strings instead of
constructor names (<a
href="0b97f04042">0b97f04</a>)</li>
</ul>
<h3>Chores</h3>
<ul>
<li><strong>api:</strong> remove retired Claude Opus 4.1 models (<a
href="11b685c66f">11b685c</a>)</li>
<li><strong>docs:</strong> small updates to descriptions (<a
href="413cc5f120">413cc5f</a>)</li>
<li><strong>docs:</strong> updates to a few documentation strings (<a
href="c38a1de5fc">c38a1de</a>)</li>
<li><strong>internal/deps:</strong> bump <code>@​babel/core</code> and
<code>@​babel/helpers</code> to 7.29.7 (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/261">#261</a>)
(<a
href="3164934680">3164934</a>)</li>
<li><strong>internal/deps:</strong> install tsc-multi from the npm
registry (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/265">#265</a>)
(<a
href="c787f9022c">c787f90</a>)</li>
<li><strong>internal:</strong> codegen related update (<a
href="73b3d61009">73b3d61</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="ed02a89f5b"><code>ed02a89</code></a>
chore: release main</li>
<li><a
href="d72ff6a1c8"><code>d72ff6a</code></a>
feat(api): add support for session budgets, advisor tool, pinned
inference lo...</li>
<li><a
href="dbfed51cc3"><code>dbfed51</code></a>
chore(internal/deps): refresh provider package dev tooling to
mirror-availabl...</li>
<li><a
href="b7e95bfe0f"><code>b7e95bf</code></a>
chore(docs): updates to a few documentation strings</li>
<li><a
href="9efb7bd454"><code>9efb7bd</code></a>
chore(api): remove retired Claude Opus 4.1 models</li>
<li><a
href="342d422c7d"><code>342d422</code></a>
chore(internal/deps): install tsc-multi from the npm registry (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/265">#265</a>)</li>
<li><a
href="501955ca31"><code>501955c</code></a>
chore(internal/deps): bump <code>@​babel/core</code> and
<code>@​babel/helpers</code> to 7.29.7 (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/261">#261</a>)</li>
<li><a
href="6641c5e46f"><code>6641c5e</code></a>
feat(tools): make bash timeout and abort errors matchable by class (<a
href="https://redirect.github.com/anthropics/anthropic-sdk-typescript/issues/259">#259</a>)</li>
<li><a
href="e421c43ea6"><code>e421c43</code></a>
chore(docs): small updates to descriptions</li>
<li><a
href="c0a963eff5"><code>c0a963e</code></a>
feat(api): add <code>mid-conversation-tool-changes-2026-07-01</code>
beta</li>
<li>Additional commits viewable in <a
href="https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.115.0...sdk-v0.116.0">compare
view</a></li>
</ul>
</details>
<br />

Updates `@types/node` from 26.1.2 to 26.2.0
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node">compare
view</a></li>
</ul>
</details>
<br />

Updates `@typescript-eslint/eslint-plugin` from 8.65.0 to 8.66.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/releases">@​typescript-eslint/eslint-plugin's
releases</a>.</em></p>
<blockquote>
<h2>v8.66.0</h2>
<h2>8.66.0 (2026-08-03)</h2>
<h3>🚀 Features</h3>
<ul>
<li><strong>typescript-estree:</strong> handle import.defer() as
ImportExpression (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12609">#12609</a>)</li>
</ul>
<h3>🩹 Fixes</h3>
<ul>
<li><strong>eslint-plugin:</strong> [no-unnecessary-type-conversion]
ignore shadowed built-ins (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12590">#12590</a>)</li>
<li><strong>eslint-plugin:</strong> [prefer-nullish-coalescing] handle
shadowed Boolean calls (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12591">#12591</a>)</li>
<li><strong>eslint-plugin:</strong> [no-useless-default-assignment]
don't report defaults used by other overloads (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12607">#12607</a>)</li>
<li><strong>eslint-plugin:</strong> [no-unnecessary-type-parameters]
check MappedType key remapping (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12588">#12588</a>)</li>
<li><strong>eslint-plugin:</strong> [class-literal-property-style]
preserve type annotations and don't drop decorators (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12617">#12617</a>)</li>
<li><strong>website:</strong> list
<code>onUnsupportedTypeScriptVersion</code> in parser options (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12585">#12585</a>)</li>
</ul>
<h3>❤️ Thank You</h3>
<ul>
<li>Evyatar Daud <a
href="https://github.com/StyleShit"><code>@​StyleShit</code></a></li>
<li>Kirk Waiblinger <a
href="https://github.com/kirkwaiblinger"><code>@​kirkwaiblinger</code></a></li>
<li>Steffen Schroeder</li>
<li>송재욱</li>
</ul>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.66.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md">@​typescript-eslint/eslint-plugin's
changelog</a>.</em></p>
<blockquote>
<h2>8.66.0 (2026-08-03)</h2>
<h3>🩹 Fixes</h3>
<ul>
<li><strong>eslint-plugin:</strong> [class-literal-property-style]
preserve type annotations and don't drop decorators (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12617">#12617</a>)</li>
<li><strong>eslint-plugin:</strong> [no-unnecessary-type-parameters]
check MappedType key remapping (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12588">#12588</a>)</li>
<li><strong>eslint-plugin:</strong> [no-useless-default-assignment]
don't report defaults used by other overloads (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12607">#12607</a>)</li>
<li><strong>eslint-plugin:</strong> [prefer-nullish-coalescing] handle
shadowed Boolean calls (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12591">#12591</a>)</li>
<li><strong>eslint-plugin:</strong> [no-unnecessary-type-conversion]
ignore shadowed built-ins (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12590">#12590</a>)</li>
</ul>
<h3>❤️ Thank You</h3>
<ul>
<li>Evyatar Daud <a
href="https://github.com/StyleShit"><code>@​StyleShit</code></a></li>
<li>송재욱</li>
</ul>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.66.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="e51b11ba3a"><code>e51b11b</code></a>
chore(release): publish 8.66.0</li>
<li><a
href="20cb15e6db"><code>20cb15e</code></a>
chore(eslint-plugin): split prefer-optional-chain.test.ts in multiple
files (...</li>
<li><a
href="780a8c52d5"><code>780a8c5</code></a>
docs(eslint-plugin): [member-ordering] add lacking commas in default
member t...</li>
<li><a
href="08dd427202"><code>08dd427</code></a>
fix(eslint-plugin): [class-literal-property-style] preserve type
annotations ...</li>
<li><a
href="6be25d3b45"><code>6be25d3</code></a>
fix(eslint-plugin): [no-unnecessary-type-parameters] check MappedType
key rem...</li>
<li><a
href="8826d0ebf7"><code>8826d0e</code></a>
fix(eslint-plugin): [no-useless-default-assignment] don't report
defaults use...</li>
<li><a
href="7aecc1c44e"><code>7aecc1c</code></a>
fix(eslint-plugin): [prefer-nullish-coalescing] handle shadowed Boolean
calls...</li>
<li><a
href="5ffa76049a"><code>5ffa760</code></a>
fix(eslint-plugin): [no-unnecessary-type-conversion] ignore shadowed
built-in...</li>
<li><a
href="f282f84df6"><code>f282f84</code></a>
chore(eslint-plugin): fix all
<code>eslint-plugin/require-test-error-positions</code> (#...</li>
<li><a
href="c8cafa4ae9"><code>c8cafa4</code></a>
docs: [unified-signatures] caveats regarding signatures merging (<a
href="https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin/issues/12581">#12581</a>)</li>
<li>See full diff in <a
href="https://github.com/typescript-eslint/typescript-eslint/commits/v8.66.0/packages/eslint-plugin">compare
view</a></li>
</ul>
</details>
<br />

Updates `@typescript-eslint/parser` from 8.65.0 to 8.66.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/releases">@​typescript-eslint/parser's
releases</a>.</em></p>
<blockquote>
<h2>v8.66.0</h2>
<h2>8.66.0 (2026-08-03)</h2>
<h3>🚀 Features</h3>
<ul>
<li><strong>typescript-estree:</strong> handle import.defer() as
ImportExpression (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12609">#12609</a>)</li>
</ul>
<h3>🩹 Fixes</h3>
<ul>
<li><strong>eslint-plugin:</strong> [no-unnecessary-type-conversion]
ignore shadowed built-ins (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12590">#12590</a>)</li>
<li><strong>eslint-plugin:</strong> [prefer-nullish-coalescing] handle
shadowed Boolean calls (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12591">#12591</a>)</li>
<li><strong>eslint-plugin:</strong> [no-useless-default-assignment]
don't report defaults used by other overloads (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12607">#12607</a>)</li>
<li><strong>eslint-plugin:</strong> [no-unnecessary-type-parameters]
check MappedType key remapping (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12588">#12588</a>)</li>
<li><strong>eslint-plugin:</strong> [class-literal-property-style]
preserve type annotations and don't drop decorators (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12617">#12617</a>)</li>
<li><strong>website:</strong> list
<code>onUnsupportedTypeScriptVersion</code> in parser options (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12585">#12585</a>)</li>
</ul>
<h3>❤️ Thank You</h3>
<ul>
<li>Evyatar Daud <a
href="https://github.com/StyleShit"><code>@​StyleShit</code></a></li>
<li>Kirk Waiblinger <a
href="https://github.com/kirkwaiblinger"><code>@​kirkwaiblinger</code></a></li>
<li>Steffen Schroeder</li>
<li>송재욱</li>
</ul>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.66.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md">@​typescript-eslint/parser's
changelog</a>.</em></p>
<blockquote>
<h2>8.66.0 (2026-08-03)</h2>
<p>This was a version bump only for parser to align it with other
projects, there were no code changes.</p>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.66.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="e51b11ba3a"><code>e51b11b</code></a>
chore(release): publish 8.66.0</li>
<li>See full diff in <a
href="https://github.com/typescript-eslint/typescript-eslint/commits/v8.66.0/packages/parser">compare
view</a></li>
</ul>
</details>
<br />

Updates `eslint` from 10.8.0 to 10.8.1
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/eslint/eslint/releases">eslint's
releases</a>.</em></p>
<blockquote>
<h2>v10.8.1</h2>
<h2>Bug Fixes</h2>
<ul>
<li><a
href="18eb0a7e78"><code>18eb0a7</code></a>
fix: prevent ASI hazard in <code>no-unused-labels</code> autofix (<a
href="https://redirect.github.com/eslint/eslint/issues/21173">#21173</a>)
(dongkyu lee)</li>
<li><a
href="151ba3f583"><code>151ba3f</code></a>
fix: false positives in <code>getter-return</code> and
<code>accessor-pairs</code> (<a
href="https://redirect.github.com/eslint/eslint/issues/21163">#21163</a>)
(Grit)</li>
<li><a
href="6898df9364"><code>6898df9</code></a>
fix: ignore meta-property names in <code>id-denylist</code> (<a
href="https://redirect.github.com/eslint/eslint/issues/21166">#21166</a>)
(Pixel)</li>
<li><a
href="4d7db6628e"><code>4d7db66</code></a>
fix: ignore meta-property names in <code>id-match</code> (<a
href="https://redirect.github.com/eslint/eslint/issues/21167">#21167</a>)
(Pixel)</li>
<li><a
href="677214e7ee"><code>677214e</code></a>
fix: handle ASI hazards in no-unused-vars removeVar suggestion (<a
href="https://redirect.github.com/eslint/eslint/issues/20935">#20935</a>)
(kuldeep kumar)</li>
</ul>
<h2>Documentation</h2>
<ul>
<li><a
href="7d0cbf81cf"><code>7d0cbf8</code></a>
docs: Update README (GitHub Actions Bot)</li>
<li><a
href="0a05812adb"><code>0a05812</code></a>
docs: add missing backticks to <code>no-duplicate-imports.js</code> (<a
href="https://redirect.github.com/eslint/eslint/issues/21183">#21183</a>)
(Lee Daeun)</li>
<li><a
href="678c90b55d"><code>678c90b</code></a>
docs: Update README (GitHub Actions Bot)</li>
<li><a
href="8a104242e8"><code>8a10424</code></a>
docs: Update README (GitHub Actions Bot)</li>
<li><a
href="69bb948061"><code>69bb948</code></a>
docs: Update README (GitHub Actions Bot)</li>
</ul>
<h2>Chores</h2>
<ul>
<li><a
href="0a14800505"><code>0a14800</code></a>
chore: update github/codeql-action action to v4.37.4 (<a
href="https://redirect.github.com/eslint/eslint/issues/21196">#21196</a>)
(renovate[bot])</li>
<li><a
href="05adcb1354"><code>05adcb1</code></a>
test: fix failing ecosystem test for <code>eslint-plugin-unicorn</code>
(<a
href="https://redirect.github.com/eslint/eslint/issues/21191">#21191</a>)
(Lazizbek Ergashev)</li>
<li><a
href="5611035665"><code>5611035</code></a>
test: add error locations info to <code>no-void</code> (<a
href="https://redirect.github.com/eslint/eslint/issues/21185">#21185</a>)
(Lee Daeun)</li>
<li><a
href="ee47333aa6"><code>ee47333</code></a>
ci: bump github/codeql-action from 4 to 4.37.3 (<a
href="https://redirect.github.com/eslint/eslint/issues/21176">#21176</a>)
(dependabot[bot])</li>
<li><a
href="f131c034ad"><code>f131c03</code></a>
chore: improve ecosystem test failure reporting (<a
href="https://redirect.github.com/eslint/eslint/issues/20937">#20937</a>)
(crimsonjay0)</li>
<li><a
href="1f6eddee60"><code>1f6edde</code></a>
chore: update ecosystem plugins (<a
href="https://redirect.github.com/eslint/eslint/issues/21182">#21182</a>)
(ESLint Bot)</li>
<li><a
href="d3266fb26c"><code>d3266fb</code></a>
chore: unpin <code>webpack</code> dependency (<a
href="https://redirect.github.com/eslint/eslint/issues/21172">#21172</a>)
(Francesco Trotta)</li>
<li><a
href="65a6519cc8"><code>65a6519</code></a>
chore: add allowScripts field to package.json (<a
href="https://redirect.github.com/eslint/eslint/issues/21092">#21092</a>)
(GiHoon Noh)</li>
<li><a
href="22e5256853"><code>22e5256</code></a>
ci: add <code>triage:no</code> label to Dependabot PRs (<a
href="https://redirect.github.com/eslint/eslint/issues/21141">#21141</a>)
(lumir)</li>
<li><a
href="55c9038836"><code>55c9038</code></a>
ci: bump actions/labeler from 6 to 7 (<a
href="https://redirect.github.com/eslint/eslint/issues/21159">#21159</a>)
(dependabot[bot])</li>
<li><a
href="7280e78183"><code>7280e78</code></a>
chore: update dependency prettier to v3.9.6 (<a
href="https://redirect.github.com/eslint/eslint/issues/21162">#21162</a>)
(renovate[bot])</li>
<li><a
href="eddbad6015"><code>eddbad6</code></a>
test: fix failing ecosystem test for <code>eslint-plugin-unicorn</code>
(<a
href="https://redirect.github.com/eslint/eslint/issues/21156">#21156</a>)
(Francesco Trotta)</li>
<li><a
href="60a178d5ef"><code>60a178d</code></a>
chore: update ecosystem plugins (<a
href="https://redirect.github.com/eslint/eslint/issues/21150">#21150</a>)
(ESLint Bot)</li>
<li><a
href="f9f61dc611"><code>f9f61dc</code></a>
test: add error locations to <code>no-unreachable</code> (<a
href="https://redirect.github.com/eslint/eslint/issues/21151">#21151</a>)
(JIYEON)</li>
<li><a
href="d08629382b"><code>d086293</code></a>
test: add error locations to <code>no-undef</code> (<a
href="https://redirect.github.com/eslint/eslint/issues/21147">#21147</a>)
(JIYEON)</li>
<li><a
href="cc01b67061"><code>cc01b67</code></a>
test: add error locations to <code>no-useless-catch</code> (<a
href="https://redirect.github.com/eslint/eslint/issues/21144">#21144</a>)
(devoil)</li>
<li><a
href="688e75ede0"><code>688e75e</code></a>
chore: add missing backticks in JSDoc (<a
href="https://redirect.github.com/eslint/eslint/issues/21143">#21143</a>)
(Bo Hyun Kim)</li>
<li><a
href="7c1e17543a"><code>7c1e175</code></a>
test: add error locations to <code>require-await</code> (<a
href="https://redirect.github.com/eslint/eslint/issues/21145">#21145</a>)
(Grit)</li>
<li><a
href="588a26ddce"><code>588a26d</code></a>
test: add error locations to <code>no-extra-label</code> (<a
href="https://redirect.github.com/eslint/eslint/issues/21139">#21139</a>)
(dongkyu lee)</li>
<li><a
href="059aa89574"><code>059aa89</code></a>
test: add error locations to <code>no-useless-concat</code> (<a
href="https://redirect.github.com/eslint/eslint/issues/21140">#21140</a>)
(dongkyu lee)</li>
<li><a
href="5a452a8ba5"><code>5a452a8</code></a>
test: add error locations to <code>no-const-assign</code> (<a
href="https://redirect.github.com/eslint/eslint/issues/21138">#21138</a>)
(dongkyu lee)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="c049dc3c42"><code>c049dc3</code></a>
10.8.1</li>
<li><a
href="a3f7826941"><code>a3f7826</code></a>
Build: changelog update for 10.8.1</li>
<li><a
href="18eb0a7e78"><code>18eb0a7</code></a>
fix: prevent ASI hazard in <code>no-unused-labels</code> autofix (<a
href="https://redirect.github.com/eslint/eslint/issues/21173">#21173</a>)</li>
<li><a
href="0a14800505"><code>0a14800</code></a>
chore: update github/codeql-action action to v4.37.4 (<a
href="https://redirect.github.com/eslint/eslint/issues/21196">#21196</a>)</li>
<li><a
href="7d0cbf81cf"><code>7d0cbf8</code></a>
docs: Update README</li>
<li><a
href="05adcb1354"><code>05adcb1</code></a>
test: fix failing ecosystem test for <code>eslint-plugin-unicorn</code>
(<a
href="https://redirect.github.com/eslint/eslint/issues/21191">#21191</a>)</li>
<li><a
href="5611035665"><code>5611035</code></a>
test: add error locations info to <code>no-void</code> (<a
href="https://redirect.github.com/eslint/eslint/issues/21185">#21185</a>)</li>
<li><a
href="ee47333aa6"><code>ee47333</code></a>
ci: bump github/codeql-action from 4 to 4.37.3 (<a
href="https://redirect.github.com/eslint/eslint/issues/21176">#21176</a>)</li>
<li><a
href="f131c034ad"><code>f131c03</code></a>
chore: improve ecosystem test failure reporting (<a
href="https://redirect.github.com/eslint/eslint/issues/20937">#20937</a>)</li>
<li><a
href="0a05812adb"><code>0a05812</code></a>
docs: add missing backticks to <code>no-duplicate-imports.js</code> (<a
href="https://redirect.github.com/eslint/eslint/issues/21183">#21183</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/eslint/eslint/compare/v10.8.0...v10.8.1">compare
view</a></li>
</ul>
</details>
<br />

Updates `@anthropic-ai/claude-agent-sdk-darwin-arm64` from 0.3.220 to
0.3.226

Updates `@anthropic-ai/claude-agent-sdk-darwin-x64` from 0.3.220 to
0.3.226

Updates `@anthropic-ai/claude-agent-sdk-linux-arm64` from 0.3.220 to
0.3.226

Updates `@anthropic-ai/claude-agent-sdk-linux-arm64-musl` from 0.3.220
to 0.3.226

Updates `@anthropic-ai/claude-agent-sdk-linux-x64` from 0.3.220 to
0.3.226

Updates `@anthropic-ai/claude-agent-sdk-linux-x64-musl` from 0.3.220 to
0.3.226

Updates `@anthropic-ai/claude-agent-sdk-win32-arm64` from 0.3.220 to
0.3.226

Updates `@anthropic-ai/claude-agent-sdk-win32-x64` from 0.3.220 to
0.3.226

Updates `@typescript-eslint/project-service` from 8.65.0 to 8.66.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/releases">@​typescript-eslint/project-service's
releases</a>.</em></p>
<blockquote>
<h2>v8.66.0</h2>
<h2>8.66.0 (2026-08-03)</h2>
<h3>🚀 Features</h3>
<ul>
<li><strong>typescript-estree:</strong> handle import.defer() as
ImportExpression (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12609">#12609</a>)</li>
</ul>
<h3>🩹 Fixes</h3>
<ul>
<li><strong>eslint-plugin:</strong> [no-unnecessary-type-conversion]
ignore shadowed built-ins (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12590">#12590</a>)</li>
<li><strong>eslint-plugin:</strong> [prefer-nullish-coalescing] handle
shadowed Boolean calls (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12591">#12591</a>)</li>
<li><strong>eslint-plugin:</strong> [no-useless-default-assignment]
don't report defaults used by other overloads (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12607">#12607</a>)</li>
<li><strong>eslint-plugin:</strong> [no-unnecessary-type-parameters]
check MappedType key remapping (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12588">#12588</a>)</li>
<li><strong>eslint-plugin:</strong> [class-literal-property-style]
preserve type annotations and don't drop decorators (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12617">#12617</a>)</li>
<li><strong>website:</strong> list
<code>onUnsupportedTypeScriptVersion</code> in parser options (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12585">#12585</a>)</li>
</ul>
<h3>❤️ Thank You</h3>
<ul>
<li>Evyatar Daud <a
href="https://github.com/StyleShit"><code>@​StyleShit</code></a></li>
<li>Kirk Waiblinger <a
href="https://github.com/kirkwaiblinger"><code>@​kirkwaiblinger</code></a></li>
<li>Steffen Schroeder</li>
<li>송재욱</li>
</ul>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.66.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/project-service/CHANGELOG.md">@​typescript-eslint/project-service's
changelog</a>.</em></p>
<blockquote>
<h2>8.66.0 (2026-08-03)</h2>
<p>This was a version bump only for project-service to align it with
other projects, there were no code changes.</p>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.66.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="e51b11ba3a"><code>e51b11b</code></a>
chore(release): publish 8.66.0</li>
<li>See full diff in <a
href="https://github.com/typescript-eslint/typescript-eslint/commits/v8.66.0/packages/project-service">compare
view</a></li>
</ul>
</details>
<br />

Updates `@typescript-eslint/scope-manager` from 8.65.0 to 8.66.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/releases">@​typescript-eslint/scope-manager's
releases</a>.</em></p>
<blockquote>
<h2>v8.66.0</h2>
<h2>8.66.0 (2026-08-03)</h2>
<h3>🚀 Features</h3>
<ul>
<li><strong>typescript-estree:</strong> handle import.defer() as
ImportExpression (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12609">#12609</a>)</li>
</ul>
<h3>🩹 Fixes</h3>
<ul>
<li><strong>eslint-plugin:</strong> [no-unnecessary-type-conversion]
ignore shadowed built-ins (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12590">#12590</a>)</li>
<li><strong>eslint-plugin:</strong> [prefer-nullish-coalescing] handle
shadowed Boolean calls (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12591">#12591</a>)</li>
<li><strong>eslint-plugin:</strong> [no-useless-default-assignment]
don't report defaults used by other overloads (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12607">#12607</a>)</li>
<li><strong>eslint-plugin:</strong> [no-unnecessary-type-parameters]
check MappedType key remapping (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12588">#12588</a>)</li>
<li><strong>eslint-plugin:</strong> [class-literal-property-style]
preserve type annotations and don't drop decorators (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12617">#12617</a>)</li>
<li><strong>website:</strong> list
<code>onUnsupportedTypeScriptVersion</code> in parser options (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12585">#12585</a>)</li>
</ul>
<h3>❤️ Thank You</h3>
<ul>
<li>Evyatar Daud <a
href="https://github.com/StyleShit"><code>@​StyleShit</code></a></li>
<li>Kirk Waiblinger <a
href="https://github.com/kirkwaiblinger"><code>@​kirkwaiblinger</code></a></li>
<li>Steffen Schroeder</li>
<li>송재욱</li>
</ul>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.66.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/scope-manager/CHANGELOG.md">@​typescript-eslint/scope-manager's
changelog</a>.</em></p>
<blockquote>
<h2>8.66.0 (2026-08-03)</h2>
<p>This was a version bump only for scope-manager to align it with other
projects, there were no code changes.</p>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.66.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="e51b11ba3a"><code>e51b11b</code></a>
chore(release): publish 8.66.0</li>
<li><a
href="0c94e088e9"><code>0c94e08</code></a>
chore: add CI check to ensure snapshots dirs don't have stale files (<a
href="https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/scope-manager/issues/12623">#12623</a>)</li>
<li>See full diff in <a
href="https://github.com/typescript-eslint/typescript-eslint/commits/v8.66.0/packages/scope-manager">compare
view</a></li>
</ul>
</details>
<br />

Updates `@typescript-eslint/tsconfig-utils` from 8.65.0 to 8.66.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/releases">@​typescript-eslint/tsconfig-utils's
releases</a>.</em></p>
<blockquote>
<h2>v8.66.0</h2>
<h2>8.66.0 (2026-08-03)</h2>
<h3>🚀 Features</h3>
<ul>
<li><strong>typescript-estree:</strong> handle import.defer() as
ImportExpression (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12609">#12609</a>)</li>
</ul>
<h3>🩹 Fixes</h3>
<ul>
<li><strong>eslint-plugin:</strong> [no-unnecessary-type-conversion]
ignore shadowed built-ins (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12590">#12590</a>)</li>
<li><strong>eslint-plugin:</strong> [prefer-nullish-coalescing] handle
shadowed Boolean calls (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12591">#12591</a>)</li>
<li><strong>eslint-plugin:</strong> [no-useless-default-assignment]
don't report defaults used by other overloads (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12607">#12607</a>)</li>
<li><strong>eslint-plugin:</strong> [no-unnecessary-type-parameters]
check MappedType key remapping (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12588">#12588</a>)</li>
<li><strong>eslint-plugin:</strong> [class-literal-property-style]
preserve type annotations and don't drop decorators (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12617">#12617</a>)</li>
<li><strong>website:</strong> list
<code>onUnsupportedTypeScriptVersion</code> in parser options (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12585">#12585</a>)</li>
</ul>
<h3>❤️ Thank You</h3>
<ul>
<li>Evyatar Daud <a
href="https://github.com/StyleShit"><code>@​StyleShit</code></a></li>
<li>Kirk Waiblinger <a
href="https://github.com/kirkwaiblinger"><code>@​kirkwaiblinger</code></a></li>
<li>Steffen Schroeder</li>
<li>송재욱</li>
</ul>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.66.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/tsconfig-utils/CHANGELOG.md">@​typescript-eslint/tsconfig-utils's
changelog</a>.</em></p>
<blockquote>
<h2>8.66.0 (2026-08-03)</h2>
<p>This was a version bump only for tsconfig-utils to align it with
other projects, there were no code changes.</p>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.66.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="e51b11ba3a"><code>e51b11b</code></a>
chore(release): publish 8.66.0</li>
<li>See full diff in <a
href="https://github.com/typescript-eslint/typescript-eslint/commits/v8.66.0/packages/tsconfig-utils">compare
view</a></li>
</ul>
</details>
<br />

Updates `@typescript-eslint/type-utils` from 8.65.0 to 8.66.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/releases">@​typescript-eslint/type-utils's
releases</a>.</em></p>
<blockquote>
<h2>v8.66.0</h2>
<h2>8.66.0 (2026-08-03)</h2>
<h3>🚀 Features</h3>
<ul>
<li><strong>typescript-estree:</strong> handle import.defer() as
ImportExpression (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12609">#12609</a>)</li>
</ul>
<h3>🩹 Fixes</h3>
<ul>
<li><strong>eslint-plugin:</strong> [no-unnecessary-type-conversion]
ignore shadowed built-ins (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12590">#12590</a>)</li>
<li><strong>eslint-plugin:</strong> [prefer-nullish-coalescing] handle
shadowed Boolean calls (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12591">#12591</a>)</li>
<li><strong>eslint-plugin:</strong> [no-useless-default-assignment]
don't report defaults used by other overloads (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12607">#12607</a>)</li>
<li><strong>eslint-plugin:</strong> [no-unnecessary-type-parameters]
check MappedType key remapping (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12588">#12588</a>)</li>
<li><strong>eslint-plugin:</strong> [class-literal-property-style]
preserve type annotations and don't drop decorators (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12617">#12617</a>)</li>
<li><strong>website:</strong> list
<code>onUnsupportedTypeScriptVersion</code> in parser options (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12585">#12585</a>)</li>
</ul>
<h3>❤️ Thank You</h3>
<ul>
<li>Evyatar Daud <a
href="https://github.com/StyleShit"><code>@​StyleShit</code></a></li>
<li>Kirk Waiblinger <a
href="https://github.com/kirkwaiblinger"><code>@​kirkwaiblinger</code></a></li>
<li>Steffen Schroeder</li>
<li>송재욱</li>
</ul>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.66.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/type-utils/CHANGELOG.md">@​typescript-eslint/type-utils's
changelog</a>.</em></p>
<blockquote>
<h2>8.66.0 (2026-08-03)</h2>
<p>This was a version bump only for type-utils to align it with other
projects, there were no code changes.</p>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.66.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="e51b11ba3a"><code>e51b11b</code></a>
chore(release): publish 8.66.0</li>
<li>See full diff in <a
href="https://github.com/typescript-eslint/typescript-eslint/commits/v8.66.0/packages/type-utils">compare
view</a></li>
</ul>
</details>
<br />

Updates `@typescript-eslint/types` from 8.65.0 to 8.66.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/releases">@​typescript-eslint/types's
releases</a>.</em></p>
<blockquote>
<h2>v8.66.0</h2>
<h2>8.66.0 (2026-08-03)</h2>
<h3>🚀 Features</h3>
<ul>
<li><strong>typescript-estree:</strong> handle import.defer() as
ImportExpression (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12609">#12609</a>)</li>
</ul>
<h3>🩹 Fixes</h3>
<ul>
<li><strong>eslint-plugin:</strong> [no-unnecessary-type-conversion]
ignore shadowed built-ins (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12590">#12590</a>)</li>
<li><strong>eslint-plugin:</strong> [prefer-nullish-coalescing] handle
shadowed Boolean calls (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12591">#12591</a>)</li>
<li><strong>eslint-plugin:</strong> [no-useless-default-assignment]
don't report defaults used by other overloads (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12607">#12607</a>)</li>
<li><strong>eslint-plugin:</strong> [no-unnecessary-type-parameters]
check MappedType key remapping (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12588">#12588</a>)</li>
<li><strong>eslint-plugin:</strong> [class-literal-property-style]
preserve type annotations and don't drop decorators (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12617">#12617</a>)</li>
<li><strong>website:</strong> list
<code>onUnsupportedTypeScriptVersion</code> in parser options (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12585">#12585</a>)</li>
</ul>
<h3>❤️ Thank You</h3>
<ul>
<li>Evyatar Daud <a
href="https://github.com/StyleShit"><code>@​StyleShit</code></a></li>
<li>Kirk Waiblinger <a
href="https://github.com/kirkwaiblinger"><code>@​kirkwaiblinger</code></a></li>
<li>Steffen Schroeder</li>
<li>송재욱</li>
</ul>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.66.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/types/CHANGELOG.md">@​typescript-eslint/types's
changelog</a>.</em></p>
<blockquote>
<h2>8.66.0 (2026-08-03)</h2>
<p>This was a version bump only for types to align it with other
projects, there were no code changes.</p>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.66.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="e51b11ba3a"><code>e51b11b</code></a>
chore(release): publish 8.66.0</li>
<li><a
href="918411c1b6"><code>918411c</code></a>
chore(types): fix <code>build</code> nx task inputs (<a
href="https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/types/issues/12634">#12634</a>)</li>
<li>See full diff in <a
href="https://github.com/typescript-eslint/typescript-eslint/commits/v8.66.0/packages/types">compare
view</a></li>
</ul>
</details>
<br />

Updates `@typescript-eslint/typescript-estree` from 8.65.0 to 8.66.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/releases">@​typescript-eslint/typescript-estree's
releases</a>.</em></p>
<blockquote>
<h2>v8.66.0</h2>
<h2>8.66.0 (2026-08-03)</h2>
<h3>🚀 Features</h3>
<ul>
<li><strong>typescript-estree:</strong> handle import.defer() as
ImportExpression (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12609">#12609</a>)</li>
</ul>
<h3>🩹 Fixes</h3>
<ul>
<li><strong>eslint-plugin:</strong> [no-unnecessary-type-conversion]
ignore shadowed built-ins (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12590">#12590</a>)</li>
<li><strong>eslint-plugin:</strong> [prefer-nullish-coalescing] handle
shadowed Boolean calls (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12591">#12591</a>)</li>
<li><strong>eslint-plugin:</strong> [no-useless-default-assignment]
don't report defaults used by other overloads (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12607">#12607</a>)</li>
<li><strong>eslint-plugin:</strong> [no-unnecessary-type-parameters]
check MappedType key remapping (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12588">#12588</a>)</li>
<li><strong>eslint-plugin:</strong> [class-literal-property-style]
preserve type annotations and don't drop decorators (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12617">#12617</a>)</li>
<li><strong>website:</strong> list
<code>onUnsupportedTypeScriptVersion</code> in parser options (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12585">#12585</a>)</li>
</ul>
<h3>❤️ Thank You</h3>
<ul>
<li>Evyatar Daud <a
href="https://github.com/StyleShit"><code>@​StyleShit</code></a></li>
<li>Kirk Waiblinger <a
href="https://github.com/kirkwaiblinger"><code>@​kirkwaiblinger</code></a></li>
<li>Steffen Schroeder</li>
<li>송재욱</li>
</ul>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.66.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-estree/CHANGELOG.md">@​typescript-eslint/typescript-estree's
changelog</a>.</em></p>
<blockquote>
<h2>8.66.0 (2026-08-03)</h2>
<h3>🚀 Features</h3>
<ul>
<li><strong>typescript-estree:</strong> handle import.defer() as
ImportExpression (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12609">#12609</a>)</li>
</ul>
<h3>❤️ Thank You</h3>
<ul>
<li>Evyatar Daud <a
href="https://github.com/StyleShit"><code>@​StyleShit</code></a></li>
<li>Kirk Waiblinger <a
href="https://github.com/kirkwaiblinger"><code>@​kirkwaiblinger</code></a></li>
</ul>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.66.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="e51b11ba3a"><code>e51b11b</code></a>
chore(release): publish 8.66.0</li>
<li><a
href="e88c943f01"><code>e88c943</code></a>
feat(typescript-estree): handle import.defer() as ImportExpression (<a
href="https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-estree/issues/12609">#12609</a>)</li>
<li>See full diff in <a
href="https://github.com/typescript-eslint/typescript-eslint/commits/v8.66.0/packages/typescript-estree">compare
view</a></li>
</ul>
</details>
<br />

Updates `@typescript-eslint/utils` from 8.65.0 to 8.66.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/releases">@​typescript-eslint/utils's
releases</a>.</em></p>
<blockquote>
<h2>v8.66.0</h2>
<h2>8.66.0 (2026-08-03)</h2>
<h3>🚀 Features</h3>
<ul>
<li><strong>typescript-estree:</strong> handle import.defer() as
ImportExpression (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12609">#12609</a>)</li>
</ul>
<h3>🩹 Fixes</h3>
<ul>
<li><strong>eslint-plugin:</strong> [no-unnecessary-type-conversion]
ignore shadowed built-ins (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12590">#12590</a>)</li>
<li><strong>eslint-plugin:</strong> [prefer-nullish-coalescing] handle
shadowed Boolean calls (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12591">#12591</a>)</li>
<li><strong>eslint-plugin:</strong> [no-useless-default-assignment]
don't report defaults used by other overloads (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12607">#12607</a>)</li>
<li><strong>eslint-plugin:</strong> [no-unnecessary-type-parameters]
check MappedType key remapping (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12588">#12588</a>)</li>
<li><strong>eslint-plugin:</strong> [class-literal-property-style]
preserve type annotations and don't drop decorators (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12617">#12617</a>)</li>
<li><strong>website:</strong> list
<code>onUnsupportedTypeScriptVersion</code> in parser options (<a
href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12585">#12585</a>)</li>
</ul>
<h3>❤️ Thank You</h3>
<ul>
<li>Evyatar Daud <a
href="https://github.com/StyleShit"><code>@​StyleShit</code></a></li>
<li>Kirk Waiblinger <a
href="https://github.com/kirkwaiblinger"><code>@​kirkwaiblinger</code></a></li>
<li>Steffen Schroeder</li>
<li>송재욱</li>
</ul>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.66.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/utils/CHANGELOG.md">@​typescript-eslint/utils's
changelog</a>.</em></p>
<blockquote>
<h2>8.66.0 (2026-08-03)</h2>
<p>This was a version bump only for utils to align it with other
projects, there were no code changes.</p>
<p>See <a
href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.66.0">GitHub
Releases</a> for more information.</p>
<p>You can read about our <a
href="https://typescript-eslint.io/users/versioning">versioning
strategy</a> and <a
href="https://typescript-eslint.io/users/releases">releases</a> on our
website.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="e51b11ba3a"><code>e51b11b</code></a>
chore(release): publish 8.66.0</li>
<li>See full diff in <a
href="https://github.com/typescript-eslint/typescript-eslint/commits/v8.66.0/packages/utils">compare
view</a></li>
</ul>
</details>
<br />

Updates `@typescript-eslint/visitor-keys` from 8.65.0 to 8.66.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/typescript-eslint/typescript-eslint/releases">@​typescript-eslint/visitor-keys's
releases</a>.</em></p>
<blockquote>
<h2>v8.66.0</h2>
<h2>8.66.0 (2026-08-03)</h2>
<h3>🚀 Features</h3>
<ul>
<...

_Description has been truncated_

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2026-08-14 02:39:32 +02:00
nikita-ashihmin
35aaddb3d5 feat: publish the model fallback as a warning advisory (#990)
## Problem

When the API refuses a turn, the SDK retries on the fallback model and
makes the swap persistent for the session. We flag that with a
transcript line:

```ts
text: `**Model fallback:** ${message.original_model} declined this request${category}; retried with ${message.fallback_model}. ${outcome}${explanation}`,
```

It goes out as an `agent_message_chunk`, so the client cannot tell a
session-level advisory from something the model actually said — the bold
label is the only severity signal available, and it is just characters
inside the assistant's own text.

The comment above that code already states the stakes: *"Without a
notice the user just sees regenerated output."* The notice matters; the
channel it uses does not fit it.

## Change

Routes it through the AIR typed session-failure extension instead, as a
new `advisory` category:

- `severity?: "error" | "warning"` on the record. **Optional, and absent
means `error`**, so a client that predates this keeps treating every
record it receives as a failure.
- The advisory carries its own wording (`safeMessage`) rather than the
canned per-category message, so the client renders the explanation
verbatim in a warning banner.
- **Clients that did not negotiate the `sessionFailure` capability keep
the exact transcript line they get today.**

### Advisories are not turn failures

Two existing behaviours would have mangled them, so both are now
guarded:

- `createSessionFailure` clears every other active record when a new one
is published. An advisory no longer does that, and is no longer cleared
by one — otherwise a model-fallback notice would erase an actionable
error, or vice versa.
- `clearFailuresFromEarlierTurns` clears everything whose `turnId` is
not the active turn. Advisories carry no `turnId`, so without the guard
every turn boundary would sweep them away.

They therefore live under their own `:notice:` id namespace,
session-scoped, one slot, newest wins.

## Scoped out

`**Fast mode turned off:**` (`syncFastMode…`) is the same pattern and
deserves the same treatment, but it sits in a class method while the
failure machinery is closure-scoped inside `prompt()`. Lifting that out
is a separate change rather than something to smuggle into this one.

## Tests

`npm run build`, `npm run check`, and `npm run test:run` (**766
passed**) are clean.

The existing `model_refusal_fallback` tests still assert the `**Model
fallback:**` transcript line and still pass — they never call
`initialize`, so they exercise the no-capability path, which is exactly
the backward-compatibility guarantee.

One test added for the typed path, asserting that the advisory is
published with `severity: "warning"`, that its `safeMessage` carries the
real model ids and refusal category, that it uses the `:notice:` id
namespace, that it contains no `**` markdown lead-in, and that the
transcript line is **not** also emitted.

Client side: IJAI-993.
2026-08-12 22:16:28 +04:00
nikita-ashihmin
1f09e9a3ca feat: surface Skill tool calls with name and kind in _meta (#986)
## Summary

- Add `skill?: string` to `ToolUpdateMeta.claudeCode`, populated from
`toolUse.input.skill` in `claudeCodeMetaFromToolUse`. Lets ACP clients
detect skill invocations from structured metadata rather than parsing
the title string.
- Add `case "Skill":` to `toolInfoFromToolUse`: sets `title` to `"Load
skill: <name>"` and returns empty content — readable fallback for
clients that don't read `_meta`.
- Add `case "Skill":` to `toolUpdateFromToolResult`: returns `{}` to
suppress the raw `"Launching skill: <name>"` result text, matching the
pattern used for `Edit`/`Write`.

## Motivation

Without this, the Skill tool falls through to the `default` case and
renders as a generic `kind: "other"` block with title `"Skill"` and an
expand control showing the raw result text. With this change, clients
that read `_meta.claudeCode.skill` can render the block with the
appropriate icon, the skill name, and no expand control.

## Test plan

- [ ] Invoke a skill (e.g. `/commits`) and confirm
`_meta.claudeCode.skill` is present in the emitted `tool_call` update
- [ ] Confirm title is `"Load skill: commits"` in the ACP event stream
- [ ] Confirm no content is emitted for the skill tool result
2026-08-12 14:51:31 +04:00
nikita-ashihmin
ec73cd8560 feat: surface resolved model name in default model option description (#982)
## Summary

- When the SDK's `"default"` model entry carries a `resolvedModel` (e.g.
`"claude-sonnet-5"`), `buildConfigOptions` now sets the option's
`description` to the human-readable `displayName` of the matching named
model (e.g. `"Claude Sonnet 5"`)
- Falls back to the raw `resolvedModel` string if no named entry shares
that resolved ID
- No behaviour change when `resolvedModel` is absent

This lets ACP clients show the actual model behind "Default" — e.g.
"Default (Claude Sonnet 5)" — instead of just "Default (recommended)".

## Test plan

- [ ] `buildConfigOptions model option resolved description > sets
description to the named model's displayName when resolvedModel matches`
- [ ] `buildConfigOptions model option resolved description > falls back
to resolvedModel itself when no named model shares it`
- [ ] `buildConfigOptions model option resolved description > leaves
description undefined when default model has no resolvedModel`
- [ ] All 753 existing tests still pass

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

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-11 13:21:42 +04:00
nikita-ashihmin
8157ee113e feat: expose typed session failures for AIR (#979)
## Summary

- Negotiate the JetBrains AIR `sessionFailure` extension when the client
advertises an integer version `>= 1` and the capability name.
- Return turn-terminal failures only on `PromptResponse._meta`; publish
idle and asynchronous session health failures through `session/update`.
- Preserve legacy ACP behavior for clients that do not negotiate the
extension.
- Emit bounded fixed safe messages without SDK/provider details, paths,
credentials, or stack traces.

## Recovery contract

Failures use `_meta.jetbrains.air.sessionFailure` with a stable id,
monotonic revision, phase, category, source, safe message, retryability,
and optional real turn attribution. Session-scoped ids include a
consumer epoch, so replayed tombstones from a dead consumer cannot
suppress failures after restart. Stale consumers cannot publish into a
replacement session.

AIR owns localized action presentation. Claude supplies typed category
and retryability facts. Billing maps to quota exhaustion, max-output
limits map to context exhaustion, and the irreversibly closed Claude
Query reports non-retryable `transport_lost` so AIR offers New Session.

A held-open turn keeps its already recorded successful `PromptResponse`,
while worker shutdown or transport death also emits a separate
session-scoped health failure without `turnId`; the next prompt is
proven to fail because the Query is closed. Worker-shutdown remains
armed through buffered trailing frames and is classified only when EOF
proves the live tail.

## Validation

- 750 passed, 25 skipped.
- Build passed.
- ESLint passed.
- Changed files pass Prettier; the repository-wide check is blocked only
by an unrelated untracked local proposal file.
- Tests cover negotiation, taxonomy, sanitization, terminal/asynchronous
carrier separation, stale consumers, worker replay/live-tail behavior,
held turns, process/transport failure, restart-safe ids, clear
revisions, and capability-off behavior.
2026-08-10 14:15:44 +04:00
nikita-ashihmin
3df1ede89f fix: show a pending title while Claude prepares a file (#978)
## Summary

- show `Preparing file…` instead of the bare `Write` title while
streamed input has no `file_path`
- refine the same tool call to `Write <display path>` as soon as the
path is available
- cover both partial-field refinement and
complete-input/consolidated-message delivery

## Tests

- `npm run lint`
- `npx prettier --check src/tools.ts src/tests/acp-agent.test.ts`
- `npm run build`
- `npm run test:run` — 716 passed, 25 skipped

YouTrack: https://youtrack.jetbrains.com/issue/IJAI-841
2026-08-09 22:07:58 +04:00
nikita-ashihmin
1afa940a2c fix: preserve task plans across prompts (#974)
## Summary

- republish unfinished Task* plan snapshots when a follow-up prompt
starts
- avoid resurfacing fully completed historical plans on unrelated
prompts
- clear stale task state when Claude starts a fresh conversation
- reconcile task state from authoritative TaskList results after resume
or history compaction
- consume structured Task* outputs during live sessions and parse Claude
Code textual output when replaying history
- reject logically failed TaskUpdate results instead of persisting the
requested mutation
- keep scanning structured tool output past unrelated JSON blocks
- use Claude activeForm for in-progress TodoWrite and Task* entries

This keeps ACP clients from losing an unfinished task list at prompt
boundaries, restores state when incremental history is unavailable, and
prevents plans from leaking across conversation resets.

## Tests

- npm run test:run (713 passed, 20 skipped)
- npm run check
- npm run build
- git diff --check
2026-08-08 14:23:28 +04:00
acp-release-bot[bot]
6b405138fc chore(main): release 0.66.0 (#961)
🤖 I have created a release *beep* *boop*
---


##
[0.66.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.65.0...v0.66.0)
(2026-08-07)


### Features

* **deps-dev:** Bump globals from 17.8.0 to 17.9.0 in the minor group
([#960](https://github.com/agentclientprotocol/claude-agent-acp/issues/960))
([7f27c47](7f27c47c5c))
* expose provider-neutral ACP goal extension
([#964](https://github.com/agentclientprotocol/claude-agent-acp/issues/964))
([8b31dea](8b31dea11b))


### Bug Fixes

* publish and replace Claude goals reliably
([#967](https://github.com/agentclientprotocol/claude-agent-acp/issues/967))
([f8fd3ab](f8fd3ab822))

---
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-07 15:22:06 +02:00
Mark Tkachenko
8aaf608b4e ci: fix release flow (#971) 2026-08-07 15:16:50 +02:00
nikita-ashihmin
f8fd3ab822 fix: publish and replace Claude goals reliably (#967)
## Summary

- publish optimistic provider-neutral goal snapshots for submitted and
steered goal commands
- advertise and implement `set`, using steering for an active turn and
an ordinary prompt while idle
- suppress stale old-goal runtime updates while replacement/clear is
pending and roll back failed commands
- keep cancellation turn-scoped and orphan-account pending steers so
stale results cannot settle the next prompt
- reject unsupported pause/resume controls without host-side fallbacks

## Validation

- `npm test -- --run` (702 passed, 20 skipped)
- `npm run check`
- `npm run build`
- regression coverage for idle/active set and clear, stale runtime
updates, command failure rollback, cancellation, and stale steer
isolation
2026-08-07 17:01:18 +04:00
Mark Tkachenko
133337ffe5 ci: simplify the release flow and make it agent-friendly (#965) 2026-08-07 13:46:42 +02:00
nikita-ashihmin
8b31dea11b feat: expose provider-neutral ACP goal extension (#964)
## Summary

- advertise a provider-neutral goal extension in
`InitializeResponse._meta.goal`
- map Claude SDK `active_goal` messages to
`session_info_update._meta.goal`
- expose the shared `_session/goal` control method with the truthfully
supported `clear` action
- document the extension as a candidate shape for a future first-class
ACP goal API

## Architecture

A goal is persistent **session state**, not the lifecycle of one
`session/prompt` request. `goal.status === "active"` says that the
objective may drive more work; it does not say that a prompt is
executing now.

This keeps two independent axes:

1. **Goal state** is published asynchronously as session metadata and
may survive multiple prompt turns.
2. **Prompt activity** follows the backend's actual running/quiescent
boundaries. While a turn runs, clients use advertised steering or prompt
queueing. Once the backend is quiescent, an ordinary `session/prompt` is
valid even if the goal remains active.

The metadata is deliberately provider-neutral:

```json
{
  "_meta": {
    "goal": {
      "version": 1,
      "controlMethod": "_session/goal",
      "actions": ["clear"]
    }
  }
}
```

State is emitted as `session_info_update._meta.goal`; `null` clears it.
The common snapshot vocabulary supports `objective`, common statuses,
timestamps in Unix milliseconds, budgets/usage, iteration count, and a
continuation reason. Each implementation emits only fields it actually
knows. This shape is intentionally close to a future typed ACP
capability/update so promotion out of `_meta` would not require a
provider-specific migration.

Control actions are capability-negotiated. The shared vocabulary
reserves `set`, `pause`, `resume`, and `clear`, but an agent advertises
only the subset it can implement with correct semantics.

## Claude mapping

The Claude runtime already emits internal `active_goal` messages,
although that message is not currently included in the public
`SDKMessage` union. The adapter handles it before the exhaustive switch:

- `condition` → `objective`
- `iterations` → `iterations`
- `set_at` → `createdAt`
- `last_reason` → `lastReason`
- `value: null` → `goal: null`

Provider bookkeeping such as `tokens_at_start` is intentionally not
exposed. Goal updates do not settle, extend, or otherwise mutate ACP
prompt lifecycle. Claude's existing Stop hook remains authoritative for
whether the backend itself continues working.

Only `clear` is advertised for out-of-band control. It submits `/goal
clear` through the existing session prompt queue, preserving the
adapter's established ordering and turn ownership. Setting a goal
remains available through `/goal <condition>` but is not advertised as a
control action because it starts the long-running Stop-hook workflow.

The companion Codex implementation is agentclientprotocol/codex-acp#371.

## Verification

- `npm run test:run` — 692 passed, 20 skipped
- `npm run build`
- `npm run check`
2026-08-06 17:01:56 +04:00
Mark Tkachenko
bba912728f ci: validate PR titles against release-please conventions (#962) 2026-08-05 19:03:29 +02:00
dependabot[bot]
7f27c47c5c feat(deps-dev): Bump globals from 17.8.0 to 17.9.0 in the minor group (#960)
Bumps the minor group with 1 update:
[globals](https://github.com/sindresorhus/globals).

Updates `globals` from 17.8.0 to 17.9.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/sindresorhus/globals/releases">globals's
releases</a>.</em></p>
<blockquote>
<h2>v17.9.0</h2>
<ul>
<li>Update globals (2026-08-01) (<a
href="https://redirect.github.com/sindresorhus/globals/issues/348">#348</a>)
5a958ed</li>
</ul>
<hr />
<p><a
href="https://github.com/sindresorhus/globals/compare/v17.8.0...v17.9.0">https://github.com/sindresorhus/globals/compare/v17.8.0...v17.9.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8e7b9358b1"><code>8e7b935</code></a>
17.9.0</li>
<li><a
href="5a958ed060"><code>5a958ed</code></a>
Update globals (2026-08-01) (<a
href="https://redirect.github.com/sindresorhus/globals/issues/348">#348</a>)</li>
<li>See full diff in <a
href="https://github.com/sindresorhus/globals/compare/v17.8.0...v17.9.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=globals&package-manager=npm_and_yarn&previous-version=17.8.0&new-version=17.9.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 16:46:45 +00:00
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
214 changed files with 49820 additions and 5814 deletions

2
.gitattributes vendored Normal file
View File

@@ -0,0 +1,2 @@
src/tests/acp-scenarios/__snapshots__/** linguist-generated=true
src/tests/acp-scenarios/origin-main/** linguist-generated=true

48
.github/workflows/conventional-prs.yml vendored Normal file
View File

@@ -0,0 +1,48 @@
name: Conventional PRs
# Squash merges use the PR title as the commit subject, which is what
# release-please parses to compute the next version and CHANGELOG entry.
on:
pull_request:
branches: [main]
# labeled/unlabeled so validation re-runs when `dependencies` is applied.
types: [opened, reopened, edited, synchronize, labeled, unlabeled]
permissions: {}
concurrency:
group: "conventional-prs-${{ github.event.pull_request.number }}"
cancel-in-progress: true
jobs:
validate:
name: Validate PR title
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
pull-requests: read
steps:
# Config reference: https://github.com/amannn/action-semantic-pull-request#configuration
- uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Exactly the types release-please understands. feat/fix/perf/revert/docs
# appear in the changelog; the rest are valid but hidden. Any other type
# would be dropped silently, so it is rejected here instead.
types: |
feat
fix
perf
revert
docs
style
chore
refactor
test
build
ci
# Dependabot titles itself conventionally already; don't block bot PRs.
ignoreLabels: |
dependencies

View File

@@ -3,9 +3,29 @@ on:
push:
branches:
- main
workflow_dispatch:
inputs:
channel:
description: Which channel to publish
required: true
default: stable
type: choice
options:
- stable
- preview
ref:
description: Tag or commit to publish
required: true
type: string
publish_npm:
description: Publish the package before updating the registry (stable only)
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:
@@ -27,7 +47,11 @@ jobs:
id: release
with:
token: ${{ steps.generate-token.outputs.token }}
release-type: node
# Do not add release-type here. The action ignores config-file whenever
# release-type is set, which silently disables the pre-1.0 versioning
# rules in release-please-config.json and lets a breaking change jump
# straight to 1.0.0. The node release type is declared in that config
# instead, so nothing is lost by leaving this out.
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
outputs:
@@ -38,13 +62,17 @@ 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.channel == 'stable' && inputs.publish_npm) || needs.release-please.outputs.release_created == 'true') }}
environment: release # Optional: for enhanced security
permissions:
contents: read
id-token: write
outputs:
version: ${{ steps.publish.outputs.version }}
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:
@@ -52,14 +80,179 @@ jobs:
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm run build
- run: npm publish
- name: Publish
id: publish
run: |
version="$(node -p "require('./package.json').version")"
npm publish
echo "version=$version" >> "$GITHUB_OUTPUT"
# Same shape as publish-npm. Tagging is a separate job, so nothing here needs
# write access to the repository.
publish-npm-preview:
name: Publish preview to npm
runs-on: ubuntu-latest
# Every push to main gets a preview without waiting for CI or release-please,
# except release-please's own release merge, which publishes a stable version.
# Check the commit author and the generated release subject to avoid publishing
# the same tree twice; either match is enough to skip the preview.
if: >-
${{
(github.event_name == 'workflow_dispatch' && inputs.channel == 'preview') ||
(github.event_name == 'push'
&& github.event.head_commit.author.name != 'acp-release-bot[bot]'
&& !startsWith(github.event.head_commit.message, 'chore(main): release '))
}}
# Same environment as the stable job, so the npm trusted-publisher binding holds.
# It carries no required reviewers, so previews never wait for an approval.
environment: release
permissions:
contents: read
id-token: write # npm OIDC trusted publishing
timeout-minutes: 15
# Serialise previews so two pushes cannot read the same registry state and compute
# the same -preview.N. Job-level rather than workflow-level: a workflow-level group
# would also serialise release-please, and cancelling a queued release-please run
# means a release PR that silently stops updating. The trade-off is that GitHub
# keeps only one run pending per group, so a third push landing while one preview
# runs and another waits drops the waiting one — that commit gets no preview, but a
# version is never reused.
concurrency:
group: publish-npm-preview
cancel-in-progress: false
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
# Publish the exact pushed commit, or the explicitly requested manual ref.
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || github.sha }}
# Brings the tags the version calculation reads as its floor. The repo is a
# few megabytes packed, so a full fetch is cheap and sidesteps every
# shallow-clone tag caveat.
fetch-depth: 0
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020
with:
node-version: "lts/*"
registry-url: "https://registry.npmjs.org"
# Ahead of the version bump, so this still validates the committed lockfile.
- run: npm ci
- name: Compute the preview version
id: preview
run: |
version="$(node scripts/next-preview-version.mjs)"
sha="$(git rev-parse HEAD)"
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "sha=$sha" >> "$GITHUB_OUTPUT"
echo "Preview \`$version\` from \`$sha\`" >> "$GITHUB_STEP_SUMMARY"
- name: Apply the version to the working tree only
# Never committed: package.json and .release-please-manifest.json on main stay
# release-please's to own, and this only changes what goes into the tarball.
# `npm version` keeps package-lock.json's version fields in step, and
# --no-git-tag-version skips every git operation.
run: npm version "${{ steps.preview.outputs.version }}" --no-git-tag-version
- run: npm run build
- name: Publish
id: publish
# --tag is mandatory: npm publish defaults to `latest` even for a semver
# prerelease, which would point every plain `npm install` at a preview.
run: |
npm publish --tag preview
echo "published=true" >> "$GITHUB_OUTPUT"
outputs:
published: ${{ steps.publish.outputs.published }}
version: ${{ steps.preview.outputs.version }}
sha: ${{ steps.preview.outputs.sha }}
publish-tag-preview:
name: Tag the published preview
runs-on: ubuntu-latest
needs: publish-npm-preview
if: ${{ needs.publish-npm-preview.outputs.published == 'true' }}
environment: release
permissions:
contents: write # create refs/tags/v<version>
timeout-minutes: 5
steps:
# A re-run carries over the outputs of jobs it did not re-run. If that ever stops
# holding, fail with the manual recipe rather than tagging the wrong commit.
- name: Check the publish handed over a version and a commit
env:
VERSION: ${{ needs.publish-npm-preview.outputs.version }}
SHA: ${{ needs.publish-npm-preview.outputs.sha }}
run: |
if [ -z "$VERSION" ] || [ -z "$SHA" ]; then
echo "::error::publish-npm-preview reported version='$VERSION' sha='$SHA'." \
"Tag it by hand — see docs/RELEASES.md, 'A preview published but the" \
"commit was not tagged'."
exit 1
fi
- name: Create the tag
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ needs.publish-npm-preview.outputs.version }}
SHA: ${{ needs.publish-npm-preview.outputs.sha }}
run: |
gh api "repos/$GITHUB_REPOSITORY/git/refs" \
-f ref="refs/tags/v$VERSION" \
-f sha="$SHA"
echo "Tagged \`v$VERSION\` at \`$SHA\`" >> "$GITHUB_STEP_SUMMARY"
trigger-registry-update:
needs: publish-npm
needs: [publish-npm, publish-npm-preview]
# Both channels dispatch this: the registry has its own handling for preview
# versions. The two never fire together — a release merge publishes stable and
# skips the preview, and every other push does the reverse — so the registry sees
# exactly one dispatch per published version. The payload is deliberately
# unchanged: it names no version, and the registry resolves what it needs itself.
if: >-
${{
always() && (
needs.publish-npm.result == 'success'
|| needs.publish-npm-preview.outputs.published == 'true'
|| (github.event_name == 'workflow_dispatch' && inputs.channel == 'stable' && !inputs.publish_npm)
)
}}
runs-on: ubuntu-latest
environment: release
permissions: {}
# npm metadata is normally visible within about five minutes. Leave 2.5x that
# window for propagation, plus enough time to mint the token and dispatch.
timeout-minutes: 15
steps:
- name: Wait for package to become available
if: ${{ needs.publish-npm.result == 'success' || needs.publish-npm-preview.outputs.published == 'true' }}
env:
PACKAGE: "@agentclientprotocol/claude-agent-acp"
VERSION: ${{ needs.publish-npm-preview.outputs.version || needs.publish-npm.outputs.version }}
#language=bash
run: |
if [ -z "$VERSION" ]; then
echo "::error::The publish job did not report a package version."
exit 1
fi
deadline=$((SECONDS + 750))
while (( SECONDS < deadline )); do
if timeout 10s npm pack "$PACKAGE@$VERSION" \
--dry-run \
--ignore-scripts \
--silent \
--registry=https://registry.npmjs.org \
--prefer-online \
--fetch-retries=0 >/dev/null 2>&1; then
echo "$PACKAGE@$VERSION is available from npm."
exit 0
fi
remaining=$((deadline - SECONDS))
if (( remaining > 0 )); then
echo "Waiting for $PACKAGE@$VERSION to become available (${remaining}s remaining)..."
sleep 10
fi
done
echo "::error::$PACKAGE@$VERSION was not available from npm after 12.5 minutes."
exit 1
- name: Generate token scoped to the registry repo
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1
id: registry-token

View File

@@ -5,3 +5,7 @@ dist
.release-please-manifest.json
release-please-config.json
CHANGELOG.md
# Recorded ACP traffic, written by src/tests/acp-scenarios.test.ts.
src/tests/acp-scenarios/__snapshots__
src/tests/acp-scenarios/origin-main

View File

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

48
AGENTS.md Normal file
View File

@@ -0,0 +1,48 @@
# Agent guide
An ACP-compatible coding agent powered by the Claude Agent SDK. Source in `src/`,
TypeScript, ESM, Node >= 22.
## Commands
```sh
npm run build # tsc
npm run test:run # vitest, single pass
npm run check # eslint + prettier --check
npm run lint:fix # eslint --fix
npm run format # prettier --write
```
CI runs `format:check`, `lint`, `build` and `test:run`. Run `npm run check` before
opening a PR.
## Pull requests
Squash merges use the PR title as the commit subject, and release-please parses it
to compute the next version. Titles must be conventional commits using one of:
`feat`, `fix`, `perf`, `revert`, `docs`, `style`, `chore`, `refactor`, `test`,
`build`, `ci`. `conventional-prs.yml` rejects anything else.
The title also decides the release: `feat:` bumps the minor, `fix:`/`perf:` the
patch, and `chore:`/`ci:`/`test:` and friends do not release at all.
## Releasing
Stable releases are fully automated by release-please. There is no manual release
workflow, and the version is never chosen by hand — it follows from the commit
history.
```sh
npm run release:preflight # verifies it is safe to release, prints the PR and version
gh pr merge <pr-number> --squash
```
The preflight is the guard-list as code; if it exits non-zero, follow what it
prints rather than merging.
Every _other_ push to `main` publishes a preview to npm — `0.73.1-preview.4` and
so on — under the `preview` dist-tag, tags the commit it came from, and updates
the agent registry the same way a release does. Only `latest` is reserved for
real releases. So anything merged to `main` is published within minutes; there is
no staging branch. Full runbook, including how to recover a stalled release:
[`docs/RELEASES.md`](docs/RELEASES.md).

View File

@@ -1,5 +1,273 @@
# Changelog
## [0.84.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.83.0...v0.84.0) (2026-09-28)
### Features
* **deps:** update Claude SDK ([#1189](https://github.com/agentclientprotocol/claude-agent-acp/issues/1189)) ([d5e6f33](https://github.com/agentclientprotocol/claude-agent-acp/commit/d5e6f33046614fca4798d49f0c77edba951a6771))
## [0.83.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.82.0...v0.83.0) (2026-09-28)
### Features
* **deps:** Bump @anthropic-ai/claude-agent-sdk to 0.3.283 ([#1186](https://github.com/agentclientprotocol/claude-agent-acp/issues/1186)) ([49858b5](https://github.com/agentclientprotocol/claude-agent-acp/commit/49858b527397a08d343fe2c148a5fe9e3eb84547))
## [0.82.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.81.2...v0.82.0) (2026-09-28)
### Features
* AIR tool call contract, exact git patches, plan file, and fixes for every client ([#1153](https://github.com/agentclientprotocol/claude-agent-acp/issues/1153)) ([875d75f](https://github.com/agentclientprotocol/claude-agent-acp/commit/875d75f2a4941d9c6313ed51f89da0f42443ac2f))
### Bug Fixes
* use ACP auth errors without access updates ([#1179](https://github.com/agentclientprotocol/claude-agent-acp/issues/1179)) ([e6681d2](https://github.com/agentclientprotocol/claude-agent-acp/commit/e6681d2a5734857727352474c8c9aa848f9210ee))
## [0.81.2](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.81.1...v0.81.2) (2026-09-24)
### Bug Fixes
* announce resumed subagent generations when they start ([#1173](https://github.com/agentclientprotocol/claude-agent-acp/issues/1173)) ([b495e55](https://github.com/agentclientprotocol/claude-agent-acp/commit/b495e55a2249f066dab76e56316080f151df99be))
* continue clear-context plans approved in a background followup ([#1170](https://github.com/agentclientprotocol/claude-agent-acp/issues/1170)) ([a2c362c](https://github.com/agentclientprotocol/claude-agent-acp/commit/a2c362c948511b203b43982f13ab068ba14741ea))
## [0.81.1](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.81.0...v0.81.1) (2026-09-23)
### Bug Fixes
* gate login result text on error state ([#1103](https://github.com/agentclientprotocol/claude-agent-acp/issues/1103)) ([6e97e07](https://github.com/agentclientprotocol/claude-agent-acp/commit/6e97e071c581002b43d9556dbd1d1376ebf9516f))
* honor permissions.disableBypassPermissionsMode ([#1165](https://github.com/agentclientprotocol/claude-agent-acp/issues/1165)) ([281e47e](https://github.com/agentclientprotocol/claude-agent-acp/commit/281e47eb810da748b9e66798086f0010dbb4dc4b))
* include model on usage updates ([#1032](https://github.com/agentclientprotocol/claude-agent-acp/issues/1032)) ([da11f1f](https://github.com/agentclientprotocol/claude-agent-acp/commit/da11f1feb269b93f13fde7470f2b5a1b070867a9))
* keep the agent starting when the managed-policy tier cannot be read ([#1146](https://github.com/agentclientprotocol/claude-agent-acp/issues/1146)) ([58c5db1](https://github.com/agentclientprotocol/claude-agent-acp/commit/58c5db1fdc1b6fbce27224523fddebd3c52a65dd))
* mark informational chunks with metadata ([#1055](https://github.com/agentclientprotocol/claude-agent-acp/issues/1055)) ([bd059c1](https://github.com/agentclientprotocol/claude-agent-acp/commit/bd059c10e042c126933f27abd33f5523f39fab72))
* offer bypass alongside auto in plan approval ([#1164](https://github.com/agentclientprotocol/claude-agent-acp/issues/1164)) ([43c27e9](https://github.com/agentclientprotocol/claude-agent-acp/commit/43c27e97aacd9b711aefcb4b84271bf872c2eea7))
* preserve context usage when quota is exhausted ([#1132](https://github.com/agentclientprotocol/claude-agent-acp/issues/1132)) ([39062b6](https://github.com/agentclientprotocol/claude-agent-acp/commit/39062b63ff3087fc7ce2655a9738450f5f61682c))
* preserve native Vertex endpoint defaults ([#1104](https://github.com/agentclientprotocol/claude-agent-acp/issues/1104)) ([29a4e98](https://github.com/agentclientprotocol/claude-agent-acp/commit/29a4e9847761837ab85ea42d4bab9267be606755))
* publish effective mode after plan approval ([#1163](https://github.com/agentclientprotocol/claude-agent-acp/issues/1163)) ([a2f4239](https://github.com/agentclientprotocol/claude-agent-acp/commit/a2f4239543b22d0928fbdbef7a9c7a4854b3d61d))
* recreate resumed sessions when any session option changes ([#1097](https://github.com/agentclientprotocol/claude-agent-acp/issues/1097)) ([df38ccc](https://github.com/agentclientprotocol/claude-agent-acp/commit/df38cccae04ce4abb525447c5e8d9db78ffec61c))
* render Write tool calls that use path/file_text aliases ([#1161](https://github.com/agentclientprotocol/claude-agent-acp/issues/1161)) ([90cde4b](https://github.com/agentclientprotocol/claude-agent-acp/commit/90cde4b3974656794fbb274ac6ad8e57f701e618))
* replay marker-only slash skill prompts ([#1035](https://github.com/agentclientprotocol/claude-agent-acp/issues/1035)) ([97394d9](https://github.com/agentclientprotocol/claude-agent-acp/commit/97394d93b695c141eda71b85025bc4e22141b8c4))
* **session:** recreate query when configured skills change ([#968](https://github.com/agentclientprotocol/claude-agent-acp/issues/968)) ([388a0f5](https://github.com/agentclientprotocol/claude-agent-acp/commit/388a0f51914ef59f2168007b633927e1a9d6ec48)), closes [#955](https://github.com/agentclientprotocol/claude-agent-acp/issues/955)
* settle steered turns on the result that answers the steer ([#1166](https://github.com/agentclientprotocol/claude-agent-acp/issues/1166)) ([9392c69](https://github.com/agentclientprotocol/claude-agent-acp/commit/9392c69cc66591ade56a08200d807577180aa682))
## [0.81.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.80.0...v0.81.0) (2026-09-22)
### Features
* **deps:** update Claude SDK ([#1157](https://github.com/agentclientprotocol/claude-agent-acp/issues/1157)) ([eb989e9](https://github.com/agentclientprotocol/claude-agent-acp/commit/eb989e93f4e20315a85405ef099f97eec899df13))
* Send experimental session notices for live advisories ([#1155](https://github.com/agentclientprotocol/claude-agent-acp/issues/1155)) ([79851b8](https://github.com/agentclientprotocol/claude-agent-acp/commit/79851b86685b8a0673dec54d85d6fa2a3b749cfb))
## [0.80.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.79.0...v0.80.0) (2026-09-22)
### Features
* **deps:** Bump claude-agent-sdk to 0.3.278 ([#1147](https://github.com/agentclientprotocol/claude-agent-acp/issues/1147)) ([5bc3b4e](https://github.com/agentclientprotocol/claude-agent-acp/commit/5bc3b4e5609c7e4290fa1bca50c30c7340de6bbf))
### Bug Fixes
* close interrupted compaction lifecycles ([#1154](https://github.com/agentclientprotocol/claude-agent-acp/issues/1154)) ([a05aca6](https://github.com/agentclientprotocol/claude-agent-acp/commit/a05aca6b81bfd172ab47064dd21e835da95fc72b))
* prefer terminal output deltas ([#1150](https://github.com/agentclientprotocol/claude-agent-acp/issues/1150)) ([c6f9668](https://github.com/agentclientprotocol/claude-agent-acp/commit/c6f9668c1234b43888bc44aaf63daf8be1a745e2))
## [0.79.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.78.0...v0.79.0) (2026-09-17)
### Features
* Update to claude agent sdk 0.3.274 ([#1143](https://github.com/agentclientprotocol/claude-agent-acp/issues/1143)) ([d0fa8e0](https://github.com/agentclientprotocol/claude-agent-acp/commit/d0fa8e03853c4f5a9b074fc2af32931ffe6f588f))
### Bug Fixes
* show shell commands in permission prompts ([#1070](https://github.com/agentclientprotocol/claude-agent-acp/issues/1070)) ([bbae5c2](https://github.com/agentclientprotocol/claude-agent-acp/commit/bbae5c2c0936554104b07630b142fd71fe1d839e))
## [0.78.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.77.0...v0.78.0) (2026-09-15)
### Features
* Add experimental ACP compaction update support ([#1134](https://github.com/agentclientprotocol/claude-agent-acp/issues/1134)) ([543a9a2](https://github.com/agentclientprotocol/claude-agent-acp/commit/543a9a2f97429659bb28d09691a71e4c99e41ed5))
### Bug Fixes
* keep the picked option when AskUserQuestion custom text is also supplied ([#1131](https://github.com/agentclientprotocol/claude-agent-acp/issues/1131)) ([8823ea6](https://github.com/agentclientprotocol/claude-agent-acp/commit/8823ea6fcb6743d37c1aad91ccd44725164b8927))
### Performance Improvements
* report file changes from Claude checkpoints ([#1138](https://github.com/agentclientprotocol/claude-agent-acp/issues/1138)) ([91f1699](https://github.com/agentclientprotocol/claude-agent-acp/commit/91f1699366ee98f9b3e9a6b96f0662c40b6ee38e))
* supply AIR diff counts from Claude structured patches ([#1122](https://github.com/agentclientprotocol/claude-agent-acp/issues/1122)) ([735950a](https://github.com/agentclientprotocol/claude-agent-acp/commit/735950a83ee1fa25366515a3239482183a051dca))
## [0.77.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.76.0...v0.77.0) (2026-09-14)
### ⚠ BREAKING CHANGES
* claudeCode.options.agent is no longer forwarded to Claude Code, and the agent-picker exports DEFAULT_AGENT_ID, AGENT_CONFIG_ID, BUILTIN_AGENT_NAMES, and discoverCustomAgents are removed. Consumers relying on main-thread agent selection must stop passing that option.
### Features
* Add tool names to tool calls ([#1128](https://github.com/agentclientprotocol/claude-agent-acp/issues/1128)) ([67c7c9b](https://github.com/agentclientprotocol/claude-agent-acp/commit/67c7c9b117af7464fd5d583f719bf6214a5508a8))
* **deps:** Bump @anthropic-ai/claude-agent-sdk to 0.3.270 ([#1123](https://github.com/agentclientprotocol/claude-agent-acp/issues/1123)) ([d3205ab](https://github.com/agentclientprotocol/claude-agent-acp/commit/d3205ab11f873f58e50dddbf13f6d7c555a9f478))
### Bug Fixes
* keep multi-select answers when a custom answer is typed ([#1031](https://github.com/agentclientprotocol/claude-agent-acp/issues/1031)) ([1a4512c](https://github.com/agentclientprotocol/claude-agent-acp/commit/1a4512c71199709f6c59bd56c2c67aba63fe243d))
* parse TaskList output without ambiguous regex ([#1006](https://github.com/agentclientprotocol/claude-agent-acp/issues/1006)) ([b274923](https://github.com/agentclientprotocol/claude-agent-acp/commit/b274923ef84a5a39b4ab3d12b3d10a8fa23f51f6))
* strip injected system reminders from replayed prompts ([#1040](https://github.com/agentclientprotocol/claude-agent-acp/issues/1040)) ([15ba608](https://github.com/agentclientprotocol/claude-agent-acp/commit/15ba608a79b2cdfdb94c04ce1ebe03cfdae2fb51))
### Code Refactoring
* remove agent config option ([#1112](https://github.com/agentclientprotocol/claude-agent-acp/issues/1112)) ([6b7473b](https://github.com/agentclientprotocol/claude-agent-acp/commit/6b7473b1afb48fbf0cb3b463d576a89a73ddf7a3))
## [0.76.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.75.1...v0.76.0) (2026-09-09)
### Features
* advertise recommended config values ([#1111](https://github.com/agentclientprotocol/claude-agent-acp/issues/1111)) ([2b666c3](https://github.com/agentclientprotocol/claude-agent-acp/commit/2b666c3d35566c60edafc5050d23cf2ce7ea1e95))
* **deps-dev:** Bump vitest from 4.1.11 to 5.0.0 ([#1099](https://github.com/agentclientprotocol/claude-agent-acp/issues/1099)) ([194e195](https://github.com/agentclientprotocol/claude-agent-acp/commit/194e195b057497311558fea2a5fbd1b4953ea29d))
* **deps:** Bump fast-uri from 3.1.6 to 3.1.7 ([#1100](https://github.com/agentclientprotocol/claude-agent-acp/issues/1100)) ([d870ebd](https://github.com/agentclientprotocol/claude-agent-acp/commit/d870ebd2fd14bda95f81ec4b86d76ef4ae258005))
## [0.75.1](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.75.0...v0.75.1) (2026-09-05)
### Bug Fixes
* restore session forks and speed up loading ([#1089](https://github.com/agentclientprotocol/claude-agent-acp/issues/1089)) ([f5e79f5](https://github.com/agentclientprotocol/claude-agent-acp/commit/f5e79f55f8ba8d1cd0a72cbc78bfea726bea2f00))
## [0.75.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.74.0...v0.75.0) (2026-09-05)
### Features
* **auth:** report the agent's auth identity over ACP (authStatus extension) ([#1080](https://github.com/agentclientprotocol/claude-agent-acp/issues/1080)) ([eb5ca9f](https://github.com/agentclientprotocol/claude-agent-acp/commit/eb5ca9fd17b6af4a4566be4ad75b64588ce60b52))
* render usage statistics as Markdown ([#1085](https://github.com/agentclientprotocol/claude-agent-acp/issues/1085)) ([2081767](https://github.com/agentclientprotocol/claude-agent-acp/commit/20817678f68083a2997d1bc45ef20241a9097220))
* surface context compaction as an ACP tool lifecycle ([#991](https://github.com/agentclientprotocol/claude-agent-acp/issues/991)) ([f74a517](https://github.com/agentclientprotocol/claude-agent-acp/commit/f74a51758dc42896addbcdaf7611a29ec1d1db17))
## [0.74.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.73.0...v0.74.0) (2026-09-04)
### Features
* **auth:** refuse claude.ai subscriptions under `--hide-claude-auth` ([#1079](https://github.com/agentclientprotocol/claude-agent-acp/issues/1079)) ([da9f7e5](https://github.com/agentclientprotocol/claude-agent-acp/commit/da9f7e56956c770bd1339151d6166a011fe39174))
## [0.73.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.72.0...v0.73.0) (2026-09-01)
### Features
* **deps:** update Claude SDK ([#1066](https://github.com/agentclientprotocol/claude-agent-acp/issues/1066)) ([b4e3aaa](https://github.com/agentclientprotocol/claude-agent-acp/commit/b4e3aaa727821a85cef6dcf51452381d35fd68a5))
## [0.72.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.71.0...v0.72.0) (2026-09-01)
### Features
* **deps:** Update to @anthropic-ai/claude-agent-sdk 0.3.252 ([#1062](https://github.com/agentclientprotocol/claude-agent-acp/issues/1062)) ([9aaf066](https://github.com/agentclientprotocol/claude-agent-acp/commit/9aaf0663bf48a4209e8e6511af395102c05e501e))
### Bug Fixes
* Adopt per-model effort settings and user_message_uuid result attribution ([#1065](https://github.com/agentclientprotocol/claude-agent-acp/issues/1065)) ([a04d354](https://github.com/agentclientprotocol/claude-agent-acp/commit/a04d35496c1f1b4c19d8f4204ee6377de45624ab))
## [0.71.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.70.0...v0.71.0) (2026-08-31)
### Features
* add ai generated session title ([#984](https://github.com/agentclientprotocol/claude-agent-acp/issues/984)) ([d334766](https://github.com/agentclientprotocol/claude-agent-acp/commit/d334766ef95dd89201979d42252e3d2a5a259cb9))
* align Claude modes and clear-context planning ([#1004](https://github.com/agentclientprotocol/claude-agent-acp/issues/1004)) ([996d488](https://github.com/agentclientprotocol/claude-agent-acp/commit/996d488589b8db7a0f9af3dfc7b886d9d47ebae9))
* **deps:** Bump @anthropic-ai/claude-agent-sdk to 0.3.238 ([#1018](https://github.com/agentclientprotocol/claude-agent-acp/issues/1018)) ([ee9f300](https://github.com/agentclientprotocol/claude-agent-acp/commit/ee9f300db4562e8b7958cec9fa63dab05a5c2eb0))
* expose native subagents and async tasks ([#1017](https://github.com/agentclientprotocol/claude-agent-acp/issues/1017)) ([14d192d](https://github.com/agentclientprotocol/claude-agent-acp/commit/14d192d1087ea8662392b5c61c9fcdd496c5a179))
* expose permission mode kinds ([#1025](https://github.com/agentclientprotocol/claude-agent-acp/issues/1025)) ([caf609b](https://github.com/agentclientprotocol/claude-agent-acp/commit/caf609b56c91f677ffe82b6e9d11d9e9dfd99d45))
* report per-model token usage on prompt responses ([#1037](https://github.com/agentclientprotocol/claude-agent-acp/issues/1037)) ([fad4d10](https://github.com/agentclientprotocol/claude-agent-acp/commit/fad4d10e46c5e65fc6d426c98074bbb76067bf25))
* support message-specific ACP session forks ([#1046](https://github.com/agentclientprotocol/claude-agent-acp/issues/1046)) ([c3ff343](https://github.com/agentclientprotocol/claude-agent-acp/commit/c3ff3438844f5249d6a7f5c297906e2cd3d5fa7f))
### Bug Fixes
* change min zod version to 4.x to avoid failing directory imports on 'v4' ([#1057](https://github.com/agentclientprotocol/claude-agent-acp/issues/1057)) ([7c66108](https://github.com/agentclientprotocol/claude-agent-acp/commit/7c6610835f26f18cd162b78dff74a7b7cd74497a))
* defer steering while user input is pending ([#1045](https://github.com/agentclientprotocol/claude-agent-acp/issues/1045)) ([8710ce1](https://github.com/agentclientprotocol/claude-agent-acp/commit/8710ce1cbccf562cb04b4bcc30e053e960aee05f))
## [0.70.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.69.0...v0.70.0) (2026-08-17)
### Features
* switch providers for loaded Claude sessions ([#1002](https://github.com/agentclientprotocol/claude-agent-acp/issues/1002)) ([50a9543](https://github.com/agentclientprotocol/claude-agent-acp/commit/50a95434e94318456f2d07c3d21aaf3595c3407d))
## [0.69.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.68.0...v0.69.0) (2026-08-16)
### Features
* report changed files to AIR ([#1001](https://github.com/agentclientprotocol/claude-agent-acp/issues/1001)) ([450d6b1](https://github.com/agentclientprotocol/claude-agent-acp/commit/450d6b19dc46a041128356a6fa3cfa3ce6a5a382))
## [0.68.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.67.0...v0.68.0) (2026-08-14)
### Features
* align typed session failures with AIR protocol ([#992](https://github.com/agentclientprotocol/claude-agent-acp/issues/992)) ([0581b9c](https://github.com/agentclientprotocol/claude-agent-acp/commit/0581b9cf397ffd88f2830db721c2d8e3689045e4))
## [0.67.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.66.0...v0.67.0) (2026-08-14)
### Features
* **deps:** Update to @anthropic-ai/claude-agent-sdk v0.3.232 ([#993](https://github.com/agentclientprotocol/claude-agent-acp/issues/993)) ([de0d0e2](https://github.com/agentclientprotocol/claude-agent-acp/commit/de0d0e2b7d185c521c3d1ac7b86e4312c919abfe))
* expose typed session failures for AIR ([#979](https://github.com/agentclientprotocol/claude-agent-acp/issues/979)) ([8157ee1](https://github.com/agentclientprotocol/claude-agent-acp/commit/8157ee113e705750be4eb6cc787bdd12f1db84ff))
* publish the model fallback as a warning advisory ([#990](https://github.com/agentclientprotocol/claude-agent-acp/issues/990)) ([35aaddb](https://github.com/agentclientprotocol/claude-agent-acp/commit/35aaddb3d5b14eca316582ab285af8a660150dae))
* surface resolved model name in default model option description ([#982](https://github.com/agentclientprotocol/claude-agent-acp/issues/982)) ([ec73cd8](https://github.com/agentclientprotocol/claude-agent-acp/commit/ec73cd8560be7d5e8b9741e404d7d45e17336996))
* surface Skill tool calls with name and kind in _meta ([#986](https://github.com/agentclientprotocol/claude-agent-acp/issues/986)) ([1f09e9a](https://github.com/agentclientprotocol/claude-agent-acp/commit/1f09e9a3cae787b0effdfae0e7205ef7fe22b9dc))
### Bug Fixes
* preserve task plans across prompts ([#974](https://github.com/agentclientprotocol/claude-agent-acp/issues/974)) ([1afa940](https://github.com/agentclientprotocol/claude-agent-acp/commit/1afa940a2c8c0f4c610f4f64d30c0961642907b0))
* show a pending title while Claude prepares a file ([#978](https://github.com/agentclientprotocol/claude-agent-acp/issues/978)) ([3df1ede](https://github.com/agentclientprotocol/claude-agent-acp/commit/3df1ede89f217312bc237124dc1eccc10c860f99))
## [0.66.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.65.0...v0.66.0) (2026-08-07)
### Features
* **deps-dev:** Bump globals from 17.8.0 to 17.9.0 in the minor group ([#960](https://github.com/agentclientprotocol/claude-agent-acp/issues/960)) ([7f27c47](https://github.com/agentclientprotocol/claude-agent-acp/commit/7f27c47c5c7c49e65014e9f7dc55cba17352d33b))
* expose provider-neutral ACP goal extension ([#964](https://github.com/agentclientprotocol/claude-agent-acp/issues/964)) ([8b31dea](https://github.com/agentclientprotocol/claude-agent-acp/commit/8b31dea11bed54f86c41217759159c415611346c))
### Bug Fixes
* publish and replace Claude goals reliably ([#967](https://github.com/agentclientprotocol/claude-agent-acp/issues/967)) ([f8fd3ab](https://github.com/agentclientprotocol/claude-agent-acp/commit/f8fd3ab8224420f8ced570e974cde09612939d6b))
## [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)

1
CLAUDE.md Symbolic link
View File

@@ -0,0 +1 @@
AGENTS.md

View File

@@ -9,6 +9,7 @@ This tool implements an ACP agent by using the official [Claude Agent SDK](https
- Context @-mentions
- Images
- Tool calls (with permission requests)
- Compact file changes through the negotiated [AIR diff patch extension](docs/air-extensions.md#diff-patch)
- Following
- Edit review
- TODO lists
@@ -16,19 +17,33 @@ This tool implements an ACP agent by using the official [Claude Agent SDK](https
- Interactive (and background) terminals
- Custom [Slash commands](https://docs.anthropic.com/en/docs/claude-code/slash-commands)
- Client MCP servers
- Session-scoped long-running goals for AIR through the [goal extension](docs/air-extensions.md#goal) under `_meta.jetbrains.air.goal`
- Structured errors, recovery, and warnings through the opt-in [session failure extension](docs/air-extensions.md#session-failure)
- Concrete model and effort defaults through the opt-in [recommended config value extension](docs/air-extensions.md#recommended-config-values)
- Tool permission presentation, editable choices, and durable effects through the [permission extension](docs/air-extensions.md#permission-presentation)
- One fact per field in every tool call report, as the [ACP tool call contract](docs/air-extensions.md#tool-call-contract) defines
- All AIR extensions, capabilities, and `_meta` keys: [AIR extensions](docs/air-extensions.md)
Learn more about the [Agent Client Protocol](https://agentclientprotocol.com/).
### Nested subagent transcripts
To try changes that have landed on `main` but are not released yet, install from the
`preview` channel — every push to `main` publishes one. See
[`docs/RELEASES.md`](docs/RELEASES.md#preview-releases).
ACP 1.2 has no standard subagent tool kind or nested-message relationship. Clients that can render
nested transcripts can opt in with `clientCapabilities._meta["subagent-transcript"] = true`.
The agent then forwards subagent text, thinking, and tool calls, relating nested updates to the
launching Agent/Task call through `_meta.claudeCode.parentToolUseId`. Agent/Task calls are marked
with `_meta.claudeCode.subagent = true`.
```sh
npm install @agentclientprotocol/claude-agent-acp@preview
```
Clients that do not advertise the capability retain the legacy flattened behavior. In both modes,
the normal Agent/Task tool result is preserved as the protocol-compatible fallback.
### Subagent sessions
Subagents are exposed only after bilateral capability negotiation. Until the released ACP SDKs
preserve the draft `clientCapabilities.subagents` field, a supporting client may advertise
`nativeSubagentSessions` in `_meta.jetbrains.air.capabilities`; the adapter mirrors the capability
in its initialize response. The canonical field remains supported and takes precedence once it is
available. Without either client signal, Agent/Task lifecycle keeps its legacy ordinary ACP
tool-call representation and child interactions stay on the root session. Clients that use the
historical `_meta["subagent-transcript"]` capability or `forwardSubagentText` session option retain
the flattened child transcript behavior. See [AIR extensions](docs/air-extensions.md#native-subagent-sessions).
## Contribution Policy

View File

@@ -1,24 +1,245 @@
## How to publish a new release
# Releases
1. Create a new branch prep-vX.X.X
Releases are automated by [release-please](https://github.com/googleapis/release-please)
in [`.github/workflows/publish.yml`](../.github/workflows/publish.yml). Every push
to `main` re-computes the next version from the conventional commit messages and
keeps a single release PR open, titled `chore(main): release X.Y.Z` and labelled
`autorelease: pending`.
Merging that PR is what releases. It tags `vX.Y.Z`, creates the GitHub release,
publishes to npm, and dispatches a version update to the agent registry.
There is no manual release button, and versions are never typed in by hand: the
version is an output of the commit history, not an input.
Every _other_ push to `main` publishes a preview instead — see
[Preview releases](#preview-releases). Anything merged to `main` is on npm within
minutes; there is no staging branch.
## Releasing
```sh
git checkout -b prep-vX.X.X
npm run release:preflight
```
2. Bump the version in package.json
This reports the open release PR, the version it will ship, and checks that the
repository is in a state where merging is safe. Nothing has to be remembered —
if it exits non-zero, follow what it prints instead of merging.
Then merge it, using the PR number the preflight printed:
```sh
npm version vX.X.X
gh pr merge <pr-number> --squash
gh run watch "$(gh run list --workflow=publish.yml --limit 1 --json databaseId --jq '.[0].databaseId')"
```
3. Add a new entry in CHANGELOG.md
4. Create a PR for `prev-vX.X.X` & merge it
5. Create tag and push it
The run is looked up rather than picked interactively, so this is safe to script.
If the workflow has already finished, `gh run list --workflow=publish.yml` shows
the outcome instead.
Merging main requires no review, so a green preflight and `Build` are the only
gates. Once the workflow finishes, confirm both outputs landed:
```sh
git tag vX.X.X
git push origin vX.X.X
gh release view "v<version>"
npm view "@agentclientprotocol/claude-agent-acp@<version>"
```
6. Paste CHANGELOG into release notes and publish the version on GitHub
## Preview releases
Every push to `main` that is not a release merge publishes a preview from the
same workflow. There is no GitHub release — only an npm publish under the
`preview` dist-tag, a `v<version>` tag on the commit it came from, and the same
agent registry update a stable release dispatches, since the registry has its own
handling for preview versions.
Those are three jobs, in that order: `publish-npm-preview` mirrors `publish-npm`
and does nothing but publish; `publish-tag-preview` creates the tag; and
`trigger-registry-update` is shared with the stable path. Before dispatching,
the registry job polls npm for the exact published version for up to 12.5 minutes,
including downloading its tarball, so the registry never checks while npm is
still propagating the package. The tag is a separate job so that a tag failure
can be retried on its own with **Re-run failed jobs** — re-running the publish is
not an option, because npm versions are immutable and publishing the same one
twice fails outright.
Both downstream jobs are gated on a `published` output that the publish step
sets only after `npm publish --tag preview` succeeds. This ensures tagging runs
only after publication and the registry update runs only after that exact version
can also be downloaded from npm.
A stable and a preview dispatch can never collide — a release merge publishes
stable and skips the preview, every other push does the reverse — so the registry
sees exactly one dispatch per published version.
```sh
npm install @agentclientprotocol/claude-agent-acp@preview
npm view @agentclientprotocol/claude-agent-acp dist-tags
git ls-remote --tags origin 'refs/tags/*preview*'
```
The version is the `package.json` version with the patch incremented, plus
`-preview.N`: with `main` at 0.73.0 the previews are `0.73.1-preview.1`,
`0.73.1-preview.2`, and so on. `N` restarts at 1 whenever release-please moves
`package.json`, which keeps the sequence monotonic whichever way the next release
goes — a patch release makes the next base 0.73.2, a minor makes it 0.74.1, and
both sort above every `0.73.1-preview.*`.
`0.73.1-preview.4` is **not** a promise that 0.73.1 will ship. The base is a
patch bump because that is the only choice depending solely on `package.json`,
which release-please only ever increases. Using release-please's predicted next
version would read better but that prediction moves mid-flight: a `fix:` opens a
0.73.1 release PR, a later `feat:` moves it to 0.74.0, and `N` would reset under
previews that were already published.
`N` comes from [`scripts/next-preview-version.mjs`](../scripts/next-preview-version.mjs),
which takes the larger of two sources. The npm registry says what is taken — npm
versions are immutable and stay reserved even after `npm unpublish`, so reusing
one is a hard failure — but it is CDN-served and can lag a publish by minutes.
The git tags this job writes are strongly consistent and cover that window. The
job publishes before it tags, so a version can exist on npm without a tag but
never the reverse; that is why a registry read failure aborts the run rather than
falling back to the tags alone.
Two pushes landing together cannot collide, because the job takes a concurrency
group. GitHub keeps only one run pending per group, so a third push arriving
while one preview runs and another waits drops the waiting one — that commit
simply gets no preview.
`latest` stays put because the job passes `npm publish --tag preview`. Without
it npm would move `latest` onto the preview: `--tag` defaults to `latest` even
for a semver prerelease. Right after a release the `preview` dist-tag can name a
version _below_ `latest` until the next push lands; that is cosmetic.
Release merges are excluded by checking the head commit's author and the subject
release-please generates. Both are checked, either is enough, and the cost of a
miss is one wasted version number plus a `preview` tag briefly pointing at
already-released code — `latest` is untouched. Previews start directly on pushes
to `main`, without waiting for CI or the `release-please` job. The commit checks
let previews run independently of release-please's outputs.
To publish a preview by hand from any commit:
```sh
gh workflow run publish.yml --ref main \
-f channel=preview -f ref=<commit-or-branch> -f publish_npm=false
```
`--ref main` is required: the `release` environment only accepts protected
branches, so a dispatch from anywhere else is rejected before the job starts.
## How the version is chosen
Squash merges use the PR title as the commit subject, so the PR title decides the
next version. [`conventional-prs.yml`](../.github/workflows/conventional-prs.yml)
rejects titles release-please would not understand.
| PR title prefix | Effect |
| --------------------------------------------------------- | --------------------------- |
| `fix:`, `perf:`, `revert:`, `docs:` | patch, e.g. 0.66.0 → 0.66.1 |
| `feat:` | minor, e.g. 0.66.0 → 0.67.0 |
| any of the above with `!`, or BREAKING CHANGE | minor while below 1.0.0 |
| `chore:`, `ci:`, `build:`, `test:`, `refactor:`, `style:` | no release on their own |
Breaking changes bump the minor rather than the major because
`bump-minor-pre-major` is set in
[`release-please-config.json`](../release-please-config.json) and the package is
still below 1.0.0. That is deliberate: it keeps a single `!` in a PR title from
shipping 1.0.0 by accident.
Note that `config-file` only takes effect while the workflow does **not** pass a
`release-type` input to the action — with `release-type` set, the action ignores
the config entirely. The release type is declared inside the config instead.
`release-type` also switches release-please from `Manifest.fromManifest` to
`Manifest.fromConfig`, which is a second and sharper reason never to set it. On
the manifest path the previous release is found by an exact string match against
the version in [`.release-please-manifest.json`](../.release-please-manifest.json),
which is why the `v<x>-preview.<n>` tags are invisible to it. On the config path
release-please instead sorts every candidate tag and release descending and takes
the highest — and there the preview tags _would_ be candidates.
Because the config is what is read, it also has to say
`"include-component-in-tag": false`. Left at its default, release-please derives a
component from the package name and tags `claude-agent-acp-vX.Y.Z` instead of
`vX.Y.Z`. That renames the tag every step here looks up, and because no tag under
the new scheme exists, it also walks the entire commit history into the changelog
rather than just what landed since the last release. The preflight checks the tag
release-please is going to use, so this cannot reach a published release.
Releasing 1.0.0 is therefore an explicit act: add `"release-as": "1.0.0"` to
`release-please-config.json` in its own PR, release, then remove it again.
## Recovering a stalled release
### The release PR merged but nothing was tagged
The preflight fails with `release-please is jammed`. While a merged release PR
still carries `autorelease: pending`, release-please refuses to open any new
release PR at all, so every later release stalls silently until this is cleared.
Take the release notes release-please already wrote into the changelog, create
the missing release, then move the label the way release-please would have:
```sh
awk '/^## \[<version>\]/{f=1;print;next} /^## \[/{f=0} f' CHANGELOG.md > notes.md
gh release create "v<version>" --target <merge-commit-sha> --notes-file notes.md
gh pr edit <pr-number> --remove-label "autorelease: pending" \
--add-label "autorelease: tagged"
```
Then publish the tag as described below.
### The tag exists but npm or the registry is missing
npm publishes through OIDC from inside the workflow, so this cannot be done from
a laptop. Re-run the publish workflow against the existing tag:
```sh
gh workflow run publish.yml -f ref="v<version>" -f publish_npm=true
```
npm versions are immutable. If the package already published and only the
registry update failed, pass `-f publish_npm=false` so the run skips publishing
and only re-dispatches the registry update.
### A preview published but the commit was not tagged
Only the publish is irreversible, so re-run just the tag job:
```sh
gh run rerun <run-id> --failed
```
Or **Re-run failed jobs** on the run in the web or mobile UI. This re-runs
`publish-tag-preview` alone and leaves the successful publish untouched, which
matters because re-publishing an immutable npm version would fail.
If the re-run reports that it received no version or commit, the run's carried
over job outputs are gone and it cannot tag anything safely. Do it by hand
instead, taking the version from the publish job's log:
```sh
gh api "repos/$(gh repo view --json nameWithOwner --jq .nameWithOwner)/git/refs" \
-f ref="refs/tags/v<version>" -f sha="<commit-sha>"
```
Either way nothing is broken in the meantime: the next preview still picks the
right `N` once the registry CDN catches up. The tag is how that number is known
immediately.
## Credentials
| Secret | Used for |
| ------------------------------------------------------------- | ----------------------------------------------------------------- |
| `RELEASE_PLZ_APP_ID`, `RELEASE_PLZ_APP_PRIVATE_KEY` | App token for release PRs and tags, so they can trigger workflows |
| `REGISTRY_UPDATER_APP_ID`, `REGISTRY_UPDATER_APP_PRIVATE_KEY` | App token scoped to the `registry` repository |
Publishing to npm uses OIDC trusted publishing, so there is no npm token. All
release jobs run in the `release` environment.
npm binds a trusted publisher to one repository, one **workflow filename** and
one environment, and a package may only have one such binding. That is why
preview publishing is another job inside `publish.yml` rather than a workflow of
its own: a separate file would fail to authenticate, and registering it would
cost the stable path its publisher.

1267
docs/air-extensions.md Normal file

File diff suppressed because it is too large Load Diff

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);
});

1224
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@
"publishConfig": {
"access": "public"
},
"version": "0.64.1",
"version": "0.84.0",
"description": "An ACP-compatible coding agent powered by the Claude Agent SDK (TypeScript)",
"main": "dist/lib.js",
"types": "dist/lib.d.ts",
@@ -29,11 +29,13 @@
"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 .",
"format:check": "prettier --check .",
"check": "npm run lint && npm run format:check",
"release:preflight": "bash scripts/release-preflight.sh",
"test": "vitest",
"test:integration": "RUN_INTEGRATION_TESTS=true vitest run",
"test:run": "vitest run",
@@ -63,23 +65,26 @@
"node": ">=22"
},
"dependencies": {
"@agentclientprotocol/sdk": "1.3.0",
"@anthropic-ai/claude-agent-sdk": "0.3.220",
"zod": "^3.25.0 || ^4.0.0"
"@agentclientprotocol/sdk": "1.5.1",
"@anthropic-ai/claude-agent-sdk": "0.3.284",
"diff": "9.0.0",
"zod": "4.6.5"
},
"devDependencies": {
"@anthropic-ai/sdk": "0.115.0",
"@anthropic-ai/sdk": "0.128.0",
"@eslint/js": "10.0.1",
"@tsconfig/node22": "22.0.5",
"@types/node": "26.1.2",
"@typescript-eslint/eslint-plugin": "8.65.0",
"@typescript-eslint/parser": "8.65.0",
"eslint": "10.8.0",
"@tsconfig/node22": "22.0.6",
"@types/node": "26.6.3",
"@typescript-eslint/eslint-plugin": "8.70.1",
"@typescript-eslint/parser": "8.70.1",
"ajv": "8.20.0",
"ajv-formats": "3.0.1",
"eslint": "10.11.0",
"eslint-config-prettier": "10.1.8",
"globals": "17.8.0",
"prettier": "3.9.6",
"globals": "17.12.0",
"prettier": "3.9.9",
"ts-node": "10.9.2",
"typescript": "6.0.3",
"vitest": "4.1.10"
"vitest": "5.0.2"
}
}

View File

@@ -1,12 +1,12 @@
{
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"include-component-in-tag": false,
"packages": {
".": {
"changelog-path": "CHANGELOG.md",
"release-type": "node",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true
"include-component-in-tag": false
}
},
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"

202
scripts/next-preview-version.mjs Executable file
View File

@@ -0,0 +1,202 @@
#!/usr/bin/env node
//
// Prints the next preview version for this package, e.g. `0.73.1-preview.4`.
//
// The base is package.json's version with the patch incremented, so a preview always
// sorts above the last release and below whatever release follows it. `-preview.N`
// counts from 1 per base and restarts whenever release-please moves package.json on.
//
// Basing the preview on release-please's *predicted* next version would be more
// truthful — it would give `0.74.0-preview.N` when a `feat:` is queued — but the
// prediction moves mid-flight: a `fix:` opens a 0.73.1 release PR, a later `feat:`
// moves it to 0.74.0, and N resets under previews that were already published. If the
// prediction ever moved down, the next preview would sort below the previous one.
// package.json only ever increases, so patch+1 is monotonic in every case:
// 0.73.1-preview.9 < 0.73.2-preview.1 and < 0.74.1-preview.1, whichever way the next
// release goes. The cost is that `0.73.1-preview.4` is not a promise that 0.73.1 will
// ship.
//
// N has to be a number nobody has used, and two sources are consulted because either
// alone is unsafe:
//
// * the npm registry, authoritative for what is taken — npm versions are immutable
// and stay reserved even after `npm unpublish`, so a taken N is a hard E403 at
// publish time — but served from a CDN, so it can lag a publish by minutes;
// * git tags, written by the workflow after each publish and strongly consistent,
// which cover that window and any unpublish.
//
// The workflow publishes before it tags, so a version can exist on npm without a tag
// but never the other way round. That asymmetry is why the registry is the authority
// and the tags are only a floor, and why a registry read failure is fatal here rather
// than falling back to the tags alone.
//
// See docs/RELEASES.md.
import { execFileSync } from "node:child_process";
import { readFileSync } from "node:fs";
import { pathToFileURL } from "node:url";
const DEFAULT_REGISTRY = "https://registry.npmjs.org";
const PREVIEW_ID = "preview";
const FETCH_ATTEMPTS = 3;
const FETCH_TIMEOUT_MS = 10_000;
const BACKOFF_MS = 500;
/** X.Y.Z: no prerelease, no build metadata, no leading zeros. */
const RELEASE_VERSION = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/;
/** The base a preview anticipates: package.json's version with the patch bumped. */
export function bumpPatch(version) {
const match = RELEASE_VERSION.exec(String(version ?? "").trim());
if (!match) {
throw new Error(
`expected a plain X.Y.Z release version, got ${JSON.stringify(version)}. ` +
`release-please owns package.json's version; a prerelease or a range here means ` +
`something else has edited it.`,
);
}
const [, major, minor, patch] = match;
return `${major}.${minor}.${Number(patch) + 1}`;
}
function escapeRegExp(literal) {
return literal.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
/**
* Matcher for `<base>-preview.<n>`. `0731-preview.1` would match a base of `0.73.1`. `n`
* is a semver-legal numeric identifier, so leading zeros are rejected; npm would never
* have accepted `preview.01` in the first place.
*/
export function previewPattern(base) {
return new RegExp(`^${escapeRegExp(base)}-${PREVIEW_ID}\\.(0|[1-9]\\d*)$`);
}
/** The N in `<base>-preview.N`, or null for anything else. */
export function previewNumber(candidate, base) {
const match = previewPattern(base).exec(String(candidate ?? "").trim());
return match ? Number(match[1]) : null;
}
/** `refs/tags/v1.2.3`, `v1.2.3` and `1.2.3` all become `1.2.3`. */
export function versionFromTag(tag) {
return String(tag ?? "")
.trim()
.replace(/^refs\/tags\//, "")
.replace(/^v/, "");
}
/**
* Highest N among the candidates, or 0 when none match.
*/
export function highestPreviewNumber(candidates, base) {
let highest = 0;
for (const candidate of candidates) {
const n = previewNumber(candidate, base);
if (n !== null && n > highest) {
highest = n;
}
}
return highest;
}
export function nextPreviewVersion({ base, registryVersions = [], tags = [] }) {
const taken = Math.max(
highestPreviewNumber(registryVersions, base),
highestPreviewNumber(tags.map(versionFromTag), base),
);
return `${base}-${PREVIEW_ID}.${taken + 1}`;
}
/** Every version this package has ever published, per the registry. */
export async function fetchPublishedVersions(name, options = {}) {
const {
registry = DEFAULT_REGISTRY,
fetchImpl = fetch,
attempts = FETCH_ATTEMPTS,
backoffMs = BACKOFF_MS,
} = options;
const url = `${registry}/${name.replace("/", "%2f")}`;
let lastError;
for (let attempt = 1; attempt <= attempts; attempt++) {
try {
const response = await fetchImpl(url, {
// The abbreviated packument is a fraction of the full one — tens of kilobytes
// rather than megabytes — and still carries every version key.
headers: { accept: "application/vnd.npm.install-v1+json" },
signal: AbortSignal.timeout(FETCH_TIMEOUT_MS),
});
if (response.status === 404) {
// Never published. A definite answer, not a failure.
return [];
}
if (!response.ok) {
throw new Error(`${url} answered ${response.status} ${response.statusText}`);
}
const packument = await response.json();
// `versions` on a packument is always an object keyed by version, so there is
// none of the "a single version comes back as a bare string" shape that
// `npm view <pkg> versions --json` has.
return Object.keys(packument.versions ?? {});
} catch (error) {
lastError = error;
if (attempt < attempts) {
await new Promise((resolve) => setTimeout(resolve, backoffMs * 2 ** (attempt - 1)));
}
}
}
throw new Error(
`could not read published versions for ${name} after ${attempts} attempts: ${lastError}. ` +
`Refusing to guess a preview number: the registry is the only record of versions ` +
`that were published and then unpublished, and those can never be reused.`,
{ cause: lastError },
);
}
function localPreviewTags(base) {
try {
return execFileSync("git", ["tag", "--list", `v${base}-${PREVIEW_ID}.*`], {
encoding: "utf8",
stdio: ["ignore", "pipe", "ignore"],
})
.split("\n")
.filter(Boolean);
} catch {
// No git, no repository, or a clone without tags. Tags are only a floor under the
// registry, so carry on rather than fail.
process.stderr.write("warning: could not list git tags; using the registry alone\n");
return [];
}
}
function readFlag(argv, name) {
const index = argv.indexOf(name);
return index === -1 ? undefined : argv[index + 1];
}
async function main(argv) {
const packageJsonPath = readFlag(argv, "--package-json") ?? "package.json";
const manifest = JSON.parse(readFileSync(packageJsonPath, "utf8"));
const base = bumpPatch(manifest.version);
const registryVersions = await fetchPublishedVersions(manifest.name, {
registry: readFlag(argv, "--registry") ?? DEFAULT_REGISTRY,
});
const tags = argv.includes("--no-git-tags") ? [] : localPreviewTags(base);
// Diagnostics on stderr so stdout stays a single machine-readable line.
process.stderr.write(
`${manifest.name} ${manifest.version} -> base ${base}; registry high-water ` +
`${highestPreviewNumber(registryVersions, base)}, tag high-water ` +
`${highestPreviewNumber(tags.map(versionFromTag), base)}\n`,
);
process.stdout.write(`${nextPreviewVersion({ base, registryVersions, tags })}\n`);
}
// Only when invoked as a program, so the helpers above can be imported by the test
// without doing any I/O.
if (import.meta.url === pathToFileURL(process.argv[1] ?? "").href) {
main(process.argv.slice(2)).catch((error) => {
process.stderr.write(`${error.message}\n`);
process.exit(1);
});
}

View File

@@ -0,0 +1,249 @@
import { describe, it, expect, vi } from "vitest";
import {
bumpPatch,
previewNumber,
versionFromTag,
highestPreviewNumber,
nextPreviewVersion,
fetchPublishedVersions,
} from "./next-preview-version.mjs";
const PACKAGE = "@agentclientprotocol/claude-agent-acp";
/** A packument response, abbreviated the way the registry returns it. */
function packument(versions) {
return {
ok: true,
status: 200,
statusText: "OK",
json: async () => ({ name: PACKAGE, versions }),
};
}
function failure(status, statusText = "Internal Server Error") {
return { ok: false, status, statusText, json: async () => ({}) };
}
describe("bumpPatch", () => {
it("increments the patch", () => {
expect(bumpPatch("0.73.0")).toBe("0.73.1");
expect(bumpPatch("1.0.0")).toBe("1.0.1");
expect(bumpPatch("0.0.0")).toBe("0.0.1");
});
it("increments numerically rather than by concatenation", () => {
expect(bumpPatch("0.73.9")).toBe("0.73.10");
expect(bumpPatch("0.73.19")).toBe("0.73.20");
});
it("trims surrounding whitespace", () => {
expect(bumpPatch(" 0.73.0 ")).toBe("0.73.1");
});
// release-please owns package.json's version, so anything that is not a plain
// release means something else has edited it. Failing loudly beats guessing.
it.each([
["a two-part version", "0.73"],
["a four-part version", "0.73.0.1"],
["a prerelease", "0.73.0-preview.1"],
["build metadata", "0.73.0+build.1"],
["a v prefix", "v0.73.0"],
["a range", "^0.73.0"],
["leading zeros", "01.2.3"],
["the empty string", ""],
["undefined", undefined],
])("throws on %s", (_label, version) => {
expect(() => bumpPatch(version)).toThrow(/plain X\.Y\.Z release version/);
});
});
describe("previewNumber", () => {
it("reads N out of a matching version", () => {
expect(previewNumber("0.73.1-preview.1", "0.73.1")).toBe(1);
expect(previewNumber("0.73.1-preview.10", "0.73.1")).toBe(10);
});
it("treats zero as a number rather than as no match", () => {
expect(previewNumber("0.73.1-preview.0", "0.73.1")).toBe(0);
});
it.each([
["a plain release", "0.73.1"],
["a different base", "0.73.2-preview.1"],
["a missing number", "0.73.1-preview"],
["leading zeros in N", "0.73.1-preview.01"],
["a dotted N", "0.73.1-preview.1.2"],
["build metadata", "0.73.1-preview.1+build.5"],
["another prerelease id", "0.73.1-alpha.1"],
// Proves the base's dots are escaped rather than matching any character.
["a base whose dots are elided", "0731-preview.1"],
// Proves the pattern is anchored at the start.
["a base with a numeric prefix", "10.73.1-preview.1"],
])("returns null for %s", (_label, candidate) => {
expect(previewNumber(candidate, "0.73.1")).toBeNull();
});
});
describe("versionFromTag", () => {
it("strips a refs/tags/ prefix and a v", () => {
expect(versionFromTag("refs/tags/v0.73.1-preview.3")).toBe("0.73.1-preview.3");
expect(versionFromTag("v0.73.1")).toBe("0.73.1");
expect(versionFromTag("0.73.1")).toBe("0.73.1");
});
});
describe("highestPreviewNumber", () => {
it("is 0 when nothing matches", () => {
expect(highestPreviewNumber([], "0.73.1")).toBe(0);
expect(highestPreviewNumber(["0.73.1", "0.72.1-preview.4"], "0.73.1")).toBe(0);
});
// Sorted as strings, `preview.9` would beat `preview.10`.
it("compares numerically, not lexicographically", () => {
expect(highestPreviewNumber(["0.73.1-preview.9", "0.73.1-preview.10"], "0.73.1")).toBe(10);
expect(highestPreviewNumber(["0.73.1-preview.10", "0.73.1-preview.9"], "0.73.1")).toBe(10);
});
it("ignores order and duplicates", () => {
const candidates = [
"0.73.1-preview.2",
"0.73.1-preview.7",
"0.73.1-preview.2",
"0.73.1-preview.5",
];
expect(highestPreviewNumber(candidates, "0.73.1")).toBe(7);
});
it("counts only the requested base", () => {
const candidates = ["0.72.1-preview.99", "0.73.1-preview.3", "0.74.1-preview.42"];
expect(highestPreviewNumber(candidates, "0.73.1")).toBe(3);
});
});
describe("nextPreviewVersion", () => {
it("starts at 1 with no history", () => {
expect(nextPreviewVersion({ base: "0.73.1" })).toBe("0.73.1-preview.1");
});
it("continues from the registry", () => {
const registryVersions = ["0.73.0", "0.73.1-preview.1", "0.73.1-preview.2", "0.73.1-preview.3"];
expect(nextPreviewVersion({ base: "0.73.1", registryVersions })).toBe("0.73.1-preview.4");
});
// The registry is CDN-served and can lag a publish by minutes; the tag the previous
// run wrote is what closes that window.
it("uses the tags as a floor when the registry is behind", () => {
const next = nextPreviewVersion({
base: "0.73.1",
registryVersions: ["0.73.1-preview.1"],
tags: ["refs/tags/v0.73.1-preview.3"],
});
expect(next).toBe("0.73.1-preview.4");
});
// The converse: publish succeeded but the tag step did not, so the registry is
// ahead. It stays authoritative.
it("keeps the registry authoritative when the tags are behind", () => {
const next = nextPreviewVersion({
base: "0.73.1",
registryVersions: ["0.73.1-preview.1", "0.73.1-preview.2", "0.73.1-preview.3"],
tags: ["v0.73.1-preview.1"],
});
expect(next).toBe("0.73.1-preview.4");
});
it("restarts at 1 once a release moves the base", () => {
const next = nextPreviewVersion({
base: "0.73.1",
registryVersions: ["0.72.1-preview.7", "0.73.0"],
tags: ["v0.72.1-preview.7"],
});
expect(next).toBe("0.73.1-preview.1");
});
it("composes with bumpPatch", () => {
const next = nextPreviewVersion({
base: bumpPatch("0.73.0"),
registryVersions: ["0.73.0"],
tags: ["v0.73.0"],
});
expect(next).toBe("0.73.1-preview.1");
});
});
describe("fetchPublishedVersions", () => {
const options = (fetchImpl) => ({ fetchImpl, backoffMs: 0 });
it("returns the version keys of the packument", async () => {
const fetchImpl = vi.fn(async () => packument({ "0.73.0": {}, "0.73.1-preview.1": {} }));
await expect(fetchPublishedVersions(PACKAGE, options(fetchImpl))).resolves.toEqual([
"0.73.0",
"0.73.1-preview.1",
]);
});
it("requests the abbreviated packument at the scope-encoded URL", async () => {
const fetchImpl = vi.fn(async () => packument({}));
await fetchPublishedVersions(PACKAGE, options(fetchImpl));
const [url, init] = fetchImpl.mock.calls[0];
expect(url).toBe("https://registry.npmjs.org/@agentclientprotocol%2fclaude-agent-acp");
expect(init.headers.accept).toBe("application/vnd.npm.install-v1+json");
});
it("honours a custom registry", async () => {
const fetchImpl = vi.fn(async () => packument({}));
await fetchPublishedVersions(PACKAGE, {
...options(fetchImpl),
registry: "http://127.0.0.1:4873",
});
expect(fetchImpl.mock.calls[0][0]).toBe(
"http://127.0.0.1:4873/@agentclientprotocol%2fclaude-agent-acp",
);
});
it("tolerates a packument with no versions", async () => {
const fetchImpl = vi.fn(async () => ({
ok: true,
status: 200,
statusText: "OK",
json: async () => ({ name: PACKAGE }),
}));
await expect(fetchPublishedVersions(PACKAGE, options(fetchImpl))).resolves.toEqual([]);
});
// A 404 is a definite answer — the package has never been published — so it must not
// be retried or turned into a failure.
it("treats 404 as an empty history without retrying", async () => {
const fetchImpl = vi.fn(async () => failure(404, "Not Found"));
await expect(fetchPublishedVersions(PACKAGE, options(fetchImpl))).resolves.toEqual([]);
expect(fetchImpl).toHaveBeenCalledTimes(1);
});
it("retries a server error and resolves", async () => {
const fetchImpl = vi
.fn()
.mockResolvedValueOnce(failure(500))
.mockResolvedValueOnce(packument({ "0.73.0": {} }));
await expect(fetchPublishedVersions(PACKAGE, options(fetchImpl))).resolves.toEqual(["0.73.0"]);
expect(fetchImpl).toHaveBeenCalledTimes(2);
});
it("retries a network failure and resolves", async () => {
const fetchImpl = vi
.fn()
.mockRejectedValueOnce(new TypeError("fetch failed"))
.mockResolvedValueOnce(packument({ "0.73.0": {} }));
await expect(fetchPublishedVersions(PACKAGE, options(fetchImpl))).resolves.toEqual(["0.73.0"]);
expect(fetchImpl).toHaveBeenCalledTimes(2);
});
// Guessing N after a failed read risks reusing a version that was published and then
// unpublished, which npm reserves forever.
it("gives up rather than guessing when every attempt fails", async () => {
const fetchImpl = vi.fn(async () => failure(500));
await expect(fetchPublishedVersions(PACKAGE, options(fetchImpl))).rejects.toThrow(
/could not read published versions for @agentclientprotocol\/claude-agent-acp after 3 attempts/,
);
expect(fetchImpl).toHaveBeenCalledTimes(3);
});
});

124
scripts/release-preflight.sh Executable file
View File

@@ -0,0 +1,124 @@
#!/usr/bin/env bash
#
# Preflight checks for a release.
#
# release-please decides what the next version is; this script only verifies the
# repository is in a state where merging the open release PR produces a correct
# release. Merging main needs no review, so these checks are the only thing
# standing between a mistake and a published package — keep them as code rather
# than as a list someone has to remember. See docs/RELEASES.md.
#
# Requires an authenticated GitHub CLI. Nothing else: gh has a jq engine builtin.
set -euo pipefail
PENDING_LABEL="autorelease: pending"
fail() {
printf 'FAIL %s\n' "$1" >&2
exit 1
}
pass() {
printf 'ok %s\n' "$1"
}
command -v gh >/dev/null 2>&1 ||
fail "GitHub CLI (gh) is not installed."
gh auth status >/dev/null 2>&1 ||
fail "GitHub CLI is not authenticated. Run 'gh auth login'."
repo=$(gh repo view --json nameWithOwner --jq .nameWithOwner 2>/dev/null) ||
fail "cannot work out which GitHub repository this is. Run from a checkout."
# A merged release PR that still carries the pending label means release-please
# never tagged it. In that state it refuses to open any new release PR at all,
# so every later release stalls silently until it is recovered by hand.
stuck=$(gh pr list --repo "$repo" --state merged --label "$PENDING_LABEL" \
--json number --jq 'map("#\(.number)") | join(", ")')
[ -z "$stuck" ] ||
fail "merged release PR still labelled '$PENDING_LABEL': $stuck.
release-please is jammed and will not open new release PRs.
See docs/RELEASES.md, 'Recovering a stalled release'."
pass "no untagged merged release PR"
rows=$(gh pr list --repo "$repo" --state open --label "$PENDING_LABEL" \
--json number,title,headRefName --jq '.[] | [.number, .headRefName, .title] | @tsv')
count=$(printf '%s\n' "$rows" | grep -c . || true)
if [ "$count" -eq 0 ]; then
fail "no open release PR.
Nothing has landed since the last tag that release-please puts in a
changelog, so there is nothing to release. Land a feat/fix/perf/revert/docs
change first, or check that the Publish and Release workflow is running."
fi
if [ "$count" -gt 1 ]; then
fail "$count open release PRs, expected exactly one:
$rows"
fi
IFS=$(printf '\t') read -r pr_number head_ref pr_title <<EOF
$rows
EOF
pass "one open release PR: #$pr_number ($pr_title)"
# release-please reads the version to tag from the PR title, while npm publishes
# whatever package.json says. If those disagree the tag and the published package
# describe different releases, so check all three sources against each other.
# The version is the last field, not everything after 'release': release-please
# writes the component into the title as 'release <component> X.Y.Z' whenever it
# is configured to tag with one.
title_version=${pr_title##* }
case $title_version in
[0-9]*.[0-9]*.[0-9]*) ;;
*) fail "cannot read a version from PR title '$pr_title'." ;;
esac
pkg_version=$(gh api "repos/$repo/contents/package.json?ref=$head_ref" \
-H "Accept: application/vnd.github.raw" --jq .version)
manifest_version=$(gh api "repos/$repo/contents/.release-please-manifest.json?ref=$head_ref" \
-H "Accept: application/vnd.github.raw" --jq '."."')
if [ "$title_version" != "$pkg_version" ] || [ "$title_version" != "$manifest_version" ]; then
fail "version mismatch on #$pr_number:
PR title $title_version
package.json $pkg_version
.release-please-manifest.json $manifest_version"
fi
pass "version agrees across PR title, package.json and manifest: $title_version"
# The tag comes from the config, not from the PR title. With
# include-component-in-tag left on, release-please tags <component>-vX.Y.Z, which
# breaks the vX.Y.Z scheme the rest of this script and docs/RELEASES.md rely on,
# and makes it rewrite the whole history into the changelog because no tag under
# that scheme exists yet. The compare link it writes into the PR body names the
# tags it is going to use, so check those rather than trusting the config.
compare_tag=$(gh pr view "$pr_number" --repo "$repo" --json body --jq '
.body | capture("/compare/[^)]*[.][.][.](?<to>[^)\\s]+)").to // ""' 2>/dev/null || true)
case $compare_tag in
"" | "v$title_version") ;;
*) fail "release-please is going to tag '$compare_tag', not 'v$title_version'.
Every previous release is tagged vX.Y.Z, and the changelog for #$pr_number
covers the whole history rather than just this release, because no tag
under that scheme exists. Set 'include-component-in-tag': false in
release-please-config.json, then let it rewrite the release PR." ;;
esac
if gh release view "v$title_version" --repo "$repo" >/dev/null 2>&1; then
fail "tag v$title_version already exists. Merging would try to release it twice."
fi
pass "tag v$title_version does not exist yet"
build=$(gh pr view "$pr_number" --repo "$repo" --json statusCheckRollup --jq '
[.statusCheckRollup[]? | select(.name == "Build")]
| if length == 0 then "MISSING" else (.[0].conclusion // .[0].status // "PENDING") end')
[ "$build" = "SUCCESS" ] ||
fail "required check 'Build' is $build on #$pr_number, expected SUCCESS."
pass "required check 'Build' passed"
cat <<EOF
Ready to release $title_version.
gh pr merge $pr_number --squash
Merging tags v$title_version, publishes to npm and updates the agent registry.
EOF

File diff suppressed because it is too large Load Diff

124
src/acp-subagents.ts Normal file
View File

@@ -0,0 +1,124 @@
import type {
ClientCapabilities,
SessionCapabilities,
SessionNotification,
} from "@agentclientprotocol/sdk";
import {
AIR_NATIVE_SUBAGENT_SESSIONS_CAPABILITY,
clientSupportsAirCapability,
} from "./air-extension.js";
export { AIR_NATIVE_SUBAGENT_SESSIONS_CAPABILITY } from "./air-extension.js";
/**
* Temporary typed surface for agentclientprotocol/agent-client-protocol#1992.
*
* The wire contract is already defined by the ACP draft, but the published
* TypeScript SDK does not contain it yet. Keep the compatibility boundary in
* this file so it can be replaced by SDK exports without changing lifecycle
* code when the draft ships.
*/
export type SubagentSessionCapabilities = {
cancel?: boolean;
close?: boolean;
_meta?: Record<string, unknown> | null;
};
export type SubagentSpawnedUpdate = {
sessionUpdate: "subagent_spawned";
subagentSessionId: string;
name: string;
task: string;
/**
* Adapter extension: the exact prompt of the subagent. A client can show it
* as the first user message of the subagent session. It is absent when the
* adapter does not know the prompt.
*/
prompt?: string;
capabilities: SubagentSessionCapabilities;
_meta?: Record<string, unknown> | null;
};
export type SubagentState = "completed" | "failed" | "cancelled" | "disconnected";
export type SubagentStateUpdate = {
sessionUpdate: "subagent_state_update";
subagentSessionId: string;
state: SubagentState;
_meta?: Record<string, unknown> | null;
};
export type AsyncTaskState = "running" | "paused" | "completed" | "failed" | "stopped";
export type AsyncTaskSpawnedUpdate = {
sessionUpdate: "async_task_spawned";
asyncTaskId: string;
name: string;
taskType: string;
description: string;
showInTranscript: boolean;
canStop: boolean;
outputFilePath?: string;
toolCallId?: string;
_meta?: Record<string, unknown> | null;
};
export type AsyncTaskProgressUpdate = {
sessionUpdate: "async_task_progress";
asyncTaskId: string;
description?: string;
summary?: string;
lastToolName?: string;
usage?: { totalTokens: number; toolUses: number; durationMs: number };
/** Latest durable task log path. May arrive after spawn. */
outputFilePath?: string;
/** Originating tool call, when correlation becomes known after spawn. */
toolCallId?: string;
_meta?: Record<string, unknown> | null;
};
export type AsyncTaskStateUpdate = {
sessionUpdate: "async_task_state_update";
asyncTaskId: string;
state: AsyncTaskState;
summary?: string;
/** Latest durable task log path, including terminal-only SDK reports. */
outputFilePath?: string;
/** Originating tool call, including terminal-only late correlation. */
toolCallId?: string;
_meta?: Record<string, unknown> | null;
};
export type AcpSessionUpdate =
| SessionNotification["update"]
| SubagentSpawnedUpdate
| SubagentStateUpdate
| AsyncTaskSpawnedUpdate
| AsyncTaskProgressUpdate
| AsyncTaskStateUpdate;
export type AcpSessionNotification = Omit<SessionNotification, "update"> & {
update: AcpSessionUpdate;
};
export type SubagentAwareSessionCapabilities = SessionCapabilities & {
subagents?: Record<string, never>;
};
export function clientSupportsSubagents(capabilities?: ClientCapabilities | null): boolean {
const subagents = (
capabilities as (ClientCapabilities & { subagents?: unknown }) | null | undefined
)?.subagents;
if (typeof subagents === "object" && subagents !== null && !Array.isArray(subagents)) {
return true;
}
return clientSupportsAirCapability(capabilities, AIR_NATIVE_SUBAGENT_SESSIONS_CAPABILITY);
}
/** The only cast needed until the TypeScript SDK publishes PR #1992. */
export function asSdkSessionNotification(
notification: AcpSessionNotification,
): SessionNotification {
return notification as SessionNotification;
}

119
src/air-extension.ts Normal file
View File

@@ -0,0 +1,119 @@
export const AIR_NATIVE_SUBAGENT_SESSIONS_CAPABILITY = "nativeSubagentSessions";
export const AIR_ASYNC_TASKS_CAPABILITY = "asyncTasks";
export const AIR_SESSION_FAILURE_CAPABILITY = "sessionFailure";
export const AIR_RECOMMENDED_CONFIG_VALUE_CAPABILITY = "recommendedValue";
export const AIR_DIFF_PATCH_CAPABILITY = "diffPatch";
/** AIR renders `rawInput` itself and needs no display copy of the input. */
export const AIR_RAW_INPUT_RENDERING_CAPABILITY = "rawInputRendering";
/**
* The plan of an ExitPlanMode is a file. `rawInput.planFilePath` names the
* file, and AIR reads the plan from it.
*/
export const AIR_PLAN_FILE_CAPABILITY = "planFile";
/** The `_meta.jetbrains.air` keys that the ACP tool call contract defines. */
export const AIR_COMMAND_TITLE_KEY = "commandTitle";
export const AIR_SUBAGENT_KEY = "subagent";
export const AIR_SKILL_KEY = "skill";
export const AIR_CONTEXT_COMPACTION_KEY = "contextCompaction";
export const AIR_GOAL_KEY = "goal";
export const AIR_KIND_KEY = "kind";
export const AIR_PERMISSION_KEY = "permission";
export const AIR_CUSTOM_ANSWER_KEY = "customAnswer";
const JETBRAINS_META_KEY = "jetbrains";
const AIR_META_KEY = "air";
const AIR_EXTENSION_VERSION_KEY = "version";
const AIR_EXTENSION_CAPABILITIES_KEY = "capabilities";
const AIR_EXTENSION_VERSION = 1;
/** The capability list this side advertises, as its own `_meta` object. */
export function airCapabilityMeta(...capabilities: string[]) {
return withAirMeta(undefined, AIR_EXTENSION_CAPABILITIES_KEY, capabilities);
}
/**
* Merges one AIR extension payload into an existing `_meta`.
*
* Every other namespace is preserved: an update can carry both agent-native
* `claudeCode` metadata and an AIR payload, and two AIR payloads can share the
* same `air` object. Pass `undefined` to build a fresh `_meta`.
*/
export function withAirMeta(
meta: Record<string, unknown> | null | undefined,
capability: string,
payload: unknown,
): Record<string, unknown> {
const jetbrains = asRecord(meta?.[JETBRAINS_META_KEY]);
const air = asRecord(jetbrains[AIR_META_KEY]);
return {
...meta,
[JETBRAINS_META_KEY]: {
...jetbrains,
[AIR_META_KEY]: {
...air,
[AIR_EXTENSION_VERSION_KEY]: AIR_EXTENSION_VERSION,
[capability]: payload,
},
},
};
}
/**
* Whether the client is JetBrains AIR: it declared `_meta.jetbrains.air` in
* its capabilities.
*
* Only AIR gets the AIR extensions of `docs/air-extensions.md`. Every other
* client, Zed too, gets the fields and the upstream `_meta` keys of the
* upstream adapter, and no key that exists only for AIR.
*/
export function isAirClient(capabilities: unknown): boolean {
return airExtensionMeta(asRecord(capabilities)._meta) !== undefined;
}
/**
* The `_meta` of an AIR client with one more AIR payload, or undefined for
* every other client: a client that is not AIR gets no AIR key.
*/
export function airOnlyMeta(
airClient: boolean,
capability: string,
payload: unknown,
meta?: Record<string, unknown> | null,
): Record<string, unknown> | undefined {
return airClient ? withAirMeta(meta, capability, payload) : (meta ?? undefined);
}
/** The `air` object inside a `_meta`, or undefined when the peer sent no AIR extension. */
export function airExtensionMeta(meta: unknown): Record<string, unknown> | undefined {
const air = asRecord(asRecord(meta)[JETBRAINS_META_KEY])[AIR_META_KEY];
return air && typeof air === "object" && !Array.isArray(air)
? (air as Record<string, unknown>)
: undefined;
}
/**
* Whether the peer advertised `capability`.
*
* Takes `unknown` because every caller is reading wire data: an ACP
* `ClientCapabilities`, or a bag whose `_meta` was never validated.
*/
export function clientSupportsAirCapability(capabilities: unknown, capability: string): boolean {
const air = airExtensionMeta(asRecord(capabilities)._meta);
const version = air?.[AIR_EXTENSION_VERSION_KEY];
const advertised = air?.[AIR_EXTENSION_CAPABILITIES_KEY];
return (
typeof version === "number" &&
Number.isFinite(version) &&
Number.isInteger(version) &&
version >= AIR_EXTENSION_VERSION &&
Array.isArray(advertised) &&
advertised.includes(capability)
);
}
function asRecord(value: unknown): Record<string, unknown> {
return value && typeof value === "object" && !Array.isArray(value)
? (value as Record<string, unknown>)
: {};
}

893
src/async-tasks.ts Normal file
View File

@@ -0,0 +1,893 @@
import type { ClientCapabilities } from "@agentclientprotocol/sdk";
import type { AcpSessionNotification, AsyncTaskState } from "./acp-subagents.js";
import { AIR_ASYNC_TASKS_CAPABILITY, clientSupportsAirCapability } from "./air-extension.js";
import { noticeOrTranscriptUpdate } from "./session-notices.js";
type Publish = (notification: AcpSessionNotification) => Promise<void>;
/** Moves an update to its owner session, or drops it with `null`. */
type Route = (notification: AcpSessionNotification) => AcpSessionNotification | null;
type TerminalSource = "event" | "level" | "shutdown";
type AsyncTask = {
id: string;
name: string;
taskType: string;
description: string;
showInTranscript: boolean;
outputFilePath?: string;
toolCallId?: string;
/**
* The route to the session of the tool call that started the task. The
* spawn sets it, so every update of the task goes to one session. A task
* without a route stays in the root session.
*/
route?: Route;
announced: boolean;
/**
* Whether the spawn waits for the tool call id. The updates of a held task
* wait in {@link AsyncTask.deferred} and follow the spawn in order.
*/
held: boolean;
deferred: (() => Promise<void>)[];
ignored: boolean;
startedObserved: boolean;
panelOnlyRecovery: boolean;
stopping: boolean;
stopAnnounced: boolean;
state: AsyncTaskState;
terminalSummary?: string;
terminalSource?: TerminalSource;
/** The optional fields that the client holds now, as JSON. */
published: Map<string, string>;
};
type TaskIdentity = { taskId?: unknown; task_id?: unknown };
export type AsyncTaskStarted = TaskIdentity & {
taskType?: unknown;
task_type?: unknown;
description?: unknown;
subagentType?: unknown;
subagent_type?: unknown;
isBackgrounded?: unknown;
is_backgrounded?: unknown;
workflowName?: unknown;
workflow_name?: unknown;
skipTranscript?: unknown;
skip_transcript?: unknown;
outputFilePath?: unknown;
output_file?: unknown;
toolCallId?: unknown;
tool_use_id?: unknown;
};
export type AsyncTaskUpdated = TaskIdentity & { patch?: TaskPatch };
type TaskPatch = {
status?: unknown;
description?: unknown;
isBackgrounded?: unknown;
is_backgrounded?: unknown;
error?: unknown;
outputFilePath?: unknown;
output_file?: unknown;
};
export type AsyncTaskNotification = TaskIdentity & {
status?: unknown;
toolCallId?: unknown;
tool_use_id?: unknown;
summary?: unknown;
outputFilePath?: unknown;
output_file?: unknown;
};
type TaskProgress = TaskIdentity & {
description?: unknown;
toolCallId?: unknown;
tool_use_id?: unknown;
summary?: unknown;
lastToolName?: unknown;
last_tool_name?: unknown;
usage?: unknown;
outputFilePath?: unknown;
output_file?: unknown;
};
type BackgroundTaskLevel = TaskIdentity & {
taskType?: unknown;
task_type?: unknown;
description?: unknown;
};
export function clientSupportsAsyncTasks(capabilities?: ClientCapabilities | null): boolean {
return clientSupportsAirCapability(capabilities, AIR_ASYNC_TASKS_CAPABILITY);
}
/** Publishes Claude's non-agent background work as a separate AIR task lifecycle. */
export class AsyncTaskRuntime {
/**
* One registry owns both active tasks and terminal tombstones. Keeping an
* unannounced terminal record is intentional: the Bash result proving that
* a command was backgrounded can arrive after its terminal SDK edge.
*/
private readonly tasks = new Map<string, AsyncTask>();
constructor(
readonly enabled: boolean,
private readonly sessionId: string,
private readonly publish: Publish,
/** `notices`: the client can present `notice` updates, so the stop
* acknowledgement need not be a transcript line. `routeOf`: the route of
* the tasks that a tool call in another session started, for example in
* a native subagent session. */
private readonly options: {
notices?: boolean;
routeOf?: (toolCallId: string) => Route | undefined;
} = {},
) {}
async taskStarted(message: AsyncTaskStarted): Promise<void> {
if (!this.enabled) return;
const taskId = taskIdOf(message);
if (!taskId) return;
const task = this.task(taskId);
if (isSubagentTask(message)) {
task.ignored = true;
return;
}
const previousOutputFilePath = task.outputFilePath;
const previousToolCallId = task.toolCallId;
const wasAnnounced = task.announced;
this.mergeStarted(task, message);
if (
isBackgroundTask(
field(message, "isBackgrounded", "is_backgrounded"),
field(message, "taskType", "task_type"),
) ||
task.held
) {
await this.announce(task);
}
if (
wasAnnounced &&
(task.outputFilePath !== previousOutputFilePath || task.toolCallId !== previousToolCallId)
) {
await this.publishMetadata(task);
}
}
async taskBackgrounded(message: AsyncTaskStarted): Promise<void> {
if (!this.enabled) return;
const taskId = taskIdOf(message);
if (!taskId) return;
const task = this.task(taskId);
if (isSubagentTask(message)) {
task.ignored = true;
return;
}
const previousOutputFilePath = task.outputFilePath;
const previousToolCallId = task.toolCallId;
const wasAnnounced = task.announced;
this.mergeStarted(task, message);
await this.announce(task);
if (
wasAnnounced &&
(task.outputFilePath !== previousOutputFilePath || task.toolCallId !== previousToolCallId)
) {
await this.publishMetadata(task);
}
}
async taskUpdated(message: AsyncTaskUpdated): Promise<void>;
async taskUpdated(taskId: string, patch: TaskPatch): Promise<void>;
async taskUpdated(taskOrId: string | AsyncTaskUpdated, legacyPatch?: TaskPatch): Promise<void> {
if (!this.enabled) return;
const taskId = typeof taskOrId === "string" ? nonBlankString(taskOrId) : taskIdOf(taskOrId);
const patch = typeof taskOrId === "string" ? legacyPatch : taskOrId.patch;
if (!taskId || !patch) return;
const task = this.task(taskId);
const previousOutputFilePath = task.outputFilePath;
this.mergePatch(task, patch);
if (field(patch, "isBackgrounded", "is_backgrounded") === true) {
await this.announce(task);
}
const state = taskState(patch.status);
if (!state) {
if (task.announced && task.outputFilePath !== previousOutputFilePath) {
await this.publishMetadata(task);
}
return;
}
if (state === "running" || state === "paused") {
if (isTerminal(task.state)) {
if (task.announced && task.outputFilePath !== previousOutputFilePath) {
await this.publishMetadata(task);
}
return;
}
if (task.state !== state) {
task.state = state;
const error = nonBlankString(patch.error);
await this.whenAnnounced(task, () => this.publishState(task, state, error));
} else if (task.announced && task.outputFilePath !== previousOutputFilePath) {
await this.publishMetadata(task);
}
return;
}
await this.finish(task, state, nonBlankString(patch.error), "event");
}
async taskProgress(message: TaskProgress): Promise<void> {
if (!this.enabled) return;
const taskId = taskIdOf(message);
if (!taskId) return;
const task = this.tasks.get(taskId);
if (!task || task.ignored || !(task.announced || task.held)) return;
const previousOutputFilePath = task.outputFilePath;
const previousToolCallId = task.toolCallId;
this.mergeOutputFilePath(task, message);
this.mergeToolCallId(task, message);
const outputChanged = task.outputFilePath !== previousOutputFilePath;
if (isTerminal(task.state)) {
if (outputChanged) await this.publishMetadata(task);
return;
}
const usage = taskUsage(message.usage);
const description = nonBlankString(message.description);
const summary = nonBlankString(message.summary);
const lastToolName = nonBlankString(field(message, "lastToolName", "last_tool_name"));
const progress = {
...(description ? { description } : {}),
...(summary ? { summary } : {}),
...(lastToolName ? { lastToolName } : {}),
...(usage ? { usage } : {}),
...(outputChanged && task.outputFilePath ? { outputFilePath: task.outputFilePath } : {}),
...(task.toolCallId !== previousToolCallId && task.toolCallId
? { toolCallId: task.toolCallId }
: {}),
};
await this.whenAnnounced(task, () => this.publishProgress(task, progress));
// The progress brought the tool call id of a held task: send the spawn,
// then the progress beats that waited for it.
if (task.held && task.toolCallId) await this.announce(task);
}
async taskNotification(message: AsyncTaskNotification): Promise<void>;
async taskNotification(
taskId: string,
status: unknown,
summary?: unknown,
outputFilePath?: unknown,
): Promise<void>;
async taskNotification(
taskOrId: string | AsyncTaskNotification,
legacyStatus?: unknown,
legacySummary?: unknown,
legacyOutputFilePath?: unknown,
): Promise<void> {
if (!this.enabled) return;
const message: AsyncTaskNotification =
typeof taskOrId === "string"
? {
taskId: taskOrId,
status: legacyStatus,
summary: legacySummary,
outputFilePath: legacyOutputFilePath,
}
: taskOrId;
const taskId = taskIdOf(message);
const state = taskState(message.status);
if (!taskId || !state || state === "running" || state === "paused") return;
const task = this.task(taskId);
const wasTerminal = isTerminal(task.state);
const correctsLevelState = wasTerminal && task.terminalSource === "level";
const previousOutputFilePath = task.outputFilePath;
this.mergeOutputFilePath(task, message);
this.mergeToolCallId(task, message);
await this.finish(task, state, nonBlankString(message.summary), "event");
if (
wasTerminal &&
!correctsLevelState &&
task.announced &&
task.outputFilePath !== previousOutputFilePath
) {
await this.publishMetadata(task);
}
}
/**
* Reconciles the SDK's replace-semantics background task level. It does not
* create unknown tasks because this level normally precedes task_started and
* carries no tool-call attribution. It can, however, promote a known
* foreground task and terminate an announced task whose edge was lost.
*/
async backgroundTasksChanged(
tasksOrMessage: readonly BackgroundTaskLevel[] | { tasks?: unknown },
): Promise<void> {
if (!this.enabled) return;
const value = Array.isArray(tasksOrMessage)
? tasksOrMessage
: isRecord(tasksOrMessage)
? tasksOrMessage.tasks
: undefined;
if (!Array.isArray(value)) return;
const live = new Set<string>();
for (const item of value) {
if (!isRecord(item)) continue;
const taskId = taskIdOf(item);
if (!taskId) continue;
live.add(taskId);
const task = this.task(taskId);
if (task.ignored || isTerminal(task.state)) continue;
if (field(item, "taskType", "task_type") === "local_agent") {
task.ignored = true;
continue;
}
if (!task.startedObserved) {
// The replace-level proves liveness but carries neither transcript
// policy nor full identity. Recover it for the Async Tasks panel only;
// creating a transcript card here would be irreversible if a late
// task_started says skip_transcript=true.
task.panelOnlyRecovery = true;
task.showInTranscript = false;
}
this.mergeLevel(task, item);
await this.announce(task);
}
for (const task of this.tasks.values()) {
if (
(task.announced || task.held) &&
!task.ignored &&
!isTerminal(task.state) &&
!live.has(task.id)
) {
// This replace-semantics level is itself the authoritative liveness
// boundary. Close immediately so a lost terminal edge cannot leave a
// permanent running card; a following task_notification may correct
// the best-effort stopped state to completed/failed.
await this.finish(task, "stopped", undefined, "level");
}
}
}
async finishAll(state: Extract<AsyncTaskState, "failed" | "stopped">): Promise<void> {
const errors: unknown[] = [];
for (const task of this.tasks.values()) {
if ((task.announced || task.held) && !task.ignored && !isTerminal(task.state)) {
try {
await this.finish(task, state, undefined, "shutdown");
} catch (error) {
errors.push(error);
}
}
}
if (errors.length === 1) throw errors[0];
if (errors.length > 1) throw new AggregateError(errors, "Failed to finish async tasks");
}
canStop(taskId: string): boolean {
const task = this.tasks.get(taskId);
return task?.announced === true && !task.ignored && !task.stopping && !isTerminal(task.state);
}
claimStop(taskId: string): boolean {
if (!this.canStop(taskId)) return false;
this.tasks.get(taskId)!.stopping = true;
return true;
}
releaseStop(taskId: string): void {
const task = this.tasks.get(taskId);
if (task && !isTerminal(task.state)) task.stopping = false;
}
async taskStopped(taskId: string): Promise<void> {
const task = this.tasks.get(taskId);
if (!task || !task.announced || task.ignored || task.stopAnnounced) return;
task.stopAnnounced = true;
// No terminal summary: a stopped task leaves the Async Tasks panel at once,
// so anything said there is said to nobody.
await this.finish(task, "stopped", undefined, "event");
// This acknowledgement is the only one the user gets -- the SDK injects
// nothing into the model's context for a stopped shell task. A client on
// the notice contract shows it as a live `notice`; otherwise the
// transcript is where it has to land.
//
// Terminal state deliberately does not gate this. The SDK's own
// `task_notification` routinely wins the race against the `stopTask`
// response that brought us here, so by now the task is usually already
// terminal: gating on that would silence the very stop the user asked for.
// `stopAnnounced` is what keeps this to one line per task.
//
// `showInTranscript` does not gate it either: that flag decides whether the
// task owns a transcript *card* (a background Bash task is already drawn as
// its tool call), not whether the agent may answer a direct user action.
await this.send(
task,
noticeOrTranscriptUpdate(
{ severity: "info", title: "Task stopped by user", description: `${task.name}.` },
this.options.notices ?? false,
),
);
}
/**
* Sends the spawn of each held task without a tool call id. The prompt
* result ends the model turn, and the result of the tool call that started a
* task comes before it. So a held task is never held for longer than one turn.
*/
async releaseHeld(): Promise<void> {
if (!this.enabled) return;
for (const task of this.tasks.values()) {
if (task.held) await this.announce(task, { withoutToolCall: true });
}
}
clear(): void {
this.tasks.clear();
}
private task(taskId: string): AsyncTask {
let task = this.tasks.get(taskId);
if (task) return task;
task = {
id: taskId,
name: "Background task",
taskType: "task",
description: "Background task",
showInTranscript: true,
announced: false,
held: false,
deferred: [],
ignored: false,
startedObserved: false,
panelOnlyRecovery: false,
stopping: false,
stopAnnounced: false,
state: "running",
published: new Map(),
};
this.tasks.set(taskId, task);
return task;
}
private mergeStarted(task: AsyncTask, message: AsyncTaskStarted): void {
task.startedObserved = true;
const rawTaskType = field(message, "taskType", "task_type");
if (rawTaskType !== undefined) task.taskType = friendlyTaskType(rawTaskType);
const description = nonBlankString(message.description);
if (description) task.description = description;
else if (task.description === "Background task")
task.description = defaultDescription(task.taskType);
task.name = nonBlankString(field(message, "workflowName", "workflow_name")) ?? task.description;
const skipTranscript = field(message, "skipTranscript", "skip_transcript");
if (task.panelOnlyRecovery) {
// A level-only recovery was already announced without a transcript
// entry. Keep that decision monotonic: a late task_started can enrich
// the panel, but cannot retroactively create or mutate transcript UI.
task.showInTranscript = false;
} else if (skipTranscript !== undefined) {
task.showInTranscript = skipTranscript !== true;
}
this.mergeOutputFilePath(task, message);
const toolCallId = nonBlankString(field(message, "toolCallId", "tool_use_id"));
if (toolCallId) task.toolCallId = toolCallId;
}
/** Keeps the first tool call id that a later SDK message brings. */
private mergeToolCallId(
task: AsyncTask,
value: { toolCallId?: unknown; tool_use_id?: unknown },
): void {
task.toolCallId ??= nonBlankString(field(value, "toolCallId", "tool_use_id"));
}
/** Sends an update of an announced task. A held task sends it after its spawn. */
private async whenAnnounced(task: AsyncTask, send: () => Promise<void>): Promise<void> {
if (task.announced) await send();
else if (task.held) task.deferred.push(send);
}
private mergePatch(task: AsyncTask, patch: TaskPatch): void {
const description = nonBlankString(patch.description);
if (description) {
task.description = description;
task.name = description;
}
this.mergeOutputFilePath(task, patch);
}
private mergeLevel(task: AsyncTask, level: BackgroundTaskLevel): void {
const rawTaskType = field(level, "taskType", "task_type");
if (rawTaskType !== undefined) task.taskType = friendlyTaskType(rawTaskType);
const description = nonBlankString(level.description);
if (description) {
task.description = description;
task.name = description;
}
}
private mergeOutputFilePath(
task: AsyncTask,
value: { outputFilePath?: unknown; output_file?: unknown },
): void {
const outputFilePath = nonBlankString(field(value, "outputFilePath", "output_file"));
if (outputFilePath) task.outputFilePath = outputFilePath;
}
/**
* Sends the spawn of the task. The spawn names the tool call that started the
* task, so it waits for the tool call id: the task is held until the id
* arrives. The id comes as `tool_use_id` of the SDK `task_started`,
* `task_progress`, or `task_notification`, or from the Bash result of a
* backgrounded command. A held task gets its spawn without the id when it
* ends first, or when the prompt result ends the model turn
* ({@link releaseHeld}). No guess by the command text binds a task.
*/
private async announce(
task: AsyncTask,
options: { withoutToolCall?: boolean } = {},
): Promise<void> {
if (task.announced || task.ignored) return;
if (!task.toolCallId && !options.withoutToolCall && !isTerminal(task.state)) {
task.held = true;
return;
}
if (task.toolCallId) task.route ??= this.options.routeOf?.(task.toolCallId);
await this.send(task, {
sessionUpdate: "async_task_spawned",
asyncTaskId: task.id,
name: task.name,
taskType: task.taskType,
description: task.description,
showInTranscript: task.showInTranscript,
canStop: true,
...(task.outputFilePath ? { outputFilePath: task.outputFilePath } : {}),
...(task.toolCallId ? { toolCallId: task.toolCallId } : {}),
});
task.announced = true;
task.held = false;
recordPublished(task, {
description: task.description,
outputFilePath: task.outputFilePath,
toolCallId: task.toolCallId,
});
for (const send of task.deferred.splice(0)) await send();
if (isTerminal(task.state)) {
await this.publishState(task, task.state, task.terminalSummary);
}
}
private async finish(
task: AsyncTask,
state: Extract<AsyncTaskState, "completed" | "failed" | "stopped">,
summary: string | undefined,
source: TerminalSource,
): Promise<void> {
if (task.ignored) return;
if (isTerminal(task.state)) {
// A level event may precede the authoritative terminal edge. Correct its
// best-effort stopped state if that edge later arrives.
if (task.terminalSource !== "level" || source !== "event") return;
}
const previous = {
state: task.state,
terminalSummary: task.terminalSummary,
terminalSource: task.terminalSource,
};
task.state = state;
task.terminalSummary = summary;
task.terminalSource = source;
try {
if (task.announced) await this.publishState(task, state, summary);
// The task ended before its tool call id arrived. The spawn goes out now
// without the id, so the task still appears.
else if (task.held) await this.announce(task);
} catch (error) {
task.state = previous.state;
task.terminalSummary = previous.terminalSummary;
task.terminalSource = previous.terminalSource;
throw error;
}
}
private async publishMetadata(task: AsyncTask): Promise<void> {
if (task.outputFilePath || task.toolCallId) {
if (isTerminal(task.state)) {
await this.publishState(task, task.state, task.terminalSummary);
} else {
await this.publishProgress(task, {
...(task.outputFilePath ? { outputFilePath: task.outputFilePath } : {}),
...(task.toolCallId ? { toolCallId: task.toolCallId } : {}),
});
}
}
}
/**
* Publishes the progress fields that changed since the last report of the
* task. A beat with nothing new is not sent.
*/
private async publishProgress(
task: AsyncTask,
update: {
description?: string;
summary?: string;
lastToolName?: string;
usage?: { totalTokens: number; toolUses: number; durationMs: number };
outputFilePath?: string;
toolCallId?: string;
},
): Promise<void> {
const changed = changedFields(task, update);
if (Object.keys(changed).length === 0) return;
await this.send(task, {
sessionUpdate: "async_task_progress",
asyncTaskId: task.id,
...changed,
});
recordPublished(task, changed);
}
/** Publishes a state, with the output path and the tool call only when they changed. */
private async publishState(
task: AsyncTask,
state: AsyncTaskState,
summary?: string,
): Promise<void> {
const changed = changedFields(task, {
outputFilePath: task.outputFilePath,
toolCallId: task.toolCallId,
});
await this.send(task, {
sessionUpdate: "async_task_state_update",
asyncTaskId: task.id,
state,
...(summary ? { summary } : {}),
...changed,
});
recordPublished(task, changed);
}
/** Publishes an update of the task in the session that owns the task. */
private async send(task: AsyncTask, update: AcpSessionNotification["update"]): Promise<void> {
const notification: AcpSessionNotification = { sessionId: this.sessionId, update };
const routed = task.route ? task.route(notification) : notification;
if (routed) await this.publish(routed);
}
}
/**
* The fields whose value differs from what the client holds. An undefined
* value is not a field. The caller records the fields with
* {@link recordPublished} after the send succeeds, so a retry after a failed
* send carries them again.
*/
function changedFields<T extends Record<string, unknown>>(task: AsyncTask, fields: T): Partial<T> {
const changed: Partial<T> = {};
for (const [key, value] of Object.entries(fields)) {
if (value === undefined) continue;
if (task.published.get(key) === JSON.stringify(value)) continue;
(changed as Record<string, unknown>)[key] = value;
}
return changed;
}
/** Records the fields that the client holds now. An undefined value is not a field. */
function recordPublished(task: AsyncTask, fields: Record<string, unknown>): void {
for (const [key, value] of Object.entries(fields)) {
if (value !== undefined) task.published.set(key, JSON.stringify(value));
}
}
/** Recovers background Bash lifecycle data exposed only on its tool result. */
export function backgroundBashTaskFromToolResult(
content: unknown,
toolUseResult: unknown,
toolUses: Record<string, { name: string; input: unknown }>,
): AsyncTaskStarted | undefined {
if (!Array.isArray(content)) return undefined;
const toolResults = content.flatMap(toolResultBlock);
const bashResults = toolResults.filter((result) => toolUses[result.toolUseId]?.name === "Bash");
if (bashResults.length === 0) return undefined;
const backgroundResults = structuredBackgroundResults(toolUseResult, toolUses);
const distinctTaskIds = new Set([
...backgroundResults.map((result) => result.taskId),
...bashResults
.map((result) => backgroundTaskIdFromText(result.content))
.filter((taskId): taskId is string => taskId !== undefined),
]);
if (distinctTaskIds.size !== 1) return undefined;
const taskId = [...distinctTaskIds][0];
if (!taskId) return undefined;
const hintedToolUseIds = new Set(
backgroundResults
.filter((result) => result.taskId === taskId && result.toolUseId)
.map((result) => result.toolUseId!),
);
let matches: typeof bashResults;
if (hintedToolUseIds.size > 0) {
matches = bashResults.filter((result) => hintedToolUseIds.has(result.toolUseId));
} else {
const pathMatches = bashResults.filter(
(result) => asyncTaskOutputFilePath(result.content, taskId) !== undefined,
);
matches = pathMatches.length > 0 ? pathMatches : bashResults.length === 1 ? bashResults : [];
}
if (matches.length !== 1) return undefined;
const match = matches[0];
const toolUse = toolUses[match.toolUseId];
const input = isRecord(toolUse?.input) ? toolUse.input : undefined;
return {
taskId,
taskType: "local_bash",
description: nonBlankString(input?.command),
isBackgrounded: true,
outputFilePath: asyncTaskOutputFilePath(match.content, taskId),
toolCallId: match.toolUseId,
};
}
function backgroundTaskIdFromText(content: unknown): string | undefined {
const text = textContent(content);
if (!text) return undefined;
const marker = "Command running in background with ID: ";
const start = text.indexOf(marker);
if (start < 0) return undefined;
const valueStart = start + marker.length;
const valueEnd = text.indexOf(".", valueStart);
return valueEnd < 0 ? undefined : nonBlankString(text.slice(valueStart, valueEnd));
}
function structuredBackgroundResults(
value: unknown,
toolUses: Record<string, { name: string; input: unknown }>,
hintedToolUseId?: string,
seen = new Set<unknown>(),
): { taskId: string; toolUseId?: string }[] {
if (typeof value !== "object" || value === null || seen.has(value)) return [];
seen.add(value);
if (Array.isArray(value)) {
return value.flatMap((item) =>
structuredBackgroundResults(item, toolUses, hintedToolUseId, seen),
);
}
const directTaskId = nonBlankString(field(value, "backgroundTaskId", "background_task_id"));
const directToolUseId =
nonBlankString(field(value, "toolUseId", "tool_use_id")) ?? hintedToolUseId;
const results: { taskId: string; toolUseId?: string }[] = directTaskId
? [{ taskId: directTaskId, toolUseId: directToolUseId }]
: [];
for (const [key, child] of Object.entries(value)) {
if (key === "backgroundTaskId" || key === "background_task_id") continue;
results.push(
...structuredBackgroundResults(child, toolUses, toolUses[key] ? key : directToolUseId, seen),
);
}
return results;
}
function toolResultBlock(value: unknown): { toolUseId: string; content?: unknown }[] {
if (!isRecord(value) || value.type !== "tool_result") return [];
const toolUseId = nonBlankString(field(value, "toolUseId", "tool_use_id"));
return toolUseId ? [{ toolUseId, content: value.content }] : [];
}
function asyncTaskOutputFilePath(content: unknown, taskId: string): string | undefined {
const text = textContent(content);
if (!text) return undefined;
const marker = "Output is being written to: ";
const start = text.indexOf(marker);
if (start < 0) return undefined;
const valueStart = start + marker.length;
const valueEnd = text.indexOf(". You will be notified", valueStart);
if (valueEnd < 0) return undefined;
const path = text.slice(valueStart, valueEnd).trim();
const expectedPosixSuffix = `/tasks/${taskId}.output`;
const expectedWindowsSuffix = `\\tasks\\${taskId}.output`;
return path.endsWith(expectedPosixSuffix) || path.endsWith(expectedWindowsSuffix)
? path
: undefined;
}
function textContent(value: unknown): string | undefined {
if (typeof value === "string") return value;
if (Array.isArray(value)) {
const parts = value.map(textContent).filter((part): part is string => part !== undefined);
return parts.length > 0 ? parts.join("") : undefined;
}
if (!isRecord(value)) return undefined;
if (typeof value.text === "string") return value.text;
return value.content === value ? undefined : textContent(value.content);
}
function friendlyTaskType(value: unknown): string {
if (value === "local_bash") return "shell";
if (value === "local_workflow") return "workflow";
if (value === "local_monitor" || value === "mcp") return "monitor";
return nonBlankString(value) ?? "task";
}
function defaultDescription(taskType: string): string {
return taskType === "task" ? "Background task" : taskType[0].toUpperCase() + taskType.slice(1);
}
function isBackgroundTask(isBackgrounded: unknown, taskType: unknown): boolean {
if (isBackgrounded === true) return true;
if (isBackgrounded === false) return false;
return taskType !== "local_bash" && taskType !== "local_agent";
}
function isSubagentTask(message: AsyncTaskStarted): boolean {
return (
field(message, "subagentType", "subagent_type") !== undefined ||
field(message, "taskType", "task_type") === "local_agent"
);
}
function taskState(value: unknown): AsyncTaskState | undefined {
if (value === "pending" || value === "running") return "running";
if (value === "paused") return "paused";
if (value === "completed") return "completed";
if (value === "failed") return "failed";
if (value === "killed" || value === "cancelled" || value === "stopped") return "stopped";
return undefined;
}
function isTerminal(state: AsyncTaskState): state is "completed" | "failed" | "stopped" {
return state === "completed" || state === "failed" || state === "stopped";
}
function taskUsage(
value: unknown,
): { totalTokens: number; toolUses: number; durationMs: number } | undefined {
if (!isRecord(value)) return undefined;
const totalTokens = numberField(value, "totalTokens", "total_tokens");
const toolUses = numberField(value, "toolUses", "tool_uses");
const durationMs = numberField(value, "durationMs", "duration_ms");
if (totalTokens === undefined || toolUses === undefined || durationMs === undefined)
return undefined;
return { totalTokens, toolUses, durationMs };
}
function taskIdOf(value: TaskIdentity): string | undefined {
return nonBlankString(field(value, "taskId", "task_id"));
}
function field(value: object, camelCase: string, snakeCase: string): unknown {
const record = value as Record<string, unknown>;
return record[camelCase] !== undefined ? record[camelCase] : record[snakeCase];
}
function numberField(
value: Record<string, unknown>,
camelCase: string,
snakeCase: string,
): number | undefined {
const result = field(value, camelCase, snakeCase);
return typeof result === "number" ? result : undefined;
}
function nonBlankString(value: unknown): string | undefined {
return typeof value === "string" && value.trim().length > 0 ? value.trim() : undefined;
}
function isRecord(value: unknown): value is Record<string, unknown> {
return typeof value === "object" && value !== null && !Array.isArray(value);
}

337
src/auth-status.ts Normal file
View File

@@ -0,0 +1,337 @@
/**
* `authStatus` — interim `_meta`-based ACP extension that reports which auth
* identity the agent process itself uses (Claude subscription, API key,
* gateway, external cloud credentials, or nothing).
*
* Push only. One carrier, connection-scoped (never per session): the
* notification `_auth/status_update` → `{authStatus}`. The client never asks;
* there is no request method. The empty `agentCapabilities._meta.authStatus`
* marker means "this agent pushes its identity", nothing more.
*
* The agent reads the identity at these moments:
* - `initialize`, with an asynchronous CLI probe. Nothing waits for it, and its
* result is the first push of the connection;
* - a completed `authenticate` or a `logout`;
* - each `createSession`, from the session account. A refused session reports
* too: the client must know which account was refused;
* - each turn the `--hide-claude-auth` guard checks. The guard reads the
* account anyway, so this costs nothing;
* - the START of each user prompt, with an asynchronous CLI probe. This finds a
* login or a logout done in another terminal, including the sign-in a client
* performs after a refusal, because the retried prompt is a new prompt.
* Nothing waits for it and the push goes out mid-turn if that is when the
* read lands.
*
* A probe whose kind differs from a live session's account marks that session
* for recreation under `--hide-claude-auth`. The mark is a flag, consumed at
* the next turn boundary: a running turn is never interrupted. The probe judges
* nothing itself — the next turn runs a new `initialize`, and the creation
* guard decides on the account it reports.
*
* A read does not always cause a push. The agent sends `_auth/status_update`
* only when the payload is different from the last one it sent.
*
* "Cannot determine" is expressed by silence: an agent that cannot read its own
* identity pushes nothing, and the client shows "not reported". A known
* logged-out state is a payload of its own (`kind: "none"`), which is what
* distinguishes the two.
*
* Reporting only — there is no write path in v1. When the upstream RFD lands,
* the same payload moves from `_meta` to first-class fields and this module
* is retired.
*/
import type { AccountInfo } from "@anthropic-ai/claude-agent-sdk";
/** Change notification, agent → client. Fire and forget: clients that do not
* know the method drop it silently, so it is sent unconditionally. */
export const AUTH_STATUS_UPDATE_METHOD = "_auth/status_update";
/** Upper bound on one `claude auth status --json` run, so a hung CLI cannot
* wedge every later probe that joins it. */
export const AUTH_STATUS_PROBE_TIMEOUT_MS = 5000;
export type AuthStatusKind = "account" | "api_key" | "gateway" | "external" | "none";
export type AuthStatusAccount = {
email?: string;
organization?: string;
/** Vendor plan/license string, not normalized. */
plan?: string;
};
export type AuthStatus = {
kind: AuthStatusKind;
/** Human-readable and usable as a UI string on its own. The "type" line:
* "Claude Max", "Anthropic API key", "AWS Bedrock". */
label: string;
/** Optional second line carrying the specifics (key source, gateway host, …).
* Clients render it under `label`, falling back to `account.email`. */
detail?: string;
account?: AuthStatusAccount;
/** Vendor-namespaced extras, e.g. `{claudeCode: {...}}`. */
vendor?: Record<string, unknown>;
};
export type AuthStatusUpdateNotification = { authStatus: AuthStatus };
/** Advertisement carried in `agentCapabilities._meta.authStatus`, never a
* status payload: its mere presence means "this agent pushes its identity",
* and it stays empty. Informational — a client that never saw it still
* accepts `_auth/status_update`, because there is nothing to ask for. */
export type AuthStatusCapability = Record<string, never>;
export function authStatusCapability(): AuthStatusCapability {
return {};
}
/** Shape of `claude auth status --json`. Absent fields are omitted, not null,
* and the logged-out case exits 1 while still printing valid JSON. */
export type CliAuthStatus = {
loggedIn?: boolean;
authMethod?: string;
apiProvider?: string;
apiKeySource?: string;
email?: string;
orgId?: string;
orgName?: string;
subscriptionType?: string;
};
const NOT_LOGGED_IN: AuthStatus = {
kind: "none",
label: "Not logged in",
};
/** Display names for the non-firstParty backends, where auth lives outside the
* agent (AWS credentials, gcloud ADC, …). */
const EXTERNAL_PROVIDER_LABELS: Record<string, string> = {
bedrock: "AWS Bedrock",
vertex: "Google Vertex AI",
foundry: "Azure AI Foundry",
anthropicAws: "Anthropic on AWS",
anthropicGoogleCloud: "Anthropic on Google Cloud",
mantle: "Mantle",
};
export function notLoggedInAuthStatus(): AuthStatus {
return { ...NOT_LOGGED_IN };
}
/** ACP-level gateway auth (`authenticate` with `gateway`/`gateway-bedrock`).
* The gateway owns the credentials, so it wins over anything the CLI reports. */
export function gatewayAuthStatus(baseUrl?: string): AuthStatus {
let host: string | undefined;
if (baseUrl) {
try {
host = new URL(baseUrl).host;
} catch {
host = baseUrl;
}
}
return {
kind: "gateway",
label: "Custom model gateway",
...(host ? { detail: host } : {}),
};
}
/**
* Does this `AccountInfo` say anything about the identity?
*
* The SDK always fills `apiProvider`, but the identity fields come from the
* claude.ai profile: with an `apiKeyHelper` and no subscription login the
* session reports `{apiProvider: "firstParty"}` and nothing else. That is "no
* information", not "logged out" — an empty read must never be mapped to
* `none`, or it destroys what the CLI probe already established.
*
* `tokenSource` is deliberately not a signal: the CLI sets it to the OAuth
* token's origin (`CLAUDE_CODE_OAUTH_TOKEN`,
* `CLAUDE_CODE_OAUTH_TOKEN_FILE_DESCRIPTOR`, …), never to a key source, so it
* cannot attribute a key and carries no plan of its own.
*/
export function accountInfoHasIdentitySignal(account: AccountInfo | undefined): boolean {
if (!account) return false;
return Boolean(
account.apiKeySource ||
account.subscriptionType ||
(account.apiProvider && account.apiProvider !== "firstParty"),
);
}
/** Session-time mapping from the SDK's `AccountInfo`, the richest source when
* it is populated. Returns `undefined` when the account carries no identity
* signal, so callers keep the status they already know. */
export function fromAccountInfo(account: AccountInfo | undefined): AuthStatus | undefined {
if (!account || !accountInfoHasIdentitySignal(account)) {
return undefined;
}
return mapAuthFields({
apiProvider: account.apiProvider,
subscriptionType: account.subscriptionType,
apiKeySource: account.apiKeySource,
email: account.email,
organization: account.organization,
});
}
/** Pre-session mapping from `claude auth status --json` stdout. Returns
* `undefined` when the output is not the expected JSON object, so callers can
* report "not known" instead of guessing. */
export function fromCliStatus(stdout: string): AuthStatus | undefined {
let parsed: unknown;
try {
parsed = JSON.parse(stdout);
} catch {
return undefined;
}
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
return undefined;
}
const status = parsed as CliAuthStatus;
if (typeof status.loggedIn !== "boolean") {
return undefined;
}
// `loggedIn` tracks the claude.ai login only. On a 3P backend (Bedrock,
// Vertex, …) it is false while the credentials live outside the agent, so the
// backend must decide the kind before the logged-out shortcut runs.
const externalBackend = Boolean(status.apiProvider && status.apiProvider !== "firstParty");
if (!externalBackend && !status.loggedIn && !status.apiKeySource) {
return notLoggedInAuthStatus();
}
return mapAuthFields({
apiProvider: status.apiProvider,
subscriptionType: status.subscriptionType,
apiKeySource: status.apiKeySource,
email: status.email,
organization: status.orgName,
});
}
/** Single mapping table shared by both sources; see the `kind`/`label` table in
* `extension-authstatus-meta.md`. Order matters: a 3P backend or a gateway
* decides the kind before any firstParty identity fields are considered, and
* an API key outranks a stored subscription login.
*
* Both can be reported at once — an `apiKeyHelper` in settings.json next to a
* claude.ai OAuth login yields `apiKeySource` AND `subscriptionType`. Claude
* Code's authentication precedence puts `apiKeyHelper` above the `/login`
* subscription, so the key is what actually pays for the turn and is what we
* report. */
function mapAuthFields(fields: {
apiProvider?: string;
subscriptionType?: string;
apiKeySource?: string;
email?: string;
organization?: string;
}): AuthStatus {
const { apiProvider, subscriptionType, apiKeySource, email, organization } = fields;
if (apiProvider === "gateway") {
return gatewayAuthStatus();
}
if (apiProvider && apiProvider !== "firstParty") {
return {
kind: "external",
label: EXTERNAL_PROVIDER_LABELS[apiProvider] ?? apiProvider,
};
}
if (apiKeySource) {
return {
kind: "api_key",
label: "Anthropic API key",
// The source ("apiKeyHelper", "env", …) is the specifics line.
detail: apiKeySource,
};
}
if (subscriptionType) {
// `account.plan` keeps the raw vendor string; only the label is titled.
const account: AuthStatusAccount = { plan: subscriptionType };
if (email) account.email = email;
if (organization) account.organization = organization;
return {
kind: "account",
label: planLabel(subscriptionType),
// No detail: the client falls back to `account.email` for line 2.
account,
};
}
return notLoggedInAuthStatus();
}
/** Names the plan with exactly one "Claude". A newer CLI already reports
* "Claude Max", an older one reports "max", and both must read "Claude Max".
* Each word is title-cased; a word that already carries capitals is kept. */
function planLabel(plan: string): string {
const titled = plan.replace(/\S+/g, (word) => word.charAt(0).toUpperCase() + word.slice(1));
return /^claude(\s|$)/i.test(plan) ? titled : `Claude ${titled}`;
}
/**
* Do two payloads describe the same login? Compared on the field that
* identifies each kind — the key source for `api_key`, the email for
* `account`, the kind alone for the rest, which carry no per-identity key.
*/
export function sameIdentity(a: AuthStatus, b: AuthStatus): boolean {
if (a.kind !== b.kind) {
return false;
}
switch (a.kind) {
case "api_key":
return a.detail === b.detail;
case "account":
return (a.account?.email ?? "") === (b.account?.email ?? "");
default:
return true;
}
}
/**
* Folds a fresh read into what is already known. Sources differ in richness for
* the very same login: the SDK's session `AccountInfo` can carry an
* organization the CLI probe omits. So when the read describes the same
* identity, its values win field by field but the fields it lacks are kept;
* when it describes a different identity, it replaces the old one wholesale.
*/
export function mergeAuthStatus(previous: AuthStatus | undefined, next: AuthStatus): AuthStatus {
if (!previous || !sameIdentity(previous, next)) {
return next;
}
const merged: AuthStatus = { ...next };
if (merged.detail === undefined && previous.detail !== undefined) {
merged.detail = previous.detail;
}
if (previous.account || next.account) {
merged.account = { ...previous.account, ...next.account };
}
if (merged.vendor === undefined && previous.vendor !== undefined) {
merged.vendor = previous.vendor;
}
return merged;
}
/**
* Do two payloads carry the same information? Unlike {@link sameIdentity},
* which asks "is this the same login", this compares every rendered field, so
* a richer read of one login is NOT the same. Callers use it to suppress a
* push that would tell the client nothing new.
*
* `a` undefined means "nothing reported yet", which never equals a payload.
*/
export function sameAuthStatus(a: AuthStatus | undefined, b: AuthStatus): boolean {
if (!a) {
return false;
}
return (
a.kind === b.kind &&
a.label === b.label &&
a.detail === b.detail &&
a.account?.email === b.account?.email &&
a.account?.organization === b.account?.organization &&
a.account?.plan === b.account?.plan &&
// Vendor extras are an open bag, so compare them structurally. Both sides
// are built by this module from the same key order, so a string compare is
// enough and costs nothing on the usual `undefined`/`undefined` pair.
JSON.stringify(a.vendor) === JSON.stringify(b.vendor)
);
}

View File

@@ -0,0 +1,162 @@
import type { NewSessionRequest, SessionConfigOption } from "@agentclientprotocol/sdk";
import type {
EffortLevel,
Options,
PermissionMode,
SDKUserMessage,
} from "@anthropic-ai/claude-agent-sdk";
import { DEFAULT_MODEL_ID } from "./session-config-ids.js";
export type ClearContextReset = {
toolUseId: string;
plan: string;
mode: PermissionMode;
};
type Usage = {
inputTokens: number;
outputTokens: number;
cachedReadTokens: number;
cachedWriteTokens: number;
};
export type ClearContextTurn = {
settled: boolean;
promptUuid: string;
carriedUsage?: Usage;
carriedModelUsage?: Record<string, Usage>;
};
/** The session state needed to replace Claude's private conversation without
* replacing the public ACP turn. Keeping this projection here makes the
* restart workflow independent from the agent's much larger Session record. */
export type ClearContextSession<Turn extends ClearContextTurn = ClearContextTurn> = {
cwd: string;
creationParams?: NewSessionRequest;
accumulatedUsage: Usage;
accumulatedModelUsage?: Record<string, Usage>;
models: { currentModelId: string };
configOptions: SessionConfigOption[];
fastModeEnabled: boolean;
effortPinnedLevel?: string;
activeTurn?: Turn | null;
turnQueue?: Turn[];
pendingExitPlanContextReset?: ClearContextReset;
contextUsedTokens?: number;
input: { push(message: SDKUserMessage): unknown };
};
export type ClearContextCoordinatorHost<
Session extends ClearContextSession<Turn>,
Turn extends ClearContextTurn,
> = {
currentSession(sessionId: string): Session | undefined;
closeQueryStream(session: Session): void;
restartSession(
params: NewSessionRequest,
options: { publicSessionId: string; permissionMode: PermissionMode },
): Promise<Session>;
applyFastMode(session: Session, enabled: boolean): Promise<void>;
publishSessionState(
sessionId: string,
mode: PermissionMode,
configOptions: SessionConfigOption[],
): Promise<void>;
continuationMessage(sessionId: string, plan: string, promptUuid: string): SDKUserMessage;
ensureConsumer(session: Session, sessionId: string): void;
logError(message: string, error: unknown): void;
};
function restartParams<Session extends ClearContextSession>(session: Session): NewSessionRequest {
const originalParams = session.creationParams ?? { cwd: session.cwd, mcpServers: [] };
const originalMeta = originalParams._meta as
({ claudeCode?: { options?: Options } } & Record<string, unknown>) | undefined;
const originalOptions = originalMeta?.claudeCode?.options;
const unmanagedOptions = { ...(originalOptions ?? {}) };
delete unmanagedOptions.model;
delete unmanagedOptions.agent;
delete unmanagedOptions.effort;
return {
...originalParams,
_meta: {
...(originalMeta ?? {}),
claudeCode: {
...(originalMeta?.claudeCode ?? {}),
options: {
...unmanagedOptions,
...(session.models.currentModelId !== DEFAULT_MODEL_ID
? { model: session.models.currentModelId }
: {}),
...(session.effortPinnedLevel !== undefined
? { effort: session.effortPinnedLevel as EffortLevel }
: {}),
},
},
},
};
}
/** Replace Claude's private conversation and attach the still-pending ACP turn
* to it. The host owns provider-specific creation and stream mechanics; this
* coordinator owns the ordering and state transfer invariants. */
export async function continuePlanInFreshContext<
Turn extends ClearContextTurn,
Session extends ClearContextSession<Turn>,
>(
sessionId: string,
oldSession: Session,
reset: ClearContextReset,
host: ClearContextCoordinatorHost<Session, Turn>,
signal?: AbortSignal,
): Promise<void> {
const assertRestartActive = (session?: Session): void => {
if (signal?.aborted || (session && host.currentSession(sessionId) !== session)) {
throw new Error("Clear-context restart aborted");
}
};
assertRestartActive();
const turn = oldSession.activeTurn;
if (!turn || turn.settled || host.currentSession(sessionId) !== oldSession) {
throw new Error("Cannot clear context without an active ACP turn");
}
const params = restartParams(oldSession);
host.closeQueryStream(oldSession);
const freshSession = await host.restartSession(params, {
publicSessionId: sessionId,
permissionMode: reset.mode,
});
assertRestartActive(freshSession);
// Do not consume the reset or mutate the turn until a replacement exists.
// A failed restart must remain distinguishable from a lost query transport.
turn.carriedUsage = { ...oldSession.accumulatedUsage };
turn.carriedModelUsage = { ...oldSession.accumulatedModelUsage };
oldSession.pendingExitPlanContextReset = undefined;
if (oldSession.fastModeEnabled !== freshSession.fastModeEnabled) {
try {
await host.applyFastMode(freshSession, oldSession.fastModeEnabled);
} catch (error) {
host.logError("Failed to restore Fast mode after clearing context:", error);
}
assertRestartActive(freshSession);
}
oldSession.activeTurn = null;
oldSession.turnQueue = [];
freshSession.turnQueue = [turn];
freshSession.contextUsedTokens = 0;
try {
await host.publishSessionState(sessionId, reset.mode, freshSession.configOptions);
} catch (error) {
host.logError("Failed to publish clear-context session state:", error);
}
assertRestartActive(freshSession);
freshSession.input.push(host.continuationMessage(sessionId, reset.plan, turn.promptUuid));
assertRestartActive(freshSession);
host.ensureConsumer(freshSession, sessionId);
}

View File

@@ -0,0 +1,30 @@
import { AIR_CONTEXT_COMPACTION_KEY, withAirMeta } from "./air-extension.js";
export const CONTEXT_COMPACTION_META_VERSION = 1;
export type ContextCompactionTrigger = "manual" | "automatic";
export interface ContextCompactionMetadata {
version: typeof CONTEXT_COMPACTION_META_VERSION;
trigger?: ContextCompactionTrigger;
preTokens?: number;
postTokens?: number;
durationMs?: number;
error?: string;
}
/**
* The `_meta` of a context compaction report:
* `_meta.jetbrains.air.contextCompaction`, as `docs/air-extensions.md`
* defines. The standard toolCallId and status fields own lifecycle identity
* and phase; this extension carries only compaction-specific facts. Only AIR
* gets it.
*/
export function createContextCompactionMeta(
metadata: Omit<ContextCompactionMetadata, "version"> = {},
): Record<string, unknown> {
return withAirMeta(undefined, AIR_CONTEXT_COMPACTION_KEY, {
version: CONTEXT_COMPACTION_META_VERSION,
...metadata,
} satisfies ContextCompactionMetadata);
}

427
src/context-compaction.ts Normal file
View File

@@ -0,0 +1,427 @@
import { ClientCapabilities, SessionNotification } from "@agentclientprotocol/sdk";
import {
ContextCompactionMetadata,
createContextCompactionMeta,
} from "./context-compaction-meta.js";
import { compactionToolCall } from "./tool-calls/reporters/compaction.js";
type CompactionStatus = "completed" | "failed";
type TerminalStatus = CompactionStatus | "cancelled";
/**
* How compaction reaches the client.
*
* - `compaction_update`: the ACP session-compaction contract (ID-addressed
* `compaction_update` / `compaction_summary_chunk`), used when the v1 client
* advertises `clientCapabilities.session.compaction`.
* - `tool_call`: the legacy synthetic "Compact conversation" tool call, kept
* for clients that do not advertise the capability.
*/
export type CompactionPresentation = "tool_call" | "compaction_update";
type CompactionState = {
/** Doubles as the toolCallId under the legacy presentation. */
compactionId: string;
terminalStatus?: TerminalStatus;
heartbeatSent: boolean;
/** The summary text that went out as chunks. */
streamedSummary?: string;
/** User-displayable summary reported by the PostCompact hook. While the
* compaction is in progress it awaits the terminal update; on a `completed`
* state it has been sent. */
summary?: string;
};
type SendUpdate = (notification: SessionNotification) => Promise<void>;
export type ContextCompactionLifecycleOptions = {
sessionId: string;
presentation?: CompactionPresentation;
/** Receives failures of the send that must not propagate: the turn-boundary
* `cancelled` terminal. */
logError?: (message: string, error: unknown) => void;
/** The client is AIR. Only AIR gets the compaction facts, under `_meta.jetbrains.air`. */
airClient?: boolean;
};
export function clientSupportsCompactionUpdates(capabilities?: ClientCapabilities | null): boolean {
const compaction = capabilities?.session?.compaction;
return typeof compaction === "object" && compaction !== null && !Array.isArray(compaction);
}
/** Tags on their own line, as the model emits them; a summary that merely
* quotes `<summary>` mid-sentence must not be truncated at the mention. */
const SUMMARY_OPEN_LINE = /^[ \t]*<summary>[ \t]*\r?\n/gim;
const SUMMARY_CLOSE_LINE = /^[ \t]*<\/summary>[ \t]*$/gim;
/** The model's private reasoning block that precedes the summary; stripped
* first so a `<summary>` it merely mentions cannot anchor the summary span,
* and even when the summary tags themselves are missing. Own-line tags
* anywhere; inline tags only as a leading block, since a summary body may
* quote both tag names. */
const ANALYSIS_BLOCKS = [
/^[ \t]*<analysis>[ \t]*\r?\n[\s\S]*?\n[ \t]*<\/analysis>[ \t]*$/gim,
/^\s*<analysis>[\s\S]*?<\/analysis>/i,
];
/** The framing Claude Code wraps around the retained summary when it persists
* it as the post-compaction user message. */
const CONTINUATION_PREAMBLE = /^\s*This session is being continued from a previous conversation/i;
const PERSISTED_PREAMBLE =
/^\s*This session is being continued from a previous conversation[^\n]*\n+Summary:[ \t]*\r?\n/;
const PERSISTED_TRAILERS = [
/\n+If you need specific details from before compaction[\s\S]*$/,
/\n+(?:Please )?[Cc]ontinue the conversation from where it left (?:it )?off[\s\S]*$/,
];
/**
* Reduce Claude's compaction output to the user-displayable summary.
*
* The PostCompact hook reports the model's raw output, which wraps the
* summary in `<summary>` tags (often preceded by an `<analysis>` block). The
* persisted transcript instead frames the same summary with continuation
* instructions for the model. Neither framing belongs in the ACP `summary`,
* and a continuation prompt whose framing is not recognized yields no summary
* at all rather than model-facing instructions.
*/
export function compactionSummaryText(raw: string): string | undefined {
let text = raw;
for (const block of ANALYSIS_BLOCKS) {
text = text.replace(block, "");
}
const tagged = taggedSummary(text);
if (tagged !== undefined) {
text = tagged;
} else if (CONTINUATION_PREAMBLE.test(text)) {
const body = text.replace(PERSISTED_PREAMBLE, "");
if (body === text) return undefined;
text = body;
for (const trailer of PERSISTED_TRAILERS) {
text = text.replace(trailer, "");
}
}
text = text.trim();
return text.length > 0 ? text : undefined;
}
function taggedSummary(raw: string): string | undefined {
const close = [...raw.matchAll(SUMMARY_CLOSE_LINE)].at(-1);
if (close?.index !== undefined) {
const open = [...raw.slice(0, close.index).matchAll(SUMMARY_OPEN_LINE)].at(-1);
if (open?.index !== undefined) {
return raw.slice(open.index + open[0].length, close.index);
}
}
// Inline tags: the widest span, so a quoted `</summary>` inside the body
// does not end it early. Plain index scans keep an unterminated tag linear.
const openInline = raw.search(/<summary>/i);
const closeInline = raw.toLowerCase().lastIndexOf("</summary>");
if (openInline >= 0 && closeInline > openInline) {
return raw.slice(openInline + "<summary>".length, closeInline);
}
return undefined;
}
/** True for the post-compaction user message Claude Code persists (and
* `getSessionMessages` returns) with the summary of the dropped history. */
export function isCompactSummaryMessage(message: unknown): boolean {
return (
typeof message === "object" &&
message !== null &&
(message as { type?: unknown }).type === "user" &&
(message as { isCompactSummary?: unknown }).isCompactSummary === true
);
}
/**
* Translates Claude's compaction signals into one idempotent ACP lifecycle.
*
* The SDK can duplicate terminal compact_result messages and can omit the
* opening status on replay. State therefore lives until the owning turn's
* result (or abort), while a new compacting status after a terminal outcome
* starts a fresh lifecycle.
*/
export class ContextCompactionLifecycle {
private activeCompaction: CompactionState | undefined;
private outputDelivered = false;
private duplicateErrorOutput: string | undefined;
/** After interruption, uncorrelated terminal frames and hooks may still
* arrive from the abandoned work, including an opening we never consumed.
* Wait for a known new turn before accepting them again. */
private interrupted = false;
/** Summary reported by PostCompact before the opening status was consumed.
* Deliberately survives `reset()`: the CLI awaits the hook before emitting
* the compaction's terminal frames, so a pending summary always belongs to
* a compaction whose frames are still ahead of the consumer — possibly
* queued behind a previous turn's result. */
private pendingSummary: string | undefined;
private readonly sessionId: string;
readonly presentation: CompactionPresentation;
private readonly logError: (message: string, error: unknown) => void;
private readonly airClient: boolean;
constructor(
private readonly sendUpdate: SendUpdate,
options: ContextCompactionLifecycleOptions,
) {
this.sessionId = options.sessionId;
this.presentation = options.presentation ?? "tool_call";
this.logError = options.logError ?? (() => {});
this.airClient = options.airClient ?? false;
}
get hasDeliveredOutput(): boolean {
return this.outputDelivered;
}
/**
* Close the lifecycle at a turn boundary (result, cancel, idle-abandon).
*
* A `compaction_update` entity still `in_progress` here never received its
* terminal signal from the runtime and gets its one terminal status,
* `cancelled`. The legacy tool call is deliberately left as it was (an
* `in_progress` call): ACP `ToolCallStatus` has no cancelled state and that
* presentation's behavior predates this lifecycle. Never throws — a failed
* send is logged, so callers can settle the turn unconditionally.
*/
async reset(): Promise<void> {
const state = this.activeCompaction;
this.activeCompaction = undefined;
this.outputDelivered = false;
this.duplicateErrorOutput = undefined;
if (!state || state.terminalStatus || this.presentation !== "compaction_update") return;
state.terminalStatus = "cancelled";
await this.sendQuietly(
{
sessionUpdate: "compaction_update",
compactionId: state.compactionId,
status: "cancelled",
},
"cancelled compaction",
);
}
/** Abandon the current work before settling its prompt or tearing down the
* stream. Unlike a normal result boundary, its pending hooks are not safe
* to carry into the next compaction. A hook has no command ID, so even an
* early hook for the next compaction must be omitted until the stream gives
* us a new live turn boundary. Idempotent and best-effort. */
async interrupt(): Promise<void> {
if (this.presentation === "compaction_update") {
this.interrupted = true;
this.pendingSummary = undefined;
}
await this.reset();
}
/** A live command's dispatch/echo proves the interrupted command's tail
* has drained in the SDK's FIFO stream. Do not reset normal lifecycle
* state: compaction may already have started before the user echo. */
resume(): void {
this.interrupted = false;
}
/**
* Claude also emits a failed manual compaction's error as local-command
* stdout. Consume that one duplicate after the lifecycle carried it,
* without hiding unrelated command output.
*/
consumeDuplicateErrorOutput(content: string): boolean {
if (
this.duplicateErrorOutput === undefined ||
content.trim() !== this.duplicateErrorOutput.trim()
) {
return false;
}
this.duplicateErrorOutput = undefined;
return true;
}
async start(compactionId: string): Promise<void> {
if (this.interrupted) return;
if (this.activeCompaction && !this.activeCompaction.terminalStatus) {
return;
}
this.open(compactionId);
if (this.presentation === "compaction_update") {
await this.send({
sessionUpdate: "compaction_update",
compactionId,
status: "in_progress",
...(this.airClient ? { _meta: createContextCompactionMeta() } : {}),
});
return;
}
await this.send(compactionToolCall.started(compactionId, this.airClient));
}
/**
* Streaming progress from the API's compaction content block.
*
* Under `compaction_update` the block's text is the retained summary and
* streams as `compaction_summary_chunk`s — but only into an entity the CLI
* announced with its `compacting` status. The block alone carries no
* terminal signal, so opening an entity from it would leave nothing but the
* turn-boundary `cancelled` to close a compaction that succeeded. The legacy
* tool call keeps its historical behavior: open on first sight, re-assert
* `in_progress` once.
*/
async heartbeat(fallbackId: string, summaryChunk?: string): Promise<void> {
if (this.presentation === "compaction_update") {
const state = this.activeCompaction;
if (!state || state.terminalStatus || !summaryChunk) return;
state.streamedSummary = (state.streamedSummary ?? "") + summaryChunk;
await this.send({
sessionUpdate: "compaction_summary_chunk",
compactionId: state.compactionId,
content: { type: "text", text: summaryChunk },
});
return;
}
if (!this.activeCompaction) await this.start(fallbackId);
const state = this.activeCompaction;
if (!state || state.terminalStatus || state.heartbeatSent) return;
state.heartbeatSent = true;
await this.send(compactionToolCall.inProgress(state.compactionId, this.airClient));
}
/**
* The PostCompact hook's summary. The CLI awaits the hook before emitting
* the compaction's terminal frames, so the summary lands while its
* compaction is `in_progress` and rides on the terminal update. Anything
* else — no entity yet, or the entity is a previous, already-terminal
* compaction of the same turn whose status frame the consumer is still
* catching up to — belongs to the compaction whose frames are ahead of the
* consumer, and waits for it. Only the `compaction_update` presentation
* carries the summary; the legacy tool call never exposed it. Never throws:
* it runs detached from a hook callback. Returns whether a summary was
* retained.
*/
recordSummary(rawSummary: unknown): boolean {
if (this.interrupted) return false;
if (this.presentation !== "compaction_update" || typeof rawSummary !== "string") return false;
const summary = compactionSummaryText(rawSummary);
if (!summary) return false;
const state = this.activeCompaction;
if (state && !state.terminalStatus) {
state.summary = summary;
} else {
this.pendingSummary = summary;
}
return true;
}
async finish(
compactionId: string,
status: CompactionStatus,
metadata: Omit<ContextCompactionMetadata, "version"> = {},
enrichTerminal = false,
): Promise<void> {
if (this.interrupted) return;
// The opening status can be missed (replay, or a terminal-only runtime):
// the first update for the ID is then already terminal.
const opened = this.activeCompaction === undefined;
const firstTerminal = !this.activeCompaction?.terminalStatus;
const state = this.activeCompaction ?? this.open(compactionId, status);
if (firstTerminal) {
state.terminalStatus = status;
} else if (!enrichTerminal) {
return;
}
if (status === "failed" && metadata.error) {
this.duplicateErrorOutput = metadata.error;
}
const terminalStatus = state.terminalStatus ?? status;
const hasMetadata = Object.keys(metadata).length > 0;
if (this.presentation === "compaction_update") {
// A summary that went out as chunks is not sent again in full. The
// chunks are the raw API text and the summary is the cleaned hook text,
// so the summary is left out only when both hold the same text.
const summaryStreamed = state.streamedSummary === state.summary;
const summary =
firstTerminal && terminalStatus === "completed" && !summaryStreamed
? state.summary
: undefined;
await this.send({
sessionUpdate: "compaction_update",
compactionId: state.compactionId,
status: terminalStatus,
...(summary !== undefined ? { summary: [{ type: "text", text: summary }] } : {}),
...(terminalStatus === "failed" && metadata.error ? { error: metadata.error } : {}),
// `_meta` is a replace-patch: seed it with the first terminal, then
// only re-send it when the boundary adds facts, so a status-only
// duplicate can't wipe the token counts.
// The standard `error` field carries the error, so `_meta` does not.
// Only AIR gets the compaction facts.
...(this.airClient && (firstTerminal || hasMetadata)
? { _meta: createContextCompactionMeta(withoutError(metadata)) }
: {}),
});
return;
}
await this.send(
compactionToolCall.finished(
state.compactionId,
opened || firstTerminal ? status : undefined,
metadata,
opened,
this.airClient,
),
);
}
/** Make `compactionId` the active entity, moving a pending hook summary onto
* it, and mark compaction output as delivered for the owning turn. */
private open(compactionId: string, terminalStatus?: TerminalStatus): CompactionState {
const state: CompactionState = {
compactionId,
heartbeatSent: false,
...(terminalStatus ? { terminalStatus } : {}),
...(this.pendingSummary !== undefined ? { summary: this.pendingSummary } : {}),
};
this.pendingSummary = undefined;
this.activeCompaction = state;
this.outputDelivered = true;
return state;
}
private send(update: SessionNotification["update"]): Promise<void> {
return this.sendUpdate({ sessionId: this.sessionId, update });
}
private async sendQuietly(update: SessionNotification["update"], what: string): Promise<void> {
try {
await this.send(update);
} catch (error) {
this.logError(`Failed to send the ${what} update for session ${this.sessionId}`, error);
}
}
}
function withoutError({
error: _error,
...facts
}: Omit<ContextCompactionMetadata, "version">): Omit<ContextCompactionMetadata, "version"> {
return facts;
}
export function contextCompactionMetadataFromBoundary(compactMetadata: {
trigger: "manual" | "auto";
pre_tokens: number;
post_tokens?: number;
duration_ms?: number;
}): Omit<ContextCompactionMetadata, "version"> {
return {
trigger: compactMetadata.trigger === "auto" ? "automatic" : "manual",
preTokens: compactMetadata.pre_tokens,
...(compactMetadata.post_tokens !== undefined
? { postTokens: compactMetadata.post_tokens }
: {}),
...(compactMetadata.duration_ms !== undefined
? { durationMs: compactMetadata.duration_ms }
: {}),
};
}

586
src/diff.ts Normal file
View File

@@ -0,0 +1,586 @@
import { ToolCallContent, ToolCallLocation } from "@agentclientprotocol/sdk";
import { structuredPatch } from "diff";
import { constants } from "node:fs";
import { type FileHandle, open } from "node:fs/promises";
import path from "node:path";
import { AIR_DIFF_PATCH_CAPABILITY, withAirMeta } from "./air-extension.js";
import { normalizeWriteInput } from "./tool-calls/reporters/file-edit.js";
/**
* The largest file, in bytes, that the adapter turns into a git patch.
*
* A larger file, a larger new text, or an Edit whose result can be larger
* gets no patch. The tool call then keeps its standard ACP content. The limit
* bounds the file read, the replacement, and the line diff that run while
* Claude waits for an approval.
*/
export const MAX_PATCH_FILE_BYTES = 1024 * 1024;
/**
* The wall-clock budget, in milliseconds, of one line diff for a patch.
*
* The diff runs synchronously, so the budget is also the longest block of the
* event loop.
*/
const PATCH_DIFF_TIMEOUT_MS = 100;
/** The number of context lines around a change in a hunk. */
const PATCH_CONTEXT_LINES = 3;
/** Git reads this many leading bytes to decide that a file is binary. */
const BINARY_SNIFF_BYTES = 8000;
const NO_NEWLINE_MARKER = "\\ No newline at end of file";
/**
* One unified-diff hunk in the `diff` package convention.
*
* A side with zero lines stores the number of the line after the change as its
* start. {@link hunkHeader} converts that start to the git convention.
*/
interface PatchHunk {
oldStart: number;
oldLines: number;
newStart: number;
newLines: number;
lines: string[];
}
interface DiffToolResponse {
filePath?: string;
structuredPatch?: PatchHunk[];
/** FileWriteOutput only (FileEditOutput carries no `type`): whether the
* write created the file or overwrote an existing one. */
type?: "create" | "update";
/** FileWriteOutput only: the content that was written. */
content?: string;
/** The pre-change content. It is null on a Write create, or on a Write
* update whose previous content was too large to include. An Edit that
* creates a file reports an empty string, as for an existing empty file. */
originalFile?: string | null;
/** FileEditOutput only: the text that the Edit replaced. It is empty when
* the Edit created the file or filled an existing empty file. */
oldString?: string;
}
interface EditPreviewInput {
file_path?: unknown;
old_string?: unknown;
new_string?: unknown;
replace_all?: unknown;
}
/** The kind of file change that a git patch describes. */
type FileChange = "create" | "update";
/**
* Builds the exact patch shown before Claude runs an Edit or Write tool.
*
* Returns undefined when the adapter cannot predict the file change exactly.
* The caller then keeps the standard tool-call content. The adapter declines
* a file that is missing for an Edit, too large, binary, or that has CR line
* endings. Claude converts the line endings of an edited file, so an in-memory
* replacement would not match the bytes that Claude writes. It also declines
* an `old_string` that does not match exactly once, because Claude then
* normalizes quotes or fails.
*
* A Write always gets content that shows the change: the patch, the standard
* diff of a text that cannot have an exact patch, or a notice that the Write
* overwrites a file that the adapter cannot show.
*
* The preview uses the tool input as it is. Claude can still remove the
* trailing whitespace of a line before it writes. The PostToolUse hook then
* sends the patch of the written file.
*/
export async function previewPatchContent(
toolName: string,
input: Record<string, unknown>,
cwd?: string,
): Promise<ToolCallContent[] | undefined> {
if (toolName === "Edit") {
const edit = input as EditPreviewInput;
if (
typeof edit.file_path !== "string" ||
typeof edit.old_string !== "string" ||
typeof edit.new_string !== "string"
) {
return undefined;
}
const oldString = edit.old_string;
const filePath = resolveToolPath(edit.file_path, cwd);
const oldText = await readPatchSource(filePath);
if (oldText === undefined) return undefined;
const newString = edit.new_string;
if (oldString === newString || !isPatchableText(newString)) return undefined;
if (oldString.length === 0) {
// An empty old_string creates the file, or fills an existing file that
// holds only whitespace. `trim` also removes a byte order mark, whose
// handling the adapter does not predict, so such a file is declined.
if (oldText !== null && (oldText.trim() !== "" || oldText.includes("\uFEFF"))) {
return undefined;
}
return optionalContent(filePatch(filePath, oldText, newString)?.content);
}
if (oldText === null) return undefined;
const occurrences = oldText.split(oldString).length - 1;
if (occurrences === 0 || (edit.replace_all !== true && occurrences !== 1)) return undefined;
if (replacedTextBytesBound(oldText, oldString, newString, occurrences) > MAX_PATCH_FILE_BYTES) {
return undefined;
}
const newText = replacedText(oldText, oldString, newString, edit.replace_all === true);
return optionalContent(filePatch(filePath, oldText, newText)?.content);
}
if (toolName === "Write") {
const write = normalizeWriteInput(input);
if (typeof write?.file_path !== "string" || typeof write.content !== "string") {
return undefined;
}
// The Write tool call shows no diff, so the approval is the only place that
// shows what the Write changes.
const content = write.content;
const filePath = resolveToolPath(write.file_path, cwd);
const oldText = await readPatchSource(filePath);
if (oldText === undefined) {
return [
{
type: "content",
content: {
type: "text",
text: `Overwrites the existing file \`${write.file_path}\`. The adapter cannot show its current content.`,
},
},
];
}
if (oldText === content) return undefined;
const standard: ToolCallContent[] = [
{ type: "diff", path: write.file_path, oldText, newText: content },
];
if (!isPatchableText(content)) return standard;
// A dense change can exceed the diff budget. The approval then shows the standard diff.
return optionalContent(filePatch(filePath, oldText, content)?.content) ?? standard;
}
return undefined;
}
/**
* An upper bound of the UTF-8 size, in bytes, of {@link replacedText}.
*
* The caller checks the bound before it builds the text. A `replace_all` of
* many short matches with a long `newString` can otherwise build a text of
* gigabytes before the timed line diff starts.
*/
function replacedTextBytesBound(
fileText: string,
oldString: string,
newString: string,
occurrences: number,
): number {
const growth = Buffer.byteLength(newString, "utf8") - Buffer.byteLength(oldString, "utf8");
return Buffer.byteLength(fileText, "utf8") + occurrences * Math.max(0, growth);
}
/**
* The file text after Claude replaces `oldString` with `newString`.
*
* An empty `newString` deletes a line: when `oldString` does not end with a
* line break and the file holds `oldString` and a line break, Claude also
* removes that line break. With `replaceAll`, it then replaces only the
* occurrences that a line break follows.
*/
function replacedText(
fileText: string,
oldString: string,
newString: string,
replaceAll: boolean,
): string {
const target =
newString === "" && !oldString.endsWith("\n") && fileText.includes(`${oldString}\n`)
? `${oldString}\n`
: oldString;
return replaceAll
? fileText.split(target).join(newString)
: fileText.replace(target, () => newString);
}
/**
* Builds the git patch for a finished Edit or Write from the file on disk.
*
* The Claude SDK `structuredPatch` is display data: Claude converts leading
* tabs to spaces and CRLF line endings to LF before it computes the hunks. A
* patch built from those hunks does not match the file. This function diffs
* `originalFile` against the written file instead. It returns undefined when
* it cannot build an exact patch, and the caller then sends the standard diff.
* A written file that contains a CR or a byte order mark is declined, because
* Claude removed those bytes from `originalFile`.
*/
export async function patchUpdateFromDiffToolResponse(
toolResponse: unknown,
): Promise<{ content: ToolCallContent[]; locations: ToolCallLocation[] } | undefined> {
if (!toolResponse || typeof toolResponse !== "object") return undefined;
const response = toolResponse as DiffToolResponse;
if (typeof response.filePath !== "string") return undefined;
// An Edit with an empty old_string reports "" as the original of a created
// file and of an existing empty file. The response does not tell the two
// apart, so the caller keeps the standard diff.
if (response.type === undefined && response.oldString === "" && response.originalFile === "") {
return undefined;
}
// A Write whose content is the previous text changed nothing. The file on
// disk can hold a later change, and that change is not the change of this Write.
if (
response.type === "update" &&
typeof response.content === "string" &&
response.originalFile === response.content
) {
return undefined;
}
const oldText =
response.type === "create"
? null
: typeof response.originalFile === "string"
? response.originalFile
: undefined;
if (oldText === undefined) return undefined;
// The same size limit as the new side: a larger text gets the standard diff.
if (oldText !== null && Buffer.byteLength(oldText, "utf8") > MAX_PATCH_FILE_BYTES)
return undefined;
const newText = await readPatchSource(response.filePath);
if (typeof newText !== "string" || newText.startsWith("\uFEFF")) return undefined;
if (response.type === "create" && newText !== response.content) return undefined;
const patch = filePatch(response.filePath, oldText, newText);
if (!patch) return undefined;
return {
content: [patch.content],
// A created file keeps the location of its Write tool call.
locations:
oldText === null
? [{ path: response.filePath }]
: patch.hunks.map(({ newStart }) => ({ path: response.filePath!, line: newStart })),
};
}
/**
* Builds standard ACP diff content from the structured toolResponse provided
* by the PostToolUse hook for diff-producing tools (Edit, Write). Unlike
* parsing the plain unified diff string, this uses the pre-parsed
* structuredPatch which supports multiple replacement sites (replaceAll) and
* always includes context lines for better readability.
*/
export function toolUpdateFromDiffToolResponse(toolResponse: unknown): {
content?: ToolCallContent[];
locations?: ToolCallLocation[];
} {
if (!toolResponse || typeof toolResponse !== "object") return {};
const response = toolResponse as DiffToolResponse;
if (!response.filePath || !Array.isArray(response.structuredPatch)) return {};
const content: ToolCallContent[] = [];
const locations: ToolCallLocation[] = [];
for (const { lines, newStart } of response.structuredPatch) {
const oldText: string[] = [];
const newText: string[] = [];
for (const line of lines) {
if (line.startsWith("-")) {
oldText.push(line.slice(1));
} else if (line.startsWith("+")) {
newText.push(line.slice(1));
} else if (line === NO_NEWLINE_MARKER) {
continue;
} else {
oldText.push(line.slice(1));
newText.push(line.slice(1));
}
}
if (oldText.length > 0 || newText.length > 0) {
locations.push({ path: response.filePath, line: newStart });
content.push({
type: "diff",
path: response.filePath,
oldText: oldText.join("\n") || null,
newText: newText.join("\n"),
});
}
}
// A Write `update` can arrive with an empty structuredPatch — nothing
// changed, the diff timed out, or the previous content was too large to
// diff (originalFile null; SDK 0.3.252 documents the lane). Returning `{}`
// would leave Write's optimistic tool_use-time content standing, and that
// was built with `oldText: null` — "creation" semantics — so an overwrite
// of a large existing file would render as creating it. Emit a truthful
// replacement instead. Gated on `type` so Edit (whose output carries no
// `type` and whose optimistic old/new diff is already truthful) keeps the
// empty-return behavior. A `create` needs nothing here: the
// tool_use-time diff shows the created file, and a client with diffPatch
// gets it from the Write reporter.
if (content.length === 0 && response.type === "update" && typeof response.content === "string") {
locations.push({ path: response.filePath });
content.push(
typeof response.originalFile === "string"
? {
type: "diff",
path: response.filePath,
oldText: response.originalFile,
newText: response.content,
}
: {
type: "content",
content: {
type: "text",
text: `Updated \`${response.filePath}\` (previous content too large to diff)`,
},
},
);
}
const result: { content?: ToolCallContent[]; locations?: ToolCallLocation[] } = {};
if (content.length > 0) result.content = content;
if (locations.length > 0) result.locations = locations;
return result;
}
/**
* The text of one git patch for `filePath`.
*
* The headers follow `git diff`: the path loses its leading slash, gets the
* `a/` and `b/` prefixes, and is quoted when git would quote it. A created
* file gets its mode line and a `/dev/null` side.
*/
export function gitPatchText(filePath: string, change: FileChange, hunks: PatchHunk[]): string {
return [
...gitPatchHeader(filePath, change),
...hunks.flatMap((hunk) => [hunkHeader(hunk), ...hunk.lines]),
"",
].join("\n");
}
function gitPatchHeader(filePath: string, change: FileChange): string[] {
// git drops one leading slash of an absolute path; a Windows path gets
// forward slashes so the header names the same file on every platform.
const name = filePath.replaceAll("\\", "/").replace(/^\/+/u, "");
const oldName = quoteGitPath("a/", name);
const newName = quoteGitPath("b/", name);
// git ends a ---/+++ name that contains a space with a tab, for GNU patch.
const tab = name.includes(" ") ? "\t" : "";
return [
`diff --git ${oldName} ${newName}`,
...(change === "create" ? ["new file mode 100644"] : []),
`--- ${change === "create" ? "/dev/null" : `${oldName}${tab}`}`,
`+++ ${newName}${tab}`,
];
}
const GIT_PATH_ESCAPES: Record<number, string> = {
0x07: "a",
0x08: "b",
0x09: "t",
0x0a: "n",
0x0b: "v",
0x0c: "f",
0x0d: "r",
0x22: '"',
0x5c: "\\",
};
/**
* Quotes `prefix + name` like git with the default `core.quotePath`.
*
* A double quote, a backslash, a control byte, or a non-ASCII byte makes git
* put the whole name in double quotes. git then writes a C escape or a
* three-digit octal escape for each such UTF-8 byte.
*/
function quoteGitPath(prefix: string, name: string): string {
const full = `${prefix}${name}`;
let quoted = "";
let needsQuotes = false;
for (const byte of Buffer.from(full, "utf8")) {
const escape = GIT_PATH_ESCAPES[byte];
if (escape !== undefined) {
quoted += `\\${escape}`;
needsQuotes = true;
} else if (byte < 0x20 || byte >= 0x7f) {
quoted += `\\${byte.toString(8).padStart(3, "0")}`;
needsQuotes = true;
} else {
quoted += String.fromCharCode(byte);
}
}
return needsQuotes ? `"${quoted}"` : full;
}
function hunkHeader({ oldStart, oldLines, newStart, newLines }: PatchHunk): string {
return `@@ -${hunkRange(oldStart, oldLines)} +${hunkRange(newStart, newLines)} @@`;
}
/** A git hunk range. A side with zero lines names the line before the change. */
function hunkRange(start: number, count: number): string {
if (count === 0) return `${Math.max(0, start - 1)},0`;
return count === 1 ? String(start) : `${start},${count}`;
}
/** The hunk that adds every line of `text` to an empty file. */
function wholeFileHunk(text: string): PatchHunk | undefined {
if (text.length === 0) return undefined;
const terminated = text.endsWith("\n");
const lines = (terminated ? text.slice(0, -1) : text).split("\n");
return {
oldStart: 1,
oldLines: 0,
newStart: 1,
newLines: lines.length,
lines: [...lines.map((line) => `+${line}`), ...(terminated ? [] : [NO_NEWLINE_MARKER])],
};
}
/**
* The line-diff hunks between two texts. Returns undefined when the diff runs
* out of its time budget.
*/
function diffHunks(oldText: string | null, newText: string): PatchHunk[] | undefined {
if (oldText === null) {
const hunk = wholeFileHunk(newText);
return hunk ? [hunk] : [];
}
const oldLines = textLines(oldText);
const newLines = textLines(newText);
// The diff gets only the changed middle and its context lines. An edit
// usually changes a small part of a large file.
const common = Math.min(oldLines.length, newLines.length);
let prefix = 0;
while (prefix < common && oldLines[prefix] === newLines[prefix]) prefix++;
let suffix = 0;
while (
suffix < common - prefix &&
oldLines[oldLines.length - 1 - suffix] === newLines[newLines.length - 1 - suffix]
) {
suffix++;
}
const skipped = Math.max(0, prefix - PATCH_CONTEXT_LINES);
const skippedEnd = Math.max(0, suffix - PATCH_CONTEXT_LINES);
const patch = structuredPatch(
"",
"",
oldLines.slice(skipped, oldLines.length - skippedEnd).join(""),
newLines.slice(skipped, newLines.length - skippedEnd).join(""),
"",
"",
{ context: PATCH_CONTEXT_LINES, timeout: PATCH_DIFF_TIMEOUT_MS },
);
return patch?.hunks.map((hunk) => ({
...hunk,
oldStart: hunk.oldStart + skipped,
newStart: hunk.newStart + skipped,
}));
}
/** The lines of a text, each with its line break. The last line can have none. */
function textLines(text: string): string[] {
return text.match(/[^\n]*\n|[^\n]+$/g) ?? [];
}
/**
* The git patch of a file change and its hunks. Returns undefined when
* nothing changed or the diff runs out of its time budget.
*/
function filePatch(
filePath: string,
oldText: string | null,
newText: string,
): { content: ToolCallContent; hunks: PatchHunk[] } | undefined {
const hunks = diffHunks(oldText, newText);
if (!hunks || hunks.length === 0) return undefined;
const change = oldText === null ? "create" : "update";
return { content: patchContent(filePath, gitPatchText(filePath, change, hunks)), hunks };
}
/**
* Reads a file as patch input.
*
* Returns null when the file does not exist. Returns undefined when the file
* cannot be read, is not a regular file, is larger than
* {@link MAX_PATCH_FILE_BYTES}, is binary, is not valid UTF-8, or contains a
* CR.
*/
async function readPatchSource(filePath: string): Promise<string | null | undefined> {
let handle: FileHandle;
try {
// O_NONBLOCK keeps the open of a FIFO from waiting for a writer. It does not change a regular file.
handle = await open(filePath, constants.O_RDONLY | constants.O_NONBLOCK);
} catch (error) {
return isMissingFileError(error) ? null : undefined;
}
try {
// The checks and the read use one open file, so a swap of the path between them has no effect.
const stats = await handle.stat();
if (!stats.isFile() || stats.size > MAX_PATCH_FILE_BYTES) return undefined;
// One byte more than the checked size shows a file that grew after the check.
const buffer = Buffer.alloc(stats.size + 1);
let length = 0;
while (length < buffer.length) {
const { bytesRead } = await handle.read(buffer, length, buffer.length - length, length);
if (bytesRead === 0) break;
length += bytesRead;
}
if (length > stats.size) return undefined;
const text = decodeFileText(buffer.subarray(0, length));
return text?.includes("\r") ? undefined : text;
} catch {
return undefined;
} finally {
await handle.close();
}
}
/** The text of a file of at most {@link MAX_PATCH_FILE_BYTES} that is not binary and is valid UTF-8. */
function decodeFileText(bytes: Uint8Array): string | undefined {
if (bytes.length > MAX_PATCH_FILE_BYTES) return undefined;
if (bytes.subarray(0, BINARY_SNIFF_BYTES).includes(0)) return undefined;
try {
return new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(bytes);
} catch {
return undefined;
}
}
/** Whether a tool input text can be the new side of an exact patch. */
function isPatchableText(text: string): boolean {
return (
Buffer.byteLength(text, "utf8") <= MAX_PATCH_FILE_BYTES &&
!text.includes("\0") &&
!text.includes("\r")
);
}
function optionalContent(content: ToolCallContent | undefined): ToolCallContent[] | undefined {
return content ? [content] : undefined;
}
/**
* A diff block in the AIR patch form.
*
* `oldText: null` and `newText: ""` only satisfy the ACP schema. The adapter
* sends this form only to a client that advertised `diffPatch`.
*/
function patchContent(filePath: string, text: string): ToolCallContent {
return {
type: "diff",
path: filePath,
oldText: null,
newText: "",
_meta: withAirMeta(undefined, AIR_DIFF_PATCH_CAPABILITY, {
version: 1,
format: "git_patch",
text,
}),
};
}
function resolveToolPath(filePath: string, cwd?: string): string {
return path.isAbsolute(filePath) ? filePath : path.resolve(cwd ?? process.cwd(), filePath);
}
function isMissingFileError(error: unknown): boolean {
return error instanceof Error && "code" in error && error.code === "ENOENT";
}

View File

@@ -12,6 +12,7 @@ import type {
AskUserQuestionInput,
AskUserQuestionOutput,
} from "@anthropic-ai/claude-agent-sdk/sdk-tools.js";
import { AIR_CUSTOM_ANSWER_KEY, withAirMeta } from "./air-extension.js";
/**
* Bridges between the Claude Agent SDK's elicitation/dialog callbacks and ACP's
@@ -148,14 +149,6 @@ function questionCustomFieldKey(index: number): string {
*/
const OPTION_META_KEY = "_claude/askUserQuestionOption";
/**
* Shared `_meta` key for marking a per-question free-text field as the custom
* answer companion for a select question. This intentionally has no
* agent-specific namespace so ACP clients can recognize the same marker across
* Codex, Claude, and other AskUserQuestion bridges.
*/
const CUSTOM_ANSWER_META_KEY = "_askUserQuestionCustomAnswer";
/**
* Render the AskUserQuestion tool's questions as an ACP form elicitation.
*
@@ -168,14 +161,17 @@ const CUSTOM_ANSWER_META_KEY = "_askUserQuestionCustomAnswer";
*
* Each question is followed by its own optional free-text "custom answer" field
* (`question_<n>_custom`), mirroring the CLI's per-question "Other" box: the
* user can type their own answer instead of picking an option, scoped to that
* specific question. Nothing is marked required, so the user can also just skip
* — matching the built-in tool, which always offers Skip + a free-text box.
* user can type their own answer instead of picking an option, add it to a
* multi-select's picks, or attach it as a note to a single-select's pick (see
* `applyAskElicitationResponse`), scoped to that specific question. Nothing is
* marked required, so the user can also just skip — matching the built-in tool,
* which always offers Skip + a free-text box.
*/
export function askUserQuestionsToCreateRequest(
questions: AskUserQuestion[],
sessionId: string,
toolCallId: string | undefined,
airClient = false,
): CreateElicitationRequest {
const single = questions.length === 1;
const properties: Record<string, ElicitationPropertySchema> = {};
@@ -211,13 +207,19 @@ export function askUserQuestionsToCreateRequest(
properties[questionCustomFieldKey(index)] = {
type: "string",
title: "Other",
description: "Type your own answer instead of choosing an option above (optional).",
_meta: {
[CUSTOM_ANSWER_META_KEY]: {
questionId: questionFieldKey(index),
isCustomAnswer: true,
},
},
description: question.multiSelect
? "Type your own answer to add to your selection above (optional)."
: "Type your own answer, or add a note to the option you chose above (optional).",
// Marks the field as the custom answer companion of a select question,
// under `_meta.jetbrains.air.customAnswer`. Only AIR gets the marker.
...(airClient
? {
_meta: withAirMeta(undefined, AIR_CUSTOM_ANSWER_KEY, {
questionId: questionFieldKey(index),
isCustomAnswer: true,
}),
}
: {}),
};
});
@@ -241,17 +243,36 @@ export function askUserQuestionsToCreateRequest(
export type AskUserQuestionOutcome =
{ action: "answered"; updatedInput: Record<string, unknown> } | { action: "cancel" };
/**
* Serialize a multi-select answer the way the CLI's own AskUserQuestion UI
* does: comma-joined, with any item that itself contains the separator (or a
* double quote) JSON-quoted. The tool's `call()` splits the string back on the
* same rule, so a free-text answer like `Redis, not Memcached` stays one item
* instead of reading as two more picks.
*/
function joinMultiSelectAnswer(items: string[]): string {
return items
.map((item) => (item.includes(", ") || item.includes('"') ? JSON.stringify(item) : item))
.join(", ");
}
/**
* Fold an ACP elicitation response into the AskUserQuestion tool's input.
*
* Selected labels are read back from the indexed form fields and written into
* `answers` as a `{ [questionText]: label }` map (comma-joining multi-selects)
* — the key shape the tool's own `call()` reads. A non-empty per-question
* custom-answer field (`question_<n>_custom`) takes precedence over that
* question's selection, since the user typed their own answer instead of
* picking one. Decline yields empty answers (the model is told the user skipped
* rather than the turn aborting); cancel — and any custom/future action we
* don't understand — aborts the tool call.
* `answers` as a `{ [questionText]: label }` map — the key shape the tool's own
* `call()` reads — with multi-selects comma-joined in the CLI's own quoted form
* (see `joinMultiSelectAnswer`). A non-empty per-question custom-answer field
* (`question_<n>_custom`) joins the selection of a multi-select question, where
* the two fields are independent and filling both means both. For a
* single-select question it is the answer when nothing was picked (the user
* typed their own instead), and otherwise travels beside the pick as the
* tool's own per-question `annotations[question].notes` — the slot the CLI
* uses for free text attached to a selection and renders to the model as
* `"Q"="A" notes: ...` — so a client that presents the box as a notes field
* cannot make the selection disappear. Decline yields empty answers (the model
* is told the user skipped rather than the turn aborting); cancel — and any
* custom/future action we don't understand — aborts the tool call.
*/
export function applyAskElicitationResponse(
response: CreateElicitationResponse,
@@ -270,27 +291,57 @@ export function applyAskElicitationResponse(
// Typed against the tool's own output schema so the answer/response shapes
// stay in sync with what the built-in tool's call() expects to read back.
const answers: AskUserQuestionOutput["answers"] = {};
const annotations: NonNullable<AskUserQuestionInput["annotations"]> = {};
questions.forEach((question, index) => {
// A typed custom answer wins over the selection: the user chose to write
// their own answer for this question instead of picking an option.
const custom = content[questionCustomFieldKey(index)];
if (typeof custom === "string" && custom.trim() !== "") {
answers[question.question] = custom.trim();
return;
}
const customText = typeof custom === "string" ? custom.trim() : "";
const value = content[questionFieldKey(index)];
if (value === undefined || value === null) {
const picks: string[] =
value === undefined || value === null
? []
: Array.isArray(value)
? value.filter((item) => item !== undefined && item !== null && item !== "").map(String)
: [String(value)];
// A multi-select is additive, and the form offers the selection and the
// custom box as independent fields — a user who fills both means both, so
// the typed answer joins the checked options.
if (question.multiSelect) {
const text = joinMultiSelectAnswer(customText === "" ? picks : [...picks, customText]);
if (text !== "") {
answers[question.question] = text;
}
return;
}
const text = Array.isArray(value) ? value.join(", ") : String(value);
if (text === "") {
// A single-select question is answered by exactly one thing. With no option
// picked, the typed text is that answer (the CLI's "Other"). With an option
// picked as well, the pick stays the answer and the text rides along as the
// tool's per-question `notes` annotation, so neither is lost. A single-select
// normally holds one item; the plain join only matters if a client hands
// back an array for it, and then mirrors the old behavior.
const picked = picks.join(", ");
if (picked === "") {
if (customText !== "") {
answers[question.question] = customText;
}
return;
}
answers[question.question] = text;
answers[question.question] = picked;
if (customText !== "") {
annotations[question.question] = { notes: customText };
}
});
return { action: "answered", updatedInput: { ...toolInput, answers } };
return {
action: "answered",
updatedInput: {
...toolInput,
answers,
...(Object.keys(annotations).length > 0 ? { annotations } : {}),
},
};
}
/**

232
src/exit-plan.ts Normal file
View File

@@ -0,0 +1,232 @@
import type { SessionNotification } from "@agentclientprotocol/sdk";
import type { SDKResultMessage } from "@anthropic-ai/claude-agent-sdk";
import {
type ClearContextCoordinatorHost,
type ClearContextReset,
type ClearContextSession,
type ClearContextTurn,
continuePlanInFreshContext,
} from "./clear-context-coordinator.js";
import { parseToolResultMeta } from "./tool-result-meta.js";
export function acceptedPlanToolResult(
notification: SessionNotification,
toolUseId: string | undefined,
): SessionNotification {
const update = notification.update;
if (
!toolUseId ||
update.sessionUpdate !== "tool_call_update" ||
update.toolCallId !== toolUseId
) {
return notification;
}
const completed = { ...update };
delete completed.rawOutput;
delete completed.content;
return { ...notification, update: { ...completed, status: "completed" } };
}
function containsToolResultFor(content: unknown, toolUseId: string): boolean {
return (
Array.isArray(content) &&
content.some(
(block) =>
typeof block === "object" &&
block !== null &&
(block as { type?: unknown }).type === "tool_result" &&
(block as { tool_use_id?: unknown }).tool_use_id === toolUseId,
)
);
}
type ExitPlanState = {
toolUseCache: Record<string, { name: string } | undefined>;
pendingExitPlanModeInterruption?: { toolUseId: string; toolResultSeen: boolean };
pendingExitPlanContextReset?: ClearContextReset;
};
function rejectedExitPlanToolUseId(
content: unknown,
toolUseCache: ExitPlanState["toolUseCache"],
rawToolResultMeta: unknown,
): string | undefined {
if (!Array.isArray(content)) return undefined;
const toolResultMeta = parseToolResultMeta(rawToolResultMeta);
if (!toolResultMeta) return undefined;
for (const block of content) {
if (typeof block !== "object" || block === null) continue;
const { type, tool_use_id: toolUseId, is_error: isError } = block as Record<string, unknown>;
if (
type === "tool_result" &&
typeof toolUseId === "string" &&
isError === true &&
toolResultMeta.get(toolUseId)?.nonExecutionKind === "user-rejected" &&
toolUseCache[toolUseId]?.name === "ExitPlanMode"
) {
return toolUseId;
}
}
return undefined;
}
/** Reconcile an SDK user message with the two pending ExitPlanMode lanes and
* return the accepted plan tool id whose rendered update must be completed. */
export function observeExitPlanToolResults(
message: { type: string; tool_result_meta?: unknown },
content: unknown,
state: ExitPlanState,
): string | undefined {
if (message.type !== "user") return undefined;
const rejectedToolUseId = rejectedExitPlanToolUseId(
content,
state.toolUseCache,
message.tool_result_meta,
);
if (rejectedToolUseId) {
// The stream is authoritative: resumed queries can lose the short-lived
// marker installed by canUseTool, while metadata preserves correlation.
state.pendingExitPlanModeInterruption = {
toolUseId: rejectedToolUseId,
toolResultSeen: true,
};
}
const pendingInterruption = state.pendingExitPlanModeInterruption;
if (pendingInterruption && containsToolResultFor(content, pendingInterruption.toolUseId)) {
pendingInterruption.toolResultSeen = true;
}
const pendingReset = state.pendingExitPlanContextReset;
return pendingReset && containsToolResultFor(content, pendingReset.toolUseId)
? pendingReset.toolUseId
: undefined;
}
export function executionDiagnostic(message: SDKResultMessage): string | undefined {
if (message.subtype === "success") {
return message.result.startsWith("[ede_diagnostic]") ? message.result : undefined;
}
return message.errors.find((error) => error.startsWith("[ede_diagnostic]"));
}
/** Whether `message` is the error-shaped diagnostic Claude emits for the cycle
* a recorded ExitPlanMode `interrupt: true` answer stopped. */
export function isExitPlanInterruptionResult(
message: SDKResultMessage,
pending: ExitPlanState["pendingExitPlanModeInterruption"],
): boolean {
if (!pending?.toolResultSeen || !message.is_error) return false;
const diagnostic = executionDiagnostic(message);
return (
!!diagnostic &&
/(?:^|\s)result_type=user(?:\s|$)/.test(diagnostic) &&
/(?:^|\s)stop_reason=tool_use(?:\s|$)/.test(diagnostic)
);
}
/** Claude wraps a rejected ExitPlanMode explanation in a Markdown code fence.
* Strip exactly one complete outer fence for that tool only. */
export function exitPlanModeRawOutput(toolName: string, content: unknown): unknown {
if (toolName !== "ExitPlanMode" || typeof content !== "string") {
return content;
}
const fenced = /^\s*```[^\r\n]*\r?\n([\s\S]*?)\r?\n```\s*$/.exec(content);
return fenced?.[1] ?? content;
}
export type ExitPlanRestartHost<
Session extends ClearContextSession<Turn>,
Turn extends ClearContextTurn,
> = Omit<
ClearContextCoordinatorHost<Session, Turn>,
"publishSessionState" | "continuationMessage"
> & {
sessionUpdate(notification: SessionNotification): Promise<void>;
destroyReplacement(sessionId: string, session: Session): void;
settleCancelledTurn(oldSession: Session, turnSession: Session, turn: Turn): void;
settleFailedTurn(turnSession: Session, turn: Turn, error: unknown): void;
};
/** Owns the lifetime of accepted-plan context replacements. In particular, a
* session cancellation invalidates an in-progress async restart so a late
* restartSession result cannot recreate a closed public session. */
export class ExitPlanCoordinator<
Session extends ClearContextSession<Turn>,
Turn extends ClearContextTurn,
> {
private readonly restarts = new Map<string, AbortController>();
constructor(private readonly host: ExitPlanRestartHost<Session, Turn>) {}
cancel(sessionId: string): void {
this.restarts.get(sessionId)?.abort();
}
async restart(sessionId: string, oldSession: Session, reset: ClearContextReset): Promise<void> {
this.cancel(sessionId);
const controller = new AbortController();
this.restarts.set(sessionId, controller);
try {
const clearContextHost: ClearContextCoordinatorHost<Session, Turn> = {
...this.host,
publishSessionState: async (id, mode, configOptions) => {
await this.host.sessionUpdate({
sessionId: id,
update: { sessionUpdate: "current_mode_update", currentModeId: mode },
});
await this.host.sessionUpdate({
sessionId: id,
update: { sessionUpdate: "config_option_update", configOptions },
});
},
continuationMessage: (id, plan, promptUuid) => ({
type: "user",
message: {
role: "user",
content: [{ type: "text", text: `Implement the following plan:\n\n${plan}` }],
},
session_id: id,
parent_tool_use_id: null,
origin: { kind: "human" },
uuid: promptUuid as `${string}-${string}-${string}-${string}-${string}`,
}),
};
await continuePlanInFreshContext(
sessionId,
oldSession,
reset,
clearContextHost,
controller.signal,
);
} catch (error) {
const currentSession = this.host.currentSession(sessionId);
const replacement = currentSession !== oldSession ? currentSession : undefined;
if (replacement) this.host.destroyReplacement(sessionId, replacement);
const turn = replacement?.activeTurn ?? oldSession.activeTurn;
if (turn && !turn.settled) {
const turnSession = replacement?.activeTurn === turn ? replacement : oldSession;
if (controller.signal.aborted) {
this.host.settleCancelledTurn(oldSession, turnSession, turn);
} else {
// A provider/session-creation failure is turn-scoped. Settling it
// here keeps it out of the query consumer's transport-loss catch.
this.host.settleFailedTurn(turnSession, turn, error);
}
oldSession.activeTurn = null;
oldSession.turnQueue = (oldSession.turnQueue ?? []).filter((queued) => queued !== turn);
if (replacement) {
replacement.activeTurn = null;
replacement.turnQueue = (replacement.turnQueue ?? []).filter((queued) => queued !== turn);
}
}
oldSession.pendingExitPlanContextReset = undefined;
} finally {
if (this.restarts.get(sessionId) === controller) {
this.restarts.delete(sessionId);
}
}
}
}

335
src/file-change-audit.ts Normal file
View File

@@ -0,0 +1,335 @@
import type { Query, RewindFilesResult } from "@anthropic-ai/claude-agent-sdk";
import * as fs from "node:fs";
import * as path from "node:path";
import { airExtensionMeta, clientSupportsAirCapability, withAirMeta } from "./air-extension.js";
export const AGENT_FILE_CHANGE_REPORT_CAPABILITY = "agentFileChangeReport";
const MAX_REPORTED_PATHS = 1024;
const MAX_REPORTED_PATH_LENGTH = 4096;
export const AGENT_FILE_CHANGE_REPORT_MAX_BYTES = 256 * 1024;
export const AGENT_FILE_CHANGE_REPORT_TIMEOUT_MS = 2_000;
const REQUEST_ID_PATTERN = /^[A-Za-z0-9._:-]{1,128}$/;
export type FileChangeReportTurnState = {
requestId: string;
phase: "requested" | "collecting" | "finished";
};
export type NativeFileChangeReportTurn = {
promptUuid: string;
fileChangeReport?: FileChangeReportTurnState;
};
export type FileChangeReportWorkspace = {
cwd: string;
additionalDirectories: string[];
};
export type AgentFileChangeReportResult = {
version: 1;
requestId: string;
} & (
| {
status: "reported";
paths: string[];
declaredComplete: boolean;
truncated: boolean;
}
| {
status: "unavailable";
reason: FileChangeReportUnavailableReason;
}
);
export type FileChangeReportUnavailableReason =
"cancelled" | "timeout" | "invalidOutput" | "notReported" | "providerError";
type NativeFileChangeReporterOptions = {
cwd: string;
additionalDirectories: string[];
publish: (result: AgentFileChangeReportResult) => Promise<void>;
logError: (message: string) => void;
timeoutMs?: number;
};
export type NativeFileChangeReporter = {
request(meta: unknown): FileChangeReportTurnState | undefined;
report(
turn: NativeFileChangeReportTurn | null | undefined,
query: Pick<Query, "rewindFiles">,
): Promise<void>;
finish(
state: FileChangeReportTurnState | undefined,
reason: FileChangeReportUnavailableReason,
): void;
};
export function agentFileChangeReportRequestId(meta: unknown): string | undefined {
const air = airExtensionMeta(meta);
const request = air?.agentFileChangeReportRequest;
if (!request || typeof request !== "object" || Array.isArray(request)) return undefined;
const requestRecord = request as Record<string, unknown>;
const requestKeys = Object.keys(requestRecord);
if (
requestKeys.length !== 2 ||
!requestKeys.includes("version") ||
!requestKeys.includes("requestId") ||
requestRecord.version !== 1
)
return undefined;
const requestId = requestRecord.requestId;
return typeof requestId === "string" && REQUEST_ID_PATTERN.test(requestId)
? requestId
: undefined;
}
export function supportsAgentFileChangeReport(capabilities: unknown): boolean {
return clientSupportsAirCapability(capabilities, AGENT_FILE_CHANGE_REPORT_CAPABILITY);
}
export function agentFileChangeReportMeta(
result: AgentFileChangeReportResult,
): Record<string, unknown> {
return withAirMeta(undefined, AGENT_FILE_CHANGE_REPORT_CAPABILITY, result);
}
export function createNativeFileChangeReporter(
options: NativeFileChangeReporterOptions,
): NativeFileChangeReporter {
const workspace = normalizeWorkspace(options.cwd, options.additionalDirectories);
const timeoutMs = options.timeoutMs ?? AGENT_FILE_CHANGE_REPORT_TIMEOUT_MS;
const requestIds = new Set<string>();
const publish = async (state: FileChangeReportTurnState, result: AgentFileChangeReportResult) => {
if (state.phase === "finished") return;
state.phase = "finished";
try {
await options.publish(result);
} catch (error) {
options.logError(`Failed to publish file-change report ${state.requestId}: ${error}`);
}
};
const finishUnavailable = async (
state: FileChangeReportTurnState,
reason: FileChangeReportUnavailableReason,
) => {
await publish(state, {
version: 1,
requestId: state.requestId,
status: "unavailable",
reason,
});
};
const report = async (
turn: NativeFileChangeReportTurn | null | undefined,
query: Pick<Query, "rewindFiles">,
) => {
const state = turn?.fileChangeReport;
if (!state || state.phase !== "requested") return;
state.phase = "collecting";
let timer: ReturnType<typeof setTimeout> | undefined;
const previewPromise = query.rewindFiles(turn.promptUuid, { dryRun: true });
// A timed-out control request may still settle later. Observe it so a late
// rejection cannot become unhandled, but never let it publish a second terminal.
void previewPromise.catch(() => {});
try {
const preview = await Promise.race<RewindFilesResult | null>([
previewPromise,
new Promise<null>((resolve) => {
timer = setTimeout(() => resolve(null), timeoutMs);
timer.unref?.();
}),
]);
if (preview === null) {
await finishUnavailable(state, "timeout");
return;
}
if (!preview.canRewind || !Array.isArray(preview.filesChanged)) {
await finishUnavailable(state, "invalidOutput");
return;
}
const normalized = normalizeReportedPaths(preview.filesChanged, workspace);
await publish(
state,
fitReportedAgentFileChangeReport({
version: 1,
requestId: state.requestId,
status: "reported",
paths: normalized.paths,
// Checkpoints cover Claude file tools, but not every mutation source
// (notably Bash and most subagents), so this list is never exhaustive.
declaredComplete: false,
truncated: normalized.truncated,
}),
);
} catch (error) {
options.logError(`Failed to inspect Claude file checkpoint ${turn.promptUuid}: ${error}`);
await finishUnavailable(state, "providerError");
} finally {
if (timer) clearTimeout(timer);
}
};
return {
request(meta) {
const requestId = agentFileChangeReportRequestId(meta);
if (!requestId || requestIds.has(requestId)) return undefined;
requestIds.add(requestId);
return { requestId, phase: "requested" };
},
report,
finish(state, reason) {
if (!state) return;
void finishUnavailable(state, reason);
},
};
}
function normalizeWorkspace(
cwd: string,
additionalDirectories: string[],
): FileChangeReportWorkspace {
const normalizedCwd = canonicalizeWorkspaceRoot(path.resolve(cwd));
const seen = new Set([pathKey(normalizedCwd)]);
const normalizedAdditionalDirectories: string[] = [];
for (const directory of additionalDirectories) {
const normalized = canonicalizeWorkspaceRoot(path.resolve(normalizedCwd, directory));
const key = pathKey(normalized);
if (seen.has(key)) continue;
seen.add(key);
normalizedAdditionalDirectories.push(normalized);
}
return {
cwd: normalizedCwd,
additionalDirectories: normalizedAdditionalDirectories,
};
}
function normalizeReportedPaths(
reportedPaths: string[],
workspace: FileChangeReportWorkspace,
): { paths: string[]; truncated: boolean } {
const roots = [workspace.cwd, ...workspace.additionalDirectories];
const seen = new Set<string>();
const result: string[] = [];
let totalBytes = 0;
let truncated = false;
for (const reportedPath of reportedPaths) {
if (
typeof reportedPath !== "string" ||
reportedPath.trim().length === 0 ||
reportedPath.length > MAX_REPORTED_PATH_LENGTH ||
hasControlCharacter(reportedPath)
) {
truncated = true;
continue;
}
let normalized: string;
try {
normalized = canonicalizeReportedPath(path.resolve(workspace.cwd, reportedPath));
} catch {
truncated = true;
continue;
}
if (normalized.length > MAX_REPORTED_PATH_LENGTH || hasControlCharacter(normalized)) {
truncated = true;
continue;
}
if (!roots.some((root) => isWithinRoot(normalized, root))) {
truncated = true;
continue;
}
const key = pathKey(normalized);
if (roots.some((root) => pathKey(root) === key)) {
truncated = true;
continue;
}
if (seen.has(key)) continue;
const pathBytes = Buffer.byteLength(normalized, "utf8");
if (
result.length >= MAX_REPORTED_PATHS ||
totalBytes + pathBytes > AGENT_FILE_CHANGE_REPORT_MAX_BYTES
) {
truncated = true;
continue;
}
seen.add(key);
result.push(normalized);
totalBytes += pathBytes;
}
return { paths: result, truncated };
}
function fitReportedAgentFileChangeReport(
report: Extract<AgentFileChangeReportResult, { status: "reported" }>,
): Extract<AgentFileChangeReportResult, { status: "reported" }> {
const paths = [...report.paths];
let fitted = report;
while (Buffer.byteLength(JSON.stringify(fitted), "utf8") > AGENT_FILE_CHANGE_REPORT_MAX_BYTES) {
if (paths.length === 0) {
throw new Error("Agent file-change report exceeds the wire limit without paths");
}
paths.pop();
fitted = {
...report,
paths: [...paths],
declaredComplete: false,
truncated: true,
};
}
return fitted;
}
function isWithinRoot(candidate: string, root: string): boolean {
const relative = path.relative(root, candidate);
return !path.isAbsolute(relative) && !relative.startsWith(`..${path.sep}`) && relative !== "..";
}
function canonicalizeWorkspaceRoot(value: string): string {
return canonicalizeFromExistingAncestor(value);
}
function canonicalizeReportedPath(value: string): string {
const parent = canonicalizeFromExistingAncestor(path.dirname(value));
return path.resolve(parent, path.basename(value));
}
function canonicalizeFromExistingAncestor(value: string): string {
const original = path.resolve(value);
let current = original;
const missingSegments: string[] = [];
while (true) {
try {
const canonical = fs.realpathSync.native(current);
return path.resolve(canonical, ...missingSegments.reverse());
} catch (error) {
if (!isMissingPathError(error)) return original;
}
const parent = path.dirname(current);
if (parent === current) return original;
missingSegments.push(path.basename(current));
current = parent;
}
}
function isMissingPathError(error: unknown): boolean {
if (typeof error !== "object" || error === null || !("code" in error)) return false;
return error.code === "ENOENT" || error.code === "ENOTDIR";
}
function pathKey(value: string): string {
return process.platform === "win32" ? value.toLowerCase() : value;
}
function hasControlCharacter(value: string): boolean {
for (let index = 0; index < value.length; index++) {
const code = value.charCodeAt(index);
if (code <= 0x1f || (code >= 0x7f && code <= 0x9f)) return true;
}
return false;
}

235
src/fork-session.ts Normal file
View File

@@ -0,0 +1,235 @@
import { ForkSessionRequest, ForkSessionResponse, RequestError } from "@agentclientprotocol/sdk";
import {
forkSession as forkClaudeSession,
getSessionMessages,
importSessionToStore,
type SessionStore,
type SessionStoreEntry,
} from "@anthropic-ai/claude-agent-sdk";
import { createHash } from "node:crypto";
import { assistantMessageText } from "./session-failure-extension.js";
import { SessionTiming } from "./session-timing.js";
type ForkSessionMeta = {
[key: string]: unknown;
jetbrains?: {
air?: {
fork?: {
version?: number;
messageId?: string;
messageFingerprint?: string;
messageOccurrence?: number;
};
};
};
};
type ForkSessionDependencies = {
liveMessageIdToUuid?: ReadonlyMap<string, string>;
logger?: { log: (...args: unknown[]) => void };
messageIdForGrouping: (message: {
type?: string;
uuid?: string | null;
message?: unknown;
}) => string | undefined;
};
type ForkPoint = {
messageId: string;
messageFingerprint?: string;
messageOccurrence?: number;
};
function forkPoint(meta: unknown): ForkPoint | undefined {
const fork = (meta as ForkSessionMeta | null | undefined)?.jetbrains?.air?.fork;
if (fork?.version !== 1) return undefined;
const messageId = fork.messageId?.trim();
if (!messageId) return undefined;
const messageFingerprint = fork.messageFingerprint?.trim();
const messageOccurrence = fork.messageOccurrence;
return {
messageId,
...(messageFingerprint ? { messageFingerprint } : {}),
// AIR computes this with count(...) over the visible prefix, so it is 1-based.
...(typeof messageOccurrence === "number" &&
Number.isSafeInteger(messageOccurrence) &&
messageOccurrence > 0
? { messageOccurrence }
: {}),
};
}
function forkPointMessageIdCandidates(messageId: string): string[] {
// Older AIR builds sent their visible segment id. Prefer the exact id before its ACP source id.
const protocolMessageId = messageId.replace(/:segment:\d+$/, "");
return protocolMessageId === messageId ? [messageId] : [messageId, protocolMessageId];
}
async function loadFullSessionHistory(
sessionId: string,
cwd: string,
): Promise<SessionStoreEntry[]> {
// getSessionMessages returns only the active parentUuid chain. The import keeps inactive branches that AIR can still reference.
const entries: SessionStoreEntry[] = [];
const store: SessionStore = {
append: async (_key, batch) => {
entries.push(...batch);
},
load: async () => null,
};
await importSessionToStore(sessionId, store, { dir: cwd, includeSubagents: false });
return entries;
}
function assistantGroups(
entries: SessionStoreEntry[],
messageIdForGrouping: ForkSessionDependencies["messageIdForGrouping"],
) {
const groups = new Map<string, { uuid?: string; text: string }>();
for (const entry of entries) {
if (
entry.type !== "assistant" ||
entry.isSidechain === true ||
entry.parent_tool_use_id != null ||
entry.parent_agent_id != null
) {
continue;
}
const messageId = messageIdForGrouping(entry);
if (!messageId) continue;
const group = groups.get(messageId) ?? { text: "" };
if (typeof entry.uuid === "string" && entry.uuid.length > 0) group.uuid = entry.uuid;
group.text += assistantMessageText(entry.message) ?? "";
groups.set(messageId, group);
}
return groups;
}
function fingerprint(text: string): string {
return `sha256:${createHash("sha256").update(text).digest("hex")}`;
}
function fingerprintOccurrenceOnBranch(
targetUuid: string,
expectedFingerprint: string,
entries: SessionStoreEntry[],
groups: ReturnType<typeof assistantGroups>,
messageIdForGrouping: ForkSessionDependencies["messageIdForGrouping"],
): number {
const entriesByUuid = new Map(
entries.flatMap((entry) => (typeof entry.uuid === "string" ? [[entry.uuid, entry]] : [])),
);
const seenGroups = new Set<string>();
let occurrence = 0;
let cursor: string | undefined = targetUuid;
while (cursor) {
const entry = entriesByUuid.get(cursor);
if (!entry) break;
if (
entry.type === "assistant" &&
entry.isSidechain !== true &&
entry.parent_tool_use_id == null &&
entry.parent_agent_id == null
) {
const messageId = messageIdForGrouping(entry);
if (messageId && !seenGroups.has(messageId)) {
seenGroups.add(messageId);
const group = groups.get(messageId);
if (group && fingerprint(group.text) === expectedFingerprint) occurrence++;
}
}
cursor = typeof entry.parentUuid === "string" ? entry.parentUuid : undefined;
}
return occurrence;
}
function resolveFromFullHistory(
entries: SessionStoreEntry[],
candidates: string[],
point: ForkPoint,
messageIdForGrouping: ForkSessionDependencies["messageIdForGrouping"],
): string | undefined {
const groups = assistantGroups(entries, messageIdForGrouping);
const exact = candidates.map((candidate) => groups.get(candidate)?.uuid).find(Boolean);
if (exact) return exact;
if (!point.messageFingerprint || !point.messageOccurrence) return undefined;
const fingerprintMatches = [...groups.values()].filter(
(group) => group.uuid && fingerprint(group.text) === point.messageFingerprint,
);
// If only one persisted message has this content, the fingerprint already
// identifies it even when an older client supplied an incompatible index.
if (fingerprintMatches.length === 1) return fingerprintMatches[0]?.uuid;
const occurrenceMatches = fingerprintMatches.filter(
(group) =>
group.uuid &&
fingerprintOccurrenceOnBranch(
group.uuid,
point.messageFingerprint!,
entries,
groups,
messageIdForGrouping,
) === point.messageOccurrence,
);
return occurrenceMatches.length === 1 ? occurrenceMatches[0]?.uuid : undefined;
}
export async function forkSession(
params: ForkSessionRequest,
dependencies: ForkSessionDependencies,
): Promise<ForkSessionResponse> {
const timing = new SessionTiming(dependencies.logger, "fork", params.sessionId);
const point = forkPoint(params._meta);
if (!point) {
const forked = await forkClaudeSession(params.sessionId, { dir: params.cwd });
timing.phase("sdk-fork", " resolution=latest");
return { sessionId: forked.sessionId };
}
const candidateIds = forkPointMessageIdCandidates(point.messageId);
const liveUuid = candidateIds
.map((candidateId) => dependencies.liveMessageIdToUuid?.get(candidateId))
.find(Boolean);
const history = liveUuid
? undefined
: await getSessionMessages(params.sessionId, { dir: params.cwd });
timing.phase("active-history", ` resolution=${liveUuid ? "live" : "pending"}`);
const messageUuid =
liveUuid ??
candidateIds
.map(
(candidateId) =>
history
?.slice()
.reverse()
.find((message) => dependencies.messageIdForGrouping(message) === candidateId)?.uuid,
)
.find(Boolean);
const fullHistoryUuid = messageUuid
? undefined
: resolveFromFullHistory(
await loadFullSessionHistory(params.sessionId, params.cwd),
candidateIds,
point,
dependencies.messageIdForGrouping,
);
timing.phase(
"full-history",
` resolution=${liveUuid ? "live" : messageUuid ? "active" : fullHistoryUuid ? "full" : "missing"}`,
);
if (!messageUuid && !fullHistoryUuid) {
throw RequestError.invalidParams(
{ messageId: point.messageId },
`Fork point message ${point.messageId} was not found in session ${params.sessionId}`,
);
}
const forked = await forkClaudeSession(params.sessionId, {
dir: params.cwd,
upToMessageId: messageUuid ?? fullHistoryUuid,
});
timing.phase("sdk-fork");
return { sessionId: forked.sessionId };
}

83
src/goal-extension.ts Normal file
View File

@@ -0,0 +1,83 @@
import { RequestError } from "@agentclientprotocol/sdk";
import type { SDKActiveGoalMessage } from "@anthropic-ai/claude-agent-sdk";
export const GOAL_EXTENSION_VERSION = 1 as const;
export const GOAL_CONTROL_METHOD = "_session/goal";
export const GOAL_ACTIONS = ["set", "clear"] as const;
export type GoalAction = (typeof GOAL_ACTIONS)[number];
export type GoalCapability = {
version: typeof GOAL_EXTENSION_VERSION;
controlMethod: typeof GOAL_CONTROL_METHOD;
actions: GoalAction[];
};
export type GoalStatus = "active" | "paused" | "blocked" | "limited" | "complete";
export type GoalSnapshot = {
objective: string;
status: GoalStatus;
iterations?: number;
lastReason?: string | null;
createdAt?: number;
updatedAt?: number;
tokenBudget?: number | null;
tokensUsed?: number;
timeUsedSeconds?: number;
controlMethod: typeof GOAL_CONTROL_METHOD;
};
export type GoalRequest =
{ sessionId: string; action: "clear" } | { sessionId: string; action: "set"; objective: string };
export type GoalControlResponse = Record<string, never>;
export function goalUpdateFromPrompt(prompt: string): GoalSnapshot | null | undefined {
const match = /^\/goal(?:\s+([\s\S]*))?$/.exec(prompt);
const argument = match?.[1]?.trim();
if (!argument) {
return undefined;
}
if (argument === "clear") {
return null;
}
return {
objective: argument,
status: "active",
controlMethod: GOAL_CONTROL_METHOD,
};
}
export function parseGoalRequest(params: unknown): GoalRequest {
if (!params || typeof params !== "object") {
throw RequestError.invalidParams(undefined, "goal params must be an object");
}
const { sessionId, action, objective } = params as Record<string, unknown>;
if (typeof sessionId !== "string" || sessionId.length === 0) {
throw RequestError.invalidParams(undefined, "goal params require a non-empty sessionId");
}
if (!GOAL_ACTIONS.includes(action as GoalAction)) {
throw RequestError.invalidParams(undefined, 'goal action must be "set" or "clear"');
}
if (action === "set" && (typeof objective !== "string" || objective.trim().length === 0)) {
throw RequestError.invalidParams(undefined, 'goal action "set" requires a non-empty objective');
}
return action === "set"
? { sessionId, action, objective: (objective as string).trim() }
: { sessionId, action: "clear" };
}
export function toGoalSnapshot(message: SDKActiveGoalMessage): GoalSnapshot | null {
if (message.value === null) {
return null;
}
return {
objective: message.value.condition.trim(),
status: "active",
iterations: message.value.iterations,
lastReason: message.value.last_reason ?? null,
createdAt: message.value.set_at,
controlMethod: GOAL_CONTROL_METHOD,
};
}

286
src/hide-claude-auth.ts Normal file
View File

@@ -0,0 +1,286 @@
/**
* `--hide-claude-auth`: this integration must never bill a claude.ai
* subscription. The flag hides the claude.ai login method from `initialize`
* and makes the agent behave like a logged-out CLI whenever a subscription
* would pay for a turn. `acp-agent.ts` decides *when* the guard applies (flag
* on, no provider override) and calls in here for the *what*.
*
* The account the CLI reports at `initialize` is the source of truth. The SDK
* memoizes it, so it is a constant for the life of a query, and two layers
* keep it honest:
*
* 1. Session creation refuses an account that holds no credential this
* integration accepts. A logged-out session never exists, so the client's
* sign-in always leads to a new session with a fresh `initialize`. The
* per-turn guard repeats the check on the same cached account, which costs
* microseconds and covers a session created under a provider override that
* `providers/disable` later removed.
* 2. A sign-out during the session ends the query. The next turn recreates it,
* so the next `initialize` reports the real account and layer 1 judges it.
* The recreation resumes the stored conversation. When the CLI never wrote
* one, because the first turn was the one that signed out, the recreation
* starts a fresh query under the same session id instead.
*
* A file-based credential replaced by a subscription between two turns is seen
* by the CLI probe the agent fires at the START of every user prompt. That read
* is never awaited, so it usually lands mid-turn; all it does there is mark the
* session. The guard consumes the mark at the turn boundary — the next prompt
* recreates the query and layer 1 judges the account the new `initialize`
* reports — so a probe never interrupts a running turn. A swap that happens
* after the last probe stays unseen until the next prompt reads the store
* again. Closing that window would cost a blocking read per turn.
*/
import { RequestError } from "@agentclientprotocol/sdk";
import type { AccountInfo, Query } from "@anthropic-ai/claude-agent-sdk";
export function shouldHideClaudeAuth(): boolean {
return process.argv.includes("--hide-claude-auth");
}
/**
* `data.reason` carried by the `authRequired` JSON-RPC error when the flag
* blocks a turn. From the client's point of view the agent is logged out (same
* error code and flow as a signed-out CLI); the reason lets it render a
* different hint. A string enum so further reasons can be added without a
* shape change.
*/
export const CLAUDE_SUBSCRIPTION_NOT_SUPPORTED_REASON = "claude_subscription_not_supported";
export type AuthRequiredReason = typeof CLAUDE_SUBSCRIPTION_NOT_SUPPORTED_REASON;
export const CLAUDE_SUBSCRIPTION_NOT_SUPPORTED_MESSAGE =
"This integration does not support using claude.ai subscriptions.";
/** The message of the plain sign-out refusal. It carries no `reason`: the
* account holds nothing this integration can bill, which is the ordinary
* signed-out state every ACP client already knows how to answer. */
export const CLAUDE_LOGIN_REQUIRED_MESSAGE =
"Sign in with an API key or a Console account to use this integration.";
/**
* The `apiKeySource` values that outrank a stored subscription.
*
* The SDK documents its `ApiKeySource` type as the origin of the credential
* used for API requests. `ANTHROPIC_API_KEY` is the environment variable,
* `apiKeyHelper` is the configured helper command, and `/login managed key` is
* a key that `/login` created with an Anthropic Console account. Each of the
* three is an API key that pays instead of the subscription. Every other
* member means no API key is in use: `none`, and the legacy `user`, `project`,
* `org`, `temporary` and `oauth` that current CLIs never emit.
*/
const API_KEY_SOURCES_ABOVE_SUBSCRIPTION: ReadonlySet<string> = new Set([
"ANTHROPIC_API_KEY",
"apiKeyHelper",
"/login managed key",
]);
/**
* True when a turn on this account is paid by a claude.ai subscription.
*
* The SDK types `apiKeySource` and `tokenSource` as an open `string`, so this
* is an allowlist. An account bills the subscription only when every field
* proves it, and an unknown value keeps the guard on.
*
* - `subscriptionType` must be set. Without it the CLI reports no subscription.
* - `tokenSource` must be absent. The CLI sets it in place of the subscription
* when a bearer or OAuth environment token pays for the turn.
* - `apiProvider` must be absent or `firstParty`. The SDK documents that the
* Anthropic OAuth login applies only to `firstParty`; for a third-party
* backend such as `bedrock`, `vertex`, `foundry` or `gateway` the other
* fields are absent and the authentication is external.
* - `apiKeySource` must not be one of {@link API_KEY_SOURCES_ABOVE_SUBSCRIPTION}.
* Claude Code's credential precedence puts those keys above the `/login`
* subscription, so the key pays and the stored subscription is inert.
*/
export function billsClaudeSubscription(account: AccountInfo | undefined): boolean {
if (!account?.subscriptionType) {
return false;
}
if (account.tokenSource) {
return false;
}
if (account.apiProvider !== undefined && account.apiProvider !== "firstParty") {
return false;
}
return !API_KEY_SOURCES_ABOVE_SUBSCRIPTION.has(account.apiKeySource ?? "");
}
/**
* True when the account already holds a credential this integration accepts:
* a third-party backend, a bearer or OAuth environment token, or one of the
* API key sources in {@link API_KEY_SOURCES_ABOVE_SUBSCRIPTION}.
*
* False therefore covers both the signed-out CLI and the account whose only
* credential is a claude.ai subscription. {@link billsClaudeSubscription} runs
* first and separates the two, so a caller that reaches a `false` here is
* looking at a session with no way to pay.
*/
export function holdsNonSubscriptionCredential(account: AccountInfo | undefined): boolean {
if (!account) {
return false;
}
if (account.apiProvider !== undefined && account.apiProvider !== "firstParty") {
return true;
}
if (account.tokenSource) {
return true;
}
return API_KEY_SOURCES_ABOVE_SUBSCRIPTION.has(account.apiKeySource ?? "");
}
export function claudeSubscriptionNotSupportedError(): RequestError {
return RequestError.authRequired(
{ reason: CLAUDE_SUBSCRIPTION_NOT_SUPPORTED_REASON satisfies AuthRequiredReason },
CLAUDE_SUBSCRIPTION_NOT_SUPPORTED_MESSAGE,
);
}
/** The signed-out refusal. Deliberately without `data`, so a client that reads
* `data.reason` sees the plain ACP sign-out it already handles. */
export function claudeLoginRequiredError(): RequestError {
return RequestError.authRequired(undefined, CLAUDE_LOGIN_REQUIRED_MESSAGE);
}
/**
* The state the guard keeps for one session. It lives on the session so that a
* concurrent pair of turns shares one account read, and so
* that each degraded-guard warning is logged once.
*/
export type ClaudeSubscriptionGuardState = {
/** The in-flight guard run. Set before the first `await`. */
pendingRun?: Promise<RequestError | undefined>;
/** True after the "no account source" warning was logged for this session. */
degradedWarningLogged?: boolean;
};
export type GuardLogger = {
error: (...args: unknown[]) => void;
warn?: (...args: unknown[]) => void;
};
function warn(logger: GuardLogger, message: string): void {
(logger.warn ?? logger.error).call(logger, message);
}
/**
* Report once per session that the guard cannot read the account at all. The
* guard is then absent, not passing. The CLI build decides this, not the user,
* so a message on every turn would only add noise.
*/
export function warnClaudeSubscriptionGuardDegraded(options: {
sessionId: string;
guardState: ClaudeSubscriptionGuardState;
logger: GuardLogger;
cause: string;
}): void {
const { guardState } = options;
if (guardState.degradedWarningLogged) {
return;
}
guardState.degradedWarningLogged = true;
warn(
options.logger,
`Session ${options.sessionId}: the --hide-claude-auth subscription guard is degraded ` +
`(${options.cause}). This session cannot detect a claude.ai subscription.`,
);
}
type GuardOptions = {
sessionId: string;
query: Pick<Query, "accountInfo">;
guardState: ClaudeSubscriptionGuardState;
logger: GuardLogger;
/** Display hook: called with the account the guard just read, before the
* guard decides on it. It exists so a refused turn still reports which
* account it was refused for. Purely observational — this module knows
* nothing about what the caller does with it, and a throw from here never
* changes the verdict. */
onAccount?: (account: AccountInfo) => void;
};
/**
* The per-turn guard for a live session.
*
* It decides on the account the SDK cached at `initialize`, which is this
* integration's source of truth. That account is a constant for the life of
* the query, so the check costs microseconds. It still earns its place: it
* covers a session created under a provider override that `providers/disable`
* later removed, so the create-time check never ran for the routing in force
* now. A sign-out ends the query (see `markSessionForSignOutRespawn` in
* `acp-agent.ts`), so the next turn recreates it and `initialize` reports the
* real account. This guard does not see the residual case the module header
* names either.
*
* A turn is refused when the account bills a subscription, and also when it
* holds nothing this integration accepts, which is the user signing out in
* mid-session. The refusal mirrors the signed-out path exactly (see
* `failActiveWithSessionFailure` for `auth_required` in `acp-agent.ts`): every
* client gets the `authRequired` JSON-RPC rejection that starts its own auth
* flow. The guard sends no separate access message.
*
* Fails open when no account can be read at all: session creation already
* refused every account without a usable credential, and an unavailable probe
* must not block a session that passed that check.
*/
export async function refuseClaudeSubscriptionTurn(options: GuardOptions): Promise<void> {
// Concurrent turns must not each re-read the account and each publish a row.
// Store the run before the first await, and let the others await the same one.
const { guardState } = options;
const run = (guardState.pendingRun ??= evaluateGuard(options).finally(() => {
if (guardState.pendingRun === run) {
guardState.pendingRun = undefined;
}
}));
const refusal = await run;
if (refusal) {
throw refusal;
}
}
/** Read the account and return the error for the refused turn.
* Never throws: an unreadable account fails open. */
async function evaluateGuard(options: GuardOptions): Promise<RequestError | undefined> {
const account = await readGuardAccount(options);
if (!account) {
return undefined;
}
// Before the decision, so the client learns the identity even when the next
// lines refuse the turn. A display hook must never fail a guard.
try {
options.onAccount?.(account);
} catch (error) {
options.logger.error(
`Session ${options.sessionId}: the guard's onAccount hook threw:`,
error instanceof Error ? error.message : String(error),
);
}
if (billsClaudeSubscription(account)) {
return claudeSubscriptionNotSupportedError();
}
if (!holdsNonSubscriptionCredential(account)) {
return claudeLoginRequiredError();
}
return undefined;
}
/** The account the SDK cached at `initialize`. `undefined` when the query
* cannot answer at all. */
async function readGuardAccount(options: GuardOptions): Promise<AccountInfo | undefined> {
const { query } = options;
if (typeof query.accountInfo !== "function") {
warnClaudeSubscriptionGuardDegraded({
...options,
cause: "the SDK query has no accountInfo method",
});
return undefined;
}
try {
return await query.accountInfo();
} catch (error) {
options.logger.error(
`Session ${options.sessionId}: accountInfo failed; skipping the subscription check for this turn:`,
error instanceof Error ? error.message : String(error),
);
return undefined;
}
}

View File

@@ -1,8 +1,10 @@
#!/usr/bin/env node
import { resolveSettings } from "@anthropic-ai/claude-agent-sdk";
import { claudeCliPath, runAcp } from "./acp-agent.js";
import { applyManagedPolicyEnv } from "./managed-policy.js";
import packageJson from "../package.json" with { type: "json" };
import { appendFileSync, mkdirSync } from "node:fs";
import { join } from "node:path";
// `--cli` is checked first so that `--version`/`-v` (and any other flags) are
// forwarded to the wrapped native CLI rather than swallowed by our own version
@@ -42,13 +44,10 @@ if (process.argv.includes("--cli")) {
process.exit(0);
} else {
// Apply env vars from the managed-policy tier before any SDK call so the
// SDK subprocess inherits them. Going through resolveSettings (vs. a raw
// read of managed-settings.json) also picks up MDM sources on macOS and
// HKLM/HKCU on Windows.
const policy = await resolveSettings({ settingSources: [] });
for (const [key, value] of Object.entries(policy.effective.env ?? {})) {
process.env[key] = value;
}
// SDK subprocess inherits them. Reading the tier is best-effort: a transient
// failure leaves the agent running with no policy env instead of aborting
// module evaluation here, before any ACP traffic.
await applyManagedPolicyEnv();
// stdout is used to send messages to the client
// we redirect everything else to stderr to make sure it doesn't interfere with ACP
@@ -61,7 +60,29 @@ if (process.argv.includes("--cli")) {
console.error("Unhandled Rejection at:", promise, "reason:", reason);
});
const { connection, agent } = runAcp();
const logDirectory = process.env.CLAUDE_AGENT_LOGS;
const logger = logDirectory
? (() => {
mkdirSync(logDirectory, { recursive: true });
const logFile = join(logDirectory, "agent.log");
const writeLog = (...args: unknown[]) => {
const rendered = args
.map((arg) => (arg instanceof Error ? (arg.stack ?? arg.message) : String(arg)))
.join(" ");
appendFileSync(logFile, `${new Date().toISOString()} pid=${process.pid} ${rendered}\n`);
};
return {
log: writeLog,
error: (...args: unknown[]) => {
console.error(...args);
writeLog(...args);
},
};
})()
: undefined;
logger?.log("Claude ACP started");
const { connection, agent } = runAcp(logger);
async function shutdown() {
await agent.dispose().catch((err) => {

View File

@@ -18,6 +18,15 @@ export {
toolUpdateFromToolResult,
} from "./tools.js";
export { SettingsManager, type SettingsManagerOptions } from "./settings.js";
// The `authStatus` extension's wire surface: the notification's method name and
// the payload types needed to read the traffic. The mappers stay internal.
export {
AUTH_STATUS_UPDATE_METHOD,
type AuthStatus,
type AuthStatusAccount,
type AuthStatusKind,
type AuthStatusUpdateNotification,
} from "./auth-status.js";
// Export types
export type { ClaudePlanEntry } from "./tools.js";

34
src/managed-policy.ts Normal file
View File

@@ -0,0 +1,34 @@
import { resolveSettings } from "@anthropic-ai/claude-agent-sdk";
/**
* Applies the managed-policy tier's env vars to `process.env` before any SDK
* call, so the SDK subprocess inherits them. Going through `resolveSettings`
* rather than a raw read of `managed-settings.json` also picks up MDM sources on
* macOS and `HKLM`/`HKCU` on Windows.
*
* Reading the tier is best-effort by nature: on a host with no MDM and no
* managed policy the result is empty and the agent behaves identically. So a
* transient failure to read it — `EINTR`, `EMFILE`, `EAGAIN` — must leave the
* agent running with no policy env rather than stop it from starting.
*
* That guard matters because the caller awaits this at module scope in an ESM
* entry point, where a rejection aborts module evaluation and the process exits
* before serving any ACP traffic. `SettingsManager.loadAllSettings` wraps the
* same SDK call for the same reason.
*/
export async function applyManagedPolicyEnv(
resolve: typeof resolveSettings = resolveSettings,
env: Record<string, string | undefined> = process.env,
): Promise<void> {
let policy: Awaited<ReturnType<typeof resolveSettings>>;
try {
policy = await resolve({ settingSources: [] });
} catch (error) {
// stderr, so the ACP stream on stdout stays clean.
console.error("Failed to resolve managed policy settings:", error);
return;
}
for (const [key, value] of Object.entries(policy.effective.env ?? {})) {
env[key] = value;
}
}

739
src/native-subagents.ts Normal file
View File

@@ -0,0 +1,739 @@
import type { AcpSessionNotification, SubagentState } from "./acp-subagents.js";
import { AIR_SUBAGENT_KEY, airExtensionMeta } from "./air-extension.js";
export type NativeSubagent = {
sessionId: string;
parentSessionId: string;
parentToolUseId?: string;
name: string;
task: string;
/**
* The exact prompt of this generation, sent as `prompt` in
* `subagent_spawned`. It is absent when the adapter has no prompt.
*/
prompt?: string;
announced?: boolean;
terminalState?: SubagentState;
/** Connection-local single-flight state; never serialized on the wire. */
announcePromise?: Promise<void>;
/** Connection-local single-flight state; never serialized on the wire. */
terminalPromise?: Promise<void>;
};
export type NativeSubagentSession = {
nativeSubagentsByTaskId?: Map<string, NativeSubagent>;
nativeSubagentTaskIdByToolUseId?: Map<string, string>;
nativeSubagentParentByToolUseId?: Map<string, string>;
};
type Publish = (notification: AcpSessionNotification) => Promise<void>;
type Logger = { log(message: string): void };
type TaskStarted = {
taskId: string;
toolUseId?: string | null;
subagentType?: unknown;
description?: unknown;
prompt?: unknown;
};
type SubagentIdentity = {
name?: string;
description?: string;
prompt?: string;
subagentType?: string;
};
const MAX_PENDING_PARENTS = 64;
const MAX_PENDING_UPDATES = 256;
const MAX_PENDING_UPDATES_PER_PARENT = 32;
/** The number of child tool calls whose owning child session the runtime remembers. */
const MAX_CHILD_TOOL_CALLS = 2048;
/**
* Owns the connection-local native subagent registry and all ACP lifecycle
* ordering. The main agent only supplies SDK facts and delivers routed output.
*/
export class NativeSubagentRuntime {
readonly enabled: boolean;
private readonly children: Map<string, NativeSubagent>;
private readonly taskByToolUse: Map<string, string>;
private readonly parentByToolUse: Map<string, string>;
private readonly identityByToolUse = new Map<string, SubagentIdentity>();
private readonly controlByToolUse = new Map<string, AcpSessionNotification>();
private readonly childByParentToolUse = new Map<string, NativeSubagent>();
/**
* The child session of each tool call that went to a child session. A later
* update of that tool call can lose `parentToolUseId`, for example a progress
* beat after the child finished. It still belongs to the child session.
*/
private readonly childByToolCall = new Map<string, NativeSubagent>();
private readonly taskFinishPromises = new Map<string, Promise<void>>();
private readonly generationByTaskId = new Map<string, number>();
private readonly pending = new Map<string, AcpSessionNotification[]>();
private pendingCount = 0;
constructor(
enabled: boolean,
private readonly rootSessionId: string,
private readonly session: NativeSubagentSession,
private readonly publish: Publish,
private readonly logger: Logger,
) {
this.enabled = enabled;
this.children = session.nativeSubagentsByTaskId ??= new Map();
this.taskByToolUse = session.nativeSubagentTaskIdByToolUseId ??= new Map();
this.parentByToolUse = session.nativeSubagentParentByToolUseId ??= new Map();
for (const child of this.children.values()) {
if (child.parentToolUseId) {
this.childByParentToolUse.set(child.parentToolUseId, child);
}
}
}
async route(
notification: AcpSessionNotification,
deliver: Publish,
forcedSessionId?: string,
): Promise<AcpSessionNotification | null> {
const { update } = notification;
const claudeMeta = update._meta?.claudeCode as
{ parentToolUseId?: string | null; toolName?: string } | undefined;
const isControl = isNativeSubagentControlUpdate(update);
if (!this.enabled) return notification;
if (this.enabled && isControl) {
const toolCallId = update.toolCallId;
if (update.sessionUpdate === "tool_call") {
this.controlByToolUse.set(toolCallId, notification);
}
const identity = subagentIdentity(update.rawInput);
if (identity) {
this.identityByToolUse.set(
toolCallId,
mergeSubagentIdentity(this.identityByToolUse.get(toolCallId), identity),
);
}
const parentSessionId = claudeMeta?.parentToolUseId
? this.childByParentToolUse.get(claudeMeta.parentToolUseId)?.sessionId
: this.rootSessionId;
this.parentByToolUse.set(toolCallId, parentSessionId ?? this.rootSessionId);
const child = this.childByParentToolUse.get(toolCallId);
if (child && !child.announced) {
child.parentSessionId = parentSessionId ?? this.rootSessionId;
applySubagentIdentity(child, this.identityByToolUse.get(toolCallId));
await announceNativeSubagent(child, this.publish);
for (const pending of this.takePending(toolCallId)) await deliver(pending);
}
if (!child && isFailedToolCallUpdate(update)) {
this.takePending(toolCallId);
const initial = this.controlByToolUse.get(toolCallId);
this.cleanupControl(toolCallId);
if (forcedSessionId) {
return { ...notification, sessionId: forcedSessionId };
}
return failedControlFallback(initial, notification, parentSessionId ?? this.rootSessionId);
}
return forcedSessionId ? { ...notification, sessionId: forcedSessionId } : null;
}
const toolCallId =
update.sessionUpdate === "tool_call" || update.sessionUpdate === "tool_call_update"
? update.toolCallId
: undefined;
// A permission request may have had to create the tool call before native
// child ownership was known. Keep every later update in that original ACP
// session; moving a lifecycle after its initial call creates an orphan in
// both transcripts.
if (forcedSessionId) {
const forcedChild = this.childOfSession(forcedSessionId);
if (toolCallId && forcedChild) this.rememberToolCallOwner(toolCallId, forcedChild);
return { ...notification, sessionId: forcedSessionId };
}
const owner = toolCallId ? this.childByToolCall.get(toolCallId) : undefined;
if (owner) return this.toChild(owner, notification, toolCallId);
if (this.enabled && claudeMeta?.parentToolUseId) {
const child = this.childByParentToolUse.get(claudeMeta.parentToolUseId);
if (!child || !child.announced) {
this.buffer(claudeMeta.parentToolUseId, notification);
return null;
}
return this.toChild(child, notification, toolCallId);
}
return notification;
}
async taskStarted(task: TaskStarted, deliver: Publish): Promise<void> {
if (!this.enabled) return;
if (!task.subagentType) {
if (task.toolUseId) {
this.takePending(task.toolUseId);
this.cleanupControl(task.toolUseId);
}
return;
}
const previous = this.children.get(task.taskId);
if (previous && previous.terminalState === undefined) return;
// A SendMessage resume reuses the finished generation's tool id, whose
// control state is already cleaned up.
const knownParentSessionId =
(task.toolUseId ? this.parentByToolUse.get(task.toolUseId) : undefined) ??
(previous && this.resumedParentSessionId(previous));
const identity = task.toolUseId ? this.identityByToolUse.get(task.toolUseId) : undefined;
// A nested child must wait for the spawning Agent/Task frame to establish
// its immediate parent. Root children without a tool id can be announced.
await this.openGeneration(
task.taskId,
previous,
{
parentSessionId: knownParentSessionId ?? this.rootSessionId,
parentToolUseId: task.toolUseId ?? undefined,
name: subagentDisplayName(
identity?.name,
identity?.description ?? task.description,
identity?.subagentType ?? task.subagentType,
task.taskId,
),
task: subagentDescription(
identity?.prompt ?? task.prompt,
identity?.description ?? task.description,
),
...promptField(promptText(task.prompt) ?? identity?.prompt),
},
!!knownParentSessionId || !task.toolUseId,
deliver,
);
}
/**
* Opens a new generation of a finished child when the SDK resumes the same
* agent id. The SDK can resume a child without a new `task_started`, so a
* running `task_updated` patch or a SendMessage `resumedAgentId` is the
* signal. A child that did not finish is not changed. The `prompt` is the
* SendMessage text that resumed the child, when the adapter knows it.
*/
async taskResumed(taskId: string, deliver: Publish, prompt?: string): Promise<void> {
if (!this.enabled) return;
const previous = this.children.get(taskId);
if (!previous) return;
const finishing = this.taskFinishPromises.get(taskId) ?? previous.terminalPromise;
if (finishing) await finishing.catch(() => {});
if (this.children.get(taskId) !== previous || previous.terminalState === undefined) return;
await this.openGeneration(
taskId,
previous,
{
parentSessionId: this.resumedParentSessionId(previous),
parentToolUseId: previous.parentToolUseId,
name: previous.name,
task: previous.task,
...promptField(promptText(prompt)),
},
true,
deliver,
);
}
async finishTask(
taskId: string,
status: unknown,
deliver: Publish,
toolUseId?: string | null,
): Promise<void> {
if (!this.enabled) return;
const state = nativeSubagentState(status);
const child = toolUseId ? this.childByParentToolUse.get(toolUseId) : this.children.get(taskId);
if (child && toolUseId && this.taskByToolUse.get(toolUseId) !== taskId) return;
if (!state || !child || child.terminalState !== undefined) return;
const existing = this.taskFinishPromises.get(taskId);
if (existing) return existing;
const finish = Promise.resolve().then(async () => {
try {
await announceNativeSubagent(child, this.publish);
if (child.parentToolUseId) {
for (const pending of this.takePending(child.parentToolUseId)) await deliver(pending);
}
await finishNativeSubagent(this.session, taskId, state, this.publish);
} finally {
if (child.parentToolUseId) {
this.cleanupControl(child.parentToolUseId);
}
}
});
this.taskFinishPromises.set(taskId, finish);
try {
await finish;
} finally {
if (this.taskFinishPromises.get(taskId) === finish) this.taskFinishPromises.delete(taskId);
}
}
async finishAll(state: SubagentState, deliver: Publish): Promise<void> {
const errors: unknown[] = [];
try {
for (const taskId of [...this.children.keys()].reverse()) {
try {
await this.finishTask(taskId, state, deliver);
} catch (error) {
errors.push(error);
}
}
} finally {
this.pending.clear();
this.pendingCount = 0;
this.identityByToolUse.clear();
this.controlByToolUse.clear();
this.parentByToolUse.clear();
}
if (errors.length === 1) throw errors[0];
if (errors.length > 1) throw new AggregateError(errors, "Failed to finish native subagents");
}
discardPending(parentToolUseId: string): void {
this.takePending(parentToolUseId);
}
/**
* Routes an update to the child session. An update of a finished child is
* dropped: it never goes to the root session.
*/
private toChild(
child: NativeSubagent,
notification: AcpSessionNotification,
toolCallId: string | undefined,
): AcpSessionNotification | null {
if (child.terminalState !== undefined || child.terminalPromise) {
this.logger.log(
`Session ${this.rootSessionId}: ignoring late update for terminal subagent ${child.sessionId}`,
);
return null;
}
if (toolCallId) this.rememberToolCallOwner(toolCallId, child);
return { ...notification, sessionId: child.sessionId };
}
/**
* The route of the work that a child tool call started, for example an async
* task. The route sends each update to the child generation that owned the
* tool call when the work started, and drops the update after that child
* finished. `undefined` means that the root session owns the tool call.
* `eagerSessionId` is the session where a permission request created the
* tool call before the stream routed it.
*/
routeOfToolCall(
toolCallId: string,
eagerSessionId?: string,
): ((notification: AcpSessionNotification) => AcpSessionNotification | null) | undefined {
if (!this.enabled) return undefined;
const owner =
this.childByToolCall.get(toolCallId) ??
(eagerSessionId ? this.childOfSession(eagerSessionId) : undefined);
return owner && ((notification) => this.toChild(owner, notification, undefined));
}
private rememberToolCallOwner(toolCallId: string, child: NativeSubagent): void {
this.childByToolCall.delete(toolCallId);
this.childByToolCall.set(toolCallId, child);
if (this.childByToolCall.size > MAX_CHILD_TOOL_CALLS) {
const oldest = this.childByToolCall.keys().next().value;
if (oldest !== undefined) this.childByToolCall.delete(oldest);
}
}
/** The child generation with the ACP session `sessionId`, if one exists. */
private childOfSession(sessionId: string): NativeSubagent | undefined {
if (sessionId === this.rootSessionId) return undefined;
for (const child of this.children.values()) {
if (child.sessionId === sessionId) return child;
}
return undefined;
}
clear(): void {
this.children.clear();
this.childByToolCall.clear();
this.taskByToolUse.clear();
this.parentByToolUse.clear();
this.identityByToolUse.clear();
this.controlByToolUse.clear();
this.childByParentToolUse.clear();
this.taskFinishPromises.clear();
this.generationByTaskId.clear();
this.pending.clear();
this.pendingCount = 0;
}
private takePending(parentToolUseId: string): AcpSessionNotification[] {
const updates = this.pending.get(parentToolUseId) ?? [];
if (updates.length > 0) {
this.pending.delete(parentToolUseId);
this.pendingCount -= updates.length;
}
return updates;
}
private buffer(parentToolUseId: string, notification: AcpSessionNotification): void {
const updates = this.pending.get(parentToolUseId);
if (
this.pendingCount >= MAX_PENDING_UPDATES ||
(updates === undefined && this.pending.size >= MAX_PENDING_PARENTS) ||
(updates?.length ?? 0) >= MAX_PENDING_UPDATES_PER_PARENT
) {
this.logger.log(
`Session ${this.rootSessionId}: dropping unattributed subagent update for ${parentToolUseId}; pending buffer limit reached`,
);
return;
}
if (updates) updates.push(notification);
else this.pending.set(parentToolUseId, [notification]);
this.pendingCount++;
}
private cleanupControl(toolUseId: string): void {
this.identityByToolUse.delete(toolUseId);
this.controlByToolUse.delete(toolUseId);
this.parentByToolUse.delete(toolUseId);
}
/** The parent of a resumed generation: the old parent while it is live, else the root. */
private resumedParentSessionId(previous: NativeSubagent): string {
return this.isLiveSession(previous.parentSessionId)
? previous.parentSessionId
: this.rootSessionId;
}
private isLiveSession(sessionId: string): boolean {
if (sessionId === this.rootSessionId) return true;
for (const child of this.children.values()) {
if (child.sessionId === sessionId) return child.terminalState === undefined;
}
return false;
}
/**
* Registers a new child session for the task and makes it the owner of its
* parent tool call. With `announce`, it publishes `subagent_spawned` and
* delivers the updates that waited for the child.
*/
private async openGeneration(
taskId: string,
previous: NativeSubagent | undefined,
fields: Pick<
NativeSubagent,
"parentSessionId" | "parentToolUseId" | "name" | "task" | "prompt"
>,
announce: boolean,
deliver: Publish,
): Promise<void> {
const child: NativeSubagent = {
sessionId: this.nextChildSessionId(taskId, previous),
...fields,
};
const toolUseId = child.parentToolUseId;
this.children.set(taskId, child);
if (toolUseId) {
this.taskByToolUse.set(toolUseId, taskId);
this.childByParentToolUse.set(toolUseId, child);
this.controlByToolUse.delete(toolUseId);
}
if (!announce) return;
await announceNativeSubagent(child, this.publish);
for (const pending of toolUseId ? this.takePending(toolUseId) : []) await deliver(pending);
}
private nextChildSessionId(taskId: string, previous: NativeSubagent | undefined): string {
if (!previous) {
this.generationByTaskId.set(taskId, 1);
return taskId;
}
const generation = (this.generationByTaskId.get(taskId) ?? 1) + 1;
this.generationByTaskId.set(taskId, generation);
return `${taskId}:generation:${generation}`;
}
}
export async function announceNativeSubagent(
child: NativeSubagent,
publish: Publish,
): Promise<void> {
if (child.announced) return;
if (child.announcePromise) return child.announcePromise;
const announce = Promise.resolve().then(async () => {
await publish({
sessionId: child.parentSessionId,
update: {
sessionUpdate: "subagent_spawned",
subagentSessionId: child.sessionId,
name: child.name,
task: child.task,
...promptField(child.prompt),
capabilities: {},
},
});
child.announced = true;
});
child.announcePromise = announce;
try {
await announce;
} finally {
if (child.announcePromise === announce) child.announcePromise = undefined;
}
}
export async function finishNativeSubagent(
session: NativeSubagentSession,
taskId: string,
state: SubagentState,
publish: Publish,
): Promise<void> {
const child = session.nativeSubagentsByTaskId?.get(taskId);
if (!child || child.terminalState !== undefined) return;
if (child.terminalPromise) return child.terminalPromise;
const finish = Promise.resolve().then(async () => {
await announceNativeSubagent(child, publish);
await publish({
sessionId: child.parentSessionId,
update: {
sessionUpdate: "subagent_state_update",
subagentSessionId: child.sessionId,
state,
},
});
child.terminalState = state;
});
child.terminalPromise = finish;
try {
await finish;
} finally {
if (child.terminalPromise === finish) child.terminalPromise = undefined;
}
}
/**
* The agent id that a successful SendMessage result resumed. The SDK puts it
* in `tool_use_result.resumedAgentId` when a finished agent runs again.
*/
export function resumedNativeSubagentId(toolUseResult: unknown): string | undefined {
if (typeof toolUseResult !== "object" || toolUseResult === null) return undefined;
const result = toolUseResult as { success?: unknown; resumedAgentId?: unknown };
return result.success === true ? nonBlankString(result.resumedAgentId) : undefined;
}
/**
* The SendMessage text that resumed the agent `agentId`. The tool uses of
* `resultToolUseIds` come first: they are the SendMessage calls whose result
* carried the resume. Otherwise the latest SendMessage call to `agentId` counts.
*/
export function sendMessageResumePrompt(
toolUses: Record<string, { name: string; input: unknown } | undefined>,
agentId: string,
resultToolUseIds: readonly string[] = [],
): string | undefined {
for (const toolUseId of resultToolUseIds) {
const toolUse = toolUses[toolUseId];
if (toolUse?.name !== "SendMessage") continue;
const text = promptText((toolUse.input as { message?: unknown } | null)?.message);
if (text) return text;
}
if (resultToolUseIds.length > 0) return undefined;
for (const toolUse of Object.values(toolUses).reverse()) {
if (toolUse?.name !== "SendMessage") continue;
const input = toolUse.input as { to?: unknown; message?: unknown } | null;
if (input?.to === agentId) return promptText(input.message);
}
return undefined;
}
export function nativeSubagentState(status: unknown): SubagentState | undefined {
if (status === "completed") return "completed";
if (status === "failed") return "failed";
if (status === "disconnected") return "disconnected";
if (status === "killed" || status === "cancelled" || status === "stopped") return "cancelled";
return undefined;
}
export function isNativeSubagentControlUpdate(
update: AcpSessionNotification["update"],
): update is Extract<
AcpSessionNotification["update"],
{ sessionUpdate: "tool_call" | "tool_call_update" }
> {
if (update.sessionUpdate !== "tool_call" && update.sessionUpdate !== "tool_call_update") {
return false;
}
const claudeMeta = update._meta?.claudeCode as { toolName?: string } | undefined;
return (
airExtensionMeta(update._meta)?.[AIR_SUBAGENT_KEY] === true ||
isNativeSubagentControlTool(claudeMeta?.toolName)
);
}
export function isNativeSubagentControlTool(toolName: unknown): boolean {
return toolName === "Agent" || toolName === "Task";
}
function isFailedToolCallUpdate(update: AcpSessionNotification["update"]): boolean {
return (
(update.sessionUpdate === "tool_call" || update.sessionUpdate === "tool_call_update") &&
update.status === "failed"
);
}
function failedControlFallback(
initial: AcpSessionNotification | undefined,
terminal: AcpSessionNotification,
sessionId: string,
): AcpSessionNotification {
if (
terminal.update.sessionUpdate !== "tool_call" &&
terminal.update.sessionUpdate !== "tool_call_update"
) {
return { ...terminal, sessionId };
}
if (!initial || initial.update.sessionUpdate !== "tool_call") {
const claudeMeta = terminal.update._meta?.claudeCode as { toolName?: unknown } | undefined;
return {
...terminal,
sessionId,
update: {
...terminal.update,
sessionUpdate: "tool_call",
status: "failed",
// The synthesized tool_call is this call's first report, so give it
// the standard `name` the initial one would have carried.
...(typeof claudeMeta?.toolName === "string" ? { name: claudeMeta.toolName } : {}),
title:
typeof terminal.update.title === "string" && terminal.update.title.length > 0
? terminal.update.title
: claudeMeta?.toolName === "Task"
? "Task"
: "Agent",
_meta: ordinaryToolMeta(terminal.update._meta),
} as AcpSessionNotification["update"],
};
}
return {
...initial,
sessionId,
update: {
...initial.update,
...terminal.update,
sessionUpdate: "tool_call",
status: "failed",
title:
typeof terminal.update.title === "string" && terminal.update.title.trim().length > 0
? terminal.update.title
: initial.update.title,
_meta: {
...initial.update._meta,
...terminal.update._meta,
...ordinaryToolMeta(initial.update._meta, terminal.update._meta),
},
} as AcpSessionNotification["update"],
};
}
function ordinaryToolMeta(
...values: Array<Record<string, unknown> | null | undefined>
): Record<string, unknown> {
const merged = Object.assign({}, ...values);
const claudeCode = Object.assign(
{},
...values.map(
(value) => (value?.claudeCode as Record<string, unknown> | null | undefined) ?? {},
),
);
const result: Record<string, unknown> = { ...merged, claudeCode };
const air = airExtensionMeta(merged);
if (air && AIR_SUBAGENT_KEY in air) {
const rest = { ...air };
delete rest[AIR_SUBAGENT_KEY];
result.jetbrains = { ...(merged.jetbrains as Record<string, unknown>), air: rest };
}
return result;
}
function subagentDisplayName(
explicitName: unknown,
description: unknown,
type: unknown,
taskId: string,
): string {
for (const value of [explicitName, description, type]) {
if (typeof value === "string" && value.trim().length > 0) return value.trim();
}
const suffix = taskId.length > 8 ? taskId.slice(-8) : taskId;
return `Agent ${suffix}`;
}
function subagentDescription(prompt: unknown, description: unknown): string {
for (const value of [prompt, description]) {
if (typeof value === "string" && value.trim().length > 0) return value.trim();
}
return "Delegated task";
}
function subagentIdentity(input: unknown): SubagentIdentity | undefined {
if (typeof input !== "object" || input === null || Array.isArray(input)) return undefined;
const value = input as Record<string, unknown>;
const identity: SubagentIdentity = {
name: nonBlankString(value.name),
description: nonBlankString(value.description),
prompt: promptText(value.prompt),
subagentType: nonBlankString(value.subagent_type),
};
return Object.values(identity).some(Boolean) ? identity : undefined;
}
function mergeSubagentIdentity(
previous: SubagentIdentity | undefined,
next: SubagentIdentity,
): SubagentIdentity {
return {
name: next.name ?? previous?.name,
description: next.description ?? previous?.description,
prompt: next.prompt ?? previous?.prompt,
subagentType: next.subagentType ?? previous?.subagentType,
};
}
function applySubagentIdentity(
child: NativeSubagent,
identity: SubagentIdentity | undefined,
): void {
if (!identity) return;
if (identity.name || identity.description) {
child.name = subagentDisplayName(
identity.name,
identity.description,
identity.subagentType,
child.sessionId,
);
}
if (identity.prompt || identity.description) {
child.task = subagentDescription(identity.prompt, identity.description);
}
child.prompt ??= identity.prompt;
}
/** The prompt text unchanged, or `undefined` when it is not a non-blank string. */
function promptText(value: unknown): string | undefined {
return typeof value === "string" && value.trim().length > 0 ? value : undefined;
}
function promptField(prompt: string | undefined): { prompt?: string } {
return prompt === undefined ? {} : { prompt };
}
function nonBlankString(value: unknown): string | undefined {
return typeof value === "string" && value.trim().length > 0 ? value.trim() : undefined;
}

7
src/paths.ts Normal file
View File

@@ -0,0 +1,7 @@
import * as os from "node:os";
import * as path from "node:path";
/** The Claude configuration directory: `CLAUDE_CONFIG_DIR`, or `~/.claude`. */
export function claudeConfigDir(): string {
return process.env.CLAUDE_CONFIG_DIR ?? path.join(os.homedir(), ".claude");
}

223
src/permissions/effects.ts Normal file
View File

@@ -0,0 +1,223 @@
import type { RequestPermissionResponse } from "@agentclientprotocol/sdk";
import type {
PermissionMode,
PermissionResult,
PermissionUpdate,
} from "@anthropic-ai/claude-agent-sdk";
import type { DurablePermissionChangeSet } from "./normalization.js";
import { PERMISSION_OPTION_ID } from "./options.js";
export interface ClaudePermissionSelection {
optionId: string;
contextResetMode?: PermissionMode;
}
export interface ClaudePermissionEffectContext {
toolName: string;
input: Record<string, unknown>;
toolUseID: string;
durableChangeSet?: DurablePermissionChangeSet;
}
/** Parse the ACP envelope once before dispatching to a tool-specific effect. */
export function parseClaudePermissionSelection(
response: RequestPermissionResponse,
toolName: string,
): ClaudePermissionSelection {
if (response.outcome?.outcome !== "selected") throw new Error("Tool use aborted");
const optionId = response.outcome.optionId;
const contextResetMode =
toolName === "ExitPlanMode" ? exitPlanClearContextMode(optionId) : undefined;
return { optionId, ...(contextResetMode ? { contextResetMode } : {}) };
}
function allow(
context: ClaudePermissionEffectContext,
updatedPermissions?: PermissionUpdate[],
permanent = false,
): PermissionResult {
return {
behavior: "allow",
updatedInput: context.input,
...(updatedPermissions ? { updatedPermissions } : {}),
toolUseID: context.toolUseID,
decisionClassification: permanent ? "user_permanent" : "user_temporary",
};
}
function deny(
context: ClaudePermissionEffectContext,
message = "User refused permission to run tool",
interrupt = false,
): PermissionResult {
return {
behavior: "deny",
message,
...(interrupt ? { interrupt: true } : {}),
toolUseID: context.toolUseID,
decisionClassification: "user_reject",
};
}
function skillName(input: Record<string, unknown>): string {
const value = typeof input.skill === "string" ? input.skill.trim() : "";
if (!value || value.length > 1_000) throw new Error("Invalid Skill permission input");
return value;
}
function localAllowRuleUpdate(toolName: string, ruleContent?: string): PermissionUpdate[] {
return [
{
type: "addRules",
rules: [{ toolName, ...(ruleContent === undefined ? {} : { ruleContent }) }],
behavior: "allow",
destination: "localSettings",
},
];
}
function webFetchPermissionUpdate(input: Record<string, unknown>): PermissionUpdate[] {
if (typeof input.url !== "string") throw new Error("Invalid WebFetch permission input");
let hostname: string;
try {
hostname = new URL(input.url).hostname;
} catch {
throw new Error("Invalid WebFetch permission input");
}
if (!hostname) throw new Error("Invalid WebFetch permission input");
return localAllowRuleUpdate("WebFetch", `domain:${hostname}`);
}
function applySkillSelection(
selection: ClaudePermissionSelection,
context: ClaudePermissionEffectContext,
): PermissionResult {
switch (selection.optionId) {
case PERMISSION_OPTION_ID.allowSkillExact: {
return allow(context, localAllowRuleUpdate("Skill", skillName(context.input)), true);
}
case PERMISSION_OPTION_ID.allowSkillPrefix: {
const skill = skillName(context.input);
const spaceIndex = skill.indexOf(" ");
if (spaceIndex <= 0) throw new Error("Skill prefix permission requires arguments");
return allow(context, localAllowRuleUpdate("Skill", `${skill.slice(0, spaceIndex)}:*`), true);
}
default:
return applyCommonSelection(selection, context);
}
}
function exitPlanMode(optionId: string): PermissionMode | undefined {
switch (optionId) {
case PERMISSION_OPTION_ID.exitPlanBypass:
return "bypassPermissions";
case PERMISSION_OPTION_ID.exitPlanAuto:
return "auto";
case PERMISSION_OPTION_ID.exitPlanAcceptEdits:
return "acceptEdits";
case PERMISSION_OPTION_ID.exitPlanDefault:
return "default";
default:
return undefined;
}
}
export function exitPlanClearContextMode(optionId: string): PermissionMode | undefined {
switch (optionId) {
case PERMISSION_OPTION_ID.exitPlanClearAuto:
return "auto";
case PERMISSION_OPTION_ID.exitPlanClearBypass:
return "bypassPermissions";
case PERMISSION_OPTION_ID.exitPlanClearAcceptEdits:
return "acceptEdits";
default:
return undefined;
}
}
function applyExitPlanModeSelection(
selection: ClaudePermissionSelection,
context: ClaudePermissionEffectContext,
): PermissionResult {
if (selection.contextResetMode) {
// The adapter consumes this interrupt and continues the same ACP turn on a
// fresh Claude query. Returning allow here would execute ExitPlanMode in
// the old context before the handoff.
return deny(context, "User accepted the plan and requested a fresh context", true);
}
const mode = exitPlanMode(selection.optionId);
if (mode) {
return allow(context, [{ type: "setMode", mode, destination: "session" }], mode !== "default");
}
if (selection.optionId === PERMISSION_OPTION_ID.reject) {
// A regular deny lets Claude continue planning and ask another question.
// Interrupt stops this ACP turn; the adapter maps Claude's internal
// diagnostic for that intentional stop back to cancellation.
return deny(context, "User chose to keep planning", true);
}
return applyCommonSelection(selection, context);
}
function applyCommonSelection(
selection: ClaudePermissionSelection,
context: ClaudePermissionEffectContext,
): PermissionResult {
switch (selection.optionId) {
case PERMISSION_OPTION_ID.allowOnce:
return allow(context);
case PERMISSION_OPTION_ID.allowWithUpdates:
if (!context.durableChangeSet) throw new Error("Invalid durable permission selection");
return allow(context, context.durableChangeSet.updates, true);
case PERMISSION_OPTION_ID.reject:
return deny(context);
default:
throw new Error(`Unknown permission option: ${selection.optionId}`);
}
}
function applyGeneratedDurableSelection(
selection: ClaudePermissionSelection,
context: ClaudePermissionEffectContext,
updates: () => PermissionUpdate[],
): PermissionResult {
if (selection.optionId !== PERMISSION_OPTION_ID.allowWithUpdates) {
return applyCommonSelection(selection, context);
}
return allow(context, updates(), true);
}
/** Apply a parsed selection using the semantics of the tool that produced it. */
export function applyClaudePermissionSelection(
selection: ClaudePermissionSelection,
context: ClaudePermissionEffectContext,
): PermissionResult {
switch (context.toolName) {
case "Skill":
return applySkillSelection(selection, context);
case "WebFetch":
return applyGeneratedDurableSelection(selection, context, () =>
webFetchPermissionUpdate(context.input),
);
case "EnterPlanMode":
return applyCommonSelection(selection, context);
case "ExitPlanMode":
return applyExitPlanModeSelection(selection, context);
case "Read":
case "Bash":
case "PowerShell":
case "Glob":
case "Grep":
case "Edit":
case "Write":
case "NotebookEdit":
case "SandboxNetworkAccess":
return applyCommonSelection(selection, context);
default:
if (context.toolName.startsWith("mcp__")) {
return applyCommonSelection(selection, context);
}
return applyGeneratedDurableSelection(selection, context, () =>
localAllowRuleUpdate(context.toolName),
);
}
}

60
src/permissions/modes.ts Normal file
View File

@@ -0,0 +1,60 @@
import type { PermissionMode } from "@anthropic-ai/claude-agent-sdk";
interface PermissionModeLogger {
error: (...args: unknown[]) => void;
}
// Bypass Permissions doesn't work if we are a root/sudo user.
const IS_ROOT = (process.geteuid?.() ?? process.getuid?.()) === 0;
export const ALLOW_BYPASS = !IS_ROOT || !!process.env.IS_SANDBOX;
const PERMISSION_MODE_ALIASES: Record<string, PermissionMode> = {
// Settings use user-facing, case-insensitive spellings while the SDK uses
// camel-cased wire values. Keep legacy shorthand accepted by Claude Code too.
auto: "auto",
default: "default",
// Claude Code 2.1.200 renamed the "default" mode to "Manual" and accepts
// `"defaultMode": "manual"` in settings.json; honor the same alias here.
manual: "default",
acceptedits: "acceptEdits",
dontask: "dontAsk",
plan: "plan",
bypasspermissions: "bypassPermissions",
bypass: "bypassPermissions",
};
/** When `allowBypass` is false, `bypassPermissions` clamps to `default` so the SDK
* is never spawned in a mode it would reject. */
export function resolvePermissionMode(
defaultMode?: unknown,
logger: PermissionModeLogger = console,
allowBypass: boolean = ALLOW_BYPASS,
): PermissionMode {
if (defaultMode === undefined) {
return "default";
}
if (typeof defaultMode !== "string") {
logger.error("Ignoring permissions.defaultMode from settings: expected a string.");
return "default";
}
const normalized = defaultMode.trim().toLowerCase();
if (normalized === "") {
logger.error("Ignoring permissions.defaultMode from settings: expected a non-empty string.");
return "default";
}
const mapped = PERMISSION_MODE_ALIASES[normalized];
if (!mapped) {
logger.error(`Ignoring permissions.defaultMode from settings: unknown value '${defaultMode}'.`);
return "default";
}
if (mapped === "bypassPermissions" && !allowBypass) {
logger.error("Ignoring permission mode bypassPermissions: not available in this session.");
return "default";
}
return mapped;
}

View File

@@ -0,0 +1,130 @@
import type {
PermissionBehavior,
PermissionMode,
PermissionUpdate,
PermissionUpdateDestination,
} from "@anthropic-ai/claude-agent-sdk";
export interface DurablePermissionChangeSet {
updates: PermissionUpdate[];
}
const MAX_UPDATES = 100;
const MAX_RULES_PER_UPDATE = 100;
const MAX_DIRECTORIES_PER_UPDATE = 100;
const MAX_TOOL_NAME_LENGTH = 512;
const MAX_RULE_CONTENT_LENGTH = 10_000;
const MAX_DIRECTORY_LENGTH = 4_096;
const DESTINATIONS = new Set<PermissionUpdateDestination>([
"session",
"cliArg",
"userSettings",
"projectSettings",
"localSettings",
]);
const BEHAVIORS = new Set<PermissionBehavior>(["allow", "deny", "ask"]);
const MODES = new Set<PermissionMode>([
"default",
"acceptEdits",
"bypassPermissions",
"plan",
"dontAsk",
"auto",
]);
function isRecord(value: unknown): value is Record<string, unknown> {
return !!value && typeof value === "object" && !Array.isArray(value);
}
function isDestination(value: unknown): value is PermissionUpdateDestination {
return typeof value === "string" && DESTINATIONS.has(value as PermissionUpdateDestination);
}
function safePlainString(value: unknown, maxLength: number): value is string {
if (typeof value !== "string") return false;
const normalized = value.trim();
return (
normalized.length > 0 &&
value.length <= maxLength &&
!Array.from(normalized).some((character) => {
const code = character.charCodeAt(0);
return (
code <= 0x08 ||
code === 0x0b ||
code === 0x0c ||
(code >= 0x0e && code <= 0x1f) ||
code === 0x7f
);
})
);
}
function isRule(value: unknown): value is { toolName: string; ruleContent?: string } {
if (!isRecord(value) || !safePlainString(value.toolName, MAX_TOOL_NAME_LENGTH)) {
return false;
}
return (
value.ruleContent === undefined || safePlainString(value.ruleContent, MAX_RULE_CONTENT_LENGTH)
);
}
function isKnownUpdate(value: unknown): value is PermissionUpdate {
if (!isRecord(value) || !isDestination(value.destination) || typeof value.type !== "string") {
return false;
}
switch (value.type) {
case "addRules":
case "replaceRules":
case "removeRules":
return (
Array.isArray(value.rules) &&
value.rules.length <= MAX_RULES_PER_UPDATE &&
(value.type === "replaceRules" || value.rules.length > 0) &&
value.rules.every(isRule) &&
typeof value.behavior === "string" &&
BEHAVIORS.has(value.behavior as PermissionBehavior)
);
case "setMode":
return typeof value.mode === "string" && MODES.has(value.mode as PermissionMode);
case "addDirectories":
case "removeDirectories":
return (
Array.isArray(value.directories) &&
value.directories.length > 0 &&
value.directories.length <= MAX_DIRECTORIES_PER_UPDATE &&
value.directories.every((directory) => safePlainString(directory, MAX_DIRECTORY_LENGTH))
);
default:
return false;
}
}
export function normalizeDurablePermissionChangeSet(
suggestions: unknown,
forcedAsk = false,
): DurablePermissionChangeSet | undefined {
if (forcedAsk) return undefined;
try {
if (
!Array.isArray(suggestions) ||
suggestions.length === 0 ||
suggestions.length > MAX_UPDATES ||
!suggestions.every(isKnownUpdate)
) {
return undefined;
}
return {
// The ACP prompt may stay open for an arbitrary amount of time. Snapshot the
// provider payload so the label the user approved and the effect returned to
// Claude cannot diverge through later mutation of the callback argument.
updates: structuredClone(suggestions as PermissionUpdate[]),
};
} catch {
// SDK data is expected to be plain structured-cloneable input. Treat an
// accessor, function, proxy, or other non-wire value as an invalid bundle.
// Validation belongs in this boundary too because merely reading one of those
// values can throw before structuredClone gets a chance to reject it.
return undefined;
}
}

100
src/permissions/options.ts Normal file
View File

@@ -0,0 +1,100 @@
import type { PermissionOption } from "@agentclientprotocol/sdk";
import {
buildEditPermissionOptions,
buildGlobPermissionOptions,
buildGrepPermissionOptions,
buildNotebookEditPermissionOptions,
buildReadPermissionOptions,
buildWritePermissionOptions,
} from "./options/filesystem.js";
import { buildBashPermissionOptions, buildPowerShellPermissionOptions } from "./options/shell.js";
import type { PermissionOptionContext } from "./options/shared.js";
import {
buildComputerUseMcpPermissionOptions,
buildEnterPlanModePermissionOptions,
buildExitPlanModePermissionOptions,
buildFallbackPermissionOptions,
buildSandboxNetworkPermissionOptions,
buildSkillPermissionOptions,
buildWebFetchPermissionOptions,
isComputerUseMcpTool,
} from "./options/tools.js";
export { PERMISSION_OPTION_ID } from "./options/shared.js";
export function buildClaudePermissionOptions(context: PermissionOptionContext): PermissionOption[] {
// ACP has no "pre-selected option" field, so option order is the only lever
// for the CLI's `defaultToNo` hint ("open on the decline option"): lead with
// the reject options instead of the approvals.
const order = context.defaultToNo === true ? declineFirstOptionOrder : permissionOptionOrder;
return buildUnsortedClaudePermissionOptions(context).sort(
(left, right) => order(left) - order(right),
);
}
function buildUnsortedClaudePermissionOptions(
context: PermissionOptionContext,
): PermissionOption[] {
if (isComputerUseMcpTool(context.toolName)) {
return buildComputerUseMcpPermissionOptions(context);
}
switch (context.toolName) {
case "AskUserQuestion":
throw new Error("AskUserQuestion must be handled by ACP elicitation, not permission options");
case "Bash":
return buildBashPermissionOptions(context);
case "PowerShell":
return buildPowerShellPermissionOptions(context);
case "Read":
return buildReadPermissionOptions(context);
case "Glob":
return buildGlobPermissionOptions(context);
case "Grep":
return buildGrepPermissionOptions(context);
case "Edit":
return buildEditPermissionOptions(context);
case "Write":
return buildWritePermissionOptions(context);
case "NotebookEdit":
return buildNotebookEditPermissionOptions(context);
case "WebFetch":
return buildWebFetchPermissionOptions(context);
case "Skill":
return buildSkillPermissionOptions(context);
case "EnterPlanMode":
return buildEnterPlanModePermissionOptions();
case "ExitPlanMode":
return buildExitPlanModePermissionOptions(context);
case "SandboxNetworkAccess":
return buildSandboxNetworkPermissionOptions(context);
case "WebSearch":
case "Agent":
case "Task":
default:
return buildFallbackPermissionOptions(context);
}
}
function declineFirstOptionOrder(option: PermissionOption): number {
switch (option.kind) {
case "reject_once":
case "reject_always":
return 0;
default:
return 1 + permissionOptionOrder(option);
}
}
function permissionOptionOrder(option: PermissionOption): number {
switch (option.kind) {
case "allow_once":
return 0;
case "allow_always":
return 1;
case "reject_once":
case "reject_always":
return 3;
default:
return 2;
}
}

View File

@@ -0,0 +1,186 @@
import type { PermissionOption } from "@agentclientprotocol/sdk";
import os from "node:os";
import path from "node:path";
import type { DurablePermissionChangeSet } from "../normalization.js";
import { plainString, type PermissionOptionContext, withOptionalUpdate } from "./shared.js";
function isFileSessionChangeSet(
changeSet: DurablePermissionChangeSet | undefined,
operation: "read" | "write",
): boolean {
return (
!!changeSet &&
changeSet.updates.every((update) => {
if (update.destination !== "session") return false;
if (update.type === "setMode") {
return operation === "write" && update.mode === "acceptEdits";
}
if (update.type === "addDirectories") return operation === "write";
if (update.type !== "addRules" || update.behavior !== "allow") return false;
return update.rules.every((rule) =>
operation === "read" ? rule.toolName === "Read" : rule.toolName === "Edit",
);
})
);
}
function inputPath(context: PermissionOptionContext, key: string): string | undefined {
return plainString(context.input[key]);
}
function isInside(directory: string, candidate: string): boolean {
const relative = path.relative(path.resolve(directory), path.resolve(candidate));
return relative === "" || (!relative.startsWith(`..${path.sep}`) && relative !== "..");
}
function hasSessionAllowRuleFor(
changeSet: DurablePermissionChangeSet | undefined,
toolName: string,
): boolean {
return !!changeSet?.updates.some(
(update) =>
update.type === "addRules" &&
update.destination === "session" &&
update.behavior === "allow" &&
update.rules.some((rule) => rule.toolName === toolName),
);
}
function hasBroadSessionAllowRuleFor(
changeSet: DurablePermissionChangeSet,
toolName: string,
): boolean {
return changeSet.updates.some(
(update) =>
update.type === "addRules" &&
update.destination === "session" &&
update.behavior === "allow" &&
update.rules.some((rule) => rule.toolName === toolName && rule.ruleContent === undefined),
);
}
function hasAcceptEditsMode(changeSet: DurablePermissionChangeSet): boolean {
return changeSet.updates.some(
(update) =>
update.type === "setMode" &&
update.destination === "session" &&
update.mode === "acceptEdits",
);
}
function permissionPath(ruleContent: string | undefined): string | undefined {
const value = plainString(ruleContent);
if (!value) return undefined;
return value.replace(/[/\\]\*\*$/, "");
}
function effectCoversFilePath(
changeSet: DurablePermissionChangeSet,
filePath: string,
operation: "read" | "write",
cwd: string,
): boolean {
const directory = path.dirname(filePath);
const comparable = (candidate: string): boolean => {
const resolved = path.resolve(cwd, candidate);
return resolved === directory || isInside(resolved, filePath);
};
const paths = changeSet.updates.flatMap((update) => {
if (update.type === "addDirectories") return update.directories;
if (update.type !== "addRules" || update.behavior !== "allow") return [];
return update.rules
.filter((rule) =>
operation === "read" ? rule.toolName === "Read" : rule.toolName === "Edit",
)
.map((rule) => permissionPath(rule.ruleContent))
.filter((value): value is string => value !== undefined);
});
return paths.some(comparable);
}
function fileSessionLabel(
context: PermissionOptionContext,
filePath: string | undefined,
operation: "read" | "write",
): string | undefined {
if (!isFileSessionChangeSet(context.durableChangeSet, operation)) return undefined;
const resolvedFilePath = filePath ? path.resolve(context.cwd, filePath) : undefined;
const isClaudePath =
operation === "write" &&
!!resolvedFilePath &&
(isInside(path.join(context.cwd, ".claude"), resolvedFilePath) ||
isInside(path.join(os.homedir(), ".claude"), resolvedFilePath));
const broadRule = hasBroadSessionAllowRuleFor(
context.durableChangeSet!,
operation === "read" ? "Read" : "Edit",
);
if (resolvedFilePath) {
const coversCurrentPath =
effectCoversFilePath(context.durableChangeSet!, resolvedFilePath, operation, context.cwd) ||
broadRule ||
(operation === "write" && !isClaudePath && hasAcceptEditsMode(context.durableChangeSet!));
if (!coversCurrentPath) return undefined;
} else if (
!broadRule &&
!(operation === "write" && hasAcceptEditsMode(context.durableChangeSet!))
) {
return undefined;
}
if (
operation === "write" &&
resolvedFilePath &&
isClaudePath &&
hasSessionAllowRuleFor(context.durableChangeSet, "Edit")
) {
return "Yes, and allow Claude to edit its own settings for this session";
}
if (!resolvedFilePath || isInside(context.cwd, resolvedFilePath)) {
return operation === "read"
? "Yes, during this session"
: "Yes, allow all edits during this session";
}
const directory = path.dirname(resolvedFilePath);
const directoryName = path.basename(directory) || "this directory";
return operation === "read"
? `Yes, allow reading from ${directoryName}${path.sep} during this session`
: `Yes, allow all edits in ${directoryName}${path.sep} during this session`;
}
function buildFilePermissionOptions(
context: PermissionOptionContext,
filePath: string | undefined,
operation: "read" | "write",
): PermissionOption[] {
return withOptionalUpdate(
context.durableChangeSet,
fileSessionLabel(context, filePath, operation),
"Yes",
"No",
);
}
export function buildReadPermissionOptions(context: PermissionOptionContext): PermissionOption[] {
return buildFilePermissionOptions(context, inputPath(context, "file_path"), "read");
}
export function buildGlobPermissionOptions(context: PermissionOptionContext): PermissionOption[] {
return buildFilePermissionOptions(context, inputPath(context, "path") ?? context.cwd, "read");
}
export function buildGrepPermissionOptions(context: PermissionOptionContext): PermissionOption[] {
return buildFilePermissionOptions(context, inputPath(context, "path") ?? context.cwd, "read");
}
export function buildEditPermissionOptions(context: PermissionOptionContext): PermissionOption[] {
return buildFilePermissionOptions(context, inputPath(context, "file_path"), "write");
}
export function buildWritePermissionOptions(context: PermissionOptionContext): PermissionOption[] {
return buildFilePermissionOptions(context, inputPath(context, "file_path"), "write");
}
export function buildNotebookEditPermissionOptions(
context: PermissionOptionContext,
): PermissionOption[] {
return buildFilePermissionOptions(context, inputPath(context, "notebook_path"), "write");
}

View File

@@ -0,0 +1,110 @@
import type { PermissionOption } from "@agentclientprotocol/sdk";
import type { DurablePermissionChangeSet } from "../normalization.js";
export const PERMISSION_OPTION_ID = {
allowOnce: "allow-once",
allowWithUpdates: "allow-with-updates",
allowSkillExact: "allow-skill-exact",
allowSkillPrefix: "allow-skill-prefix",
exitPlanBypass: "exit-plan-bypass",
exitPlanAuto: "exit-plan-auto",
exitPlanAcceptEdits: "exit-plan-accept-edits",
exitPlanDefault: "exit-plan-default",
exitPlanClearAuto: "exit-plan-clear-auto",
exitPlanClearBypass: "exit-plan-clear-bypass",
exitPlanClearAcceptEdits: "exit-plan-clear-accept-edits",
reject: "reject",
} as const;
export interface PermissionOptionContext {
toolName: string;
displayName?: string;
input: Record<string, unknown>;
cwd: string;
durableChangeSet?: DurablePermissionChangeSet;
allowPersistentOptions?: boolean;
/** The CLI's `defaultToNo` hint (SDK 0.3.268+): the ask must not be
* approvable by a stray keystroke, so the decline option leads. */
defaultToNo?: boolean;
availableModes?: readonly string[];
/** The mode the session left when it entered plan mode. */
prePlanMode?: string;
contextUsedPercent?: number;
}
export function allowOnce(name = "Yes"): PermissionOption {
return { optionId: PERMISSION_OPTION_ID.allowOnce, name, kind: "allow_once" };
}
export function allowWithUpdates(name: string): PermissionOption {
return { optionId: PERMISSION_OPTION_ID.allowWithUpdates, name, kind: "allow_always" };
}
export function reject(name = "No"): PermissionOption {
return { optionId: PERMISSION_OPTION_ID.reject, name, kind: "reject_once" };
}
export function withOptionalUpdate(
changeSet: DurablePermissionChangeSet | undefined,
updateName: string | undefined,
allowName = "Yes",
rejectName = "No",
): PermissionOption[] {
const options = [allowOnce(allowName)];
if (changeSet && updateName) options.push(allowWithUpdates(updateName));
options.push(reject(rejectName));
return options;
}
export function plainString(value: unknown): string | undefined {
return typeof value === "string" && value.trim() ? value.trim() : undefined;
}
export function exactLocalAllowRule(
changeSet: DurablePermissionChangeSet | undefined,
toolName: string,
ruleContent?: string,
): boolean {
if (!changeSet || changeSet.updates.length !== 1) return false;
const update = changeSet.updates[0];
if (
update?.type !== "addRules" ||
update.behavior !== "allow" ||
update.destination !== "localSettings" ||
update.rules.length !== 1
) {
return false;
}
const rule = update.rules[0];
return (
rule?.toolName === toolName &&
(ruleContent === undefined
? rule.ruleContent === undefined
: plainString(rule.ruleContent) === ruleContent)
);
}
/**
* An MCP "don't ask again" option is only truthful when every provider update
* adds an unrestricted allow rule for the tool currently being prompted.
*/
export function isMcpAllowChangeSet(
changeSet: DurablePermissionChangeSet | undefined,
toolName: string,
): boolean {
return (
!!changeSet &&
changeSet.updates.length > 0 &&
changeSet.updates.every(
(update) =>
update.type === "addRules" &&
update.behavior === "allow" &&
update.rules.length > 0 &&
update.rules.every((rule) => rule.toolName === toolName && rule.ruleContent === undefined),
)
);
}
export function withGeneratedUpdate(name: string, rejectName = "No"): PermissionOption[] {
return [allowOnce(), allowWithUpdates(name), reject(rejectName)];
}

View File

@@ -0,0 +1,121 @@
import type { PermissionOption } from "@agentclientprotocol/sdk";
import path from "node:path";
import type { DurablePermissionChangeSet } from "../normalization.js";
import { plainString, type PermissionOptionContext, withOptionalUpdate } from "./shared.js";
function permissionRulePrefix(value: string): string {
return value.endsWith(":*") ? value.slice(0, -2) : value;
}
function displayList(values: string[]): string {
if (values.join(", ").length > 50) return "similar";
if (values.length === 1) return values[0]!;
if (values.length === 2) return `${values[0]} and ${values[1]}`;
return `${values.slice(0, -1).join(", ")}, and ${values.at(-1)}`;
}
/** Shorten paths only as much as needed to distinguish them in prompt text. */
function displayPaths(paths: string[]): string {
const normalizedPaths = [...new Set(paths.map((value) => path.normalize(value)))];
const segments = normalizedPaths.map((value) => value.split(path.sep).filter(Boolean));
// Compare equally deep suffixes so duplicate basenames gain the smallest
// useful parent prefix (for example, codex-acp/src/ vs claude-acp/src/).
const suffix = (index: number, depth: number): string =>
segments[index]!.slice(-depth).join(path.sep) || normalizedPaths[index]!;
const names = normalizedPaths.map((value, index) => {
const parts = segments[index]!;
let name = path.basename(value) || value;
for (let depth = 1; depth <= parts.length; depth++) {
const candidate = suffix(index, depth);
if (
normalizedPaths.every((_, other) => other === index || suffix(other, depth) !== candidate)
) {
name = candidate;
break;
}
if (depth === parts.length) name = value;
}
return name.endsWith(path.sep) ? name : `${name}${path.sep}`;
});
// Native Claude labels enumerate two paths and summarize larger sets.
if (names.length <= 2) return displayList(names);
return `${names[0]}, ${names[1]} and ${names.length - 2} more`;
}
/** Plain-text port of Claude Code's generateShellSuggestionsLabel. */
function shellSuggestionsLabel(
toolName: "Bash" | "PowerShell",
changeSet: DurablePermissionChangeSet,
): string | undefined {
const representable = changeSet.updates.every((update) => {
if (update.type === "addDirectories") return update.destination === "session";
if (update.type !== "addRules" || update.behavior !== "allow") return false;
return update.rules.every(
(rule) =>
(rule.toolName === toolName || rule.toolName === "Read") &&
plainString(rule.ruleContent) !== undefined,
);
});
if (!representable) return undefined;
const rules = changeSet.updates
.filter((update) => update.type === "addRules")
.flatMap((update) => update.rules);
const readPaths = rules
.filter((rule) => rule.toolName === "Read")
.map((rule) => rule.ruleContent?.replace(/\/\*\*$/, ""))
.filter((value): value is string => !!value);
const commands = [
...new Set(
rules
.filter((rule) => rule.toolName === toolName && rule.ruleContent)
.map((rule) => permissionRulePrefix(rule.ruleContent!)),
),
];
const directories = changeSet.updates
.filter((update) => update.type === "addDirectories")
.flatMap((update) => update.directories);
const hasPaths = readPaths.length > 0 || directories.length > 0;
if (readPaths.length > 0 && directories.length === 0 && commands.length === 0) {
return `Yes, allow reading from ${displayPaths(readPaths)} from this project`;
}
if (directories.length > 0 && readPaths.length === 0 && commands.length === 0) {
return `Yes, and always allow access to ${displayPaths(directories)} from this project`;
}
if (commands.length > 0 && !hasPaths) {
return `Yes, and don't ask again for ${displayList(commands)} commands`;
}
if (hasPaths && commands.length === 0) {
return `Yes, and always allow access to ${displayPaths([...directories, ...readPaths])} from this project`;
}
if (hasPaths && commands.length > 0) {
const paths = [...directories, ...readPaths];
return paths.length === 1 && commands.length === 1
? `Yes, and allow access to ${displayPaths(paths)} and ${displayList(commands)} commands`
: `Yes, and allow ${displayPaths(paths)} access and ${displayList(commands)} commands`;
}
return undefined;
}
function buildShellPermissionOptions(
context: PermissionOptionContext,
toolName: "Bash" | "PowerShell",
): PermissionOption[] {
const name = context.durableChangeSet
? shellSuggestionsLabel(toolName, context.durableChangeSet)
: undefined;
return withOptionalUpdate(context.durableChangeSet, name, "Yes", "No");
}
export function buildBashPermissionOptions(context: PermissionOptionContext): PermissionOption[] {
return buildShellPermissionOptions(context, "Bash");
}
export function buildPowerShellPermissionOptions(
context: PermissionOptionContext,
): PermissionOption[] {
return buildShellPermissionOptions(context, "PowerShell");
}

View File

@@ -0,0 +1,178 @@
import type { PermissionOption } from "@agentclientprotocol/sdk";
import {
allowOnce,
exactLocalAllowRule,
isMcpAllowChangeSet,
PERMISSION_OPTION_ID,
plainString,
type PermissionOptionContext,
reject,
withGeneratedUpdate,
withOptionalUpdate,
} from "./shared.js";
export function buildWebFetchPermissionOptions(
context: PermissionOptionContext,
): PermissionOption[] {
const url = plainString(context.input.url);
if (url && context.allowPersistentOptions !== false) {
try {
const hostname = new URL(url).hostname;
if (hostname) {
return withGeneratedUpdate(`Yes, and don't ask again for ${hostname}`);
}
} catch {
// Invalid input cannot produce Claude Code's domain-specific option.
}
}
return [allowOnce(), reject("No")];
}
export function buildSkillPermissionOptions(context: PermissionOptionContext): PermissionOption[] {
const skill = plainString(context.input.skill);
const options = [allowOnce()];
if (skill && context.allowPersistentOptions !== false) {
options.push({
optionId: PERMISSION_OPTION_ID.allowSkillExact,
name: `Yes, and don't ask again for ${skill}`,
kind: "allow_always",
});
const spaceIndex = skill.indexOf(" ");
if (spaceIndex > 0) {
const prefix = `${skill.slice(0, spaceIndex)}:*`;
options.push({
optionId: PERMISSION_OPTION_ID.allowSkillPrefix,
name: `Yes, and don't ask again for ${prefix} commands`,
kind: "allow_always",
});
}
}
options.push(reject("No"));
return options;
}
export function buildEnterPlanModePermissionOptions(): PermissionOption[] {
return [allowOnce("Yes, enter plan mode"), reject("No, start implementing now")];
}
export function buildExitPlanModePermissionOptions(
context: PermissionOptionContext,
): PermissionOption[] {
const modes = new Set(context.availableModes);
const options: PermissionOption[] = [];
// Claude Code offers bypass only when the user launched with it, so it can
// prefer bypass outright. The adapter advertises bypass by default, so Auto
// leads unless the session was in bypass before entering plan mode. Both stay
// selectable: they have different permission semantics.
const elevatedModes = (
context.prePlanMode === "bypassPermissions"
? (["bypassPermissions", "auto"] as const)
: (["auto", "bypassPermissions"] as const)
).filter((mode) => modes.has(mode));
const preferredMode = elevatedModes[0] ?? "acceptEdits";
if (plainString(context.input.plan)) {
const usage =
context.contextUsedPercent === undefined ? "" : ` (${context.contextUsedPercent}% used)`;
options.push(
preferredMode === "auto"
? {
optionId: PERMISSION_OPTION_ID.exitPlanClearAuto,
name: `Yes, clear context${usage} and use auto mode`,
kind: "allow_always",
}
: preferredMode === "bypassPermissions"
? {
optionId: PERMISSION_OPTION_ID.exitPlanClearBypass,
name: `Yes, clear context${usage} and bypass permissions`,
kind: "allow_always",
}
: {
optionId: PERMISSION_OPTION_ID.exitPlanClearAcceptEdits,
name: `Yes, clear context${usage} and auto-accept edits`,
kind: "allow_always",
},
);
}
for (const mode of elevatedModes) {
options.push(
mode === "auto"
? {
optionId: PERMISSION_OPTION_ID.exitPlanAuto,
name: "Yes, and use auto mode",
kind: "allow_always",
}
: {
optionId: PERMISSION_OPTION_ID.exitPlanBypass,
name: "Yes, and bypass permissions",
kind: "allow_always",
},
);
}
if (elevatedModes.length === 0) {
options.push({
optionId: PERMISSION_OPTION_ID.exitPlanAcceptEdits,
name: "Yes, auto-accept edits",
kind: "allow_always",
});
}
options.push({
optionId: PERMISSION_OPTION_ID.exitPlanDefault,
name: "Yes, manually approve edits",
kind: "allow_once",
});
options.push(reject("No, keep planning"));
return options;
}
export function buildSandboxNetworkPermissionOptions(
context: PermissionOptionContext,
): PermissionOption[] {
const host = plainString(context.input.host);
const name =
host && exactLocalAllowRule(context.durableChangeSet, context.toolName, host)
? `Yes, and don't ask again for ${host}`
: undefined;
return withOptionalUpdate(context.durableChangeSet, name, "Yes", "No");
}
export function buildFallbackPermissionOptions(
context: PermissionOptionContext,
): PermissionOption[] {
const toolLabel = plainString(context.displayName) ?? context.toolName;
if (context.toolName.startsWith("mcp__")) {
const changeSet =
context.allowPersistentOptions !== false &&
isMcpAllowChangeSet(context.durableChangeSet, context.toolName)
? context.durableChangeSet
: undefined;
return withOptionalUpdate(
changeSet,
changeSet ? `Yes, and don't ask again for ${toolLabel} commands` : undefined,
);
}
if (context.allowPersistentOptions !== false) {
return withGeneratedUpdate(`Yes, and don't ask again for ${toolLabel} commands`);
}
return [allowOnce(), reject("No")];
}
const COMPUTER_USE_MCP_TOOL_PREFIX = "mcp__computer-use__";
export function isComputerUseMcpTool(toolName: string): boolean {
return toolName.startsWith(COMPUTER_USE_MCP_TOOL_PREFIX);
}
export function buildComputerUseMcpPermissionOptions(
context: PermissionOptionContext,
): PermissionOption[] {
const toolLabel = plainString(context.displayName) ?? context.toolName;
const changeSet =
context.allowPersistentOptions !== false &&
isMcpAllowChangeSet(context.durableChangeSet, context.toolName)
? context.durableChangeSet
: undefined;
return withOptionalUpdate(
changeSet,
changeSet ? `Yes, and don't ask again for ${toolLabel}` : undefined,
);
}

View File

@@ -0,0 +1,120 @@
import type { RequestPermissionRequest, ToolCallContent } from "@agentclientprotocol/sdk";
import { AIR_PERMISSION_KEY, withAirMeta } from "../air-extension.js";
import { ClientCapabilities } from "../tool-calls/client-capabilities.js";
import { AcpToolCallRenderer } from "../tool-calls/renderer.js";
export interface ClaudePermissionPresentationInput {
toolName: string;
input: Record<string, unknown>;
toolUseID: string;
cwd?: string;
capabilities?: ClientCapabilities;
/** The exact patch of the change to approve, for a negotiated `diffPatch` client. */
previewContent?: ToolCallContent[];
blockedPath?: string;
title?: string;
displayName?: string;
description?: string;
decisionReason?: string;
defaultToNo?: boolean;
}
function humanText(value: unknown, maxLength: number, singleLine = false): string | undefined {
if (typeof value !== "string") return undefined;
const withoutControls = Array.from(value)
.filter((character) => {
const code = character.charCodeAt(0);
return !(
code <= 0x08 ||
code === 0x0b ||
code === 0x0c ||
(code >= 0x0e && code <= 0x1f) ||
code === 0x7f
);
})
.join("");
const normalized = singleLine
? withoutControls.replace(/\s+/gu, " ").trim()
: withoutControls.trim();
return normalized && normalized.length <= maxLength ? normalized : undefined;
}
function compactText(value: unknown): string | undefined {
return humanText(value, 160, true);
}
/**
* The permission request presentation.
*
* The request `toolCall` carries `toolCallId`, `title`, and `rawInput`. The
* adapter emits the `tool_call` before the request, so the client already
* holds the rest. The request adds only what it shows new: the exact preview
* patch, and the blocked path when the tool call has no such location.
*/
export function buildClaudePermissionPresentation(
value: ClaudePermissionPresentationInput,
): Pick<RequestPermissionRequest, "toolCall" | "_meta"> {
const capabilities = value.capabilities ?? new ClientCapabilities();
const renderer = new AcpToolCallRenderer(capabilities);
const toolUse = { id: value.toolUseID, name: value.toolName, input: value.input };
const facts = renderer.facts(toolUse, value.cwd);
const host =
value.toolName === "SandboxNetworkAccess" ? compactText(value.input.host) : undefined;
const isComputerUse = value.toolName.startsWith("mcp__computer-use__");
const subjectTitle = host ?? (isComputerUse ? compactText(value.displayName) : undefined);
// Reuse the exact standard tool-call heading as the permission heading so
// the approval never maintains a second, divergent name for the operation.
// decisionReason is temporarily exposed as the permission description so
// its actual SDK values can be inspected; it remains diagnostic policy text.
const toolCallTitle = subjectTitle ?? facts.title;
const permissionTitle = value.toolName === "ExitPlanMode" ? "Ready to code?" : toolCallTitle;
// Shell titles are executable input: compacting whitespace changes quoted
// arguments and comment boundaries, and length limits can hide the command.
const title =
value.toolName === "Bash" || value.toolName === "PowerShell"
? permissionTitle
: (humanText(permissionTitle, 4_000, true) ?? "Use tool?");
const decisionReason = humanText(value.decisionReason, 4_000);
const description = decisionReason ? `Reason: ${decisionReason}` : undefined;
const blockedPath = humanText(value.blockedPath, 4_096, true);
const extraLocations =
blockedPath && !(facts.locations ?? []).some((location) => location.path === blockedPath)
? [{ path: blockedPath }]
: undefined;
return {
toolCall: renderer.permissionToolCall(toolUse, {
cwd: value.cwd,
title: toolCallTitle,
previewContent: value.previewContent,
extraLocations,
// The upstream request shows the input of a network or computer-use
// request that has no content of its own.
fallbackContent:
host || isComputerUse
? [
{
type: "content" as const,
content: {
type: "text" as const,
text: `\`\`\`json\n${JSON.stringify(value.input, null, 2)}\n\`\`\``,
},
},
]
: undefined,
}),
// Only AIR gets the permission presentation.
...(title && capabilities.air.client
? {
_meta: withAirMeta(undefined, AIR_PERMISSION_KEY, {
version: 1,
title,
...(description ? { description } : {}),
// The CLI's own hint, forwarded so a client that can pre-select
// an option keeps the decline focused; the option order already
// leads with the reject options when this is set.
...(value.defaultToNo === true ? { defaultToNo: true } : {}),
}),
}
: {}),
};
}

View File

@@ -0,0 +1,36 @@
import type { RequestPermissionResponse } from "@agentclientprotocol/sdk";
import type { PermissionOption } from "@agentclientprotocol/sdk";
import type { PermissionMode, PermissionResult } from "@anthropic-ai/claude-agent-sdk";
import type { DurablePermissionChangeSet } from "./normalization.js";
import { applyClaudePermissionSelection, parseClaudePermissionSelection } from "./effects.js";
export interface ClaudePermissionDecision {
permissionResult: PermissionResult;
contextResetMode?: PermissionMode;
}
/** Decode, validate, and interpret an ACP response exactly once. */
export function decodeClaudePermissionResponse(
response: RequestPermissionResponse,
toolName: string,
input: Record<string, unknown>,
toolUseID: string,
offeredOptions: readonly PermissionOption[],
durableChangeSet?: DurablePermissionChangeSet,
): ClaudePermissionDecision {
const selection = parseClaudePermissionSelection(response, toolName);
const offeredOption = offeredOptions.find((option) => option.optionId === selection.optionId);
if (!offeredOption) {
throw new Error(`Permission option was not offered: ${selection.optionId}`);
}
const permissionResult = applyClaudePermissionSelection(selection, {
toolName,
input,
toolUseID,
durableChangeSet,
});
return {
permissionResult,
...(selection.contextResetMode ? { contextResetMode: selection.contextResetMode } : {}),
};
}

158
src/resumed-session.ts Normal file
View File

@@ -0,0 +1,158 @@
import { getSessionMessages, type SessionMessage } from "@anthropic-ai/claude-agent-sdk";
import { access, open, readdir } from "node:fs/promises";
import path from "node:path";
import { claudeConfigDir } from "./paths.js";
import { SessionTiming } from "./session-timing.js";
/** The size of one backward read of a transcript. */
const TAIL_CHUNK_BYTES = 64 * 1024;
type ResumeLogger = {
log: (...args: unknown[]) => void;
error: (...args: unknown[]) => void;
};
export type ResumedSessionSnapshot = {
messages?: SessionMessage[];
model?: string;
};
/** Return the concrete model recorded by the last real assistant response.
* Claude Code restores a resumed query from this same transcript field.
* Synthetic assistant records use angle-bracket placeholders and do not
* describe a model the resumed query can run. */
export function resumedModelFromTranscript(messages: SessionMessage[]): string | undefined {
for (let index = messages.length - 1; index >= 0; index--) {
const entry = messages[index];
if (
entry?.type !== "assistant" ||
entry.parent_tool_use_id != null ||
entry.parent_agent_id != null ||
!entry.message ||
typeof entry.message !== "object"
) {
continue;
}
const model = concreteModel((entry.message as { model?: unknown }).model);
if (model) return model;
}
return undefined;
}
/** The model name, or undefined for a missing or a synthetic `<…>` model. */
function concreteModel(model: unknown): string | undefined {
if (typeof model !== "string") return undefined;
const name = model.trim();
return name.length > 0 && !/^<[^>]+>$/.test(name) ? name : undefined;
}
/** Read the resume model from the local transcript without starting a Claude
* control request. This is intentionally on the load critical path. */
export async function readResumedSession(
sessionId: string,
logger?: ResumeLogger,
): Promise<ResumedSessionSnapshot> {
const timing = new SessionTiming(logger, "models", sessionId);
try {
// Deliberately search all project directories, matching replaySessionHistory.
// A client may reopen a session from a worktree or normalized path that is
// different from the directory under which Claude persisted the transcript.
const messages = await getSessionMessages(sessionId);
const model = resumedModelFromTranscript(messages);
timing.phase("read-transcript", ` messages=${messages.length} model=${model ?? "unknown"}`);
return { messages, model };
} catch (error) {
timing.phase("read-transcript", " outcome=error");
logger?.error(`Failed to read transcript for resumed session ${sessionId}:`, error);
return {};
}
}
/**
* Read the resume model of a session from the end of its local transcript.
*
* A resume needs only the model, not the messages. The transcript file is
* read backwards until the last real assistant record of the main thread, so
* the cost does not grow with the length of the session. A session without a
* local transcript file falls back to {@link readResumedSession}.
*/
export async function readResumedModel(
sessionId: string,
logger?: ResumeLogger,
): Promise<string | undefined> {
const timing = new SessionTiming(logger, "models", sessionId);
try {
const filePath = await findTranscript(sessionId);
if (filePath) {
const model = await lastAssistantModel(filePath);
timing.phase("read-transcript-tail", ` model=${model ?? "unknown"}`);
return model;
}
} catch (error) {
timing.phase("read-transcript-tail", " outcome=error");
logger?.error(`Failed to read the transcript tail of resumed session ${sessionId}:`, error);
}
return (await readResumedSession(sessionId, logger)).model;
}
/** The local transcript of a session in any project directory, as the SDK looks it up. */
export async function findTranscript(sessionId: string): Promise<string | undefined> {
const projects = path.join(claudeConfigDir(), "projects");
let directories: string[];
try {
directories = await readdir(projects);
} catch {
return undefined;
}
for (const directory of directories) {
const candidate = path.join(projects, directory, `${sessionId}.jsonl`);
try {
await access(candidate);
return candidate;
} catch {
// Not in this project directory.
}
}
return undefined;
}
/** The model of the last real assistant record of the main thread in a JSONL transcript. */
async function lastAssistantModel(filePath: string): Promise<string | undefined> {
const handle = await open(filePath, "r");
try {
let end = (await handle.stat()).size;
// The bytes of the line whose start is not read yet, in file order.
let pending: Buffer[] = [];
while (end > 0) {
const start = Math.max(0, end - TAIL_CHUNK_BYTES);
let chunk = Buffer.alloc(end - start);
await handle.read(chunk, 0, chunk.length, start);
for (let at = chunk.lastIndexOf(0x0a); at >= 0; at = chunk.lastIndexOf(0x0a)) {
const model = assistantModelOfLine(Buffer.concat([chunk.subarray(at + 1), ...pending]));
if (model) return model;
pending = [];
chunk = chunk.subarray(0, at);
}
pending.unshift(chunk);
end = start;
}
return assistantModelOfLine(Buffer.concat(pending));
} finally {
await handle.close();
}
}
function assistantModelOfLine(line: Buffer): string | undefined {
// Most lines are not assistant records. The check skips their JSON parse.
if (line.indexOf('"assistant"') < 0) return undefined;
let entry: unknown;
try {
entry = JSON.parse(line.toString("utf8"));
} catch {
return undefined;
}
if (!entry || typeof entry !== "object") return undefined;
const record = entry as { type?: unknown; isSidechain?: unknown; message?: { model?: unknown } };
if (record.type !== "assistant" || record.isSidechain === true) return undefined;
return concreteModel(record.message?.model);
}

View File

@@ -0,0 +1,3 @@
/** Shared sentinels and ids for session preferences managed by the adapter. */
export const DEFAULT_MODEL_ID = "default";
export const EFFORT_CONFIG_ID = "effort";

118
src/session-effort.ts Normal file
View File

@@ -0,0 +1,118 @@
import type { SessionConfigOption } from "@agentclientprotocol/sdk";
import type { EffortLevel, ModelInfo, Settings } from "@anthropic-ai/claude-agent-sdk";
import { AIR_RECOMMENDED_CONFIG_VALUE_CAPABILITY, withAirMeta } from "./air-extension.js";
import { EFFORT_CONFIG_ID } from "./session-config-ids.js";
export { EFFORT_CONFIG_ID } from "./session-config-ids.js";
// The SDK drops `undefined` during JSON transport and only clears a flag-layer
// setting when it receives an explicit `null`. Map both an absent picker and
// the legacy "default" row to null so a previously applied effort is cleared.
export function toSdkEffortLevel(value: string | undefined): EffortLevel | null {
return value === undefined || value === "default" ? null : (value as EffortLevel);
}
function canonicalizeModelSettingsKey(value: string): string {
return value
.trim()
.toLowerCase()
.replace(/-(\d+m)$/i, "[$1]");
}
/** Resolve the effort the CLI will use: per-model settings first, then the
* legacy top-level effort setting. Model settings are keyed by canonical
* model name, so try the resolved SDK model before picker and raw IDs. */
export function settingsEffortForModel(
settings: Settings,
modelInfo: ModelInfo | undefined,
modelId?: string,
): string | undefined {
const modelSettings = settings.modelSettings;
if (modelSettings) {
for (const key of [modelInfo?.resolvedModel, modelInfo?.value, modelId]) {
if (key === undefined) continue;
const exact = modelSettings[key]?.effortLevel;
if (typeof exact === "string") return exact;
const canonicalKey = canonicalizeModelSettingsKey(key);
const matchingEntry = Object.entries(modelSettings).find(
([candidate]) => canonicalizeModelSettingsKey(candidate) === canonicalKey,
);
const perModel = matchingEntry?.[1]?.effortLevel;
if (typeof perModel === "string") return perModel;
}
}
return settings.effortLevel;
}
/** Programmatic query settings have higher priority than file-backed settings,
* matching the SDK. Keep unrelated per-model entries from lower tiers while
* replacing entries supplied at the programmatic tier. */
export function mergeEffortSettings(base: Settings, override: Settings | undefined): Settings {
if (!override) return base;
const overriddenModelKeys = new Set(
Object.keys(override.modelSettings ?? {}).map(canonicalizeModelSettingsKey),
);
const unshadowedBaseModelSettings = Object.fromEntries(
Object.entries(base.modelSettings ?? {}).filter(
([key]) => !overriddenModelKeys.has(canonicalizeModelSettingsKey(key)),
),
);
return {
...base,
...override,
modelSettings:
base.modelSettings || override.modelSettings
? { ...unshadowedBaseModelSettings, ...override.modelSettings }
: undefined,
};
}
export function buildEffortConfigOption(
modelInfos: ModelInfo[],
currentModelId: string,
currentEffortLevel: string | undefined,
useRecommendedValue: boolean,
): SessionConfigOption | undefined {
const currentModelInfo = modelInfos.find((model) => model.value === currentModelId);
const supportedLevels = currentModelInfo?.supportsEffort
? (currentModelInfo.supportedEffortLevels ?? [])
: [];
if (supportedLevels.length === 0) return undefined;
const recommendedEffort = (supportedLevels as string[]).includes("medium")
? "medium"
: supportedLevels[0];
const options = [
...(useRecommendedValue ? [] : [{ value: "default", name: "Default" }]),
...supportedLevels.map((level) => ({
value: level,
name: level
.split(/[_-]/)
.map((part) => (part ? part.charAt(0).toUpperCase() + part.slice(1) : part))
.join(" "),
})),
];
const includes = (level: string) =>
(!useRecommendedValue && level === "default") || (supportedLevels as string[]).includes(level);
const currentValue =
currentEffortLevel && includes(currentEffortLevel)
? currentEffortLevel
: useRecommendedValue
? recommendedEffort
: "default";
return {
id: EFFORT_CONFIG_ID,
name: "Effort",
description: "Available effort levels for this model",
category: "thought_level",
type: "select",
currentValue,
options,
...(useRecommendedValue
? {
_meta: withAirMeta(undefined, AIR_RECOMMENDED_CONFIG_VALUE_CAPABILITY, recommendedEffort),
}
: {}),
};
}

View File

@@ -0,0 +1,486 @@
import type { ClientCapabilities, SessionNotification } from "@agentclientprotocol/sdk";
import {
getSessionMessages,
type SDKAssistantMessageError,
USAGE_LIMIT_ERROR_PREFIXES,
} from "@anthropic-ai/claude-agent-sdk";
import { randomUUID } from "node:crypto";
import {
AIR_SESSION_FAILURE_CAPABILITY,
airCapabilityMeta,
clientSupportsAirCapability,
withAirMeta,
} from "./air-extension.js";
export function airSessionFailureCapabilityMeta(...additionalCapabilities: string[]) {
return airCapabilityMeta(AIR_SESSION_FAILURE_CAPABILITY, ...additionalCapabilities);
}
export type ClaudeFailureKind =
| "access_denied"
| "advisory"
| "auth_required"
| "bad_request"
| "budget_exhausted"
| "context_exhausted"
| "internal_error"
| "overloaded"
| "provider_error"
| "quota_exhausted"
| "rate_limited"
| "transport_lost"
| "worker_shutdown";
type AirSessionFailureCategory =
"connection" | "access" | "limit" | "request" | "service" | "unknown";
type AirSessionFailureSeverity = "warning" | "error";
type AirSessionFailureAction = "retry" | "login" | "new_session";
type SessionFailureRecoveryPolicy =
"never" | "next_attempt" | "real_model_success" | "auth_status" | "runtime_rebind";
export type PublishedSessionFailure = {
id: string;
revision: number;
kind: ClaudeFailureKind;
category: AirSessionFailureCategory;
turnId?: string;
severity: AirSessionFailureSeverity;
title: string;
details?: string;
/** A machine-readable refinement of `kind`, e.g. the `--hide-claude-auth`
* subscription guard's reason on an `auth_required` failure. Absent for a
* plain sign-out. */
reason?: string;
actions: AirSessionFailureAction[];
recoveryPolicy: SessionFailureRecoveryPolicy;
};
type SessionFailureOptions = {
turnId?: string;
sessionScoped?: boolean;
title?: string;
details?: string;
severity?: AirSessionFailureSeverity;
reason?: string;
};
export type SessionFailureState = {
epoch: string;
revisions: Map<string, number>;
active: Map<string, PublishedSessionFailure>;
nextIncident?: number;
lastNotice?: { title: string; id: string };
};
type Logger = {
error: (...args: unknown[]) => void;
};
export function createSessionFailureState(): SessionFailureState {
return {
epoch: randomUUID(),
revisions: new Map(),
active: new Map(),
};
}
const AIR_FAILURE_POLICY: Record<
ClaudeFailureKind,
{
category: AirSessionFailureCategory;
actions: AirSessionFailureAction[];
fallbackTitle: string;
}
> = {
// Account or credential blocks that signing in again cannot fix: the
// organization must complete verification, or the cloud provider's
// credentials must be refreshed outside Claude. No `login` action, and not
// sticky like `auth_required` (nothing clears at `auth_status`).
access_denied: {
category: "service",
actions: ["retry"],
fallbackTitle: "Claude could not access the account or provider credentials.",
},
advisory: {
category: "unknown",
actions: [],
fallbackTitle: "Claude reported a notice.",
},
auth_required: {
category: "access",
actions: ["login"],
fallbackTitle: "Sign in to continue using Claude.",
},
bad_request: {
category: "request",
actions: [],
fallbackTitle: "Claude could not process this request.",
},
budget_exhausted: {
category: "limit",
actions: ["new_session"],
fallbackTitle: "This Claude session reached its configured budget.",
},
context_exhausted: {
category: "limit",
actions: ["new_session"],
fallbackTitle: "This Claude turn reached its configured limit.",
},
internal_error: {
category: "service",
actions: ["retry", "new_session"],
fallbackTitle: "Claude Agent encountered an internal error.",
},
overloaded: {
category: "service",
actions: ["retry"],
fallbackTitle: "Claude is temporarily overloaded.",
},
provider_error: {
category: "service",
actions: ["retry"],
fallbackTitle: "The model provider reported an error.",
},
quota_exhausted: {
category: "limit",
actions: [],
fallbackTitle: "The Claude account has no available quota.",
},
rate_limited: {
category: "limit",
actions: ["retry"],
fallbackTitle: "Claude is temporarily rate limited.",
},
transport_lost: {
category: "connection",
actions: ["new_session"],
fallbackTitle: "The connection to Claude was lost.",
},
worker_shutdown: {
category: "connection",
actions: ["new_session"],
fallbackTitle: "The Claude worker is shutting down.",
},
};
export function sessionFailureMeta(failure: PublishedSessionFailure) {
return withAirMeta(undefined, AIR_SESSION_FAILURE_CAPABILITY, {
id: failure.id,
revision: failure.revision,
category: failure.category,
severity: failure.severity,
title: failure.title,
...(failure.details ? { details: failure.details } : {}),
...(failure.reason ? { reason: failure.reason } : {}),
actions: failure.actions,
});
}
/** `getSessionMessages` deliberately exposes only the API message and strips
* transcript-level `error` / `isApiErrorMessage` fields. The SDK exports the
* exact stable prefixes used by its synthetic usage-limit errors, so replay
* can recover this one typed failure without matching arbitrary model prose. */
export function assistantMessageText(apiMessage: unknown): string | undefined {
if (!apiMessage || typeof apiMessage !== "object") return undefined;
const { content } = apiMessage as { content?: unknown };
if (typeof content === "string") return content || undefined;
if (!Array.isArray(content)) return undefined;
const text = content
.map((block) =>
block &&
typeof block === "object" &&
"type" in block &&
block.type === "text" &&
"text" in block &&
typeof block.text === "string"
? block.text
: "",
)
.join("");
return text || undefined;
}
export function isSyntheticUsageLimitMessage(apiMessage: unknown): boolean {
if (!apiMessage || typeof apiMessage !== "object") return false;
const { model } = apiMessage as { model?: unknown };
if (model !== "<synthetic>") return false;
const text = assistantMessageText(apiMessage);
if (!text) return false;
return USAGE_LIMIT_ERROR_PREFIXES.some((prefix) => text.startsWith(prefix));
}
export function activeUsageLimitMessage(
messages: Awaited<ReturnType<typeof getSessionMessages>>,
): { uuid: string; title: string } | undefined {
let active: { uuid: string; title: string } | undefined;
for (const message of messages) {
if (message.type !== "assistant" || message.parent_tool_use_id !== null) continue;
if (isSyntheticUsageLimitMessage(message.message)) {
const title = assistantMessageText(message.message);
if (title) active = { uuid: message.uuid, title };
continue;
}
const model =
message.message && typeof message.message === "object" && "model" in message.message
? message.message.model
: undefined;
// A later real model answer proves the account recovered. Synthetic
// local-command/interruption messages do not: they can be appended while
// the provider remains unavailable.
if (model !== undefined && model !== "<synthetic>") active = undefined;
}
return active;
}
export function supportsAirSessionFailures(capabilities?: ClientCapabilities): boolean {
return clientSupportsAirCapability(capabilities, AIR_SESSION_FAILURE_CAPABILITY);
}
function sessionFailureRecoveryPolicy(
kind: ClaudeFailureKind,
turnId?: string,
): SessionFailureRecoveryPolicy {
switch (kind) {
case "advisory":
return "never";
case "auth_required":
return "auth_status";
case "transport_lost":
case "worker_shutdown":
return "runtime_rebind";
case "quota_exhausted":
return "real_model_success";
default:
return turnId ? "next_attempt" : "real_model_success";
}
}
/** Owns the AIR failure lifecycle for both the live consumer and history replay.
* Published revisions become active only after delivery succeeds; recovery only
* removes internal active state because transcript records are historical. */
export class SessionFailureController {
private readonly sessionId: string;
private readonly state: SessionFailureState;
private readonly capabilities?: ClientCapabilities;
private readonly isCurrent: () => boolean;
private readonly sendUpdate: (notification: SessionNotification) => Promise<void>;
private readonly logger: Logger;
constructor(options: {
sessionId: string;
state: SessionFailureState;
capabilities?: ClientCapabilities;
isCurrent: () => boolean;
sendUpdate: (notification: SessionNotification) => Promise<void>;
logger: Logger;
}) {
this.sessionId = options.sessionId;
this.state = options.state;
this.capabilities = options.capabilities;
this.isCurrent = options.isCurrent;
this.sendUpdate = options.sendUpdate;
this.logger = options.logger;
}
private isSupported(): boolean {
return supportsAirSessionFailures(this.capabilities);
}
private async emit(failure: PublishedSessionFailure): Promise<boolean> {
if (!this.isCurrent()) {
this.logger.error(
`Session ${this.sessionId}: ignored AIR session failure from a stale consumer`,
);
return false;
}
try {
await this.sendUpdate({
sessionId: this.sessionId,
update: {
sessionUpdate: "session_info_update",
_meta: sessionFailureMeta(failure),
},
});
return true;
} catch (error) {
this.logger.error(
`Session ${this.sessionId}: failed to publish AIR session failure: ${error}`,
);
return false;
}
}
/** Whether a session-scoped error of `kind` is active. A turn-scoped
* warning of the same kind (an `api_retry` notice) does not count: it
* reports a retry in progress, not the state the error would publish.
*
* `reason` refines `kind`, so the active record must carry the same one,
* and an omitted `reason` matches only a record with no reason. A plain
* sign-out and the `--hide-claude-auth` subscription refusal are both
* `auth_required`, but they tell the user different things. Neither may
* suppress the other. */
hasActiveSessionError(kind: ClaudeFailureKind, reason?: string): boolean {
for (const failure of this.state.active.values()) {
if (
failure.kind === kind &&
failure.severity === "error" &&
failure.turnId === undefined &&
failure.reason === reason
) {
return true;
}
}
return false;
}
recordActive(failure: PublishedSessionFailure): void {
this.state.revisions.set(failure.id, failure.revision);
this.state.active.set(failure.id, failure);
this.state.lastNotice =
failure.kind === "advisory" ? { title: failure.title, id: failure.id } : undefined;
}
async clear(
shouldClear: (failure: PublishedSessionFailure) => boolean = () => true,
): Promise<boolean> {
if (!this.isSupported()) return true;
this.state.lastNotice = undefined;
for (const failure of [...this.state.active.values()]) {
if (!shouldClear(failure)) continue;
this.state.active.delete(failure.id);
}
return true;
}
async prepare(
kind: ClaudeFailureKind,
failureOptions: SessionFailureOptions = {},
): Promise<PublishedSessionFailure | undefined> {
if (!this.isSupported() || !this.isCurrent()) return undefined;
const policy = AIR_FAILURE_POLICY[kind];
const title = failureOptions.title || policy.fallbackTitle;
if (kind === "advisory") {
const id =
this.state.lastNotice?.title === title
? this.state.lastNotice.id
: `${this.sessionId}:notice:${this.state.epoch}:${this.state.nextIncident ?? 1}`;
if (this.state.lastNotice?.title !== title) {
this.state.nextIncident = (this.state.nextIncident ?? 1) + 1;
}
return {
id,
revision: (this.state.revisions.get(id) ?? 0) + 1,
kind,
category: policy.category,
severity: "warning",
title,
...(failureOptions.details ? { details: failureOptions.details } : {}),
actions: policy.actions,
recoveryPolicy: sessionFailureRecoveryPolicy(kind),
};
}
const id =
failureOptions.turnId && !failureOptions.sessionScoped
? `${failureOptions.turnId}:error`
: `${this.sessionId}:session-error:${this.state.epoch}:${this.state.nextIncident ?? 1}`;
if (!failureOptions.turnId || failureOptions.sessionScoped) {
this.state.nextIncident = (this.state.nextIncident ?? 1) + 1;
}
return {
id,
revision: (this.state.revisions.get(id) ?? 0) + 1,
kind,
category: policy.category,
severity: failureOptions.severity ?? "error",
title,
...(failureOptions.details ? { details: failureOptions.details } : {}),
...(failureOptions.reason ? { reason: failureOptions.reason } : {}),
actions: failureOptions.severity === "warning" ? [] : policy.actions,
recoveryPolicy: sessionFailureRecoveryPolicy(
kind,
failureOptions.turnId && !failureOptions.sessionScoped ? failureOptions.turnId : undefined,
),
...(failureOptions.turnId && !failureOptions.sessionScoped
? { turnId: failureOptions.turnId }
: {}),
};
}
async publish(
kind: ClaudeFailureKind,
failureOptions: SessionFailureOptions = {},
): Promise<void> {
const failure = await this.prepare(kind, failureOptions);
if (!failure) return;
if (await this.emit(failure)) this.recordActive(failure);
}
async restore(
id: string,
kind: ClaudeFailureKind,
title: string,
active = true,
): Promise<boolean> {
if (!this.isSupported() || !this.isCurrent()) return false;
const policy = AIR_FAILURE_POLICY[kind];
const failure: PublishedSessionFailure = {
id,
revision: (this.state.revisions.get(id) ?? 0) + 1,
kind,
category: policy.category,
severity: "error",
title,
actions: policy.actions,
recoveryPolicy: sessionFailureRecoveryPolicy(kind),
};
if (!(await this.emit(failure))) return false;
this.state.revisions.set(failure.id, failure.revision);
if (active) {
this.state.active.set(failure.id, failure);
} else {
this.state.active.delete(failure.id);
}
return true;
}
}
export function providerFailureCategory(
errorKind?: SDKAssistantMessageError,
isUsageLimit = false,
): ClaudeFailureKind {
if (isUsageLimit) return "quota_exhausted";
switch (errorKind) {
case "authentication_failed":
case "oauth_org_not_allowed":
return "auth_required";
case "billing_error":
case "account_on_hold":
return "quota_exhausted";
// 403 `permission_error` with error_code `verification_required` (the
// organization must verify at the console), and a Bedrock/Vertex/Foundry
// credential the CLI could not load (transient: it retries, and asks the
// user to check or refresh the credentials). Both are access failures
// `/login` does not repair, so they get their own lane rather than
// `auth_required`'s login action and sticky auth_status recovery.
case "verification_required":
case "cloud_credential_error":
return "access_denied";
case "rate_limit":
return "rate_limited";
case "overloaded":
return "overloaded";
case "invalid_request":
case "model_not_found":
return "bad_request";
case "max_output_tokens":
return "context_exhausted";
case "server_error":
case "unknown":
case undefined:
return "provider_error";
default:
return "provider_error";
}
}

373
src/session-mode.ts Normal file
View File

@@ -0,0 +1,373 @@
import {
RequestError,
type SessionConfigOption,
type SessionModeState,
type SessionNotification,
type SetSessionModeRequest,
type SetSessionModeResponse,
} from "@agentclientprotocol/sdk";
import type {
ModelInfo,
PermissionMode,
PermissionResult,
Query,
} from "@anthropic-ai/claude-agent-sdk";
import { AIR_KIND_KEY, airOnlyMeta } from "./air-extension.js";
import {
noticeOrTranscriptUpdate,
noticeTranscriptText,
sentenceCase,
type SessionNotice,
} from "./session-notices.js";
export const MODE_CONFIG_ID = "mode";
export const AUTO_MODE_FALLBACK: PermissionMode = "acceptEdits";
/** Reads on after the bold label in the transcript line; capitalized when it
* stands alone as a notice description. */
const AUTO_MODE_FALLBACK_REASON =
"the selected model does not support Auto mode; using Accept edits instead.";
const AUTO_MODE_FALLBACK_NOTICE: SessionNotice = {
severity: "warning",
title: "Auto mode unavailable",
description: sentenceCase(AUTO_MODE_FALLBACK_REASON),
};
export type SessionMode = {
query: Pick<Query, "setPermissionMode">;
queryClosed?: boolean;
modes: SessionModeState;
models: { currentModelId: string };
modelInfos: ModelInfo[];
/** Prevents the model-specific Auto fallback from spamming the transcript. */
autoModeFallbackWarningShown?: boolean;
/** Initial mode fallback is reported after session/new, on the first prompt. */
autoModeFallbackWarningPending?: boolean;
/** The mode the session left when it entered plan mode, if it is in plan. */
prePlanMode?: string;
};
export type SessionModeManagerOptions<S extends SessionMode> = {
getSession(sessionId: string): S | undefined;
sessionEndedMessage: string;
updateConfigOption(sessionId: string, configId: string, value: string): Promise<void>;
sessionUpdate(params: SessionNotification): Promise<void>;
/** Whether the client can present `notice` updates; the fallback warning
* is a transcript line otherwise. Read per call: capabilities are only
* known after `initialize`. */
supportsNotices?(): boolean;
logError(...args: unknown[]): void;
/** Whether the client is AIR. Only AIR gets the mode kind, under `_meta.jetbrains.air`. */
airClient?(): boolean;
};
type ModeConfigSession = SessionMode & {
configOptions: SessionConfigOption[];
};
type InitializeSessionModeParams = {
query: Pick<Query, "setPermissionMode">;
requestedMode: PermissionMode;
currentModelInfo?: ModelInfo;
currentModelId: string;
/** When false, bypassPermissions is omitted from the mode catalog. */
allowBypass: boolean;
};
/** Owns session-mode policy and the ACP/SDK synchronization it requires. */
export class SessionModeManager<S extends SessionMode> {
constructor(private readonly options: SessionModeManagerOptions<S>) {}
async initialize({
query,
requestedMode,
currentModelInfo,
currentModelId,
allowBypass,
}: InitializeSessionModeParams): Promise<{
modes: SessionModeState;
autoModeFallbackWarningPending: boolean;
}> {
const availableModes = this.buildAvailableModes(allowBypass);
let effectiveMode = requestedMode;
let autoModeFallbackWarningPending = false;
if (
effectiveMode === "auto" &&
currentModelInfo !== undefined &&
currentModelInfo.supportsAutoMode !== true
) {
this.options.logError(
`permissions.defaultMode "auto" is not available for model ` +
`"${currentModelId}"; falling back to "${AUTO_MODE_FALLBACK}".`,
);
effectiveMode = AUTO_MODE_FALLBACK;
autoModeFallbackWarningPending = true;
await this.trySyncMode(query, effectiveMode, "Failed to sync clamped permissionMode to SDK:");
} else if (!this.isAvailable(availableModes, effectiveMode)) {
this.options.logError(
`permissions.defaultMode "${effectiveMode}" is not available in ` +
`this session; falling back to "default".`,
);
effectiveMode = "default";
await this.trySyncMode(query, effectiveMode, "Failed to sync clamped permissionMode to SDK:");
}
return {
modes: { currentModeId: effectiveMode, availableModes },
autoModeFallbackWarningPending,
};
}
static configOption(modes: SessionModeState): SessionConfigOption {
return {
id: MODE_CONFIG_ID,
name: "Mode",
description: "Session permission mode",
category: "mode",
type: "select",
currentValue: modes.currentModeId,
options: modes.availableModes.map((mode) => ({
value: mode.id,
name: mode.name,
description: mode.description,
_meta: mode._meta,
})),
};
}
syncConfig(session: ModeConfigSession, mode: string): void {
const previousMode = session.modes.currentModeId;
if (mode !== "plan") {
session.prePlanMode = undefined;
} else if (previousMode !== "plan") {
session.prePlanMode = previousMode;
}
session.modes = { ...session.modes, currentModeId: mode };
session.configOptions = session.configOptions.map((option) =>
option.id === MODE_CONFIG_ID && typeof option.currentValue === "string"
? { ...option, currentValue: mode }
: option,
);
}
availableModeIds(modes: SessionModeState): string[] {
return modes.availableModes.map((mode) => mode.id);
}
effectiveMode(session: SessionMode, requestedMode: PermissionMode): PermissionMode {
return requestedMode === "auto" && this.isAutoUnavailable(session)
? AUTO_MODE_FALLBACK
: requestedMode;
}
applyPermissionFallback(
session: SessionMode,
permissionResult: PermissionResult,
): { permissionResult: PermissionResult; fallbackApplied: boolean } {
const fallbackApplied =
this.isAutoUnavailable(session) &&
permissionResult.behavior === "allow" &&
permissionResult.updatedPermissions?.some(
(update) => update.type === "setMode" && update.mode === "auto",
) === true;
if (!fallbackApplied || permissionResult.behavior !== "allow") {
return { permissionResult, fallbackApplied: false };
}
return {
permissionResult: {
...permissionResult,
updatedPermissions: permissionResult.updatedPermissions?.map((update) =>
update.type === "setMode" && update.mode === "auto"
? { ...update, mode: AUTO_MODE_FALLBACK }
: update,
),
},
fallbackApplied: true,
};
}
/** Reconcile mode after a model switch. The caller rebuilds config options
* before publishing the returned state change. */
async reconcileForModel(session: SessionMode, model: ModelInfo | undefined) {
if (
session.modes.currentModeId !== "auto" ||
model === undefined ||
model.supportsAutoMode === true
) {
return false;
}
session.modes = {
availableModes: session.modes.availableModes,
currentModeId: AUTO_MODE_FALLBACK,
};
await this.trySyncMode(
session.query,
AUTO_MODE_FALLBACK,
`Failed to sync permissionMode to "${AUTO_MODE_FALLBACK}" after model switch invalidated "auto":`,
);
return true;
}
async selectMode(sessionId: string, modeId: string): Promise<PermissionMode> {
const session = this.requireOpenSession(sessionId);
const requestedMode = this.parseMode(modeId);
if (!this.isAvailable(session.modes.availableModes, requestedMode)) {
throw new Error(`Mode ${modeId} is not available in this session`);
}
const effectiveMode = this.effectiveMode(session, requestedMode);
try {
await session.query.setPermissionMode(effectiveMode);
} catch (error) {
if (error instanceof Error) {
if (!error.message) error.message = "Invalid Mode";
throw error;
}
// eslint-disable-next-line preserve-caught-error
throw new Error("Invalid Mode");
}
if (effectiveMode !== requestedMode) {
await this.publishFallbackWarning(sessionId, session);
}
return effectiveMode;
}
async setSessionMode(params: SetSessionModeRequest): Promise<SetSessionModeResponse> {
const effectiveMode = await this.selectMode(params.sessionId, params.modeId);
if (effectiveMode !== params.modeId) {
await this.publishCurrent(params.sessionId, effectiveMode);
}
await this.options.updateConfigOption(params.sessionId, MODE_CONFIG_ID, effectiveMode);
return {};
}
async publishCurrent(sessionId: string, mode: string): Promise<void> {
await this.options.sessionUpdate({
sessionId,
update: { sessionUpdate: "current_mode_update", currentModeId: mode },
});
}
async publishFallbackWarning(sessionId: string, session: SessionMode): Promise<void> {
session.autoModeFallbackWarningPending = false;
if (session.autoModeFallbackWarningShown) return;
session.autoModeFallbackWarningShown = true;
try {
await this.options.sessionUpdate({
sessionId,
update: noticeOrTranscriptUpdate(
AUTO_MODE_FALLBACK_NOTICE,
this.options.supportsNotices?.() ?? false,
noticeTranscriptText({
...AUTO_MODE_FALLBACK_NOTICE,
description: AUTO_MODE_FALLBACK_REASON,
}),
),
});
} catch (error) {
// The fallback has already been applied; a failed advisory must not turn
// the successful mode change into a failed request.
this.options.logError(`Failed to publish Auto mode fallback warning: ${error}`);
}
}
async publishFallbackState(sessionId: string, session: SessionMode): Promise<void> {
await this.publishCurrent(sessionId, AUTO_MODE_FALLBACK);
await this.publishFallbackWarning(sessionId, session);
}
private requireOpenSession(sessionId: string): S {
const session = this.options.getSession(sessionId);
if (!session) throw new Error("Session not found");
if (session.queryClosed) {
throw RequestError.internalError(undefined, this.options.sessionEndedMessage);
}
return session;
}
private isAutoUnavailable(
session: SessionMode,
modelId = session.models.currentModelId,
): boolean {
const modelInfo = session.modelInfos.find((model) => model.value === modelId);
return modelInfo !== undefined && modelInfo.supportsAutoMode !== true;
}
private isAvailable(availableModes: SessionModeState["availableModes"], modeId: string): boolean {
return availableModes.some((mode) => mode.id === modeId);
}
private parseMode(modeId: string): PermissionMode {
switch (modeId) {
case "auto":
case "default":
case "acceptEdits":
case "bypassPermissions":
case "dontAsk":
case "plan":
return modeId;
default:
throw new Error("Invalid Mode");
}
}
private buildAvailableModes(allowBypass: boolean): SessionModeState["availableModes"] {
// Only AIR gets the mode kind.
const air = this.options.airClient?.() ?? false;
const kind = (value: string) => {
const meta = airOnlyMeta(air, AIR_KIND_KEY, value);
return meta ? { _meta: meta } : {};
};
const modes: SessionModeState["availableModes"] = [
{
id: "default",
name: "Manual",
description: "Always ask before making changes",
...kind("standard"),
},
{
id: "acceptEdits",
name: "Accept edits",
description: "Automatically accept all file edits",
...kind("standard"),
},
{
id: "plan",
name: "Plan",
description: "Create a plan before making changes",
...kind("plan"),
},
{
id: "auto",
name: "Auto",
description: "Claude handles permission decisions",
...kind("auto_review"),
},
];
if (allowBypass) {
modes.push({
id: "bypassPermissions",
name: "Bypass permissions",
description: "Accepts all permissions",
...kind("full_access"),
});
}
return modes;
}
private async trySyncMode(
query: Pick<Query, "setPermissionMode">,
mode: PermissionMode,
errorMessage: string,
): Promise<void> {
try {
await query.setPermissionMode(mode);
} catch (error) {
this.options.logError(errorMessage, error);
}
}
}

509
src/session-model.ts Normal file
View File

@@ -0,0 +1,509 @@
import type { SessionConfigOption } from "@agentclientprotocol/sdk";
import type { ModelInfo, Query, Settings } from "@anthropic-ai/claude-agent-sdk";
import { AIR_RECOMMENDED_CONFIG_VALUE_CAPABILITY, withAirMeta } from "./air-extension.js";
export const MODEL_CONFIG_ID = "model";
export type SessionModelState = {
availableModels: Array<{ modelId: string; name: string; description?: string }>;
currentModelId: string;
};
type ModelLogger = {
log: (...args: unknown[]) => void;
error: (...args: unknown[]) => void;
};
type ModelSettingsSource = { getSettings(): Settings };
const MODEL_CONTEXT_HINT_PATTERN = /\[(\d+m)\]$/i;
const CONTEXT_HINT_SUFFIX_PATTERN = /-(\d+m)$/i;
const MODEL_FAMILY_VERSION_PATTERN = /\b(\d+)(?:[-.](\d+))?\b/;
const VERSIONABLE_MODEL_DISPLAY_PATTERN =
/^(?:Claude\s+)?([a-z][a-z0-9-]*)(?:\s+\d+(?:\.\d+)?)?(?:\s+\(\d+[mk]\s+context\))?$/i;
const DISPLAY_CONTEXT_SUFFIX_PATTERN = /\s+\((\d+[mk])\s+context\)$/i;
function stripContextHints(value: string): string {
return value.replace(/\[\d+m\]/gi, "").replace(CONTEXT_HINT_SUFFIX_PATTERN, "");
}
function canonicalizeModelId(value: string): string {
return value.trim().toLowerCase().replace(CONTEXT_HINT_SUFFIX_PATTERN, "[$1]");
}
function contextHintOf(value: string): string | null {
return canonicalizeModelId(value).match(MODEL_CONTEXT_HINT_PATTERN)?.[1] ?? null;
}
function extractModelFamilyVersion(value: string): string | null {
const match = stripContextHints(value).match(MODEL_FAMILY_VERSION_PATTERN);
if (!match) return null;
return match[2] ? `${match[1]}.${match[2]}` : match[1];
}
function modelVersionsCompatible(preference: string, candidate: ModelInfo): boolean {
const preferred = extractModelFamilyVersion(preference);
if (!preferred) return true;
const candidateVersion =
extractModelFamilyVersion(candidate.value) ??
extractModelFamilyVersion(candidate.displayName) ??
extractModelFamilyVersion(candidate.description);
return candidateVersion ? preferred === candidateVersion : true;
}
function displayModelVersion(model: ModelInfo, family: string): string | undefined {
const familyVersion = new RegExp(`\\b${family}[-\\s]+(\\d+)(?:[-.](\\d+))?`, "i");
// The display name is the value we are deciding whether to rewrite, so it
// cannot validate its own normalization. Require independent SDK metadata.
for (const source of [model.resolvedModel, model.description, model.value]) {
const match = source?.match(familyVersion);
if (match) return match[2] ? `${match[1]}.${match[2]}` : match[1];
}
return undefined;
}
/** Add concrete versions when a terse SDK label names the same family as the
* underlying model metadata. Multi-word/custom labels remain untouched.
* Context size remains in the option description; if normalization would
* collide, callers fall back to the original labels. */
function versionedModelDisplayName(model: ModelInfo): string {
const versionable = model.displayName.match(VERSIONABLE_MODEL_DISPLAY_PATTERN);
if (!versionable) return model.displayName;
const version = displayModelVersion(model, versionable[1]);
if (!version) return model.displayName;
const contextSuffix = model.displayName.match(DISPLAY_CONTEXT_SUFFIX_PATTERN);
const descriptionKeepsContext =
contextSuffix !== null &&
new RegExp(`\\b${contextSuffix[1]}\\s+context\\b`, "i").test(model.description);
const withoutContext = model.displayName.replace(DISPLAY_CONTEXT_SUFFIX_PATTERN, "");
if (/\b\d+(?:\.\d+)?\b/.test(withoutContext)) {
return descriptionKeepsContext ? withoutContext : model.displayName;
}
if (descriptionKeepsContext || contextSuffix === null) return `${withoutContext} ${version}`;
// Keep the suffix in its original spelling and insert the version before it.
return `${withoutContext} ${version}${contextSuffix[0]}`;
}
function tokenizeModelPreference(model: string): { tokens: string[]; contextHint?: string } {
const lower = model.trim().toLowerCase();
const contextHint = lower.match(MODEL_CONTEXT_HINT_PATTERN)?.[1]?.toLowerCase();
const tokens = lower
.replace(MODEL_CONTEXT_HINT_PATTERN, " $1 ")
.split(/[^a-z0-9]+/)
.filter(Boolean)
.map((token) => {
if (token === "opusplan") return "opus";
if (token === "best" || token === "default") return "";
return token;
})
.filter((token) => token && token !== "claude")
.filter((token) => /[a-z]/.test(token) || token.endsWith("m"));
return { tokens, contextHint };
}
function scoreModelMatch(model: ModelInfo, tokens: string[], contextHint?: string): number {
const haystack = `${model.value} ${model.displayName}`.toLowerCase();
let score = 0;
let nonHintMatched = false;
for (const token of tokens) {
if (!haystack.includes(token)) continue;
if (token !== contextHint) nonHintMatched = true;
score += token === contextHint ? 3 : 1;
}
return contextHint && !nonHintMatched ? 0 : score;
}
export function resolveModelPreference(models: ModelInfo[], preference: string): ModelInfo | null {
const trimmed = preference.trim();
if (!trimmed) return null;
const lower = trimmed.toLowerCase();
const canonicalPreference = canonicalizeModelId(trimmed);
const directMatch = models.find(
(model) =>
model.value === trimmed ||
canonicalizeModelId(model.value) === canonicalPreference ||
model.displayName.toLowerCase() === lower,
);
if (directMatch) return directMatch;
const matchesResolved = (model: ModelInfo) =>
model.resolvedModel != null && canonicalizeModelId(model.resolvedModel) === canonicalPreference;
const resolvedMatch =
models.find((model) => model.value !== "default" && matchesResolved(model)) ??
models.find(matchesResolved);
if (resolvedMatch) return resolvedMatch;
const preferenceHint = contextHintOf(trimmed);
const includesMatch = models.find((model) => {
if (!modelVersionsCompatible(trimmed, model)) return false;
if (contextHintOf(model.value) !== preferenceHint) return false;
const value = model.value.toLowerCase();
const display = model.displayName.toLowerCase();
return value.includes(lower) || display.includes(lower) || lower.includes(value);
});
if (includesMatch) return includesMatch;
const { tokens, contextHint } = tokenizeModelPreference(trimmed);
if (tokens.length === 0) return null;
let bestMatch: ModelInfo | null = null;
let bestScore = 0;
for (const model of models) {
if (!modelVersionsCompatible(trimmed, model)) continue;
const score = scoreModelMatch(model, tokens, contextHint);
if (score > 0 && (!bestMatch || score > bestScore)) {
bestMatch = model;
bestScore = score;
}
}
return bestMatch;
}
export function matchResumedModel(models: ModelInfo[], liveModel: string): ModelInfo {
const live = canonicalizeModelId(liveModel);
const defaultEntry = models.find((model) => model.value === "default");
const defaultResolved = defaultEntry?.resolvedModel
? canonicalizeModelId(defaultEntry.resolvedModel)
: undefined;
if (defaultEntry && defaultResolved === live) return defaultEntry;
const exactMatch = models.find(
(model) => model.resolvedModel && canonicalizeModelId(model.resolvedModel) === live,
);
if (exactMatch) return exactMatch;
if (
defaultEntry &&
defaultResolved &&
stripContextHints(defaultResolved) === stripContextHints(live)
) {
return defaultEntry;
}
return (
resolveModelPreference(models, liveModel) ?? {
value: liveModel,
displayName: liveModel,
description: "",
}
);
}
export function buildModelConfigOption(
models: SessionModelState,
modelInfos: ModelInfo[],
useRecommendedValue: boolean,
): SessionConfigOption {
const defaultInfo = modelInfos.find((model) => model.value === "default");
const selectableIds = new Set(models.availableModels.map((model) => model.modelId));
const concreteInfos = modelInfos.filter(
(model) => model.value !== "default" && selectableIds.has(model.value),
);
// Recommendations describe the running default, so fuzzy family matching
// must never substitute a different generation or context window.
const defaultResolved = defaultInfo?.resolvedModel;
const recommended = defaultResolved
? (concreteInfos.find(
(model) =>
canonicalizeModelId(model.resolvedModel ?? model.value) ===
canonicalizeModelId(defaultResolved),
) ?? null)
: null;
const concreteRecommendation = useRecommendedValue && recommended !== null;
const available = concreteRecommendation
? models.availableModels.filter((model) => model.modelId !== "default")
: models.availableModels;
return {
id: MODEL_CONFIG_ID,
name: "Model",
description: "AI model to use",
category: "model",
type: "select",
currentValue:
concreteRecommendation && models.currentModelId === "default"
? recommended.value
: models.currentModelId,
...(concreteRecommendation
? {
_meta: withAirMeta(undefined, AIR_RECOMMENDED_CONFIG_VALUE_CAPABILITY, recommended.value),
}
: {}),
options: available.map((model) => {
if (model.modelId === "default" && defaultInfo?.resolvedModel) {
const named = modelInfos.find(
(info) => info.value !== "default" && info.resolvedModel === defaultInfo.resolvedModel,
);
return {
value: model.modelId,
name: model.name,
description: named?.displayName ?? defaultInfo.resolvedModel,
};
}
return {
value: model.modelId,
name: model.name,
description: model.description ?? undefined,
};
}),
};
}
function resolveSettingsModel(
models: ModelInfo[],
settingsModel: unknown,
logger: ModelLogger,
): ModelInfo | null {
if (settingsModel === undefined) {
return null;
}
if (typeof settingsModel !== "string") {
const typeLabel = settingsModel === null ? "null" : typeof settingsModel;
logger.error(`Ignoring model from settings: expected a string, got ${typeLabel}.`);
return null;
}
return resolveModelPreference(models, settingsModel);
}
const MODEL_FAMILY_ALIASES = new Set(["opus", "sonnet", "haiku", "fable"]);
/** A model id without the spellings `deniedModels` ignores: provider
* prefixes, dates, version suffixes, `-fast` and context hints. */
function normalizeDeniedModelId(value: string): string {
let id = stripContextHints(value.trim().toLowerCase());
const providerPrefix = id.lastIndexOf("anthropic.");
if (providerPrefix !== -1) id = id.slice(providerPrefix + "anthropic.".length);
return id
.replace(/@.*$/, "")
.replace(/-v\d+(?::\d+)?$/, "")
.replace(/-fast$/, "")
.replace(/-\d{8}$/, "");
}
/**
* Whether managed `deniedModels` blocks a model id, following the CLI's rules
* closely enough for the picker: a family alias blocks the whole family, and a
* model id blocks that version in every spelling plus the later minor versions
* it prefixes (`claude-opus-5` also blocks `claude-opus-5-5`). The CLI stays
* the enforcer; this only keeps the picker from offering a refused row.
*/
export function isDeniedModel(modelId: string, deniedModels: readonly string[]): boolean {
const id = normalizeDeniedModelId(modelId);
if (!id) return false;
return deniedModels.some((entry) => {
const denied = normalizeDeniedModelId(entry);
if (!denied) return false;
if (MODEL_FAMILY_ALIASES.has(denied)) return id === denied || id.includes(`-${denied}`);
return id === denied || id.startsWith(`${denied}-`);
});
}
/**
* Restrict the SDK's model list to the user's `availableModels` allowlist
* (already merged-and-deduped across settings sources by `SettingsManager`).
* The user's exact entries become the model IDs surfaced via configOptions
* and passed to `setModel`, which prevents Claude Code from silently
* substituting a date-pinned variant (e.g. `haiku` →
* `claude-haiku-4-5-20251001`) that the user may not have access to.
*
* Display info and capability flags are copied from the closest SDK match so
* the UI still renders sensible names and effort levels.
*
* Semantics from https://code.claude.com/docs/en/model-config#restrict-model-selection:
* - `undefined` is handled by the caller (no allowlist applied).
* - The Default option is unaffected by `availableModels` — it always remains
* available, even when the allowlist is `[]`.
* - Managed `deniedModels` wins over the allowlist, so a denied entry is
* dropped even though the CLI would otherwise leave it unmatched.
*/
export function applyAvailableModelsAllowlist(
sdkModels: ModelInfo[],
allowlist: string[],
settingsModelOverrides?: Record<string, string>,
deniedModels: readonly string[] = [],
): ModelInfo[] {
// Default is always preserved per the docs. Synthesize one if the SDK
// didn't surface it so downstream code (e.g. `getAvailableModels` picking
// `models[0]` as a fallback) still has something to work with.
const defaultModel = sdkModels.find((m) => m.value === "default") ?? {
value: "default",
displayName: "Default",
description: "",
};
const result: ModelInfo[] = [defaultModel];
const seen = new Set<string>([defaultModel.value]);
const sdkModelsWithoutDefault = sdkModels.filter((m) => m.value !== "default");
// Bedrock/Vertex deployments enforce short aliases (e.g. "claude-opus-4-6")
// in availableModels but require provider-specific IDs at the API. We still
// resolve `sdkMatch` against the alias (`trimmed`) — that's what the
// matching heuristics above are built for, and override targets (ARNs,
// opaque provider IDs) often won't textually resemble anything in
// `sdkModelsWithoutDefault`. Only the entry's surfaced `value` becomes the
// override target, so it's what `setModel` ends up passing to the API.
for (const entry of allowlist) {
const trimmed = entry.trim();
if (!trimmed || seen.has(trimmed)) continue;
const overridden = settingsModelOverrides?.[trimmed];
const effective = overridden ?? trimmed;
if (seen.has(effective)) continue;
const sdkMatch = resolveModelPreference(sdkModelsWithoutDefault, trimmed);
if (
[trimmed, effective, sdkMatch?.resolvedModel].some(
(id) => id != null && isDeniedModel(id, deniedModels),
)
) {
continue;
}
if (sdkMatch) {
result.push({ ...sdkMatch, value: effective });
} else {
result.push({ value: effective, displayName: trimmed, description: "" });
}
seen.add(effective);
}
// The custom model option (ANTHROPIC_CUSTOM_MODEL_OPTION) is exempt from the
// allowlist, the same way Default is. Per the model-config docs it adds an
// entry "without replacing the built-in aliases" and "appears at the bottom of
// the /model picker", so we append it last and skip the allowlist filter; this
// keeps a slim alias allowlist from hiding the custom model row.
// https://code.claude.com/docs/en/model-config#add-a-custom-model-option
const customModelOption = process.env.ANTHROPIC_CUSTOM_MODEL_OPTION?.trim();
if (customModelOption && !seen.has(customModelOption)) {
const customModel = sdkModels.find((m) => m.value === customModelOption);
if (customModel) {
result.push(customModel);
seen.add(customModel.value);
}
}
return result;
}
/** Whether a rejected `setModel` was vetoed by a user-configured
* PreModelSwitch hook. The CLI's rejection message is the stable,
* distinguishable marker ("Model switch blocked by a PreModelSwitch hook:
* <reason>"); a format change makes this stop matching and the failure
* falls back to the ordinary fail-loud path, no worse than before. */
function isPreModelSwitchHookBlock(error: unknown): boolean {
return error instanceof Error && error.message.includes("blocked by a PreModelSwitch hook");
}
export async function getAvailableModels(
query: Query,
models: ModelInfo[],
sdkModels: ModelInfo[],
settingsManager: ModelSettingsSource,
logger: ModelLogger,
isResumedSession: boolean,
sessionId: string,
resumedModelHint?: string,
): Promise<SessionModelState> {
const settings = settingsManager.getSettings();
let currentModel = models[0];
let resolvedFromInput: string | undefined;
// Model priority (highest to lowest):
// 1. ANTHROPIC_MODEL environment variable
// 2. settings.model (user configuration)
// 3. the resumed session's live model (resumed sessions only)
// 4. models[0] (default first model)
if (process.env.ANTHROPIC_MODEL) {
const match = resolveModelPreference(models, process.env.ANTHROPIC_MODEL);
if (match) {
currentModel = match;
resolvedFromInput = process.env.ANTHROPIC_MODEL;
}
} else if (typeof settings.model === "string") {
const match = resolveSettingsModel(models, settings.model, logger);
if (match) {
currentModel = match;
resolvedFromInput = settings.model;
}
}
// A resumed session restores the model from its last real assistant
// transcript record. Use that same local record instead of getContextUsage:
// the latter is a control request to the live CLI process and can add tens
// of seconds to session/load before its first turn. No `setModel` here: the
// SDK is already running this model, and pushing a picker alias back (e.g.
// "opus[1m]") could change the live model rather than describe it.
if (resolvedFromInput === undefined && isResumedSession) {
currentModel = resumedModelHint ? matchResumedModel(models, resumedModelHint) : currentModel;
}
// Skip the setModel round-trip when we can prove the SDK has already landed
// on the same model. Two cases qualify:
// (a) No override applied — currentModel is the SDK's own default (or, on
// resume, the live model read back from the SDK above); nothing to sync.
// (b) The resolver returned the user's input verbatim AND that value exists
// in the SDK's original model list — meaning no fuzzy match or
// allowlist rewrite was involved, and the SDK (which reads the same
// ANTHROPIC_MODEL / settings.json) will have arrived at the same entry.
// This only holds for fresh sessions: a resumed session lands on the
// transcript's model regardless of env/settings, so the override must
// be re-asserted to keep the reported model truthful.
// Anything else (fuzzy match, allowlist-synthesized value, alias) gets a
// setModel call so we don't drift from the user's intended pin.
const sdkSawSameValue = sdkModels.some((m) => m.value === currentModel.value);
const skipSetModel =
resolvedFromInput === undefined ||
(!isResumedSession && currentModel.value === resolvedFromInput && sdkSawSameValue);
if (!skipSetModel) {
const setModelStartedAt = performance.now();
try {
await query.setModel(currentModel.value);
logger.log(
`[session/models] sessionId=${sessionId} phase=set-model durationMs=${Math.round(performance.now() - setModelStartedAt)} model=${currentModel.value} outcome=success`,
);
} catch (error) {
logger.log(
`[session/models] sessionId=${sessionId} phase=set-model durationMs=${Math.round(performance.now() - setModelStartedAt)} model=${currentModel.value} outcome=error`,
);
// On a fresh session the pin is a defining option — fail loudly. A
// resumed session already runs fine on the transcript's model, so
// failing the whole session/load over the re-assert would be worse
// than loading with the pin unapplied (mirrors the setPermissionMode
// containment in createSession). The SDK then stayed on the
// transcript's model, so read that back rather than reporting the
// pin the session isn't running.
//
// One fresh-session failure is advisory, not defining: a
// user-configured PreModelSwitch hook can veto the pin (CLI 2.1.251+;
// 'deny', or 'ask' — which headless sessions refuse), and the SDK
// rejects setModel with "Model switch blocked by a PreModelSwitch
// hook: …". Terminal Claude Code never lets a hook veto its startup
// model (the spawn model isn't a switch), so failing session/new here
// would make the same hook config fatal only over ACP. The session
// stays on the SDK's own default — report that. We can't read the
// live model back on this path: getContextUsage isn't serviced on a
// fresh session until the first prompt turn (issues #886/#880).
if (!isResumedSession) {
if (!isPreModelSwitchHookBlock(error)) throw error;
logger.error(
`Model pin "${currentModel.value}" was vetoed by a PreModelSwitch hook; staying on the default model:`,
error,
);
currentModel = models[0];
} else {
logger.error(`Failed to re-assert model "${currentModel.value}" on resume:`, error);
currentModel = resumedModelHint ? matchResumedModel(models, resumedModelHint) : models[0];
}
}
}
const displayNames = models.map(versionedModelDisplayName);
const displayNameCounts = new Map<string, number>();
for (const name of displayNames) {
displayNameCounts.set(name, (displayNameCounts.get(name) ?? 0) + 1);
}
return {
availableModels: models.map((model, index) => ({
modelId: model.value,
name:
displayNameCounts.get(displayNames[index]) === 1 ? displayNames[index] : model.displayName,
description: model.description,
})),
currentModelId: currentModel.value,
};
}

96
src/session-notices.ts Normal file
View File

@@ -0,0 +1,96 @@
import type { ClientCapabilities, SessionNotification } from "@agentclientprotocol/sdk";
/** Fire-and-forget advisory text for the user: live events rather than
* conversation history. See the ACP Session Notices RFD
* (https://agentclientprotocol.com/rfds/session-notices). */
export type SessionNotice = {
severity: "info" | "warning" | "error";
/** Plain text that stands alone. */
title: string;
/** Plain-text detail or guidance. */
description?: string;
};
/** Longest free-form line that may serve as a notice title on its own. Past
* this the text moves to `description` under a generic title. */
export const MAX_NOTICE_TITLE_LENGTH = 256;
/** Whether the Client advertised `clientCapabilities.session.notices`. Agents
* MUST NOT send `notice` updates otherwise; the alternative is a bold-label
* transcript line, which was the only way to flag these before. */
export function clientSupportsNotices(capabilities?: ClientCapabilities | null): boolean {
const notices = capabilities?.session?.notices;
return typeof notices === "object" && notices !== null && !Array.isArray(notices);
}
export function noticeUpdate(notice: SessionNotice): SessionNotification["update"] {
return {
sessionUpdate: "notice",
severity: notice.severity,
title: notice.title,
...(notice.description ? { description: notice.description } : {}),
};
}
/** The transcript rendering of a notice for clients without the capability. */
export function noticeTranscriptText(notice: SessionNotice): string {
return notice.description ? `**${notice.title}:** ${notice.description}` : `**${notice.title}**`;
}
/** The update to send for `notice`: a `notice` when the client can present
* one, else an agent message carrying `transcriptText` (by default the
* bold-label rendering of the notice) and `transcriptMeta`, so clients
* without the capability can still tell the line apart from Claude's reply. */
export function noticeOrTranscriptUpdate(
notice: SessionNotice,
supportsNotices: boolean,
transcriptText: string = noticeTranscriptText(notice),
transcriptMeta?: Record<string, unknown>,
): SessionNotification["update"] {
if (supportsNotices) return noticeUpdate(notice);
return {
sessionUpdate: "agent_message_chunk",
content: { type: "text", text: transcriptText },
...(transcriptMeta ? { _meta: transcriptMeta } : {}),
};
}
/** Fragments that read on after a bold label stand alone as a notice
* description, so start them with a capital. */
export function sentenceCase(text: string): string {
return text.charAt(0).toUpperCase() + text.slice(1);
}
/** Collapses whitespace so a text shown as a notice can be recognized when
* the SDK repeats it elsewhere (a hook-blocked turn's result, for one). */
export function normalizeNoticeText(text: string): string {
return text.trim().replace(/\s+/g, " ");
}
/** Notice fields are plain text. Free-form SDK/hook output may carry light
* markdown that a transcript would render; drop the inline markers rather
* than show literal asterisks and backticks in a toast. */
export function noticePlainText(text: string): string {
return text
.replace(/^[ \t]*#{1,6}[ \t]+/gm, "")
.replace(/(\*\*|__)(?=\S)([\s\S]*?\S)\1/g, "$2")
.replace(/(?<![\w`])`([^`\n]+)`(?![\w`])/g, "$1");
}
/** Shapes free-form text into a notice title plus optional description: the
* first line stands as the title when it is short enough, otherwise the whole
* text becomes the description under `fallbackTitle`. */
export function splitNoticeText(
text: string,
fallbackTitle: string,
): Pick<SessionNotice, "title" | "description"> {
const trimmed = noticePlainText(text).trim();
if (!trimmed) return { title: fallbackTitle };
const lineBreak = trimmed.search(/\r?\n/);
const firstLine = lineBreak === -1 ? trimmed : trimmed.slice(0, lineBreak).trimEnd();
const rest = lineBreak === -1 ? "" : trimmed.slice(lineBreak).trim();
if (firstLine.length > MAX_NOTICE_TITLE_LENGTH) {
return { title: fallbackTitle, description: trimmed };
}
return rest ? { title: firstLine, description: rest } : { title: firstLine };
}

27
src/session-timing.ts Normal file
View File

@@ -0,0 +1,27 @@
type TimingLogger = {
log: (...args: unknown[]) => void;
};
/** Small phase timer for session lifecycle diagnostics. */
export class SessionTiming {
private readonly startedAt: number;
private phaseStartedAt: number;
constructor(
private readonly logger: TimingLogger | undefined,
private readonly operation: string,
private readonly sessionId: string,
startedAt = performance.now(),
) {
this.startedAt = startedAt;
this.phaseStartedAt = startedAt;
}
phase(name: string, detail = ""): void {
const finishedAt = performance.now();
this.logger?.log(
`[session/${this.operation}] sessionId=${this.sessionId} phase=${name} durationMs=${Math.round(finishedAt - this.phaseStartedAt)} totalMs=${Math.round(finishedAt - this.startedAt)}${detail}`,
);
this.phaseStartedAt = finishedAt;
}
}

246
src/session-titles.ts Normal file
View File

@@ -0,0 +1,246 @@
/**
* AI-generated session titles.
*
* Claude Code's own auto-title generation never runs under the Agent SDK — the
* latch that arms it is pre-set in the headless path — so `SDKSessionInfo.summary`
* degrades to the raw first prompt. This module asks the CLI for a real title
* instead, via the `generate_session_title` control request, and publishes it
* over ACP as a `session_info_update`.
*
* {@link SessionTitles} holds the per-session state and is owned by `Session`.
* `acp-agent.ts` drives it from four places: {@link SessionTitles.onPrompt} and
* {@link SessionTitles.onAssistantText} to collect text,
* {@link SessionTitles.onTurnEnd} at `session_state_changed: idle`, and
* {@link SessionTitles.reset} on `conversation_reset`.
*/
import type { ContentBlock, PromptRequest } from "@agentclientprotocol/sdk";
import { getSessionInfo, type Query, type SDKSessionInfo } from "@anthropic-ai/claude-agent-sdk";
import type { ClaudeAcpAgent, Session } from "./acp-agent.js";
const MAX_TITLE_LENGTH = 256;
/** How much session text the title is generated from. The CLI caps its own
* title input at the same 1000 trailing characters. */
const MAX_TITLE_CONTEXT_LENGTH = 1000;
/** Below this the generator returns null without calling the model, so there is
* nothing to gain by asking yet. */
const MIN_TITLE_CONTEXT_LENGTH = 10;
/** `generateSessionTitle` is present on the SDK's runtime `Query` class but is
* not declared in `sdk.d.ts` (0.3.220), so it is reached through this optional
* shape rather than the published interface. */
type TitleCapableQuery = Query & {
generateSessionTitle?: (
description: string,
options?: { persist?: boolean },
) => Promise<string | null>;
};
/** A title already stored for the session, published when generation is
* unavailable or yields nothing. */
type TitleFallback = { title: string; lastModified: number };
export function sanitizeTitle(text: string): string {
// Replace newlines and collapse whitespace
const sanitized = text
.replace(/[\r\n]+/g, " ")
.replace(/\s+/g, " ")
.trim();
if (sanitized.length <= MAX_TITLE_LENGTH) {
return sanitized;
}
return sanitized.slice(0, MAX_TITLE_LENGTH - 1) + "…";
}
/** Rolling text a title is generated from: `previous` plus `text`, keeping only
* the trailing {@link MAX_TITLE_CONTEXT_LENGTH} characters. */
export function appendTitleContext(previous: string | undefined, text: string): string {
const next = (previous ?? "") + text;
return next.length > MAX_TITLE_CONTEXT_LENGTH ? next.slice(-MAX_TITLE_CONTEXT_LENGTH) : next;
}
/** Whether this SDK still offers on-demand title generation. */
function supportsTitleGeneration(query: Query): boolean {
return typeof (query as TitleCapableQuery).generateSessionTitle === "function";
}
/** One session's title: the text a generated title is derived from, whether a
* title has been settled on, and the last one published. Created with the
* session and reachable as `session.titles`. */
export class SessionTitles {
/** Last title pushed to the client via `session_info_update`, so an unchanged
* title is never re-notified. Undefined until the first push. */
private lastTitle?: string;
/** Rolling tail of this session's own user + assistant text, capped at
* {@link MAX_TITLE_CONTEXT_LENGTH}. Dropped once a title exists. */
private context?: string;
/** Set once this session has a title or has asked for one. A title is
* generated at most once per session: the SDK reports a generated title in
* the same field as a user `/rename`, so re-titling could silently overwrite
* one. Released by {@link reset}, and when generation yields nothing. */
private settled = false;
constructor(
private readonly agent: ClaudeAcpAgent,
private readonly sessionId: string,
) {}
/** Collect a prompt's own text for the title, skipping openers not worth
* titling after. No-op once the title is settled. */
onPrompt(prompt: PromptRequest["prompt"]): void {
if (this.settled) {
return;
}
const promptText = prompt
.flatMap((chunk) => (chunk.type === "text" ? [chunk.text] : []))
.join("\n");
this.context = appendTitleContext(this.context, `\n${promptText}\n`);
}
/** Collect the assistant's own answer for the title. Chunks are appended
* verbatim so streamed text reassembles. No-op once the title is settled. */
onAssistantText(content: ContentBlock): void {
if (this.settled || content.type !== "text") {
return;
}
this.context = appendTitleContext(this.context, content.text);
}
/** Drop the title state so the next turn re-evaluates. Used on
* `conversation_reset`, which mounts a fresh transcript. */
reset(): void {
this.settled = false;
this.context = undefined;
this.lastTitle = undefined;
}
/** Turn-end title handling. `idle` is the SDK's turn-over signal, so it is
* when a title may have landed or become generatable.
*
* `info.customTitle` is non-empty only once the session file holds a real
* title — a user `/rename` or one generated earlier; the SDK folds both into
* that one field. Adopt it and latch, so neither is ever titled over.
*
* With no title yet, ask the SDK to generate one in the background: it is a
* ~2s small-model call and turn-end must not wait on it. Only when that is
* not possible do we fall back to `summary`, which for an SDK-driven session
* is just the raw first prompt. */
async onTurnEnd(session: Session): Promise<void> {
const info = await this.readSessionInfo(session);
if (info?.customTitle) {
this.settled = true;
this.context = undefined;
await this.publish(info.customTitle, info.lastModified);
return;
}
const fallback = info?.summary
? { title: info.summary, lastModified: info.lastModified }
: undefined;
if (this.canRequest(session)) {
this.settled = true;
void this.requestGenerateTitle(session, fallback).catch((error) => {
this.agent.logger.error(`Session ${this.sessionId}: session title update failed: ${error}`);
});
return;
}
// Only while this session has no title of its own: `summary` degrades to the
// raw first prompt, which must never overwrite a generated title if the
// persisted one is slow to show up in `info`.
if (fallback && !this.settled) {
await this.publish(fallback.title, fallback.lastModified);
}
}
/** Read the SDK's stored info for this session. A missing session file or read
* error is non-fatal: the title is best-effort and another turn will retry. */
private async readSessionInfo(session: Session): Promise<SDKSessionInfo | undefined> {
try {
return await getSessionInfo(this.sessionId, { dir: session.cwd });
} catch (error) {
this.agent.logger.error(`Session ${this.sessionId}: failed to read session info: ${error}`);
return undefined;
}
}
/** Notify the client of a title, unless it is the one we last sent. */
private async publish(rawTitle: string, lastModified: number): Promise<void> {
const title = sanitizeTitle(rawTitle);
if (title === this.lastTitle) {
return;
}
this.lastTitle = title;
await this.agent.client.sessionUpdate({
sessionId: this.sessionId,
update: {
sessionUpdate: "session_info_update",
title,
updatedAt: new Date(lastModified).toISOString(),
},
});
}
/** Whether to ask the SDK for a generated title now: once per session, on a
* live query, with enough collected text for the generator to work with. */
private canRequest(session: Session): boolean {
if (this.settled || session.queryClosed || session.cancelled) {
return false;
}
if (!supportsTitleGeneration(session.query)) {
return false;
}
return (this.context?.trim().length ?? 0) >= MIN_TITLE_CONTEXT_LENGTH;
}
/** Generate a title from the session's own text and publish it. `persist`
* writes it to the session file, which is what carries it into
* `session/list` and `session/load`. A null or failed generation releases the
* latch so a later turn retries, and publishes `fallback` (the stored
* summary) so a backend that can't generate titles is no worse off than
* before. */
private async requestGenerateTitle(
session: Session,
fallback: TitleFallback | undefined,
): Promise<void> {
const description = this.context?.trim() ?? "";
let title: string | null = null;
try {
title =
(await (session.query as TitleCapableQuery).generateSessionTitle?.(description, {
persist: true,
})) ?? null;
} catch (error) {
this.agent.logger.error(
`Session ${this.sessionId}: failed to generate a session title: ${error}`,
);
}
// A session torn down or replaced while the title was in flight must not
// adopt it.
if (this.agent.sessions[this.sessionId] !== session) {
return;
}
if (!title) {
this.settled = false;
if (fallback) {
await this.publish(fallback.title, fallback.lastModified);
}
return;
}
this.context = undefined;
await this.publish(title, Date.now());
}
}

View File

@@ -7,7 +7,7 @@ import {
resolveSettings,
type Settings,
} from "@anthropic-ai/claude-agent-sdk";
import { CLAUDE_CONFIG_DIR } from "./acp-agent.js";
import { claudeConfigDir } from "./paths.js";
/**
* Permission rule format examples:
@@ -49,6 +49,7 @@ export interface SettingsManagerOptions {
export class SettingsManager {
private cwd: string;
private effective: Settings = {};
private managedDeniedModels: string[] = [];
private watchers: fs.FSWatcher[] = [];
private onChange?: () => void;
private logger: { log: (...args: any[]) => void; error: (...args: any[]) => void };
@@ -91,7 +92,7 @@ export class SettingsManager {
*/
private getWatchedPaths(): string[] {
return [
path.join(CLAUDE_CONFIG_DIR, "settings.json"),
path.join(claudeConfigDir(), "settings.json"),
path.join(this.cwd, ".claude", "settings.json"),
path.join(this.cwd, ".claude", "settings.local.json"),
getManagedSettingsPath(),
@@ -106,9 +107,14 @@ export class SettingsManager {
try {
const resolved = await resolveSettings({ cwd: this.cwd });
this.effective = filterEscalatingDefaultMode(resolved);
// The CLI reads `deniedModels` from managed settings only.
this.managedDeniedModels = resolved.sources
.filter((entry) => entry.source === "managed")
.flatMap((entry) => entry.settings.deniedModels ?? []);
} catch (error) {
this.logger.error("Failed to resolve settings:", error);
this.effective = {};
this.managedDeniedModels = [];
}
}
@@ -171,6 +177,14 @@ export class SettingsManager {
return this.effective;
}
/**
* `deniedModels` entries from the managed tier, the only tier the CLI
* honors them from.
*/
getManagedDeniedModels(): string[] {
return this.managedDeniedModels;
}
/**
* Returns the current working directory
*/

54
src/subagent-history.ts Normal file
View File

@@ -0,0 +1,54 @@
import { getSessionInfo } from "@anthropic-ai/claude-agent-sdk";
import { readdir, readFile } from "node:fs/promises";
import path from "node:path";
import { findTranscript } from "./resumed-session.js";
/** Where the subagent transcripts of a session are. */
export interface SubagentHistory {
/** The subagent id of each Agent or Task tool use that launched a subagent. */
ids: Map<string, string>;
/**
* The project directory of the session, as the SDK takes it in `dir`. With
* it, the SDK reads a subagent transcript without a search of every project.
*/
dir?: string;
}
/**
* Finds the subagent transcripts of a session.
*
* Claude keeps the history of a subagent in its own transcript,
* `<session>/subagents/agent-<id>.jsonl`, next to the session transcript.
* The `agent-<id>.meta.json` file beside it names the launching tool use.
* The ids are empty for a session without a local transcript.
*/
export async function subagentHistory(sessionId: string): Promise<SubagentHistory> {
const ids = new Map<string, string>();
const transcript = await findTranscript(sessionId);
if (!transcript) return { ids };
const directory = path.join(path.dirname(transcript), sessionId, "subagents");
let names: string[];
try {
names = await readdir(directory);
} catch {
return { ids };
}
await Promise.all(
names.map(async (name) => {
const match = /^agent-(.+)\.meta\.json$/.exec(name);
if (!match) return;
try {
const meta: unknown = JSON.parse(await readFile(path.join(directory, name), "utf8"));
const toolUseId = (meta as { toolUseId?: unknown } | null)?.toolUseId;
if (typeof toolUseId === "string") ids.set(toolUseId, match[1]!);
} catch {
// A damaged meta file leaves its subagent without history.
}
}),
);
if (ids.size === 0) return { ids };
// The folder name encodes the project directory, and the encoding loses
// characters. The session info reads it back from the transcript.
const dir = (await getSessionInfo(sessionId).catch(() => undefined))?.cwd;
return dir ? { ids, dir } : { ids };
}

View File

@@ -94,7 +94,119 @@ describe("ClaudeAcpAgent settings", () => {
expect(getCapturedOptions().permissionMode).toBe("dontAsk");
expect(getCapturedOptions().settingSources).toEqual(["user", "project", "local"]);
expect(response.modes.currentModeId).toBe("dontAsk");
expect(response.modes.currentModeId).toBe("default");
}, 15_000);
it.each([
{ recommended: false, setting: undefined, explicit: undefined, expected: "default" },
{ recommended: false, setting: "low", explicit: "high", expected: "high" },
{ recommended: true, setting: undefined, explicit: undefined, expected: "medium" },
{ recommended: true, setting: "high", explicit: undefined, expected: "high" },
{ recommended: true, setting: "high", explicit: "max", expected: "max" },
])(
"initial effort reflects SDK state: %j",
async ({ recommended, setting, explicit, expected }) => {
await fs.promises.writeFile(
path.join(tempDir, "settings.json"),
JSON.stringify({ effortLevel: setting }),
);
const applyFlagSettings = vi.fn();
querySpy.mockReturnValue(
makeMockQuery({
initializationResult: async () => ({
models: [
{
value: "default",
displayName: "Default",
description: "",
supportsEffort: true,
supportedEffortLevels: ["low", "medium", "high", "max"],
},
],
}),
applyFlagSettings,
}),
);
const { ClaudeAcpAgent } = await import("../acp-agent.js");
const agent = new ClaudeAcpAgent(createMockClient());
if (recommended) {
(agent as any).clientCapabilities = {
_meta: { jetbrains: { air: { version: 1, capabilities: ["recommendedValue"] } } },
};
}
const response = await (agent as any).createSession({
cwd: tempDir,
mcpServers: [],
_meta: { disableBuiltInTools: true, claudeCode: { options: { effort: explicit } } },
});
expect(
response.configOptions.find((option: any) => option.id === "effort").currentValue,
).toBe(expected);
if (recommended) {
expect(applyFlagSettings).toHaveBeenCalledWith({ effortLevel: expected });
} else {
expect(applyFlagSettings).not.toHaveBeenCalled();
}
expect(agent.sessions[response.sessionId].effortPinnedLevel).toBe(explicit);
expect(agent.sessions[response.sessionId].appliedEffortLevel).toBe(
recommended ? expected : explicit,
);
},
);
it("seeds effort from higher-priority programmatic model settings", async () => {
await fs.promises.writeFile(
path.join(tempDir, "settings.json"),
JSON.stringify({
effortLevel: "high",
modelSettings: { "claude-sonnet-5[1m]": { effortLevel: "high" } },
}),
);
const applyFlagSettings = vi.fn();
querySpy.mockReturnValue(
makeMockQuery({
initializationResult: async () => ({
models: [
{
value: "sonnet[1m]",
resolvedModel: "claude-sonnet-5[1m]",
displayName: "Sonnet",
description: "",
supportsEffort: true,
supportedEffortLevels: ["low", "medium", "high"],
},
],
}),
applyFlagSettings,
}),
);
const { ClaudeAcpAgent } = await import("../acp-agent.js");
const agent = new ClaudeAcpAgent(createMockClient());
(agent as any).clientCapabilities = {
_meta: { jetbrains: { air: { version: 1, capabilities: ["recommendedValue"] } } },
};
const response = await (agent as any).createSession({
cwd: tempDir,
mcpServers: [],
_meta: {
disableBuiltInTools: true,
claudeCode: {
options: {
settings: {
effortLevel: "medium",
modelSettings: { "claude-sonnet-5-1m": { effortLevel: "low" } },
},
},
},
},
});
expect(response.configOptions.find((option: any) => option.id === "effort").currentValue).toBe(
"low",
);
expect(applyFlagSettings).toHaveBeenCalledWith({ effortLevel: "low" });
expect(agent.sessions[response.sessionId].effortSettingsOverride?.effortLevel).toBe("medium");
});
it("supports acceptEdits mode defaults", async () => {
@@ -150,6 +262,79 @@ describe("ClaudeAcpAgent settings", () => {
expect(response.modes.currentModeId).toBe("default");
});
it("honors the host opt-out from bypassPermissions", async () => {
await fs.promises.writeFile(
path.join(tempDir, "settings.json"),
JSON.stringify({ permissions: { defaultMode: "bypassPermissions" } }),
);
const projectDir = path.join(tempDir, "project");
await fs.promises.mkdir(projectDir, { recursive: true });
const { getCapturedOptions } = mockQuery();
const { ClaudeAcpAgent } = await import("../acp-agent.js");
const agent: ClaudeAcpAgentType = new ClaudeAcpAgent(createMockClient());
(agent as any).logger = { log: () => {}, error: () => {} };
const response = await (agent as any).createSession({
cwd: projectDir,
mcpServers: [],
_meta: {
disableBuiltInTools: true,
claudeCode: { options: { allowDangerouslySkipPermissions: false } },
},
});
expect(getCapturedOptions().allowDangerouslySkipPermissions).toBe(false);
expect(getCapturedOptions().permissionMode).toBe("default");
expect(response.modes.currentModeId).toBe("default");
expect(response.modes.availableModes.map((mode: { id: string }) => mode.id)).not.toContain(
"bypassPermissions",
);
});
it.each(["user", "project"] as const)(
"honors permissions.disableBypassPermissionsMode from %s settings",
async (tier) => {
const projectDir = path.join(tempDir, "project");
await fs.promises.mkdir(path.join(projectDir, ".claude"), { recursive: true });
await fs.promises.writeFile(
path.join(tempDir, "settings.json"),
JSON.stringify({
permissions: {
defaultMode: "bypassPermissions",
...(tier === "user" ? { disableBypassPermissionsMode: "disable" } : {}),
},
}),
);
if (tier === "project") {
await fs.promises.writeFile(
path.join(projectDir, ".claude", "settings.json"),
JSON.stringify({ permissions: { disableBypassPermissionsMode: "disable" } }),
);
}
const { getCapturedOptions } = mockQuery();
const { ClaudeAcpAgent } = await import("../acp-agent.js");
const agent: ClaudeAcpAgentType = new ClaudeAcpAgent(createMockClient());
(agent as any).logger = { log: () => {}, error: () => {} };
const response = await (agent as any).createSession({
cwd: projectDir,
mcpServers: [],
_meta: { disableBuiltInTools: true },
});
expect(getCapturedOptions().allowDangerouslySkipPermissions).toBe(false);
expect(getCapturedOptions().permissionMode).toBe("default");
expect(response.modes.currentModeId).toBe("default");
expect(response.modes.availableModes.map((mode: { id: string }) => mode.id)).not.toContain(
"bypassPermissions",
);
},
);
it("defaults to 'default' when no permissions.defaultMode is set", async () => {
const projectDir = path.join(tempDir, "project");
await fs.promises.mkdir(projectDir, { recursive: true });
@@ -253,7 +438,7 @@ describe("ClaudeAcpAgent settings", () => {
};
}
it("omits `auto` from availableModes when the resolved model lacks supportsAutoMode", async () => {
it("advertises `auto` when the resolved model lacks supportsAutoMode", async () => {
const projectDir = path.join(tempDir, "project");
await fs.promises.mkdir(projectDir, { recursive: true });
@@ -276,10 +461,8 @@ describe("ClaudeAcpAgent settings", () => {
});
const modeIds: string[] = response.modes.availableModes.map((m: any) => m.id);
expect(modeIds).not.toContain("auto");
expect(modeIds).toEqual(
expect.arrayContaining(["default", "acceptEdits", "plan", "dontAsk"]),
);
expect(modeIds).toEqual(expect.arrayContaining(["default", "acceptEdits", "plan", "auto"]));
expect(modeIds).not.toContain("dontAsk");
});
it("includes `auto` when the resolved model has supportsAutoMode: true", async () => {
@@ -305,10 +488,41 @@ describe("ClaudeAcpAgent settings", () => {
});
const modeIds: string[] = response.modes.availableModes.map((m: any) => m.id);
expect(modeIds).toContain("auto");
// A client that is not AIR gets no mode kind.
expect(response.modes.availableModes.slice(0, 4)).toEqual([
{
id: "default",
name: "Manual",
description: "Always ask before making changes",
},
{
id: "acceptEdits",
name: "Accept edits",
description: "Automatically accept all file edits",
},
{
id: "plan",
name: "Plan",
description: "Create a plan before making changes",
},
{
id: "auto",
name: "Auto",
description: "Claude handles permission decisions",
},
]);
const bypass = response.modes.availableModes[4];
if (bypass) {
expect(bypass).toEqual({
id: "bypassPermissions",
name: "Bypass permissions",
description: "Accepts all permissions",
});
}
expect(modeIds).not.toContain("dontAsk");
});
it("clamps permissions.defaultMode='auto' to 'default' on a model that lacks supportsAutoMode", async () => {
it("falls back permissions.defaultMode='auto' to Accept edits on an unsupported model", async () => {
await fs.promises.writeFile(
path.join(tempDir, "settings.json"),
JSON.stringify({ permissions: { defaultMode: "auto" } }),
@@ -342,9 +556,11 @@ describe("ClaudeAcpAgent settings", () => {
// carries the user-typed value; the SDK was synced via
// setPermissionMode after we discovered the model can't honor it.
expect(getCapturedOptions().permissionMode).toBe("auto");
expect(setPermissionModeSpy).toHaveBeenCalledWith("default");
expect(response.modes.currentModeId).toBe("default");
expect(response.modes.availableModes.map((m: any) => m.id)).not.toContain("auto");
expect(setPermissionModeSpy).toHaveBeenCalledWith("acceptEdits");
expect(response.modes.currentModeId).toBe("acceptEdits");
expect(response.modes.availableModes.map((m: any) => m.id)).toContain("auto");
const session = (agent as any).sessions[response.sessionId];
expect(session.autoModeFallbackWarningPending).toBe(true);
// A descriptive warning was logged so operators see the clamp.
const messages = errorSpy.mock.calls.map((c) => c.join(" "));

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,63 @@
import { describe, expect, it } from "vitest";
import { compareWithBaseline } from "./acp-scenarios/compare.js";
import type { Recorded } from "./acp-scenarios/harness.js";
function update(fields: Record<string, unknown>): Recorded {
return { kind: "sessionUpdate", payload: { sessionId: "s", update: fields } };
}
const toolCall = update({
sessionUpdate: "tool_call",
toolCallId: "t",
title: "Read",
status: "pending",
_meta: { claudeCode: { toolName: "Read" } },
});
const result = {
sessionUpdate: "tool_call_update",
toolCallId: "t",
title: "Read",
status: "completed",
rawOutput: "text",
_meta: { claudeCode: { toolName: "Read" } },
};
const baseline = [toolCall, update(result)];
/** A copy of `value` without `key`. */
function omit(value: Record<string, unknown>, key: string): Record<string, unknown> {
const copy = { ...value };
delete copy[key];
return copy;
}
describe("compareWithBaseline", () => {
it("accepts the baseline itself", () => {
expect(compareWithBaseline(baseline, baseline)).toEqual([]);
});
it("accepts an update without a field that did not change", () => {
expect(compareWithBaseline(baseline, [toolCall, update(omit(result, "title"))])).toEqual([]);
});
it("reports a dropped _meta key", () => {
expect(compareWithBaseline(baseline, [toolCall, update(omit(result, "_meta"))])).toContainEqual(
expect.stringMatching(/^origin\/main sent .*"toolName":"Read"/u),
);
});
it("reports a changed rawOutput", () => {
const changed = update({ ...result, rawOutput: "other" });
expect(compareWithBaseline(baseline, [toolCall, changed])).toContainEqual(
expect.stringMatching(/but the adapter sent .*"rawOutput":"other"/u),
);
});
it("reports an extra update", () => {
const extra = update({ sessionUpdate: "tool_call_update", toolCallId: "t", status: "failed" });
expect(compareWithBaseline(baseline, [...baseline, extra])).toEqual([
expect.stringMatching(/^origin\/main did not send /u),
]);
});
});

View File

@@ -0,0 +1,986 @@
/**
* The outbound ACP traffic of every scenario in `acp-scenarios/scenarios.ts`,
* for three client profiles: a plain ACP client, Zed, and JetBrains AIR.
*
* - Recordings are JSON Lines: one outbound message on each line, with sorted
* keys. `normalize` in `harness.ts` replaces only exact run-specific values:
* the generated ids, the paths, and the argv and version of this process.
* - AIR golden files: `acp-scenarios/__snapshots__/air/<scenario>.jsonl`.
* Run `npx vitest run src/tests/acp-scenarios.test.ts -u` to update them.
* - Schema: every message is valid against the ACP schema of the SDK.
* - Plain and Zed: the same information as origin/main
* (`acp-scenarios/origin-main/<profile>/<scenario>.jsonl`). `compare.ts`
* allows only the documented differences. These profiles have no golden
* files of their own. `origin-main/zed/` holds a scenario only when its
* recording differs from the plain client.
* - Zed: the Zed conventions and the upstream `_meta` keys.
* - AIR: the AIR extensions of `docs/air-extensions.md`, each fact once.
*
* To record the origin/main baseline again, copy `src/tests/acp-scenarios/`
* and this file into a checkout of origin/main, and run this file there with
* `ACP_SCENARIO_BASELINE_DIR=<dir>`. Then copy `<dir>/plain` and `<dir>/zed`
* to `acp-scenarios/origin-main/`.
*/
import { afterAll, beforeAll, describe, expect, it, vi } from "vitest";
import * as fs from "node:fs";
import * as os from "node:os";
import * as path from "node:path";
import { fileURLToPath } from "node:url";
import {
AIR_CAPABILITY_NAMES,
assistantTurn,
normalize,
PROFILES,
type Profile,
type Recorded,
resetIds,
result,
runScenario,
type Scenario,
type ScenarioRun,
streamMessage,
toolCall,
toolResult,
} from "./acp-scenarios/harness.js";
import { SCENARIOS } from "./acp-scenarios/scenarios.js";
import {
AIR_ONLY_CLAUDE_CODE_KEYS,
AIR_ONLY_META_KEYS,
canonical,
compareWithBaseline,
} from "./acp-scenarios/compare.js";
import { EXTENSION_SESSION_UPDATES, validateRecorded } from "./acp-scenarios/schema.js";
vi.mock("@anthropic-ai/claude-agent-sdk", async (importOriginal) => {
const actual = await importOriginal<typeof import("@anthropic-ai/claude-agent-sdk")>();
const harness = await import("./acp-scenarios/harness.js");
return {
...actual,
query: harness.mockedQuery,
getSessionMessages: harness.mockedSessionMessages,
};
});
// The recordings replace only the ids that the run generated, so the harness
// learns each id that `randomUUID` returns.
vi.mock("node:crypto", async (importOriginal) => {
const actual = await importOriginal<typeof import("node:crypto")>();
const harness = await import("./acp-scenarios/harness.js");
return {
...actual,
randomUUID: (...args: Parameters<typeof actual.randomUUID>) => {
const id = actual.randomUUID(...args);
harness.noteGeneratedId(id);
return id;
},
};
});
const here = path.dirname(fileURLToPath(import.meta.url));
const baselineDir = process.env.ACP_SCENARIO_BASELINE_DIR;
const profiles = Object.values(PROFILES);
const runs = new Map<string, ScenarioRun>();
const key = (profile: Profile["name"], scenario: string) => `${profile}/${scenario}`;
let configDir: string;
let Agent: Parameters<typeof runScenario>[0];
beforeAll(async () => {
// A run must not depend on the machine: no remote login, no Claude CLI, no
// user settings, and the bypass mode also for root.
for (const name of ["SSH_CONNECTION", "SSH_CLIENT", "SSH_TTY", "NO_BROWSER"]) {
vi.stubEnv(name, "");
}
vi.stubEnv("CLAUDE_CODE_REMOTE", "");
vi.stubEnv("ANTHROPIC_MODEL", "");
vi.stubEnv("IS_SANDBOX", "1");
vi.stubEnv("CLAUDE_CODE_EXECUTABLE", "/usr/bin/false");
configDir = fs.mkdtempSync(path.join(os.tmpdir(), "acp-scenario-config-"));
vi.stubEnv("CLAUDE_CONFIG_DIR", configDir);
const { ClaudeAcpAgent } = await import("../acp-agent.js");
Agent = ClaudeAcpAgent;
for (const profile of profiles) {
for (const scenario of SCENARIOS) {
resetIds();
runs.set(
key(profile.name, scenario.name),
await runScenario(ClaudeAcpAgent, profile, scenario),
);
}
}
}, 120_000);
afterAll(() => {
vi.unstubAllEnvs();
fs.rmSync(configDir, { recursive: true, force: true });
});
/** A recording as JSON Lines: one message on each line, with sorted keys. */
function toJsonLines(recorded: Recorded[]): string {
return recorded.map((record) => `${canonical(record)}\n`).join("");
}
function fromJsonLines(text: string): Recorded[] {
return text
.split("\n")
.filter((line) => line.length > 0)
.map((line) => JSON.parse(line) as Recorded);
}
function run(profile: Profile["name"], scenario: string): ScenarioRun {
const recorded = runs.get(key(profile, scenario));
if (!recorded) throw new Error(`no run of ${scenario} for ${profile}`);
return recorded;
}
/** Runs one more scenario for AIR without some AIR capabilities. */
async function runAir(scenario: Scenario, without: string[] = []): Promise<Recorded[]> {
resetIds();
const profile: Profile = {
name: "air",
capabilities: {
...PROFILES.air.capabilities,
_meta: {
...PROFILES.air.capabilities._meta,
jetbrains: {
air: {
version: 1,
capabilities: AIR_CAPABILITY_NAMES.filter((name) => !without.includes(name)),
},
},
},
},
};
return (await runScenario(Agent, profile, scenario)).raw;
}
function updates(recorded: Recorded[]): Record<string, any>[] {
return recorded
.filter((record) => record.kind === "sessionUpdate")
.map((record) => (record.payload as { update: Record<string, any> }).update);
}
function toolCallReports(recorded: Recorded[], toolCallId?: string): Record<string, any>[] {
return updates(recorded).filter(
(update) =>
(update.sessionUpdate === "tool_call" || update.sessionUpdate === "tool_call_update") &&
(toolCallId === undefined || update.toolCallId === toolCallId),
);
}
function permissionRequests(recorded: Recorded[]): Record<string, any>[] {
return recorded
.filter((record) => record.kind === "requestPermission")
.map((record) => record.payload as Record<string, any>);
}
/** Every `_meta` object in a message, with the path to it. */
function metaObjects(value: unknown, at = "$"): { at: string; meta: Record<string, unknown> }[] {
if (!value || typeof value !== "object") return [];
if (Array.isArray(value)) return value.flatMap((item, i) => metaObjects(item, `${at}[${i}]`));
return Object.entries(value as Record<string, unknown>).flatMap(([k, item]) => [
...(k === "_meta" && item && typeof item === "object" && !Array.isArray(item)
? [{ at: `${at}._meta`, meta: item as Record<string, unknown> }]
: []),
...metaObjects(item, `${at}.${k}`),
]);
}
/** The origin/main recording of a scenario. Zed has a file only where it differs from the plain client. */
function readBaseline(profile: "plain" | "zed", scenario: string): string {
const file = (name: string) =>
path.join(here, "acp-scenarios", "origin-main", name, `${scenario}.jsonl`);
return fs.readFileSync(
profile === "zed" && !fs.existsSync(file("zed")) ? file("plain") : file(profile),
"utf8",
);
}
describe.runIf(baselineDir)("the origin/main baseline", () => {
it("writes the recordings of the plain and Zed profiles", () => {
for (const profile of ["plain", "zed"] as const) {
fs.mkdirSync(path.join(baselineDir!, profile), { recursive: true });
for (const scenario of SCENARIOS) {
const text = toJsonLines(run(profile, scenario.name).normalized);
if (profile === "zed" && text === toJsonLines(run("plain", scenario.name).normalized)) {
continue;
}
fs.writeFileSync(path.join(baselineDir!, profile, `${scenario.name}.jsonl`), text);
}
}
});
});
describe.skipIf(baselineDir)("ACP scenarios", () => {
describe("normalize", () => {
const cwd = "/tmp/acp-scenario-x";
const session = "aaaaaaaa-0000-4000-8000-000000000001";
const first = "bbbbbbbb-0000-4000-8000-000000000002";
const second = "cccccccc-0000-4000-8000-000000000003";
const scripted = "00000000-0000-4000-8000-00000000c001";
const version = JSON.parse(
fs.readFileSync(path.join(here, "..", "..", "package.json"), "utf8"),
).version;
const argv = process.argv.slice(1);
it("keeps a UUID that the run did not generate", () => {
expect(normalize({ toolCallId: scripted }, cwd, session, new Set([first]))).toEqual({
toolCallId: scripted,
});
});
it("names the generated ids in the order of their first appearance", () => {
const generated = new Set([first, second]);
const reports = (ids: string[]) =>
normalize(
ids.map((id) => ({ sessionId: session, toolCallId: id })),
cwd,
session,
generated,
);
expect(reports([first, first])).toEqual([
{ sessionId: "<session>", toolCallId: "<id-1>" },
{ sessionId: "<session>", toolCallId: "<id-1>" },
]);
// A report that names another generated id, or the session id, still differs.
expect(reports([first, second])).not.toEqual(reports([first, first]));
expect(reports([first, session])).not.toEqual(reports([first, first]));
});
it("replaces only the exact argv prefix of this process", () => {
expect(argv.length).toBeGreaterThan(0);
expect(normalize({ args: [...argv, "--cli", "login"] }, cwd, session)).toEqual({
args: ["<argv>", "--cli", "login"],
});
// An extra argument stays in the recording, before or after the prefix.
expect(normalize({ args: [...argv, "--inspect", "--cli"] }, cwd, session)).toEqual({
args: ["<argv>", "--inspect", "--cli"],
});
const before = ["--inspect", ...argv, "--cli"];
const { args } = normalize({ args: before }, cwd, session) as { args: string[] };
expect(args).toHaveLength(before.length);
expect(args).not.toContain("<argv>");
expect(normalize({ args: ["other.js", "--cli"] }, cwd, session)).toEqual({
args: ["other.js", "--cli"],
});
});
it("replaces only the version of this adapter and the path of this Node binary", () => {
expect(normalize({ version, command: process.execPath }, cwd, session)).toEqual({
version: "<version>",
command: "<executable>",
});
expect(normalize({ version: "9.9.9", command: "/usr/bin/node" }, cwd, session)).toEqual({
version: "9.9.9",
command: "/usr/bin/node",
});
});
it("keeps durations and other numbers", () => {
expect(normalize({ durationMs: 7, totalDurationMs: 10 }, cwd, session)).toEqual({
durationMs: 7,
totalDurationMs: 10,
});
});
});
describe("schema check", () => {
const none = new Set<string>();
const elicitation = (url: string): Recorded => ({
kind: "createElicitation",
payload: {
sessionId: "s",
message: "Sign in",
mode: "url",
elicitationId: "e",
url,
},
});
const location = (line: number): Recorded => ({
kind: "sessionUpdate",
payload: {
sessionId: "s",
update: {
sessionUpdate: "tool_call_update",
toolCallId: "t",
locations: [{ path: "/a.ts", line }],
},
},
});
it("rejects a value that breaks a standard format", () => {
expect(validateRecorded(elicitation("https://example.com/login"), none)).toEqual([]);
expect(validateRecorded(elicitation("not a uri"), none)).not.toEqual([]);
});
it("rejects a value that breaks an ACP integer format", () => {
expect(validateRecorded(location(2 ** 32 - 1), none)).toEqual([]);
expect(validateRecorded(location(2 ** 32), none)).not.toEqual([]);
});
});
describe("air golden files", () => {
it.each(SCENARIOS.map((scenario) => scenario.name))("%s", async (scenario) => {
await expect(toJsonLines(run("air", scenario).normalized)).toMatchFileSnapshot(
path.join(here, "acp-scenarios", "__snapshots__", "air", `${scenario}.jsonl`),
);
});
});
describe.each(profiles.map((profile) => profile.name))("%s ACP schema", (profile) => {
const extensions = profile === "air" ? EXTENSION_SESSION_UPDATES : new Set<string>();
it.each(SCENARIOS.map((scenario) => scenario.name))(
"%s sends only valid messages",
(scenario) => {
const errors = run(profile, scenario).raw.flatMap((record) =>
validateRecorded(record, extensions),
);
expect(errors).toEqual([]);
},
);
});
describe.each(profiles.map((profile) => profile.name))("%s session ids", (profile) => {
// Only AIR negotiates native subagent sessions. There a child session
// gets updates after its parent announced it with `subagent_spawned`.
const nativeSubagents = profile === "air";
it.each(SCENARIOS.map((scenario) => scenario.name))(
"%s sends every session/update to the ACP session",
(scenario) => {
const { sessionId, raw } = run(profile, scenario);
const sessions = new Set([sessionId]);
const wrong: string[] = [];
for (const record of raw) {
if (record.kind !== "sessionUpdate") continue;
const payload = record.payload as { sessionId: string; update: Record<string, any> };
if (!sessions.has(payload.sessionId)) {
wrong.push(`${payload.sessionId}: ${payload.update.sessionUpdate}`);
continue;
}
if (nativeSubagents && payload.update.sessionUpdate === "subagent_spawned") {
sessions.add(payload.update.subagentSessionId);
}
}
expect(wrong).toEqual([]);
},
);
});
describe.each(["plain", "zed"] as const)("%s client", (profile) => {
it.each(SCENARIOS.map((scenario) => scenario.name))(
"%s carries the same information as origin/main",
(scenario) => {
const baseline = fromJsonLines(readBaseline(profile, scenario));
expect(compareWithBaseline(baseline, run(profile, scenario).normalized)).toEqual([]);
},
);
it.each(SCENARIOS.map((scenario) => scenario.name))(
"%s sends no key that exists only for AIR",
(scenario) => {
const found = metaObjects(run(profile, scenario).raw).flatMap(({ at, meta }) => [
...Object.keys(meta)
.filter((k) => AIR_ONLY_META_KEYS.has(k))
.map((k) => `${at}.${k}`),
...Object.keys((meta.claudeCode as Record<string, unknown> | undefined) ?? {})
.filter((k) => AIR_ONLY_CLAUDE_CODE_KEYS.has(k))
.map((k) => `${at}.claudeCode.${k}`),
]);
expect(found).toEqual([]);
expect(
updates(run(profile, scenario).raw).filter((update) =>
EXTENSION_SESSION_UPDATES.has(update.sessionUpdate),
),
).toEqual([]);
},
);
});
describe("plain client", () => {
it("gets the Bash output as a code block and the description as content", () => {
const reports = toolCallReports(run("plain", "bash-foreground").raw, "toolu_bash");
expect(reports[0]).not.toHaveProperty("_meta.terminal_info");
expect(reports.some((r) => JSON.stringify(r.content ?? []).includes("List files"))).toBe(
true,
);
expect(reports.at(-2)).toMatchObject({
status: "completed",
content: [
{ type: "content", content: { type: "text", text: "```console\na.ts\nb.ts\n```" } },
],
rawOutput: "a.ts\nb.ts",
});
});
it("gets the streamed partial input as rawInput, and the Write text in rawInput", () => {
const reports = toolCallReports(run("plain", "write-new").raw, "toolu_write");
expect(reports[0]).toMatchObject({ sessionUpdate: "tool_call", rawInput: {} });
expect(reports.some((r) => r.rawInput?.file_path && !("content" in r.rawInput))).toBe(true);
expect(reports.some((r) => r.rawInput?.content === "export const x = 1;\n")).toBe(true);
});
it("gets the whole tool call again in a permission request", () => {
const [request] = permissionRequests(run("plain", "edit-with-permission").raw);
expect(request.toolCall).toMatchObject({
toolCallId: "toolu_edit",
name: "Edit",
status: "pending",
kind: "edit",
title: "Edit src/app.ts",
rawInput: {
old_string: "const value = 1;",
new_string: "const value = 2;",
},
content: [{ type: "diff", oldText: "const value = 1;", newText: "const value = 2;" }],
});
expect(request).not.toHaveProperty("_meta");
});
it("gets the question of a single AskUserQuestion as the title", () => {
const reports = toolCallReports(run("plain", "ask-user-question").raw, "toolu_ask");
expect(reports.map((r) => r.title)).toContain("Which database?");
});
it("gets the upstream NotebookEdit rendering and the result text", () => {
const reports = toolCallReports(run("plain", "notebook-edit").raw, "toolu_nb");
expect(reports[0]).toMatchObject({ title: "NotebookEdit", kind: "other", content: [] });
expect(reports.at(-1)).toMatchObject({
status: "completed",
rawOutput: "Updated cell cell-1 with print('hi')",
});
});
it("gets every Task* plan, also a repeated one", () => {
const plans = updates(run("plain", "task-create-update").raw).filter(
(update) => update.sessionUpdate === "plan",
);
expect(plans.map((plan) => plan.entries[0]?.status)).toEqual([
"pending",
"pending",
"in_progress",
"completed",
"completed",
]);
});
});
describe("Zed", () => {
const zed = (scenario: string) => run("zed", scenario).raw;
it("keeps terminal_info, terminal_output, and terminal_exit", () => {
const reports = toolCallReports(zed("bash-foreground"), "toolu_bash");
expect(reports[0]).toMatchObject({
sessionUpdate: "tool_call",
content: [{ type: "terminal", terminalId: "toolu_bash" }],
_meta: { terminal_info: { terminal_id: "toolu_bash" } },
});
expect(reports).toContainEqual(
expect.objectContaining({
_meta: { terminal_output: { terminal_id: "toolu_bash", data: "a.ts\nb.ts" } },
}),
);
expect(reports).toContainEqual(
expect.objectContaining({
status: "completed",
_meta: expect.objectContaining({
terminal_exit: { terminal_id: "toolu_bash", exit_code: 0, signal: null },
}),
}),
);
for (const report of reports) {
expect(report._meta ?? {}).not.toHaveProperty("terminal_output_delta");
}
});
it("keeps the upstream claudeCode keys and the full PostToolUse toolResponse", () => {
const reports = toolCallReports(zed("bash-foreground"), "toolu_bash");
expect(reports[0]._meta.claudeCode).toEqual({ toolName: "Bash" });
expect(reports.at(-1)?._meta.claudeCode).toEqual({
toolName: "Bash",
toolResponse: { stdout: "a.ts\nb.ts", stderr: "", interrupted: false, isImage: false },
});
const child = toolCallReports(zed("subagent-task-legacy"), "toolu_sub_read");
expect(child[0]._meta.claudeCode).toEqual({
toolName: "Read",
parentToolUseId: "toolu_task",
});
// ACP does not merge `_meta` keys, so each update names the parent again.
for (const report of child) {
expect(report._meta.claudeCode).toMatchObject({
toolName: "Read",
parentToolUseId: "toolu_task",
});
}
const [childRequest] = permissionRequests(zed("subagent-task-legacy"));
expect(childRequest.toolCall._meta).toEqual({
claudeCode: { toolName: "Bash", parentToolUseId: "toolu_task" },
});
const [mcpRequest] = permissionRequests(zed("mcp-tool"));
expect(mcpRequest.toolCall._meta).toEqual({
claudeCode: {
toolName: "mcp__docs__search",
mcpServer: { name: "docs", source: "project" },
},
});
});
it("keeps the full permission denial toolResponse", () => {
const denial = toolCallReports(zed("permission-denied"), "toolu_denied").find(
(report) => report.status === "failed",
);
expect(denial?._meta.claudeCode.toolResponse).toEqual({
decisionReasonType: "rule",
decisionReason: "Denied by rule Bash(rm:*)",
message: "Permission to use Bash has been denied.",
});
});
it("keeps the _claude/* keys", () => {
const [elicitation] = zed("ask-user-question")
.filter((record) => record.kind === "createElicitation")
.map((record) => record.payload as Record<string, any>);
const options = elicitation.requestedSchema.properties.question_0.oneOf;
expect(options[0]._meta).toHaveProperty(["_claude/askUserQuestionOption"]);
const usage = updates(zed("rate-limit-and-origin")).filter(
(update) => update.sessionUpdate === "usage_update",
);
expect(usage.some((update) => update._meta?.["_claude/rateLimit"])).toBe(true);
expect(usage.some((update) => update._meta?.["_claude/origin"])).toBe(true);
});
it("keeps promptQueueing and steering", () => {
const initialize = zed("session-setup").find((record) => record.kind === "initialize")!
.payload as Record<string, any>;
expect(initialize.agentCapabilities._meta.claudeCode).toEqual({ promptQueueing: true });
expect(initialize._meta).toEqual({ steering: { supported: true } });
});
it("sends terminal-auth commands that rerun this adapter with --cli", () => {
// The raw traffic, because the recordings normalize the machine paths.
const initialize = zed("session-setup").find((record) => record.kind === "initialize")!
.payload as Record<string, any>;
const argv = process.argv.slice(1);
expect(initialize.authMethods).toEqual([
expect.objectContaining({
id: "claude-ai-login",
args: ["--cli", "auth", "login", "--claudeai"],
_meta: {
"terminal-auth": {
command: process.execPath,
args: [...argv, "--cli", "auth", "login", "--claudeai"],
label: "Claude Login",
},
},
}),
expect.objectContaining({
id: "console-login",
args: ["--cli", "auth", "login", "--console"],
_meta: {
"terminal-auth": {
command: process.execPath,
args: [...argv, "--cli", "auth", "login", "--console"],
label: "Anthropic Console Login",
},
},
}),
]);
});
});
describe("AIR", () => {
const air = (scenario: string) => run("air", scenario).raw;
const airMeta = (meta: Record<string, any> | undefined) => meta?.jetbrains?.air;
it("gets the AIR capabilities and the goal capability under jetbrains.air", () => {
const initialize = air("session-setup").find((record) => record.kind === "initialize")!
.payload as Record<string, any>;
expect(initialize._meta).toEqual({
jetbrains: {
air: {
version: 1,
capabilities: expect.arrayContaining(
AIR_CAPABILITY_NAMES.filter((name) => name !== "rawInputRendering"),
),
goal: expect.objectContaining({ version: 1 }),
},
},
steering: { supported: true },
});
const session = air("session-setup").find((record) => record.kind === "newSession")!
.payload as Record<string, any>;
for (const mode of session.modes.availableModes) {
expect(mode._meta).toEqual({
jetbrains: { air: { version: 1, kind: expect.any(String) } },
});
}
});
it("gets commandTitle, subagent, and skill under jetbrains.air, each once", async () => {
const bash = toolCallReports(air("bash-foreground"), "toolu_bash");
expect(bash.filter((r) => airMeta(r._meta)?.commandTitle === "List files")).toHaveLength(1);
// A native subagent session replaces the tool call of the subagent, so
// the marker shows without native subagent sessions.
const [nested] = toolCallReports(
await runAir(
{
name: "nested-agent",
turns: [
async function* () {
yield* assistantTurn("msg_nested", [
{ type: "tool_use", id: "toolu_nested", name: "Agent", input: { prompt: "Go" } },
]);
yield result();
},
],
},
["nativeSubagentSessions"],
),
"toolu_nested",
);
expect(airMeta(nested?._meta)?.subagent).toBe(true);
const skill = toolCallReports(air("skill"), "toolu_skill");
expect(skill.filter((r) => airMeta(r._meta)?.skill)).toEqual([
expect.objectContaining({
_meta: expect.objectContaining({
jetbrains: {
air: {
version: 1,
skill: { name: "commits", path: expect.stringMatching(/SKILL\.md$/) },
},
},
}),
}),
]);
});
it("gets the permission, customAnswer, goal, and contextCompaction keys", () => {
const [request] = permissionRequests(air("bash-foreground"));
expect(request._meta).toEqual({
jetbrains: { air: { version: 1, permission: { version: 1, title: "ls -la" } } },
});
const elicitation = air("ask-user-question").find(
(record) => record.kind === "createElicitation",
)!.payload as Record<string, any>;
expect(elicitation.requestedSchema.properties.question_0_custom._meta).toEqual({
jetbrains: {
air: { version: 1, customAnswer: { questionId: "question_0", isCustomAnswer: true } },
},
});
const goal = updates(air("goal")).find((u) => u.sessionUpdate === "session_info_update");
expect(goal?._meta).toEqual({
jetbrains: {
air: {
version: 1,
goal: expect.objectContaining({ objective: "Ship the feature", status: "active" }),
},
},
});
const compaction = toolCallReports(air("compaction-legacy"));
expect(compaction.at(-1)?._meta).toEqual({
jetbrains: {
air: {
contextCompaction: expect.objectContaining({ version: 1, preTokens: 1000 }),
},
},
});
expect(compaction.at(-1)).not.toHaveProperty("rawOutput");
});
it("sends no upstream copy of an AIR key", () => {
for (const scenario of SCENARIOS) {
for (const { at, meta } of metaObjects(air(scenario.name))) {
const duplicates = [
...Object.keys(meta).filter((k) => AIR_ONLY_META_KEYS.has(k) && k !== "jetbrains"),
...Object.keys((meta.claudeCode as Record<string, unknown> | undefined) ?? {}).filter(
(k) => AIR_ONLY_CLAUDE_CODE_KEYS.has(k),
),
];
expect(duplicates, `${scenario.name} ${at}`).toEqual([]);
}
}
});
it("sends each tool fact in one field", () => {
for (const scenario of SCENARIOS) {
for (const report of toolCallReports(air(scenario.name))) {
const where = `${scenario.name} ${report.toolCallId}`;
// Output is never copied into rawOutput when content carries it.
if (report.rawOutput !== undefined) {
expect(report.content ?? [], where).toEqual([]);
}
// Terminal output goes to deltas, never to snapshots.
expect(report._meta ?? {}, where).not.toHaveProperty("terminal_output");
}
}
const write = toolCallReports(air("write-new"), "toolu_write");
for (const report of write) expect(report.rawInput ?? {}).not.toHaveProperty("content");
expect(write[0]).not.toHaveProperty("rawInput");
});
describe("ExitPlanMode with a plan file", () => {
const plan = "# Plan\n1. Do it";
/**
* The CLI streams the input that the model wrote, which has no plan.
* The complete message and canUseTool get the text and the path of the
* plan file. The structured result names the file again.
*/
const planFileScenario = (options: { file: boolean; reject?: boolean }): Scenario => ({
name: "exit-plan-file",
...(options.file ? { files: { "plans/plan.md": plan } } : {}),
...(options.reject ? { permission: "reject_once" } : {}),
turns: [
async function* (ctx) {
const planFilePath = path.join(ctx.cwd, "plans", "plan.md");
const input = { plan, planFilePath };
yield* streamMessage("msg_toolu_plan", [
{ type: "tool_use", id: "toolu_plan", name: "ExitPlanMode", input: {} },
]);
yield* toolCall(
ctx,
{ id: "toolu_plan", name: "ExitPlanMode", input },
options.reject
? {
ask: true,
isError: true,
content: "```\nThe user doesn't want to proceed with this tool use.\n```",
}
: {
ask: true,
content: `User has approved your plan.\n\n## Approved Plan:\n${plan}`,
structured: { plan, isAgent: false, filePath: planFilePath },
},
);
yield result();
},
],
});
it("sends the path and no plan text in every report", async () => {
const recorded = await runAir(planFileScenario({ file: true }));
const reports = toolCallReports(recorded, "toolu_plan");
const [request] = permissionRequests(recorded);
const withInput = [...reports, request.toolCall].filter((r) => "rawInput" in r);
expect(withInput.length).toBeGreaterThan(0);
for (const report of withInput) {
expect(report.rawInput).toEqual({ planFilePath: expect.stringMatching(/plan\.md$/) });
expect(path.isAbsolute(report.rawInput.planFilePath)).toBe(true);
}
expect(reports[0]).toMatchObject({ sessionUpdate: "tool_call" });
expect(reports[0]).not.toHaveProperty("rawInput");
expect(reports.at(-1)).toMatchObject({ status: "completed", title: "Exited Plan Mode" });
expect(JSON.stringify([reports, request])).not.toContain("Do it");
});
it("sends the path with a rejection", async () => {
const recorded = await runAir(planFileScenario({ file: true, reject: true }));
const reports = toolCallReports(recorded, "toolu_plan");
const [request] = permissionRequests(recorded);
expect(request.toolCall.rawInput).toEqual({ planFilePath: expect.any(String) });
expect(reports.at(-1)).toMatchObject({ status: "failed" });
expect(JSON.stringify([reports, request])).not.toContain("Do it");
});
it("sends the plan text when the plan file does not exist", async () => {
const recorded = await runAir(planFileScenario({ file: false }));
const [request] = permissionRequests(recorded);
expect(request.toolCall.rawInput).toEqual({ plan, planFilePath: expect.any(String) });
});
it("sends the plan text to an AIR client without planFile", async () => {
const recorded = await runAir(planFileScenario({ file: true }), ["planFile"]);
const [request] = permissionRequests(recorded);
expect(request.toolCall.rawInput).toEqual({ plan, planFilePath: expect.any(String) });
});
it("sends the whole input to a client that is not AIR", async () => {
for (const profile of [PROFILES.plain, PROFILES.zed]) {
resetIds();
const recorded = (await runScenario(Agent, profile, planFileScenario({ file: true })))
.raw;
const [request] = permissionRequests(recorded);
expect(request.toolCall.rawInput).toEqual({ plan, planFilePath: expect.any(String) });
expect(request.toolCall.content).toEqual([
{ type: "content", content: { type: "text", text: plan } },
]);
const reports = toolCallReports(recorded, "toolu_plan");
expect(reports.some((r) => r.rawInput?.plan === plan)).toBe(true);
}
});
});
it("drops every update of a tool call of a finished child session", () => {
const recorded = air("subagent-late-child-update");
const finished = recorded.findIndex(
(record) =>
record.kind === "sessionUpdate" &&
(record.payload as { update: Record<string, any> }).update.sessionUpdate ===
"subagent_state_update",
);
expect(finished).toBeGreaterThan(0);
const late = recorded
.slice(finished)
.filter((record) => record.kind === "sessionUpdate")
.map((record) => record.payload as { sessionId: string; update: Record<string, any> })
.filter(({ update }) => update.toolCallId === "toolu_late_read");
expect(late).toEqual([]);
for (const record of recorded.filter((r) => r.kind === "sessionUpdate")) {
const { sessionId, update } = record.payload as {
sessionId: string;
update: Record<string, any>;
};
if (update.toolCallId === "toolu_late_read") expect(sessionId).toBe("agent_late");
}
});
it("gets the Write patch, but no file text in the PostToolUse toolResponse", async () => {
const scenario = writtenFileScenario();
const hookReport = (recorded: Recorded[]) =>
toolCallReports(recorded, "toolu_write").find(
(report) =>
report._meta?.claudeCode?.toolResponse !== undefined || report.content?.[0]?._meta,
);
const airReport = hookReport(await runAir(scenario));
expect(airReport?.content?.[0]?._meta?.jetbrains?.air?.diffPatch?.text).toContain(
"-export const x = 0;\n+export const x = 1;\n",
);
expect(airReport?._meta?.claudeCode?.toolResponse).toBeUndefined();
expect(JSON.stringify(airReport)).not.toContain("originalFile");
// A client that is not AIR keeps the full toolResponse of origin/main.
resetIds();
const plain = (await runScenario(Agent, PROFILES.plain, scenario)).raw;
expect(hookReport(plain)?._meta?.claudeCode?.toolResponse).toMatchObject({
type: "update",
content: "export const x = 1;\n",
originalFile: "export const x = 0;\n",
});
});
it("sends no creation patch over a file and no Edit patch before the preview", async () => {
const patches = (reports: Record<string, any>[]) =>
reports.flatMap((report) =>
(report.content ?? [])
.map((block: any) => block._meta?.jetbrains?.air?.diffPatch?.text)
.filter((text: unknown) => text !== undefined),
);
// Streamed: the Write of an existing file gets only the update patch of
// its hook, and the Edit gets no patch before its approval.
const writePatches = patches(toolCallReports(air("write-existing"), "toolu_write"));
expect(writePatches).toHaveLength(1);
expect(writePatches[0]).not.toContain("new file mode");
expect(writePatches[0]).toContain("-export const x = 0;\n+export const x = 1;");
const edit = air("edit-with-permission");
const approval = edit.findIndex((record) => record.kind === "requestPermission");
expect(approval).toBeGreaterThan(0);
expect(patches(toolCallReports(edit.slice(0, approval), "toolu_edit"))).toEqual([]);
// Replayed: session/load renders the same tool uses from the transcript.
const replay = await runAir(replayedEditsScenario());
expect(patches(toolCallReports(replay))).toEqual([]);
// A replay does not read old.ts: the disk shows a later state than the history.
expect(toolCallReports(replay, "toolu_r_write")[0].content).toEqual([
{
type: "diff",
path: expect.stringMatching(/old\.ts$/),
oldText: null,
newText: "export const x = 1;\n",
},
]);
expect(toolCallReports(replay, "toolu_r_edit")[0].content).toEqual([
{
type: "diff",
path: expect.stringMatching(/app\.ts$/),
oldText: "const value = 1;",
newText: "const value = 2;",
},
]);
});
it("sends the Bash output as terminal deltas", () => {
const reports = toolCallReports(air("bash-foreground"), "toolu_bash");
expect(reports).toContainEqual(
expect.objectContaining({
_meta: { terminal_output_delta: { terminal_id: "toolu_bash", data: "a.ts\nb.ts" } },
}),
);
});
});
});
/** A Write that changes the file on disk before its PostToolUse hook runs. */
function writtenFileScenario(): Scenario {
return {
name: "write-on-disk",
files: { "old.ts": "export const x = 0;\n" },
turns: [
async function* (ctx) {
const file = path.join(ctx.cwd, "old.ts");
const input = { file_path: file, content: "export const x = 1;\n" };
yield* assistantTurn("msg_write", [
{ type: "tool_use", id: "toolu_write", name: "Write", input },
]);
fs.writeFileSync(file, input.content);
yield toolResult("toolu_write", `The file ${file} has been updated successfully.`);
await ctx.postToolUse("toolu_write", "Write", input, {
type: "update",
filePath: file,
content: input.content,
structuredPatch: [
{
oldStart: 1,
oldLines: 1,
newStart: 1,
newLines: 1,
lines: ["-export const x = 0;", "+export const x = 1;"],
},
],
originalFile: "export const x = 0;\n",
});
yield result();
},
],
};
}
/** A session/load of a Write over an existing file and of an Edit. */
function replayedEditsScenario(): Scenario {
return {
name: "replayed-edits",
files: { "old.ts": "export const x = 0;\n", "app.ts": "line 1\nconst value = 1;\n" },
transcript: ({ cwd, sessionId }) => [
{
type: "user",
uuid: "00000000-0000-4000-8000-00000000f001",
session_id: sessionId,
parent_tool_use_id: null,
message: { role: "user", content: "Change both files" },
},
{
type: "assistant",
uuid: "00000000-0000-4000-8000-00000000f002",
session_id: sessionId,
parent_tool_use_id: null,
message: {
id: "msg_r_edits",
role: "assistant",
model: "claude-sonnet-4-6",
content: [
{
type: "tool_use",
id: "toolu_r_write",
name: "Write",
input: { file_path: path.join(cwd, "old.ts"), content: "export const x = 1;\n" },
},
{
type: "tool_use",
id: "toolu_r_edit",
name: "Edit",
input: {
file_path: path.join(cwd, "app.ts"),
old_string: "const value = 1;",
new_string: "const value = 2;",
},
},
],
},
},
],
turns: [],
};
}

View File

@@ -0,0 +1,9 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"AskUserQuestion"}},"content":[],"kind":"other","name":"AskUserQuestion","sessionUpdate":"tool_call","status":"pending","title":"Asking for your input","toolCallId":"toolu_ask"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"rawInput":{"questions":[{"header":"Database","multiSelect":false,"options":[{"description":"Relational","label":"Postgres","preview":"CREATE TABLE t ();"},{"description":"Key-value","label":"Redis"}],"question":"Which database?"}]},"sessionUpdate":"tool_call_update","toolCallId":"toolu_ask"}}}
{"kind":"createElicitation","payload":{"message":"Which database?","mode":"form","requestedSchema":{"properties":{"question_0":{"oneOf":[{"_meta":{"_claude/askUserQuestionOption":{"preview":"CREATE TABLE t ();"}},"const":"Postgres","description":"Relational","title":"Postgres"},{"const":"Redis","description":"Key-value","title":"Redis"}],"title":"Database","type":"string"},"question_0_custom":{"_meta":{"jetbrains":{"air":{"customAnswer":{"isCustomAnswer":true,"questionId":"question_0"},"version":1}}},"description":"Type your own answer, or add a note to the option you chose above (optional).","title":"Other","type":"string"}},"type":"object"},"sessionId":"<session>","toolCallId":"toolu_ask"}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":[{"content":{"text":"User has answered your questions: \"Which database?\"=\"Postgres\".","type":"text"},"type":"content"}],"sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_ask"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,4 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"asyncTaskId":"workflow_1","canStop":true,"description":"Build assets","name":"Build assets","outputFilePath":"/tmp/tasks/workflow_1.output","sessionUpdate":"async_task_spawned","showInTranscript":true,"taskType":"workflow"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"asyncTaskId":"workflow_1","sessionUpdate":"async_task_state_update","state":"completed","summary":"done"}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,5 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"asyncTaskId":"monitor_1","canStop":true,"description":"Watch the logs","name":"Watch the logs","sessionUpdate":"async_task_spawned","showInTranscript":true,"taskType":"monitor","toolCallId":"toolu_monitor"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"asyncTaskId":"monitor_1","sessionUpdate":"async_task_progress","summary":"first line","usage":{"durationMs":5,"toolUses":0,"totalTokens":0}}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"asyncTaskId":"monitor_1","sessionUpdate":"async_task_progress","summary":"second line","usage":{"durationMs":6,"toolUses":0,"totalTokens":0}}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,3 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"asyncTaskId":"workflow_2","canStop":true,"description":"Build assets","name":"Build assets","sessionUpdate":"async_task_spawned","showInTranscript":true,"taskType":"workflow"}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,14 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"Bash"},"terminal_info":{"terminal_id":"toolu_bg"}},"content":[{"terminalId":"toolu_bg","type":"terminal"}],"kind":"execute","name":"Bash","sessionUpdate":"tool_call","status":"pending","title":"Terminal","toolCallId":"toolu_bg"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"sessionUpdate":"tool_call_update","title":"sleep 100","toolCallId":"toolu_bg"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"jetbrains":{"air":{"commandTitle":"Wait","version":1}}},"sessionUpdate":"tool_call_update","toolCallId":"toolu_bg"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"rawInput":{"command":"sleep 100","description":"Wait","run_in_background":true},"sessionUpdate":"tool_call_update","toolCallId":"toolu_bg"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"asyncTaskId":"bash_1","canStop":true,"description":"sleep 100","name":"sleep 100","outputFilePath":"/tmp/tasks/bash_1.output","sessionUpdate":"async_task_spawned","showInTranscript":true,"taskType":"shell","toolCallId":"toolu_bg"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"jetbrains":{"air":{"asyncTasks":{"backgrounded":true}}},"terminal_output_delta":{"data":"Command running in background with ID: bash_1. Output is being written to: /tmp/tasks/bash_1.output. You will be notified when it completes.","terminal_id":"toolu_bg"}},"sessionUpdate":"tool_call_update","toolCallId":"toolu_bg"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"terminal_exit":{"exit_code":0,"signal":null,"terminal_id":"toolu_bg"}},"sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_bg"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"asyncTaskId":"bash_1","sessionUpdate":"async_task_progress","summary":"still running","usage":{"durationMs":5,"toolUses":0,"totalTokens":0}}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"asyncTaskId":"bash_1","sessionUpdate":"async_task_state_update","state":"completed","summary":"done"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,10 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"Bash"},"terminal_info":{"terminal_id":"toolu_bash"}},"content":[{"terminalId":"toolu_bash","type":"terminal"}],"kind":"execute","name":"Bash","sessionUpdate":"tool_call","status":"pending","title":"Terminal","toolCallId":"toolu_bash"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"sessionUpdate":"tool_call_update","title":"false","toolCallId":"toolu_bash"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"jetbrains":{"air":{"commandTitle":"Fail","version":1}}},"rawInput":{"command":"false","description":"Fail"},"sessionUpdate":"tool_call_update","toolCallId":"toolu_bash"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"terminal_output_delta":{"data":"Exit code 1\nboom","terminal_id":"toolu_bash"}},"sessionUpdate":"tool_call_update","toolCallId":"toolu_bash"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"terminal_exit":{"exit_code":1,"signal":null,"terminal_id":"toolu_bash"}},"sessionUpdate":"tool_call_update","status":"failed","toolCallId":"toolu_bash"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,14 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"Bash"},"terminal_info":{"terminal_id":"toolu_bash"}},"content":[{"terminalId":"toolu_bash","type":"terminal"}],"kind":"execute","name":"Bash","sessionUpdate":"tool_call","status":"pending","title":"Terminal","toolCallId":"toolu_bash"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"sessionUpdate":"tool_call_update","title":"ls -la","toolCallId":"toolu_bash"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"jetbrains":{"air":{"commandTitle":"List files","version":1}}},"rawInput":{"command":"ls -la","description":"List files"},"sessionUpdate":"tool_call_update","toolCallId":"toolu_bash"}}}
{"kind":"requestPermission","payload":{"_meta":{"jetbrains":{"air":{"permission":{"title":"ls -la","version":1},"version":1}}},"options":[{"kind":"allow_once","name":"Yes","optionId":"allow-once"},{"kind":"reject_once","name":"No","optionId":"reject"}],"sessionId":"<session>","toolCall":{"rawInput":{"command":"ls -la","description":"List files"},"title":"ls -la","toolCallId":"toolu_bash"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"terminal_output_delta":{"data":"a.ts\nb.ts","terminal_id":"toolu_bash"}},"sessionUpdate":"tool_call_update","toolCallId":"toolu_bash"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"terminal_exit":{"exit_code":0,"signal":null,"terminal_id":"toolu_bash"}},"sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_bash"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":{"text":"Do","type":"text"},"messageId":"msg_done","sessionUpdate":"agent_message_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":{"text":"ne.","type":"text"},"messageId":"msg_done","sessionUpdate":"agent_message_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,4 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"jetbrains":{"air":{"contextCompaction":{"version":1},"version":1}}},"kind":"think","sessionUpdate":"tool_call","status":"in_progress","title":"Compact conversation","toolCallId":"00000000-0000-4000-8000-000000000001"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"jetbrains":{"air":{"contextCompaction":{"error":"Context too small","version":1}}}},"content":[{"content":{"text":"Compaction failed: Context too small","type":"text"},"type":"content"}],"sessionUpdate":"tool_call_update","status":"failed","toolCallId":"00000000-0000-4000-8000-000000000001"}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,7 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"jetbrains":{"air":{"contextCompaction":{"version":1},"version":1}}},"kind":"think","sessionUpdate":"tool_call","status":"in_progress","title":"Compact conversation","toolCallId":"00000000-0000-4000-8000-000000000001"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"sessionUpdate":"tool_call_update","status":"in_progress","toolCallId":"00000000-0000-4000-8000-000000000001"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"jetbrains":{"air":{"contextCompaction":{"durationMs":7,"postTokens":100,"preTokens":1000,"trigger":"automatic","version":1}}}},"sessionUpdate":"tool_call_update","status":"completed","toolCallId":"00000000-0000-4000-8000-000000000001"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"sessionUpdate":"usage_update","size":200000,"used":100}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":100}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,7 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"jetbrains":{"air":{"contextCompaction":{"version":1},"version":1}}},"compactionId":"00000000-0000-4000-8000-000000000001","sessionUpdate":"compaction_update","status":"in_progress"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"compactionId":"00000000-0000-4000-8000-000000000001","content":{"text":"The summary.","type":"text"},"sessionUpdate":"compaction_summary_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"jetbrains":{"air":{"contextCompaction":{"durationMs":7,"postTokens":100,"preTokens":1000,"trigger":"automatic","version":1},"version":1}}},"compactionId":"00000000-0000-4000-8000-000000000001","sessionUpdate":"compaction_update","status":"completed"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"sessionUpdate":"usage_update","size":200000,"used":100}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":100}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,10 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"Edit"}},"content":[],"kind":"edit","locations":[],"name":"Edit","sessionUpdate":"tool_call","status":"pending","title":"Edit","toolCallId":"toolu_edit"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"locations":[{"path":"<cwd>/src/app.ts"}],"sessionUpdate":"tool_call_update","title":"Edit src/app.ts","toolCallId":"toolu_edit"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":[{"newText":"value = 2","oldText":"value = 1","path":"<cwd>/src/app.ts","type":"diff"}],"rawInput":{"file_path":"<cwd>/src/app.ts"},"sessionUpdate":"tool_call_update","toolCallId":"toolu_edit"}}}
{"kind":"requestPermission","payload":{"_meta":{"jetbrains":{"air":{"permission":{"title":"Edit src/app.ts","version":1},"version":1}}},"options":[{"kind":"allow_once","name":"Yes","optionId":"allow-once"},{"kind":"reject_once","name":"No","optionId":"reject"}],"sessionId":"<session>","toolCall":{"content":[{"_meta":{"jetbrains":{"air":{"diffPatch":{"format":"git_patch","text":"diff --git a<cwd>/src/app.ts b<cwd>/src/app.ts\n--- a<cwd>/src/app.ts\n+++ b<cwd>/src/app.ts\n@@ -1 +1 @@\n-const value = 1;\n+const value = 2;\n","version":1},"version":1}}},"newText":"","oldText":null,"path":"<cwd>/src/app.ts","type":"diff"}],"rawInput":{"file_path":"<cwd>/src/app.ts"},"title":"Edit src/app.ts","toolCallId":"toolu_edit"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":[{"content":{"text":"```\nThe user doesn't want to proceed with this tool use. The tool use was rejected.\n```","type":"text"},"type":"content"}],"sessionUpdate":"tool_call_update","status":"failed","toolCallId":"toolu_edit"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,11 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"Edit"}},"content":[],"kind":"edit","locations":[],"name":"Edit","sessionUpdate":"tool_call","status":"pending","title":"Edit","toolCallId":"toolu_edit"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"locations":[{"path":"<cwd>/src/app.ts"}],"sessionUpdate":"tool_call_update","title":"Edit src/app.ts","toolCallId":"toolu_edit"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":[{"newText":"const value = 2;","oldText":"const value = 1;","path":"<cwd>/src/app.ts","type":"diff"}],"rawInput":{"file_path":"<cwd>/src/app.ts"},"sessionUpdate":"tool_call_update","toolCallId":"toolu_edit"}}}
{"kind":"requestPermission","payload":{"_meta":{"jetbrains":{"air":{"permission":{"title":"Edit src/app.ts","version":1},"version":1}}},"options":[{"kind":"allow_once","name":"Yes","optionId":"allow-once"},{"kind":"reject_once","name":"No","optionId":"reject"}],"sessionId":"<session>","toolCall":{"content":[{"_meta":{"jetbrains":{"air":{"diffPatch":{"format":"git_patch","text":"diff --git a<cwd>/src/app.ts b<cwd>/src/app.ts\n--- a<cwd>/src/app.ts\n+++ b<cwd>/src/app.ts\n@@ -1,3 +1,3 @@\n line 1\n-const value = 1;\n+const value = 2;\n line 3\n","version":1},"version":1}}},"newText":"","oldText":null,"path":"<cwd>/src/app.ts","type":"diff"}],"rawInput":{"file_path":"<cwd>/src/app.ts"},"title":"Edit src/app.ts","toolCallId":"toolu_edit"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"rawOutput":"The file <cwd>/src/app.ts has been updated successfully.","sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_edit"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":[{"newText":"line 1\nconst value = 2;\nline 3","oldText":"line 1\nconst value = 1;\nline 3","path":"<cwd>/src/app.ts","type":"diff"}],"locations":[{"line":1,"path":"<cwd>/src/app.ts"}],"sessionUpdate":"tool_call_update","toolCallId":"toolu_edit"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,11 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"ExitPlanMode"}},"content":[],"kind":"switch_mode","name":"ExitPlanMode","sessionUpdate":"tool_call","status":"pending","title":"Approve Plan","toolCallId":"toolu_plan"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"rawInput":{"plan":"# Plan\n1. Do it"},"sessionUpdate":"tool_call_update","toolCallId":"toolu_plan"}}}
{"kind":"requestPermission","payload":{"_meta":{"jetbrains":{"air":{"permission":{"title":"Ready to code?","version":1},"version":1}}},"options":[{"kind":"allow_once","name":"Yes, manually approve edits","optionId":"exit-plan-default"},{"kind":"allow_always","name":"Yes, clear context (0% used) and use auto mode","optionId":"exit-plan-clear-auto"},{"kind":"allow_always","name":"Yes, and use auto mode","optionId":"exit-plan-auto"},{"kind":"allow_always","name":"Yes, and bypass permissions","optionId":"exit-plan-bypass"},{"kind":"reject_once","name":"No, keep planning","optionId":"reject"}],"sessionId":"<session>","toolCall":{"rawInput":{"plan":"# Plan\n1. Do it"},"title":"Approve Plan","toolCallId":"toolu_plan"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"currentModeId":"default","sessionUpdate":"current_mode_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"configOptions":[{"category":"mode","currentValue":"default","description":"Session permission mode","id":"mode","name":"Mode","options":[{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Always ask before making changes","name":"Manual","value":"default"},{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"_meta":{"jetbrains":{"air":{"kind":"plan","version":1}}},"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"_meta":{"jetbrains":{"air":{"kind":"auto_review","version":1}}},"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"_meta":{"jetbrains":{"air":{"kind":"full_access","version":1}}},"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","id":"model","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionUpdate":"config_option_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"sessionUpdate":"tool_call_update","status":"completed","title":"Exited Plan Mode","toolCallId":"toolu_plan"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,9 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"ExitPlanMode"}},"content":[],"kind":"switch_mode","name":"ExitPlanMode","sessionUpdate":"tool_call","status":"pending","title":"Approve Plan","toolCallId":"toolu_plan"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"rawInput":{"plan":"# Plan\n1. Do it"},"sessionUpdate":"tool_call_update","toolCallId":"toolu_plan"}}}
{"kind":"requestPermission","payload":{"_meta":{"jetbrains":{"air":{"permission":{"title":"Ready to code?","version":1},"version":1}}},"options":[{"kind":"allow_once","name":"Yes, manually approve edits","optionId":"exit-plan-default"},{"kind":"allow_always","name":"Yes, clear context (0% used) and use auto mode","optionId":"exit-plan-clear-auto"},{"kind":"allow_always","name":"Yes, and use auto mode","optionId":"exit-plan-auto"},{"kind":"allow_always","name":"Yes, and bypass permissions","optionId":"exit-plan-bypass"},{"kind":"reject_once","name":"No, keep planning","optionId":"reject"}],"sessionId":"<session>","toolCall":{"rawInput":{"plan":"# Plan\n1. Do it"},"title":"Approve Plan","toolCallId":"toolu_plan"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"rawOutput":"The user doesn't want to proceed with this tool use.","sessionUpdate":"tool_call_update","status":"failed","toolCallId":"toolu_plan"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,3 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"jetbrains":{"air":{"goal":{"controlMethod":"_session/goal","objective":"Ship the feature","status":"active"},"version":1}}},"sessionUpdate":"session_info_update"}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,14 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"Grep"}},"content":[],"kind":"search","name":"Grep","sessionUpdate":"tool_call","status":"pending","title":"grep","toolCallId":"toolu_grep"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"sessionUpdate":"tool_call_update","title":"grep \"value\"","toolCallId":"toolu_grep"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"sessionUpdate":"tool_call_update","title":"grep \"value\" src","toolCallId":"toolu_grep"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"rawInput":{"-n":true,"output_mode":"content","path":"src","pattern":"value"},"sessionUpdate":"tool_call_update","title":"grep -n \"value\" src","toolCallId":"toolu_grep"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_grep"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"Glob"}},"content":[],"kind":"search","locations":[],"name":"Glob","sessionUpdate":"tool_call","status":"pending","title":"Find","toolCallId":"toolu_glob"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"rawInput":{"pattern":"**/*.ts"},"sessionUpdate":"tool_call_update","title":"Find `**/*.ts`","toolCallId":"toolu_glob"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":[{"content":{"text":"src/app.ts\nsrc/b.ts","type":"text"},"type":"content"}],"sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_glob"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,9 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"mcp__docs__search"},"is_mcp_tool_call":true},"content":[],"kind":"other","name":"mcp__docs__search","sessionUpdate":"tool_call","status":"pending","title":"mcp__docs__search","toolCallId":"toolu_mcp"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"rawInput":{"q":"acp"},"sessionUpdate":"tool_call_update","toolCallId":"toolu_mcp"}}}
{"kind":"requestPermission","payload":{"_meta":{"jetbrains":{"air":{"permission":{"title":"mcp__docs__search","version":1},"version":1}}},"options":[{"kind":"allow_once","name":"Yes","optionId":"allow-once"},{"kind":"reject_once","name":"No","optionId":"reject"}],"sessionId":"<session>","toolCall":{"_meta":{"claudeCode":{"mcpServer":{"name":"docs","source":"project"}}},"rawInput":{"q":"acp"},"title":"mcp__docs__search","toolCallId":"toolu_mcp"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":[{"content":{"text":"Found 2 documents.","type":"text"},"type":"content"}],"sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_mcp"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,4 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"memory_recall","toolResponse":{"mode":"select"}}},"kind":"read","locations":[{"path":"/memory/a.md"},{"path":"/memory/b.md"}],"sessionUpdate":"tool_call","status":"completed","title":"Recalled 2 memories","toolCallId":"00000000-0000-4000-8000-000000000001"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"memory_recall","toolResponse":{"mode":"synthesize"}}},"content":[{"content":{"text":"The user prefers tabs.","type":"text"},"type":"content"}],"kind":"read","sessionUpdate":"tool_call","status":"completed","title":"Recalled synthesized memory","toolCallId":"00000000-0000-4000-8000-000000000002"}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,4 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"SandboxNetworkAccess"}},"content":[],"kind":"other","name":"SandboxNetworkAccess","rawInput":{"host":"example.com"},"sessionUpdate":"tool_call","status":"pending","title":"SandboxNetworkAccess","toolCallId":"toolu_net"}}}
{"kind":"requestPermission","payload":{"_meta":{"jetbrains":{"air":{"permission":{"description":"Reason: Sandbox blocks network","title":"example.com","version":1},"version":1}}},"options":[{"kind":"allow_once","name":"Yes","optionId":"allow-once"},{"kind":"reject_once","name":"No","optionId":"reject"}],"sessionId":"<session>","toolCall":{"rawInput":{"host":"example.com"},"title":"example.com","toolCallId":"toolu_net"}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,11 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"NotebookEdit"}},"content":[],"kind":"edit","locations":[],"name":"NotebookEdit","sessionUpdate":"tool_call","status":"pending","title":"Edit notebook","toolCallId":"toolu_nb"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"locations":[{"path":"<cwd>/n.ipynb"}],"sessionUpdate":"tool_call_update","title":"Edit cell in n.ipynb","toolCallId":"toolu_nb"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"sessionUpdate":"tool_call_update","title":"Edit cell cell-1 in n.ipynb","toolCallId":"toolu_nb"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"rawInput":{"cell_id":"cell-1","edit_mode":"replace","new_source":"print('hi')","notebook_path":"<cwd>/n.ipynb"},"sessionUpdate":"tool_call_update","toolCallId":"toolu_nb"}}}
{"kind":"requestPermission","payload":{"_meta":{"jetbrains":{"air":{"permission":{"title":"Edit cell cell-1 in n.ipynb","version":1},"version":1}}},"options":[{"kind":"allow_once","name":"Yes","optionId":"allow-once"},{"kind":"reject_once","name":"No","optionId":"reject"}],"sessionId":"<session>","toolCall":{"rawInput":{"cell_id":"cell-1","edit_mode":"replace","new_source":"print('hi')","notebook_path":"<cwd>/n.ipynb"},"title":"Edit cell cell-1 in n.ipynb","toolCallId":"toolu_nb"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_nb"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,10 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"Bash"},"terminal_info":{"terminal_id":"toolu_denied"}},"content":[{"terminalId":"toolu_denied","type":"terminal"}],"kind":"execute","name":"Bash","sessionUpdate":"tool_call","status":"pending","title":"Terminal","toolCallId":"toolu_denied"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"rawInput":{"command":"rm -rf /"},"sessionUpdate":"tool_call_update","title":"rm -rf /","toolCallId":"toolu_denied"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolResponse":{"decisionReasonType":"rule","message":"Permission to use Bash has been denied."}}},"content":[{"content":{"text":"Permission denied: Denied by rule Bash(rm:*)","type":"text"},"type":"content"}],"sessionUpdate":"tool_call_update","status":"failed","toolCallId":"toolu_denied"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"terminal_output_delta":{"data":"Permission to use Bash has been denied.","terminal_id":"toolu_denied"}},"sessionUpdate":"tool_call_update","toolCallId":"toolu_denied"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"terminal_exit":{"exit_code":1,"signal":null,"terminal_id":"toolu_denied"}},"sessionUpdate":"tool_call_update","toolCallId":"toolu_denied"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,8 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":{"text":"Work","type":"text"},"messageId":"msg_rate","sessionUpdate":"agent_message_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":{"text":"ing.","type":"text"},"messageId":"msg_rate","sessionUpdate":"agent_message_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6","_claude/rateLimit":{"resetsAt":1700000000,"status":"allowed_warning","utilization":0.9}},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6","_claude/origin":{"kind":"human"}},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,8 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"Read"}},"content":[],"kind":"read","locations":[],"name":"Read","sessionUpdate":"tool_call","status":"pending","title":"Read File","toolCallId":"toolu_read"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"locations":[{"line":1,"path":"<cwd>/a.ts"}],"rawInput":{"file_path":"<cwd>/a.ts"},"sessionUpdate":"tool_call_update","title":"Read a.ts","toolCallId":"toolu_read"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_read"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,15 @@
{"kind":"initialize","payload":{"_meta":{"jetbrains":{"air":{"capabilities":["sessionFailure","agentFileChangeReport","nativeSubagentSessions","asyncTasks","recommendedValue","diffPatch","planFile"],"goal":{"actions":["set","clear"],"controlMethod":"_session/goal","version":1},"version":1}},"steering":{"supported":true}},"agentCapabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"logout":{}},"loadSession":true,"mcpCapabilities":{"http":true,"sse":true},"promptCapabilities":{"embeddedContext":true,"image":true},"providers":{},"sessionCapabilities":{"additionalDirectories":{},"close":{},"delete":{},"fork":{},"list":{},"resume":{},"subagents":{}}},"agentInfo":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"authMethods":[],"protocolVersion":1}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":{"text":"Fix the bug","type":"text"},"messageId":"00000000-0000-4000-8000-00000000c001","sessionUpdate":"user_message_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":{"text":"Check the file.","type":"text"},"messageId":"msg_r1","sessionUpdate":"agent_thought_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":{"text":"I will edit it.","type":"text"},"messageId":"msg_r1","sessionUpdate":"agent_message_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"Bash"},"jetbrains":{"air":{"commandTitle":"List","version":1}},"terminal_info":{"terminal_id":"toolu_r_bash"}},"content":[{"terminalId":"toolu_r_bash","type":"terminal"}],"kind":"execute","name":"Bash","rawInput":{"command":"ls","description":"List"},"sessionUpdate":"tool_call","status":"pending","title":"ls","toolCallId":"toolu_r_bash"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"Edit"}},"content":[{"newText":"b","oldText":"a","path":"<cwd>/src/app.ts","type":"diff"}],"kind":"edit","locations":[{"path":"<cwd>/src/app.ts"}],"name":"Edit","rawInput":{"file_path":"<cwd>/src/app.ts"},"sessionUpdate":"tool_call","status":"pending","title":"Edit src/app.ts","toolCallId":"toolu_r_edit"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"capabilities":{},"name":"Explore","sessionUpdate":"subagent_spawned","subagentSessionId":"<session>:replay-subagent:toolu_r_task","task":"Look around"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"terminal_output_delta":{"data":"app.ts","terminal_id":"toolu_r_bash"}},"sessionUpdate":"tool_call_update","toolCallId":"toolu_r_bash"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"terminal_exit":{"exit_code":0,"signal":null,"terminal_id":"toolu_r_bash"}},"sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_r_bash"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"rawOutput":"The file <cwd>/src/app.ts has been updated successfully.","sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_r_edit"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>:replay-subagent:toolu_r_task","update":{"_meta":{"claudeCode":{"parentToolUseId":"toolu_r_task"}},"content":{"text":"Subagent text.","type":"text"},"messageId":"msg_r_sub","sessionUpdate":"agent_message_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":{"text":"Fixed.","type":"text"},"messageId":"msg_r2","sessionUpdate":"agent_message_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"sessionUpdate":"subagent_state_update","state":"completed","subagentSessionId":"<session>:replay-subagent:toolu_r_task"}}}
{"kind":"loadSession","payload":{"configOptions":[{"category":"mode","currentValue":"default","description":"Session permission mode","id":"mode","name":"Mode","options":[{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Always ask before making changes","name":"Manual","value":"default"},{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"_meta":{"jetbrains":{"air":{"kind":"plan","version":1}}},"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"_meta":{"jetbrains":{"air":{"kind":"auto_review","version":1}}},"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"_meta":{"jetbrains":{"air":{"kind":"full_access","version":1}}},"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","id":"model","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"modes":{"availableModes":[{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Always ask before making changes","id":"default","name":"Manual"},{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Automatically accept all file edits","id":"acceptEdits","name":"Accept edits"},{"_meta":{"jetbrains":{"air":{"kind":"plan","version":1}}},"description":"Create a plan before making changes","id":"plan","name":"Plan"},{"_meta":{"jetbrains":{"air":{"kind":"auto_review","version":1}}},"description":"Claude handles permission decisions","id":"auto","name":"Auto"},{"_meta":{"jetbrains":{"air":{"kind":"full_access","version":1}}},"description":"Accepts all permissions","id":"bypassPermissions","name":"Bypass permissions"}],"currentModeId":"default"},"sessionId":"<session>"}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}

View File

@@ -0,0 +1,3 @@
{"kind":"initialize","payload":{"_meta":{"jetbrains":{"air":{"capabilities":["sessionFailure","agentFileChangeReport","nativeSubagentSessions","asyncTasks","recommendedValue","diffPatch","planFile"],"goal":{"actions":["set","clear"],"controlMethod":"_session/goal","version":1},"version":1}},"steering":{"supported":true}},"agentCapabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"logout":{}},"loadSession":true,"mcpCapabilities":{"http":true,"sse":true},"promptCapabilities":{"embeddedContext":true,"image":true},"providers":{},"sessionCapabilities":{"additionalDirectories":{},"close":{},"delete":{},"fork":{},"list":{},"resume":{},"subagents":{}}},"agentInfo":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"authMethods":[],"protocolVersion":1}}
{"kind":"newSession","payload":{"configOptions":[{"category":"mode","currentValue":"default","description":"Session permission mode","id":"mode","name":"Mode","options":[{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Always ask before making changes","name":"Manual","value":"default"},{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"_meta":{"jetbrains":{"air":{"kind":"plan","version":1}}},"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"_meta":{"jetbrains":{"air":{"kind":"auto_review","version":1}}},"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"_meta":{"jetbrains":{"air":{"kind":"full_access","version":1}}},"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"},{"category":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","id":"model","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"modes":{"availableModes":[{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Always ask before making changes","id":"default","name":"Manual"},{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Automatically accept all file edits","id":"acceptEdits","name":"Accept edits"},{"_meta":{"jetbrains":{"air":{"kind":"plan","version":1}}},"description":"Create a plan before making changes","id":"plan","name":"Plan"},{"_meta":{"jetbrains":{"air":{"kind":"auto_review","version":1}}},"description":"Claude handles permission decisions","id":"auto","name":"Auto"},{"_meta":{"jetbrains":{"air":{"kind":"full_access","version":1}}},"description":"Accepts all permissions","id":"bypassPermissions","name":"Bypass permissions"}],"currentModeId":"default"},"sessionId":"<session>"}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}

View File

@@ -0,0 +1,8 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"Skill"}},"content":[],"kind":"other","name":"Skill","sessionUpdate":"tool_call","status":"pending","title":"Load skill","toolCallId":"toolu_skill"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"jetbrains":{"air":{"skill":{"name":"commits","path":"<cwd>/.claude/skills/commits/SKILL.md"},"version":1}}},"rawInput":{"skill":"commits"},"sessionUpdate":"tool_call_update","title":"Load skill: commits","toolCallId":"toolu_skill"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"rawOutput":"Launching skill: commits","sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_skill"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,10 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"Agent","toolResponse":{"isAsync":true,"status":"async_launched"}}},"sessionUpdate":"tool_call_update","toolCallId":"toolu_agent"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"capabilities":{},"name":"Background review","prompt":"Review the diff","sessionUpdate":"subagent_spawned","subagentSessionId":"a2","task":"Review the diff"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"a2","update":{"_meta":{"claudeCode":{"parentToolUseId":"toolu_agent"}},"content":{"text":"Reviewi","type":"text"},"messageId":"msg_async_sub","sessionUpdate":"agent_message_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"a2","update":{"_meta":{"claudeCode":{"parentToolUseId":"toolu_agent"}},"content":{"text":"ng now.","type":"text"},"messageId":"msg_async_sub","sessionUpdate":"agent_message_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"sessionUpdate":"subagent_state_update","state":"completed","subagentSessionId":"a2"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,9 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"capabilities":{},"name":"Check the logs","prompt":"Check logs","sessionUpdate":"subagent_spawned","subagentSessionId":"agent_late","task":"Check logs"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_late","update":{"_meta":{"claudeCode":{"parentToolUseId":"toolu_late","toolName":"Read"}},"content":[],"kind":"read","locations":[],"name":"Read","sessionUpdate":"tool_call","status":"pending","title":"Read File","toolCallId":"toolu_late_read"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_late","update":{"locations":[{"line":1,"path":"/var/log/app.log"}],"rawInput":{"file_path":"/var/log/app.log"},"sessionUpdate":"tool_call_update","title":"Read /var/log/app.log","toolCallId":"toolu_late_read"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"sessionUpdate":"subagent_state_update","state":"completed","subagentSessionId":"agent_late"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,19 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"capabilities":{},"name":"Fix the build","prompt":"Make the build pass","sessionUpdate":"subagent_spawned","subagentSessionId":"agent_n","task":"Make the build pass"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_n","update":{"_meta":{"claudeCode":{"parentToolUseId":"toolu_native"}},"content":{"text":"Running t","type":"text"},"messageId":"msg_native_sub_1","sessionUpdate":"agent_message_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_n","update":{"_meta":{"claudeCode":{"parentToolUseId":"toolu_native"}},"content":{"text":"he build.","type":"text"},"messageId":"msg_native_sub_1","sessionUpdate":"agent_message_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_n","update":{"_meta":{"claudeCode":{"parentToolUseId":"toolu_native","toolName":"Grep"}},"content":[],"kind":"search","name":"Grep","sessionUpdate":"tool_call","status":"pending","title":"grep","toolCallId":"toolu_native_grep"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_n","update":{"sessionUpdate":"tool_call_update","title":"grep \"TODO\"","toolCallId":"toolu_native_grep"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_n","update":{"rawInput":{"path":"/src","pattern":"TODO"},"sessionUpdate":"tool_call_update","title":"grep \"TODO\" /src","toolCallId":"toolu_native_grep"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_n","update":{"sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_native_grep"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_n","update":{"_meta":{"claudeCode":{"parentToolUseId":"toolu_native","toolName":"Bash"},"terminal_info":{"terminal_id":"toolu_native_bash"}},"content":[{"terminalId":"toolu_native_bash","type":"terminal"}],"kind":"execute","name":"Bash","sessionUpdate":"tool_call","status":"pending","title":"Terminal","toolCallId":"toolu_native_bash"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_n","update":{"sessionUpdate":"tool_call_update","title":"make","toolCallId":"toolu_native_bash"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_n","update":{"_meta":{"jetbrains":{"air":{"commandTitle":"Build","version":1}}},"rawInput":{"command":"make","description":"Build"},"sessionUpdate":"tool_call_update","toolCallId":"toolu_native_bash"}}}
{"kind":"requestPermission","payload":{"_meta":{"jetbrains":{"air":{"permission":{"title":"make","version":1},"version":1}}},"options":[{"kind":"allow_once","name":"Yes","optionId":"allow-once"},{"kind":"reject_once","name":"No","optionId":"reject"}],"sessionId":"agent_n","toolCall":{"rawInput":{"command":"make","description":"Build"},"title":"make","toolCallId":"toolu_native_bash"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_n","update":{"_meta":{"terminal_output_delta":{"data":"make: *** Error 2","terminal_id":"toolu_native_bash"}},"sessionUpdate":"tool_call_update","toolCallId":"toolu_native_bash"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_n","update":{"_meta":{"terminal_exit":{"exit_code":1,"signal":null,"terminal_id":"toolu_native_bash"}},"sessionUpdate":"tool_call_update","status":"failed","toolCallId":"toolu_native_bash"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"sessionUpdate":"subagent_state_update","state":"failed","subagentSessionId":"agent_n"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,14 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"capabilities":{},"name":"Plan the work","prompt":"Plan it","sessionUpdate":"subagent_spawned","subagentSessionId":"agent_outer","task":"Plan it"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_outer","update":{"capabilities":{},"name":"Read the spec","prompt":"Read spec.md","sessionUpdate":"subagent_spawned","subagentSessionId":"agent_inner","task":"Read spec.md"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_inner","update":{"_meta":{"claudeCode":{"parentToolUseId":"toolu_inner","toolName":"Read"}},"content":[],"kind":"read","locations":[],"name":"Read","sessionUpdate":"tool_call","status":"pending","title":"Read File","toolCallId":"toolu_grandchild_read"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_inner","update":{"locations":[{"line":1,"path":"/spec.md"}],"rawInput":{"file_path":"/spec.md"},"sessionUpdate":"tool_call_update","title":"Read /spec.md","toolCallId":"toolu_grandchild_read"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_inner","update":{"sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_grandchild_read"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_outer","update":{"sessionUpdate":"subagent_state_update","state":"completed","subagentSessionId":"agent_inner"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_outer","update":{"_meta":{"claudeCode":{"parentToolUseId":"toolu_outer"}},"content":{"text":"Plan:","type":"text"},"messageId":"msg_outer_text","sessionUpdate":"agent_message_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_outer","update":{"_meta":{"claudeCode":{"parentToolUseId":"toolu_outer"}},"content":{"text":" do X.","type":"text"},"messageId":"msg_outer_text","sessionUpdate":"agent_message_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"sessionUpdate":"subagent_state_update","state":"completed","subagentSessionId":"agent_outer"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,27 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"capabilities":{},"name":"Explore code","prompt":"Find the parser","sessionUpdate":"subagent_spawned","subagentSessionId":"agent_1","task":"Find the parser"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_1","update":{"_meta":{"claudeCode":{"parentToolUseId":"toolu_task"}},"content":{"text":"Looking for","type":"text"},"messageId":"msg_sub_1","sessionUpdate":"agent_message_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_1","update":{"_meta":{"claudeCode":{"parentToolUseId":"toolu_task"}},"content":{"text":" the parser.","type":"text"},"messageId":"msg_sub_1","sessionUpdate":"agent_message_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_1","update":{"_meta":{"claudeCode":{"parentToolUseId":"toolu_task","toolName":"Read"}},"content":[],"kind":"read","locations":[],"name":"Read","sessionUpdate":"tool_call","status":"pending","title":"Read File","toolCallId":"toolu_sub_read"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_1","update":{"locations":[{"line":1,"path":"/x.ts"}],"rawInput":{"file_path":"/x.ts"},"sessionUpdate":"tool_call_update","title":"Read /x.ts","toolCallId":"toolu_sub_read"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_1","update":{"sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_sub_read"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_1","update":{"_meta":{"claudeCode":{"parentToolUseId":"toolu_task","toolName":"Bash"},"terminal_info":{"terminal_id":"toolu_sub_bash"}},"content":[{"terminalId":"toolu_sub_bash","type":"terminal"}],"kind":"execute","name":"Bash","sessionUpdate":"tool_call","status":"pending","title":"Terminal","toolCallId":"toolu_sub_bash"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_1","update":{"sessionUpdate":"tool_call_update","title":"rg parser","toolCallId":"toolu_sub_bash"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_1","update":{"_meta":{"jetbrains":{"air":{"commandTitle":"Search","version":1}}},"rawInput":{"command":"rg parser","description":"Search"},"sessionUpdate":"tool_call_update","toolCallId":"toolu_sub_bash"}}}
{"kind":"requestPermission","payload":{"_meta":{"jetbrains":{"air":{"permission":{"title":"rg parser","version":1},"version":1}}},"options":[{"kind":"allow_once","name":"Yes","optionId":"allow-once"},{"kind":"reject_once","name":"No","optionId":"reject"}],"sessionId":"agent_1","toolCall":{"rawInput":{"command":"rg parser","description":"Search"},"title":"rg parser","toolCallId":"toolu_sub_bash"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_1","update":{"_meta":{"terminal_output_delta":{"data":"x.ts","terminal_id":"toolu_sub_bash"}},"sessionUpdate":"tool_call_update","toolCallId":"toolu_sub_bash"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_1","update":{"_meta":{"terminal_exit":{"exit_code":0,"signal":null,"terminal_id":"toolu_sub_bash"}},"sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_sub_bash"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_1","update":{"_meta":{"claudeCode":{"parentToolUseId":"toolu_task","toolName":"Edit"}},"content":[],"kind":"edit","locations":[],"name":"Edit","sessionUpdate":"tool_call","status":"pending","title":"Edit","toolCallId":"toolu_sub_edit"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_1","update":{"locations":[{"path":"<cwd>/x.ts"}],"sessionUpdate":"tool_call_update","title":"Edit x.ts","toolCallId":"toolu_sub_edit"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_1","update":{"content":[{"newText":"b","oldText":"a","path":"<cwd>/x.ts","type":"diff"}],"rawInput":{"file_path":"<cwd>/x.ts"},"sessionUpdate":"tool_call_update","toolCallId":"toolu_sub_edit"}}}
{"kind":"requestPermission","payload":{"_meta":{"jetbrains":{"air":{"permission":{"title":"Edit x.ts","version":1},"version":1}}},"options":[{"kind":"allow_once","name":"Yes","optionId":"allow-once"},{"kind":"reject_once","name":"No","optionId":"reject"}],"sessionId":"agent_1","toolCall":{"rawInput":{"file_path":"<cwd>/x.ts"},"title":"Edit x.ts","toolCallId":"toolu_sub_edit"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_1","update":{"rawOutput":"The file has been updated.","sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_sub_edit"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"locations":[{"line":1,"path":"<cwd>/x.ts"}],"sessionUpdate":"tool_call_update","toolCallId":"toolu_sub_edit"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_1","update":{"_meta":{"claudeCode":{"parentToolUseId":"toolu_task"}},"content":{"text":"Foun","type":"text"},"messageId":"msg_sub_2","sessionUpdate":"agent_message_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_1","update":{"_meta":{"claudeCode":{"parentToolUseId":"toolu_task"}},"content":{"text":"d it.","type":"text"},"messageId":"msg_sub_2","sessionUpdate":"agent_message_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"Task","toolResponse":{"status":"completed"}}},"sessionUpdate":"tool_call_update","toolCallId":"toolu_task"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"sessionUpdate":"subagent_state_update","state":"completed","subagentSessionId":"agent_1"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,14 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"capabilities":{},"name":"Summarize","prompt":"Summarize the repo","sessionUpdate":"subagent_spawned","subagentSessionId":"agent_t","task":"Summarize the repo"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_t","update":{"_meta":{"claudeCode":{"parentToolUseId":"toolu_transcript"}},"content":{"text":"Look at t","type":"text"},"messageId":"msg_transcript_sub","sessionUpdate":"agent_thought_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_t","update":{"_meta":{"claudeCode":{"parentToolUseId":"toolu_transcript"}},"content":{"text":"he layout.","type":"text"},"messageId":"msg_transcript_sub","sessionUpdate":"agent_thought_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_t","update":{"_meta":{"claudeCode":{"parentToolUseId":"toolu_transcript"}},"content":{"text":"The repo has ","type":"text"},"messageId":"msg_transcript_sub","sessionUpdate":"agent_message_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_t","update":{"_meta":{"claudeCode":{"parentToolUseId":"toolu_transcript"}},"content":{"text":"two packages.","type":"text"},"messageId":"msg_transcript_sub","sessionUpdate":"agent_message_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_t","update":{"_meta":{"claudeCode":{"parentToolUseId":"toolu_transcript","toolName":"Glob"}},"content":[],"kind":"search","locations":[],"name":"Glob","sessionUpdate":"tool_call","status":"pending","title":"Find","toolCallId":"toolu_transcript_glob"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_t","update":{"rawInput":{"pattern":"*"},"sessionUpdate":"tool_call_update","title":"Find `*`","toolCallId":"toolu_transcript_glob"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"agent_t","update":{"content":[{"content":{"text":"a\nb","type":"text"},"type":"content"}],"sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_transcript_glob"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"sessionUpdate":"subagent_state_update","state":"completed","subagentSessionId":"agent_t"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,16 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"entries":[{"content":"Write tests","priority":"medium","status":"pending"}],"sessionUpdate":"plan"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"entries":[{"content":"Write tests","priority":"medium","status":"in_progress"}],"sessionUpdate":"plan"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"entries":[{"content":"Write tests","priority":"medium","status":"completed"}],"sessionUpdate":"plan"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":{"text":"All ","type":"text"},"messageId":"msg_follow","sessionUpdate":"agent_message_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":{"text":"done.","type":"text"},"messageId":"msg_follow","sessionUpdate":"agent_message_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,12 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"TaskOutput"}},"content":[],"kind":"other","name":"TaskOutput","sessionUpdate":"tool_call","status":"pending","title":"TaskOutput","toolCallId":"toolu_out"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"rawInput":{"block":true,"task_id":"bash_1"},"sessionUpdate":"tool_call_update","toolCallId":"toolu_out"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":[{"content":{"text":"<retrieval_status>success</retrieval_status>\n<output>done</output>","type":"text"},"type":"content"}],"sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_out"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"TaskStop"}},"content":[],"kind":"other","name":"TaskStop","sessionUpdate":"tool_call","status":"pending","title":"TaskStop","toolCallId":"toolu_stop"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"rawInput":{"task_id":"bash_1"},"sessionUpdate":"tool_call_update","toolCallId":"toolu_stop"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":[{"content":{"text":"Successfully stopped task: bash_1","type":"text"},"type":"content"}],"sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_stop"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,9 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":{"text":"Let me thin","type":"text"},"messageId":"msg_text","sessionUpdate":"agent_thought_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":{"text":"k about it.","type":"text"},"messageId":"msg_text","sessionUpdate":"agent_thought_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":{"text":"Here is t","type":"text"},"messageId":"msg_text","sessionUpdate":"agent_message_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":{"text":"he answer.","type":"text"},"messageId":"msg_text","sessionUpdate":"agent_message_chunk"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,6 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"entries":[{"content":"Writing tests","priority":"medium","status":"in_progress"},{"content":"Ship","priority":"medium","status":"pending"}],"sessionUpdate":"plan"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

View File

@@ -0,0 +1,12 @@
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[],"sessionUpdate":"available_commands_update"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"Bash"},"terminal_info":{"terminal_id":"toolu_slow"}},"content":[{"terminalId":"toolu_slow","type":"terminal"}],"kind":"execute","name":"Bash","sessionUpdate":"tool_call","status":"pending","title":"Terminal","toolCallId":"toolu_slow"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":3}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"rawInput":{"command":"make"},"sessionUpdate":"tool_call_update","title":"make","toolCallId":"toolu_slow"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolResponse":{"elapsedTimeSeconds":1}}},"sessionUpdate":"tool_call_update","status":"in_progress","toolCallId":"toolu_slow"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolResponse":{"elapsedTimeSeconds":2}}},"sessionUpdate":"tool_call_update","toolCallId":"toolu_slow"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolResponse":{"elapsedTimeSeconds":3}}},"sessionUpdate":"tool_call_update","toolCallId":"toolu_slow"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"terminal_output_delta":{"data":"built","terminal_id":"toolu_slow"}},"sessionUpdate":"tool_call_update","toolCallId":"toolu_slow"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"terminal_exit":{"exit_code":0,"signal":null,"terminal_id":"toolu_slow"}},"sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_slow"}}}
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"cost":{"amount":0,"currency":"USD"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
{"kind":"promptResponse","payload":{"_meta":{"quota":{"model_usage":[],"token_count":{"cachedInputTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"reasoningOutputTokens":0,"totalTokens":0}}},"stopReason":"end_turn","usage":{"cachedReadTokens":0,"cachedWriteTokens":0,"inputTokens":0,"outputTokens":0,"totalTokens":0}}}

Some files were not shown because too many files have changed in this diff Show More