mirror of
https://github.com/agentclientprotocol/claude-agent-acp.git
synced 2026-11-17 14:51:13 +00:00
Compare commits
4 Commits
v0.107.4-p
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a6ba98ff3c | ||
|
|
c4dd80d739 | ||
|
|
4a076397c6 | ||
|
|
451bc04ae0 |
@@ -1,3 +1,3 @@
|
||||
{
|
||||
".": "0.107.3"
|
||||
".": "0.108.0"
|
||||
}
|
||||
|
||||
19
CHANGELOG.md
19
CHANGELOG.md
@@ -1,5 +1,24 @@
|
||||
# Changelog
|
||||
|
||||
## [0.108.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.107.3...v0.108.0) (2026-11-17)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* stream the output of foreground Bash commands ([#1587](https://github.com/agentclientprotocol/claude-agent-acp/issues/1587)) ([378e85d](https://github.com/agentclientprotocol/claude-agent-acp/commit/378e85d06027f5fa1802e94535548747a0feccc9))
|
||||
* support MCP servers that the client serves over the ACP connection (MCP-over-ACP) ([#1645](https://github.com/agentclientprotocol/claude-agent-acp/issues/1645)) ([20aeb46](https://github.com/agentclientprotocol/claude-agent-acp/commit/20aeb46ecedc60fef26ca8b1439b37e3bbd9b27a))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* an autonomous result naming the original prompt must not end a steered turn early ([#1451](https://github.com/agentclientprotocol/claude-agent-acp/issues/1451)) ([edab713](https://github.com/agentclientprotocol/claude-agent-acp/commit/edab7135028d83efaeaa38d0f8efe62ea7ddf203))
|
||||
* do not count a confirmWithUser question as an unfinished tool call ([#1644](https://github.com/agentclientprotocol/claude-agent-acp/issues/1644)) ([bcd3cda](https://github.com/agentclientprotocol/claude-agent-acp/commit/bcd3cdad35e4356247303870ac3137675e401227))
|
||||
* handle invalid file paths in tool reports ([#1419](https://github.com/agentclientprotocol/claude-agent-acp/issues/1419)) ([0073280](https://github.com/agentclientprotocol/claude-agent-acp/commit/0073280b977a69934fb56670943d1ef42e7b687e))
|
||||
* keep a workflow agent's tool call out of the turn's unfinished tools ([#1638](https://github.com/agentclientprotocol/claude-agent-acp/issues/1638)) ([451bc04](https://github.com/agentclientprotocol/claude-agent-acp/commit/451bc04ae022ef02473bdd92740cf19d8ceb5f3c))
|
||||
* offer clearing the context on plan approval only when Claude Code's setting is on ([#1627](https://github.com/agentclientprotocol/claude-agent-acp/issues/1627)) ([9d71d12](https://github.com/agentclientprotocol/claude-agent-acp/commit/9d71d12336c392c28967c600f8409841deaab7e0))
|
||||
* send MCP servers to Claude Code over stdin, not on its command line ([#1647](https://github.com/agentclientprotocol/claude-agent-acp/issues/1647)) ([c4dd80d](https://github.com/agentclientprotocol/claude-agent-acp/commit/c4dd80d7392b035f331b50bfdd802cfb3e144d37))
|
||||
* update to @anthropic-ai/claude-agent-sdk 0.3.326 ([#1646](https://github.com/agentclientprotocol/claude-agent-acp/issues/1646)) ([4a07639](https://github.com/agentclientprotocol/claude-agent-acp/commit/4a076397c6e785a8dd9166e8ea1df14fe17c52ed))
|
||||
|
||||
## [0.107.3](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.107.2...v0.107.3) (2026-11-16)
|
||||
|
||||
|
||||
|
||||
@@ -46,6 +46,10 @@ Claude CLI (`claude`) it runs. Keep them in the same directory; a symlink to
|
||||
instead, set `CLAUDE_CODE_EXECUTABLE`. On Alpine, install `libgcc` and
|
||||
`libstdc++` first.
|
||||
|
||||
A CLI named with `CLAUDE_CODE_EXECUTABLE` gets a session's MCP servers on its
|
||||
command line, where other users of the machine can read their `env` and
|
||||
`headers`. The CLI that comes with the adapter gets them over stdin.
|
||||
|
||||
To build one for your machine (needs [Bun](https://bun.sh)) and check it:
|
||||
|
||||
```sh
|
||||
|
||||
283
package-lock.json
generated
283
package-lock.json
generated
@@ -1,16 +1,16 @@
|
||||
{
|
||||
"name": "@agentclientprotocol/claude-agent-acp",
|
||||
"version": "0.107.3",
|
||||
"version": "0.108.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@agentclientprotocol/claude-agent-acp",
|
||||
"version": "0.107.3",
|
||||
"version": "0.108.0",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@agentclientprotocol/sdk": "2.7.0",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.3.325",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.3.326",
|
||||
"diff": "9.0.0",
|
||||
"zod": "4.6.7"
|
||||
},
|
||||
@@ -18,12 +18,12 @@
|
||||
"claude-agent-acp": "dist/index.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@anthropic-ai/sdk": "1.8.0",
|
||||
"@anthropic-ai/sdk": "1.9.0",
|
||||
"@eslint/js": "10.0.1",
|
||||
"@tsconfig/node22": "22.0.7",
|
||||
"@types/node": "26.6.6",
|
||||
"@typescript-eslint/eslint-plugin": "8.72.2",
|
||||
"@typescript-eslint/parser": "8.72.2",
|
||||
"@typescript-eslint/eslint-plugin": "8.73.0",
|
||||
"@typescript-eslint/parser": "8.73.0",
|
||||
"ajv": "8.20.0",
|
||||
"ajv-formats": "3.0.1",
|
||||
"eslint": "10.15.0",
|
||||
@@ -53,22 +53,22 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk": {
|
||||
"version": "0.3.325",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk/-/claude-agent-sdk-0.3.325.tgz",
|
||||
"integrity": "sha512-MhSm2Fhk3DA/hhjdCKXDZWlnykpPWJjX42SogllAHMplY9ZKT+Ltb8QPtQxpe225Imfs4A8IKaNE4biivA+fHg==",
|
||||
"version": "0.3.326",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk/-/claude-agent-sdk-0.3.326.tgz",
|
||||
"integrity": "sha512-BUTSky/4YWfL/MxC+4kV0NDbJFjbJPoQMFEk/s9G6hV9LUfYPMbsWz94bFQ7ZIo2ubj2xwJ2c2NVxkNlQhVw+Q==",
|
||||
"license": "SEE LICENSE IN README.md",
|
||||
"engines": {
|
||||
"node": ">=18.14.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.325",
|
||||
"@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.325",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.325",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.325",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-x64": "0.3.325",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.325",
|
||||
"@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.325",
|
||||
"@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.325"
|
||||
"@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.326",
|
||||
"@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.326",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.326",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.326",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-x64": "0.3.326",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.326",
|
||||
"@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.326",
|
||||
"@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.326"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@anthropic-ai/sdk": ">=0.93.0",
|
||||
@@ -77,9 +77,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-darwin-arm64": {
|
||||
"version": "0.3.325",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-arm64/-/claude-agent-sdk-darwin-arm64-0.3.325.tgz",
|
||||
"integrity": "sha512-0u8bTug2zH+zWE8CMiFrm/ldmH20uA9B/zhXpI7ATHFJnpPMdwTqE56CFM0m3LOwnNum0jpRn7XV1dn6Pf2pqA==",
|
||||
"version": "0.3.326",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-arm64/-/claude-agent-sdk-darwin-arm64-0.3.326.tgz",
|
||||
"integrity": "sha512-D3ZbowCMdKNet0YPZlsJxdJUW1t1Q8KLy1BwNd+5eilf18TlCRtWZlm8DrewFLmu/gxBK7gcsq6uysrIVbPyQg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -90,9 +90,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-darwin-x64": {
|
||||
"version": "0.3.325",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-x64/-/claude-agent-sdk-darwin-x64-0.3.325.tgz",
|
||||
"integrity": "sha512-HD3YRFyM5H5QH2usS/WD6gobk3BEp2jq9dKyrkhAVdQIqFMlrcSrRhGA0i3R1IOLxtPAYkmDGepZ62k1kMOW9Q==",
|
||||
"version": "0.3.326",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-x64/-/claude-agent-sdk-darwin-x64-0.3.326.tgz",
|
||||
"integrity": "sha512-m8K3Im2S8STdAVBrriuDZyJcnjsu/Vc3476wIOqTAefnCCdtdZ4AHcOcWxt+4KIHE5Vx1qT2qacTRrQBaVVweA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -103,9 +103,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-linux-arm64": {
|
||||
"version": "0.3.325",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64/-/claude-agent-sdk-linux-arm64-0.3.325.tgz",
|
||||
"integrity": "sha512-28oVrCEN6M6MJP8Od4SK/scal1QdLbn5Sci+qL8j55l6csHtPeUYF9zdjWLniFKph43pejfZf5te/Vf/bwehkw==",
|
||||
"version": "0.3.326",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64/-/claude-agent-sdk-linux-arm64-0.3.326.tgz",
|
||||
"integrity": "sha512-nYVN8jCcH490DCXIvby7rllzQFxLzKeKClfo2u/yv7mx3ipZQv344caULL/amwZ8w8GUzYyZ8hnS6pI9goSq+A==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -119,9 +119,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-linux-arm64-musl": {
|
||||
"version": "0.3.325",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64-musl/-/claude-agent-sdk-linux-arm64-musl-0.3.325.tgz",
|
||||
"integrity": "sha512-72y6QNRZC4eMCxne/wNsuwNHsViSkgFKlYMCUVXxmiR9gpIMd3rf++oJMIsSuEAQqzqT7jwCrdtibv6R4bx5PA==",
|
||||
"version": "0.3.326",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64-musl/-/claude-agent-sdk-linux-arm64-musl-0.3.326.tgz",
|
||||
"integrity": "sha512-baSsuP2/wuWujRpHjKT4WkJB5lhttqKq9jcTfY2KRtQpylbk8E5PWcct/pmwJfNCKIUoE8CD+JpmoWzsdd5Ajw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -135,9 +135,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-linux-x64": {
|
||||
"version": "0.3.325",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64/-/claude-agent-sdk-linux-x64-0.3.325.tgz",
|
||||
"integrity": "sha512-wXEWbDmNYiorY5EKASYjvQct8zHShUPmAS9N/IAsgPA/cx2vsOFqPQw8jRQKeaW6AmFgx7k/Wf7THalNXbMEkQ==",
|
||||
"version": "0.3.326",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64/-/claude-agent-sdk-linux-x64-0.3.326.tgz",
|
||||
"integrity": "sha512-WMhDY07gk2O0E8FXTbrVYmPjSLFaYPDCPwsNueVxm6vZ7ek+lPaKuOMAxTb1K07TzSmTOexoWeX2Y9VrbVDMpw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -151,9 +151,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-linux-x64-musl": {
|
||||
"version": "0.3.325",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64-musl/-/claude-agent-sdk-linux-x64-musl-0.3.325.tgz",
|
||||
"integrity": "sha512-BHewYUTd7mDLR5iHTVt6Q28gJKLC5C24b1H3NM0qGt9dxnjVUh1Lza52GzHY2Rb9hAPQymLSXWuVh1OFoFQatA==",
|
||||
"version": "0.3.326",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64-musl/-/claude-agent-sdk-linux-x64-musl-0.3.326.tgz",
|
||||
"integrity": "sha512-kK9VO3uFqNd4wgeU0Cefluam5AdPu6mvF1nn6aboGy8TA5NoxlWTmA4/AwMhK39zK1S9Q2OjeX0JtAahYlIchw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -167,9 +167,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-win32-arm64": {
|
||||
"version": "0.3.325",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-arm64/-/claude-agent-sdk-win32-arm64-0.3.325.tgz",
|
||||
"integrity": "sha512-NH3I2o105oKK8lfJ5RlzCp+YTZn3qncwQ1xSzQ4jqn7LUddThIidpFU7B+TKQxh1X9eayAp7EtrBQ36mXflQwQ==",
|
||||
"version": "0.3.326",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-arm64/-/claude-agent-sdk-win32-arm64-0.3.326.tgz",
|
||||
"integrity": "sha512-S+Ai+HhGRVFfTDmYWRfTrdWF3b4KMsfLSThZCqRJ0WCOKOXrRShMKV1hqqHBljx/wkMDPCpY0V/9S/e6w57eGQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -180,9 +180,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-win32-x64": {
|
||||
"version": "0.3.325",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-x64/-/claude-agent-sdk-win32-x64-0.3.325.tgz",
|
||||
"integrity": "sha512-pjqVL++V/2oMJ6u1HdB608bcTUvzts1e8hX93Q8khasy2JB+R823bnvpQapcOurOWB3+v1X2JXIjXyWcGPJCQQ==",
|
||||
"version": "0.3.326",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-x64/-/claude-agent-sdk-win32-x64-0.3.326.tgz",
|
||||
"integrity": "sha512-Yn1gZXYFuHmjHz7SpHx4TqDcRDsC8TfwWcntJdYjFzMWm+caPAp6QRqr/aTvirjqVA1D+D8Rd29xhuytpE3xTQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -193,9 +193,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/sdk": {
|
||||
"version": "1.8.0",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-1.8.0.tgz",
|
||||
"integrity": "sha512-yDOArk2+Qpd/djEKmZjrv7JZ+pn5iBHARJ9PAdvfhGf4H5wNqTgY/2K0/yDKdQdm8G8hrNQchMlBAHpPK7yBfg==",
|
||||
"version": "1.9.0",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-1.9.0.tgz",
|
||||
"integrity": "sha512-xDu4za3B+rK+5ZI8wLLoosiIuwi1ktZk/3L3KKNahwO50O34H+622hly8JdXzaEerLQDhsqwVzp81Nrw80BYHg==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@opentelemetry/api": "^1.4.1",
|
||||
@@ -328,23 +328,6 @@
|
||||
"node": "^20.19.0 || ^22.13.0 || >=24"
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/config-array/node_modules/minimatch": {
|
||||
"version": "11.0.8",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.8.tgz",
|
||||
"integrity": "sha512-nFQuYSTVrGvysVBps5Ih+0BdnYFN/Cj3C816r6+p7yK+FHrVLGE4O4N9AFwykrlNlvM2HYt+Rad1Uiro6h88Ig==",
|
||||
"dev": true,
|
||||
"license": "BlueOak-1.0.0",
|
||||
"dependencies": {
|
||||
"@isaacs/nonrecursive-glob-match": "^1.1.0",
|
||||
"brace-expansion": "^5.0.12"
|
||||
},
|
||||
"engines": {
|
||||
"node": "20 || >=22"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/config-helpers": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.7.0.tgz",
|
||||
@@ -417,9 +400,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@hono/node-server": {
|
||||
"version": "2.1.8",
|
||||
"resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-2.1.8.tgz",
|
||||
"integrity": "sha512-jdf7FHh6A1lzjpHHQUgxsg2GeER2vMetnAOfeActzcoli6jamlK+NAwL6Dsr5Fl3BS3tYUQzCdtZjU8Qxv7bEA==",
|
||||
"version": "2.1.9",
|
||||
"resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-2.1.9.tgz",
|
||||
"integrity": "sha512-Sk4NQd3GFY0WZWCzndwFMPwJhtD0y9qjsQ+pjID0/03nK9pxyBCUoUHCho8QYBLBVhi0ssL8UkNPHqbgSOFPIQ==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
@@ -968,9 +951,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@tybys/wasm-util": {
|
||||
"version": "0.10.4",
|
||||
"resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.4.tgz",
|
||||
"integrity": "sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==",
|
||||
"version": "0.10.5",
|
||||
"resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.5.tgz",
|
||||
"integrity": "sha512-dOGOPxlaNV+G046mZzN+9C0dAcQZeSKcXiVaM0TYy/LM4ttTmgSBDxYfovcYI8Em3+eAbiAYpvWLOv8+ZVRJKA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
@@ -1029,17 +1012,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||
"version": "8.72.2",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.72.2.tgz",
|
||||
"integrity": "sha512-222PKFXKihmFpi/pS5njoBgdAqsPhj2/GBmFbrNw8Tq8gEG9Sv+kSlKFy4u2q+mJv9ZzJgM2Gkv/bUzRZwZw5g==",
|
||||
"version": "8.73.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.73.0.tgz",
|
||||
"integrity": "sha512-UkygMFer53Yzn29MCYFTHf34hGXf5KJhiDWfIm1tXtXRrym1CS6l5H9Y3yCtPWChpC0/f93H88gdj8tN0dd4kw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@eslint-community/regexpp": "^4.12.2",
|
||||
"@typescript-eslint/scope-manager": "8.72.2",
|
||||
"@typescript-eslint/type-utils": "8.72.2",
|
||||
"@typescript-eslint/utils": "8.72.2",
|
||||
"@typescript-eslint/visitor-keys": "8.72.2",
|
||||
"@typescript-eslint/scope-manager": "8.73.0",
|
||||
"@typescript-eslint/type-utils": "8.73.0",
|
||||
"@typescript-eslint/utils": "8.73.0",
|
||||
"@typescript-eslint/visitor-keys": "8.73.0",
|
||||
"ignore": "^7.0.5",
|
||||
"natural-compare": "^1.4.0",
|
||||
"ts-api-utils": "^2.5.0"
|
||||
@@ -1052,22 +1035,22 @@
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@typescript-eslint/parser": "^8.72.2",
|
||||
"@typescript-eslint/parser": "^8.73.0",
|
||||
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/parser": {
|
||||
"version": "8.72.2",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.72.2.tgz",
|
||||
"integrity": "sha512-llP+T1YuJOLlxEciP6OyQGtz5SMxyn+9LA2BvZw5RmToGVa1y4beEDVQL6Gje7T5WFYh19WREjDCN9Ev4gm5AA==",
|
||||
"version": "8.73.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.73.0.tgz",
|
||||
"integrity": "sha512-AuL45bVcmssHfZ3Di3cs9Q0l4gBm4ZFVrJOQEE7VpqW+PVgQaEwSwazz4TVIiFabXkk6U51EprYDwqw+HR8ePw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "8.72.2",
|
||||
"@typescript-eslint/types": "8.72.2",
|
||||
"@typescript-eslint/typescript-estree": "8.72.2",
|
||||
"@typescript-eslint/visitor-keys": "8.72.2",
|
||||
"@typescript-eslint/scope-manager": "8.73.0",
|
||||
"@typescript-eslint/types": "8.73.0",
|
||||
"@typescript-eslint/typescript-estree": "8.73.0",
|
||||
"@typescript-eslint/visitor-keys": "8.73.0",
|
||||
"debug": "^4.4.3"
|
||||
},
|
||||
"engines": {
|
||||
@@ -1083,14 +1066,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/project-service": {
|
||||
"version": "8.72.2",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.72.2.tgz",
|
||||
"integrity": "sha512-6y5dLTZdHhI8Eh3yIQ/bfQhRKwn5e+TpJj64o18Cngc0iW/BCrVvrr6zGYqXPnYH31u6YXAYiFh0+qxX5mybJw==",
|
||||
"version": "8.73.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.73.0.tgz",
|
||||
"integrity": "sha512-/pEf8Rc4Mjk+qJnY0uO1+Gadeal8uv50xpuic+srG2vIVatA0XxvWMUeMtFvs6OCHqftiQ7/+qH4aehG5stzIA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/tsconfig-utils": "^8.72.2",
|
||||
"@typescript-eslint/types": "^8.72.2",
|
||||
"@typescript-eslint/tsconfig-utils": "^8.73.0",
|
||||
"@typescript-eslint/types": "^8.73.0",
|
||||
"debug": "^4.4.3"
|
||||
},
|
||||
"engines": {
|
||||
@@ -1105,14 +1088,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/scope-manager": {
|
||||
"version": "8.72.2",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.72.2.tgz",
|
||||
"integrity": "sha512-iIoMJ6/8c1/QpFNyFjU0d1YzPco4MsZjQw0k3V+vfzNWAFmUmvhlyMoYEoYYDQZXc+J6Gi1X5XcxlzW2taIIGQ==",
|
||||
"version": "8.73.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.73.0.tgz",
|
||||
"integrity": "sha512-/TjD738Iq2rzj5z0ixVOi+TsvgjAzZPLPaH1yWdDBytR/HTR5gMpyYWZeCe5WTQZLwk3ho8AV7U3muoQCRtXBQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.72.2",
|
||||
"@typescript-eslint/visitor-keys": "8.72.2"
|
||||
"@typescript-eslint/types": "8.73.0",
|
||||
"@typescript-eslint/visitor-keys": "8.73.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
@@ -1123,9 +1106,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/tsconfig-utils": {
|
||||
"version": "8.72.2",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.72.2.tgz",
|
||||
"integrity": "sha512-+h3iCgZXuTNtoLXcnnjP12ZUHLMqoUcIHPfQrFEXTUqvb9dF8QK9b5nv5VtSo5fLkdHuks8ehbTzZj3rImAm9w==",
|
||||
"version": "8.73.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.73.0.tgz",
|
||||
"integrity": "sha512-lmtCFOfYaJfpqZywGuXi4FpNtE+NQ+YLe3T0K9rtEDcW8ZuGWvfI++pj8r05sYMI8vWT2CYK4rWyedmD6Rp4og==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -1140,15 +1123,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/type-utils": {
|
||||
"version": "8.72.2",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.72.2.tgz",
|
||||
"integrity": "sha512-STfkR38qIdhfkLpgtXnUjAzsNy4xouqiBO0lrVc/Wpk9Kem5/aHXUx1J8dGC16zpdYN1+yc2ILQ28er1kXX7ag==",
|
||||
"version": "8.73.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.73.0.tgz",
|
||||
"integrity": "sha512-MOC9i4xy1F7KcDde7Ip8jf1SrRiALb2Km4UWxGNjUE2YlhjIEo1ayE27GHIwIQyfWuHTmEonQT14uyurlyC6aA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.72.2",
|
||||
"@typescript-eslint/typescript-estree": "8.72.2",
|
||||
"@typescript-eslint/utils": "8.72.2",
|
||||
"@typescript-eslint/types": "8.73.0",
|
||||
"@typescript-eslint/typescript-estree": "8.73.0",
|
||||
"@typescript-eslint/utils": "8.73.0",
|
||||
"debug": "^4.4.3",
|
||||
"ts-api-utils": "^2.5.0"
|
||||
},
|
||||
@@ -1165,9 +1148,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/types": {
|
||||
"version": "8.72.2",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.72.2.tgz",
|
||||
"integrity": "sha512-Xfn37OLZx03+PCU7qWx9DTv2FCRh1E6fk2+wONeNY15HXIwtcwuveaSwVpGAUptkNmPQegRxW5JyRel9T7wrog==",
|
||||
"version": "8.73.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.73.0.tgz",
|
||||
"integrity": "sha512-O/1ytYzflF16QDKXx4/qOXg1IuZp+n7hr9t+S0nv7N/2Tl8rJiNCshztV1gcSUvHbPtoX3+zmNbtSAyVbzxVfw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -1179,18 +1162,18 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/typescript-estree": {
|
||||
"version": "8.72.2",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.72.2.tgz",
|
||||
"integrity": "sha512-pQEGqIK/cqEvKivVWaFLYpe7XYejFxfuAOi4mu1oAWFvIo36aRHI9esRFTUxcIy/z8N482RJyH+LpZB0ZIU7Ow==",
|
||||
"version": "8.73.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.73.0.tgz",
|
||||
"integrity": "sha512-InjlBkSdWceIwIBWSwS3ENUp+i0O02PGX3Zv2wnihWJC1WDVGvG7mTHuf8b57uAaITj94d6tRPDH+sUEtXdRQQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/project-service": "8.72.2",
|
||||
"@typescript-eslint/tsconfig-utils": "8.72.2",
|
||||
"@typescript-eslint/types": "8.72.2",
|
||||
"@typescript-eslint/visitor-keys": "8.72.2",
|
||||
"@typescript-eslint/project-service": "8.73.0",
|
||||
"@typescript-eslint/tsconfig-utils": "8.73.0",
|
||||
"@typescript-eslint/types": "8.73.0",
|
||||
"@typescript-eslint/visitor-keys": "8.73.0",
|
||||
"debug": "^4.4.3",
|
||||
"minimatch": "^10.2.2",
|
||||
"minimatch": "^11.0.1",
|
||||
"semver": "^7.7.3",
|
||||
"tinyglobby": "^0.2.15",
|
||||
"ts-api-utils": "^2.5.0"
|
||||
@@ -1203,20 +1186,26 @@
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@typescript/native": "npm:typescript@>=7.1.0-dev.20261009.1 || >=7.1.0-beta <7.1.0-dev",
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@typescript/native": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/utils": {
|
||||
"version": "8.72.2",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.72.2.tgz",
|
||||
"integrity": "sha512-hv3eRYbpPbbpezuax1EfGrzpa3C4ySgNZkPUkLOWOAjU8HsOKowEDAr8C7nsNl1C+SBSKDpvno6VKHnlhvp9iA==",
|
||||
"version": "8.73.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.73.0.tgz",
|
||||
"integrity": "sha512-j2SVJJvVkXdUL0WcEzo4vEH1mO1vIi8KlVukcYA2MgMZvYN2LlZR4PmsW+GTSxSW24j6Q/EP7+MOifLtg5hmsA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.9.1",
|
||||
"@typescript-eslint/scope-manager": "8.72.2",
|
||||
"@typescript-eslint/types": "8.72.2",
|
||||
"@typescript-eslint/typescript-estree": "8.72.2"
|
||||
"@typescript-eslint/scope-manager": "8.73.0",
|
||||
"@typescript-eslint/types": "8.73.0",
|
||||
"@typescript-eslint/typescript-estree": "8.73.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
@@ -1231,13 +1220,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/visitor-keys": {
|
||||
"version": "8.72.2",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.72.2.tgz",
|
||||
"integrity": "sha512-NAGrjn0Pitjqzq/GkgMC4kBYm233PQ8GffyQ9+kTA3AlNQYEzOf25EIM02BAHZv5FRJSpHpJk+OGUxVkOB93GQ==",
|
||||
"version": "8.73.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.73.0.tgz",
|
||||
"integrity": "sha512-k4lsFVpRZICbltkIEEH4hZRkwXkqDF1GHBpClKQOHQY+RkoZAAuyc1ci3I6p+CB6v3U4jaHIUshc4RzzQXZWLg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.72.2",
|
||||
"@typescript-eslint/types": "8.73.0",
|
||||
"eslint-visitor-keys": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
@@ -1886,23 +1875,6 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/eslint/node_modules/minimatch": {
|
||||
"version": "11.0.8",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.8.tgz",
|
||||
"integrity": "sha512-nFQuYSTVrGvysVBps5Ih+0BdnYFN/Cj3C816r6+p7yK+FHrVLGE4O4N9AFwykrlNlvM2HYt+Rad1Uiro6h88Ig==",
|
||||
"dev": true,
|
||||
"license": "BlueOak-1.0.0",
|
||||
"dependencies": {
|
||||
"@isaacs/nonrecursive-glob-match": "^1.1.0",
|
||||
"brace-expansion": "^5.0.12"
|
||||
},
|
||||
"engines": {
|
||||
"node": "20 || >=22"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/espree": {
|
||||
"version": "11.2.0",
|
||||
"resolved": "https://registry.npmjs.org/espree/-/espree-11.2.0.tgz",
|
||||
@@ -2403,9 +2375,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/hono": {
|
||||
"version": "4.13.18",
|
||||
"resolved": "https://registry.npmjs.org/hono/-/hono-4.13.18.tgz",
|
||||
"integrity": "sha512-H9q/E1XizaWstJxUW881dmLxEj+t/TrGGnyxINkm4+sK0qUwsMtFdo2BWI9Vs3cIS19MU6b6iCijoUoEf4f3DA==",
|
||||
"version": "4.13.19",
|
||||
"resolved": "https://registry.npmjs.org/hono/-/hono-4.13.19.tgz",
|
||||
"integrity": "sha512-KmXvQAXwcAHV+muzbIwoJ23niEB5nMoDVr9WcRkU8mvjUECm/1+7v4Jgp7P7a+H6MLFrh+vXrGonGrGS+RQfkA==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
@@ -2458,9 +2430,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/ignore": {
|
||||
"version": "7.0.14",
|
||||
"resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.14.tgz",
|
||||
"integrity": "sha512-wCBiZ77u1tuWde6G/nfOtLaCTYcFDU5yCzARzK10y+rLhzYoL7a7yEemcopcc2Mzow7gZOIjnV2ym1NYmdiJOQ==",
|
||||
"version": "7.0.16",
|
||||
"resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.16.tgz",
|
||||
"integrity": "sha512-52N+Y4HRMOJmbLmr+DqO4iSRyyB7N52gm7PWCT6h0p978+oKbqHCB7gIJIwZvBUsjlSdWbrBFqUSmIFNZMpn0A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -2983,16 +2955,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/minimatch": {
|
||||
"version": "10.2.6",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz",
|
||||
"integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==",
|
||||
"version": "11.0.9",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.9.tgz",
|
||||
"integrity": "sha512-KCFkfyjqerNlSstjlhIGNXIKZGA/6O4V4RlhZ+Dsr621SPPw0mzlypE9D9ZOoPiVefHID+j7/XuMMlqfD/F60Q==",
|
||||
"dev": true,
|
||||
"license": "BlueOak-1.0.0",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^5.0.8"
|
||||
"@isaacs/nonrecursive-glob-match": "^1.1.0",
|
||||
"brace-expansion": "^5.0.12"
|
||||
},
|
||||
"engines": {
|
||||
"node": "18 || 20 || >=22"
|
||||
"node": "20 || >=22"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
@@ -3444,9 +3417,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/router": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz",
|
||||
"integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==",
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/router/-/router-2.3.0.tgz",
|
||||
"integrity": "sha512-bpowRfGjEPe8t9R6fJIzhwmyCGAXwKvxBUsgJm+bJukwdcWmUXbMo7p22w7aYmQBPQTUMNqMV39YX0kMou3z8w==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
@@ -3458,6 +3431,10 @@
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/safer-buffer": {
|
||||
|
||||
10
package.json
10
package.json
@@ -3,7 +3,7 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"version": "0.107.3",
|
||||
"version": "0.108.0",
|
||||
"description": "An ACP-compatible coding agent powered by the Claude Agent SDK (TypeScript)",
|
||||
"main": "dist/lib.js",
|
||||
"types": "dist/lib.d.ts",
|
||||
@@ -69,17 +69,17 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@agentclientprotocol/sdk": "2.7.0",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.3.325",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.3.326",
|
||||
"diff": "9.0.0",
|
||||
"zod": "4.6.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@anthropic-ai/sdk": "1.8.0",
|
||||
"@anthropic-ai/sdk": "1.9.0",
|
||||
"@eslint/js": "10.0.1",
|
||||
"@tsconfig/node22": "22.0.7",
|
||||
"@types/node": "26.6.6",
|
||||
"@typescript-eslint/eslint-plugin": "8.72.2",
|
||||
"@typescript-eslint/parser": "8.72.2",
|
||||
"@typescript-eslint/eslint-plugin": "8.73.0",
|
||||
"@typescript-eslint/parser": "8.73.0",
|
||||
"ajv": "8.20.0",
|
||||
"ajv-formats": "3.0.1",
|
||||
"eslint": "10.15.0",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { existsSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import type { Options } from "@anthropic-ai/claude-agent-sdk";
|
||||
|
||||
const CLI_FILE_NAME = process.platform === "win32" ? "claude.exe" : "claude";
|
||||
|
||||
@@ -30,6 +31,28 @@ export async function claudeCliPath(): Promise<string> {
|
||||
return installedClaudeCliPath();
|
||||
}
|
||||
|
||||
/**
|
||||
* How a session's MCP servers reach the CLI of {@link claudeCliPath}, unless
|
||||
* the client's options name a `mcpServersDelivery`.
|
||||
*
|
||||
* - `'initialize'` for the CLI that the adapter ships: over stdin, in the
|
||||
* SDK's initialize request. A server's `env` and `headers`, such as the
|
||||
* bearer token of an MCP-over-ACP endpoint (see `McpOverAcp`), stay off the
|
||||
* CLI's command line, which other users of the machine can read. Only a
|
||||
* launch that the client's options give `--sdk-url` still gets them there.
|
||||
* - `'argv'` for a CLI that `CLAUDE_CODE_EXECUTABLE` names: in the
|
||||
* `--mcp-config` flag, so on its command line, as before SDK 0.3.326. Its
|
||||
* version is not known, and the SDK ends the session at startup when the CLI
|
||||
* cannot read the servers from the initialize request (e.g. 2.1.323).
|
||||
*
|
||||
* The adapter always sets the option. It names the CLI to start
|
||||
* (`pathToClaudeCodeExecutable`), and for such an app the SDK prints a
|
||||
* `DeprecationWarning` when a session has MCP servers and the option is unset.
|
||||
*/
|
||||
export function mcpServersDelivery(): NonNullable<Options["mcpServersDelivery"]> {
|
||||
return process.env.CLAUDE_CODE_EXECUTABLE ? "argv" : "initialize";
|
||||
}
|
||||
|
||||
function bundledClaudeCliPath(directory: string): string {
|
||||
const path = join(directory, CLI_FILE_NAME);
|
||||
// Without this check, spawning a missing CLI fails with a bare ENOENT.
|
||||
|
||||
@@ -55,3 +55,25 @@ describe("claudeCliPath", () => {
|
||||
expect(await claudeCliPath()).toMatch(/@anthropic-ai\/claude-agent-sdk-[^/]+\/claude(\.exe)?$/);
|
||||
});
|
||||
});
|
||||
|
||||
describe("mcpServersDelivery", () => {
|
||||
afterEach(() => vi.unstubAllEnvs());
|
||||
|
||||
it.each([
|
||||
{
|
||||
name: "is initialize for the CLI that it ships",
|
||||
cli: "",
|
||||
delivery: "initialize",
|
||||
},
|
||||
{
|
||||
name: "is argv for a CLAUDE_CODE_EXECUTABLE CLI",
|
||||
cli: "/opt/claude",
|
||||
delivery: "argv",
|
||||
},
|
||||
])("$name", async ({ cli, delivery }) => {
|
||||
vi.stubEnv("CLAUDE_CODE_EXECUTABLE", cli);
|
||||
const { mcpServersDelivery } = await load();
|
||||
|
||||
expect(mcpServersDelivery()).toBe(delivery);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -615,6 +615,20 @@ describe("createSession options merging", () => {
|
||||
expect(capturedOptions!.promptSuggestions).toBe(false);
|
||||
});
|
||||
|
||||
it.each([
|
||||
{ name: "sends MCP servers as the CLI takes them", delivery: undefined },
|
||||
{ name: "lets a caller choose the MCP delivery", delivery: "initialize" as const },
|
||||
])("$name", async ({ delivery }) => {
|
||||
await agent.newSession({
|
||||
cwd: process.cwd(),
|
||||
mcpServers: [],
|
||||
...(delivery && { _meta: { claudeCode: { options: { mcpServersDelivery: delivery } } } }),
|
||||
});
|
||||
|
||||
// Unit runs name a CLI with CLAUDE_CODE_EXECUTABLE (see `vitest.config.ts`).
|
||||
expect(capturedOptions!.mcpServersDelivery).toBe(delivery ?? "argv");
|
||||
});
|
||||
|
||||
it("defaults tools to claude_code preset when not provided", async () => {
|
||||
await agent.newSession({
|
||||
cwd: process.cwd(),
|
||||
|
||||
@@ -267,6 +267,12 @@ describe("incomplete foreground tools", () => {
|
||||
await expect(prompt()).resolves.toMatchObject({ stopReason: "end_turn" });
|
||||
});
|
||||
|
||||
it("does not claim a workflow agent's permission tool as a foreground tool", async () => {
|
||||
const { prompt } = createTestSession(workflowAgentPermissionMessages);
|
||||
|
||||
await expect(prompt()).resolves.toMatchObject({ stopReason: "end_turn" });
|
||||
});
|
||||
|
||||
it("does not treat a request to run in the background as a confirmed handoff", async () => {
|
||||
const { prompt } = createTestSession(unconfirmedBackgroundToolMessages);
|
||||
|
||||
@@ -1442,6 +1448,44 @@ async function* permissionOnlyToolMessages(input: Pushable<any>, agent: ClaudeAc
|
||||
yield successfulResultMessage();
|
||||
}
|
||||
|
||||
/** A workflow agent asks for permission while the turn runs. The workflow's
|
||||
* task_started names the Workflow call, not the agent, and the agent's
|
||||
* tool_use and tool_result never stream on the root query. */
|
||||
async function* workflowAgentPermissionMessages(input: Pushable<any>, agent: ClaudeAcpAgent) {
|
||||
yield* echoNextPrompt(input);
|
||||
yield toolStart("workflow", null, "Workflow");
|
||||
yield toolUse("workflow", null, "Workflow", { script: "await agent('Stamp the date')" });
|
||||
yield {
|
||||
type: "system",
|
||||
subtype: "task_started",
|
||||
session_id: sessionId,
|
||||
task_id: "wzr1bosoo",
|
||||
tool_use_id: "workflow",
|
||||
description: "Stamp the date",
|
||||
task_type: "local_workflow",
|
||||
};
|
||||
yield {
|
||||
...toolResult("workflow"),
|
||||
message: {
|
||||
role: "user",
|
||||
content: [
|
||||
{
|
||||
type: "tool_result",
|
||||
tool_use_id: "workflow",
|
||||
content: "Workflow launched in background. Task ID: wzr1bosoo",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
await agent.canUseTool(sessionId)("Bash", { command: "date > stamp.txt; cat stamp.txt" }, {
|
||||
toolUseID: toolCallId,
|
||||
agentID: "a2a57f1ad0803996a",
|
||||
signal: new AbortController().signal,
|
||||
suggestions: [],
|
||||
} as any);
|
||||
yield successfulResultMessage();
|
||||
}
|
||||
|
||||
async function* completedToolMessages(input: Pushable<any>) {
|
||||
yield* echoNextPrompt(input);
|
||||
yield toolStart();
|
||||
|
||||
@@ -159,6 +159,17 @@ describe.skipIf(!process.env.RUN_INTEGRATION_TESTS)("v2 core with Claude Code",
|
||||
// Claude Code asks for the server's MCP revision first, not with `initialize`.
|
||||
await until(() => served.includes("tools/list"), 30_000);
|
||||
expect(served[0]).toBe("server/discover");
|
||||
// The server's bearer token went to Claude Code over stdin: it is on no
|
||||
// command line of the adapter's processes (`ps`, so not on Windows). A
|
||||
// CLAUDE_CODE_EXECUTABLE CLI gets it on its command line.
|
||||
if (process.platform !== "win32" && !process.env.CLAUDE_CODE_EXECUTABLE) {
|
||||
const commandLines = spawnSync("ps", ["-axww", "-o", "ppid=,command="], { encoding: "utf8" })
|
||||
.stdout.split("\n")
|
||||
.filter((line) => line.trim().startsWith(`${child.pid} `));
|
||||
// Claude Code's session process is one of them.
|
||||
expect(commandLines.some((line) => line.includes("stream-json"))).toBe(true);
|
||||
expect(commandLines.filter((line) => line.includes("Bearer "))).toEqual([]);
|
||||
}
|
||||
}, 60_000);
|
||||
|
||||
it("reports requires_action while a permission request waits", async () => {
|
||||
|
||||
@@ -878,6 +878,27 @@ describe("ACP v2 core", () => {
|
||||
expect(claude.options.env?.CLAUDE_CODE_EMIT_SESSION_STATE_EVENTS).toBe("1");
|
||||
});
|
||||
|
||||
it.each([
|
||||
{ name: "sends MCP servers as the CLI takes them", delivery: undefined },
|
||||
{ name: "lets the client choose the MCP delivery", delivery: "initialize" },
|
||||
])("$name", async ({ delivery }) => {
|
||||
const client = v2Client();
|
||||
await client.connect(async (agent) => {
|
||||
await agent.request(v2.methods.agent.initialize, {
|
||||
protocolVersion: v2.PROTOCOL_VERSION,
|
||||
info: { name: "v2-test-client", version: "1.0.0" },
|
||||
capabilities: {},
|
||||
});
|
||||
await agent.request(v2.methods.agent.session.new, {
|
||||
cwd,
|
||||
...(delivery && { _meta: { claudeCode: { options: { mcpServersDelivery: delivery } } } }),
|
||||
});
|
||||
});
|
||||
|
||||
// Unit runs name a CLI with CLAUDE_CODE_EXECUTABLE (see `vitest.config.ts`).
|
||||
expect(sdk.processes[0].options.mcpServersDelivery).toBe(delivery ?? "argv");
|
||||
});
|
||||
|
||||
it("answers a prompt when Claude Code starts it, and reports the work until the turn's result", async () => {
|
||||
const client = v2Client();
|
||||
await client.connect(async (agent) => {
|
||||
|
||||
@@ -187,7 +187,7 @@ import {
|
||||
import { AuthStatusReporter, cliLogout } from "../auth-status-reporter.js";
|
||||
import { terminalAuthMethods as authMethodsForTerminal } from "../auth-methods.js";
|
||||
import { McpOverAcp, sdkMcpServers } from "../mcp-servers.js";
|
||||
import { claudeCliPath } from "../claude-cli.js";
|
||||
import { claudeCliPath, mcpServersDelivery } from "../claude-cli.js";
|
||||
import { ContentBlockParam } from "@anthropic-ai/sdk/resources";
|
||||
import { randomUUID } from "node:crypto";
|
||||
import type { Stats } from "node:fs";
|
||||
@@ -8686,6 +8686,7 @@ export class ClaudeAcpAgent {
|
||||
params.toolCall.toolCallId,
|
||||
toolInput,
|
||||
parentToolUseId,
|
||||
agentID,
|
||||
signal,
|
||||
params.sessionId,
|
||||
previewContent,
|
||||
@@ -8780,13 +8781,17 @@ export class ClaudeAcpAgent {
|
||||
* always resolve. Since the streamed path never completes those calls, they
|
||||
* are resolved at tool_result time instead (see `toAcpNotifications`).
|
||||
* `parentToolUseId` attributes a subagent's tool call to the Agent/Task call
|
||||
* that spawned it, matching the streamed path's `_meta`. */
|
||||
* that spawned it, matching the streamed path's `_meta`. `agentID` is
|
||||
* `canUseTool`'s, set for every subagent's tool call, including a workflow
|
||||
* agent's, which has no `parentToolUseId`. Such a call is not recorded as
|
||||
* the turn's foreground work. */
|
||||
private async ensureToolCallEmitted(
|
||||
sessionId: string,
|
||||
toolName: string,
|
||||
toolCallId: string,
|
||||
toolInput: unknown,
|
||||
parentToolUseId?: string,
|
||||
agentID?: string,
|
||||
signal?: AbortSignal,
|
||||
notificationSessionId: string = sessionId,
|
||||
previewContent?: ToolCallContent[],
|
||||
@@ -8810,11 +8815,12 @@ export class ClaudeAcpAgent {
|
||||
}
|
||||
session.emittedToolCalls.add(toolCallId);
|
||||
if (parentToolUseId) recordToolCallParent(session, toolCallId, parentToolUseId);
|
||||
// SandboxNetworkAccess is a permission-only callback, not an executing
|
||||
// tool: the SDK does not send a tool_result for its synthetic id.
|
||||
// A subagent's tool call is not the turn's foreground work, even when no
|
||||
// parent was found for it: a workflow agent's tool_result never streams on
|
||||
// the root query. SandboxNetworkAccess is a permission-only callback, not
|
||||
// an executing tool: the SDK does not send a tool_result for its synthetic id.
|
||||
if (
|
||||
!parentToolUseId &&
|
||||
notificationSessionId === sessionId &&
|
||||
!agentID &&
|
||||
toolName !== "SandboxNetworkAccess" &&
|
||||
// Neither does it send one for a question that Claude Code asks on its own.
|
||||
!isConfirmQuestion(toolCallId)
|
||||
@@ -8853,7 +8859,8 @@ export class ClaudeAcpAgent {
|
||||
* emitted tool call and of its requests: the subagent's child session once
|
||||
* it is announced, else the root session. In the rare SDK ordering where
|
||||
* the callback beats the spawning Agent/Task frame, the root keeps it; the
|
||||
* later frame announces the child with its correct nested lineage.
|
||||
* later frame announces the child with its correct nested lineage. A
|
||||
* workflow agent gets no task_started, so the root always keeps its tool use.
|
||||
*/
|
||||
private toolUseOwner(
|
||||
session: Session,
|
||||
@@ -8968,7 +8975,8 @@ export class ClaudeAcpAgent {
|
||||
// defines a subagent's `agent_id` as its task id). Should the consumer
|
||||
// lose the race with task_started, the lookup misses and the request
|
||||
// goes out unattributed; log it so the miss is observable rather than
|
||||
// silent.
|
||||
// silent. A workflow agent's request always misses: it has no
|
||||
// task_started.
|
||||
this.logger.log(
|
||||
`[claude-agent-acp] No parent tool_use recorded for subagent ${agentID}; ` +
|
||||
`sending the ${toolName} permission request unattributed`,
|
||||
@@ -8988,6 +8996,7 @@ export class ClaudeAcpAgent {
|
||||
toolUseID,
|
||||
toolInput,
|
||||
parentToolUseId,
|
||||
agentID,
|
||||
signal,
|
||||
permissionSessionId,
|
||||
);
|
||||
@@ -10125,6 +10134,8 @@ export class ClaudeAcpAgent {
|
||||
// Before `userProvidedOptions`, so a client that passes
|
||||
// `promptSuggestions: false` keeps it off.
|
||||
promptSuggestions: true,
|
||||
// Before `userProvidedOptions`, so a client's own `mcpServersDelivery` wins.
|
||||
mcpServersDelivery: mcpServersDelivery(),
|
||||
...userProvidedOptions,
|
||||
// Claude Code uses the same checkpoint store for /rewind. Enable it only
|
||||
// for clients that negotiated per-turn file-change reports; this avoids
|
||||
|
||||
@@ -38,6 +38,7 @@ const OPTION_REBUILDS_SESSION = {
|
||||
maxThinkingTokens: true,
|
||||
maxTurns: true,
|
||||
mcpServers: true,
|
||||
mcpServersDelivery: true,
|
||||
model: true,
|
||||
outputFormat: true,
|
||||
pathToClaudeCodeExecutable: true,
|
||||
|
||||
@@ -33,7 +33,7 @@ import packageJson from "../../package.json" with { type: "json" };
|
||||
import { messageIdForGrouping } from "../sdk-to-acp.js";
|
||||
import type { Logger } from "../logger.js";
|
||||
import { customAgents } from "../session-config-options.js";
|
||||
import { claudeCliPath } from "../claude-cli.js";
|
||||
import { claudeCliPath, mcpServersDelivery } from "../claude-cli.js";
|
||||
import { clientSystemPrompt, sessionSystemPrompt } from "../client-system-prompt.js";
|
||||
import type { ElicitationSupport } from "../elicitation.js";
|
||||
import { forkSession } from "../fork-session.js";
|
||||
@@ -1062,6 +1062,8 @@ class V2Agent implements AgentHandle, SessionConnection {
|
||||
// AIR gets it, so no other client's session spends a request on it.
|
||||
// Before the client's options: `promptSuggestions: false` turns it off.
|
||||
...(this.air.client ? { promptSuggestions: true } : {}),
|
||||
// Before the client's options: its own `mcpServersDelivery` wins.
|
||||
mcpServersDelivery: mcpServersDelivery(),
|
||||
...client,
|
||||
// The checkpoints that AIR's file-change reports read (see
|
||||
// `file-changes.ts`), only for a client that declared them, as on v1.
|
||||
|
||||
Reference in New Issue
Block a user