mirror of
https://github.com/agentclientprotocol/claude-agent-acp.git
synced 2026-12-01 21:52:06 +00:00
Compare commits
25 Commits
v0.111.1-p
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5fb2db36eb | ||
|
|
a630df5ff7 | ||
|
|
1c2510dd45 | ||
|
|
22ca229363 | ||
|
|
5ff3411cfa | ||
|
|
4dd607cec1 | ||
|
|
9f9acd2b6e | ||
|
|
daeda8cce3 | ||
|
|
0e7eda1d97 | ||
|
|
76ace8c222 | ||
|
|
0ad8bbaceb | ||
|
|
627ba95140 | ||
|
|
cc17382250 | ||
|
|
a3d6df806a | ||
|
|
3f4c4058ba | ||
|
|
c8fbdd1249 | ||
|
|
bc752f88e1 | ||
|
|
1762ccff2e | ||
|
|
e28b50d4f4 | ||
|
|
9918571ebf | ||
|
|
764fb84f9f | ||
|
|
0f095f678d | ||
|
|
677a6d9afa | ||
|
|
893f7680c7 | ||
|
|
aa93ed06c1 |
20
.github/workflows/binaries.yml
vendored
20
.github/workflows/binaries.yml
vendored
@@ -13,6 +13,9 @@ on:
|
||||
description: Upload each archive as a workflow artifact for the release job.
|
||||
type: boolean
|
||||
default: false
|
||||
release_sha:
|
||||
description: Commit SHA verified against the release tag for a manual rebuild.
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -24,6 +27,8 @@ jobs:
|
||||
timeout-minutes: 20
|
||||
strategy:
|
||||
fail-fast: false
|
||||
# scripts/missing-release-archives.sh reads the `archive:` lines to know
|
||||
# which archives a release needs.
|
||||
matrix:
|
||||
include:
|
||||
- target: bun-linux-x64
|
||||
@@ -60,7 +65,22 @@ jobs:
|
||||
shell: bash
|
||||
|
||||
steps:
|
||||
- name: Select the release commit for a manual rebuild
|
||||
if: ${{ github.event_name == 'workflow_dispatch' && inputs.upload }}
|
||||
id: release
|
||||
env:
|
||||
RELEASE_SHA: ${{ inputs.release_sha }}
|
||||
run: |
|
||||
if [[ ! "$RELEASE_SHA" =~ ^[0-9a-f]{40}$ ]]; then
|
||||
echo "::error::A manual binary rebuild requires the full commit SHA from find-release."
|
||||
exit 1
|
||||
fi
|
||||
echo "sha=$RELEASE_SHA" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
|
||||
with:
|
||||
ref: ${{ steps.release.outputs.sha || github.sha }}
|
||||
persist-credentials: false
|
||||
|
||||
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1
|
||||
with:
|
||||
|
||||
2
.github/workflows/conventional-prs.yml
vendored
2
.github/workflows/conventional-prs.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
# Config reference: https://github.com/amannn/action-semantic-pull-request#configuration
|
||||
- uses: amannn/action-semantic-pull-request@2252a14e810aa9b85c2d560bd7070c802206ecf6 # v6.1.2
|
||||
- uses: amannn/action-semantic-pull-request@66e72920af32222769c386d81f89656ebcb6d6d5 # v6.1.4
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
|
||||
159
.github/workflows/publish.yml
vendored
159
.github/workflows/publish.yml
vendored
@@ -88,37 +88,153 @@ jobs:
|
||||
npm publish
|
||||
echo "version=$version" >> "$GITHUB_OUTPUT"
|
||||
|
||||
# Standalone executables for the GitHub release, stable releases only. They
|
||||
# don't gate the npm publish: a failed build leaves the release without
|
||||
# binaries, and re-running the failed jobs attaches them.
|
||||
# A manual stable run has no release-please output to say which release it
|
||||
# is for, or whether that release still lacks archives. This finds the
|
||||
# release for the version at `ref` and lists the archives it lacks, so a
|
||||
# hand-made release (docs/RELEASES.md, "The release PR merged but nothing was
|
||||
# tagged") gets them, and a complete one is not rebuilt.
|
||||
find-release:
|
||||
name: Find the release's archives
|
||||
if: ${{ github.event_name == 'workflow_dispatch' && inputs.channel == 'stable' }}
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
timeout-minutes: 5
|
||||
outputs:
|
||||
tag: ${{ steps.find.outputs.tag }}
|
||||
build: ${{ steps.find.outputs.build }}
|
||||
sha: ${{ steps.find.outputs.sha }}
|
||||
steps:
|
||||
# Use the workflow's commit for scripts/missing-release-archives.sh.
|
||||
# Read the requested ref's package version through the API.
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
|
||||
- name: List the archives the release lacks
|
||||
id: find
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_REPO: ${{ github.repository }}
|
||||
REF: ${{ inputs.ref }}
|
||||
#language=bash
|
||||
run: |
|
||||
version="$(gh api --method GET "repos/$GH_REPO/contents/package.json" \
|
||||
-H "Accept: application/vnd.github.raw+json" -f ref="$REF" --jq .version)"
|
||||
tag="v$version"
|
||||
if ! missing="$(scripts/missing-release-archives.sh "$tag")"; then
|
||||
echo "::error title=No release $tag::'$REF' is version $version, which has no GitHub release. Create it first (docs/RELEASES.md, 'The release PR merged but nothing was tagged')."
|
||||
exit 1
|
||||
fi
|
||||
echo "tag=$tag" >> "$GITHUB_OUTPUT"
|
||||
|
||||
if [ -z "$missing" ]; then
|
||||
echo "build=false" >> "$GITHUB_OUTPUT"
|
||||
echo "$tag already has every archive; not rebuilding them." >> "$GITHUB_STEP_SUMMARY"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Pass the SHA so every runner builds the commit checked here even if the tag moves.
|
||||
tagged="$(gh api "repos/$GH_REPO/commits/tags/$tag" --jq .sha)"
|
||||
requested="$(gh api "repos/$GH_REPO/commits/$REF" --jq .sha)"
|
||||
if [ "$requested" != "$tagged" ]; then
|
||||
echo "::error title=$tag lacks archives::'$REF' is not the commit $tag points to ($tagged). Run again with ref=$tag to build them."
|
||||
exit 1
|
||||
fi
|
||||
echo "sha=$tagged" >> "$GITHUB_OUTPUT"
|
||||
echo "build=true" >> "$GITHUB_OUTPUT"
|
||||
echo "$tag lacks $(paste -sd ' ' - <<<"$missing"); building them." >> "$GITHUB_STEP_SUMMARY"
|
||||
|
||||
# Standalone executables for the GitHub release: every stable release from
|
||||
# release-please, and a manual stable run whose release lacks some. They
|
||||
# don't gate the npm publish: a failed build leaves the release without that
|
||||
# platform's archive, fails upload-binaries and holds back the registry
|
||||
# update. retry-binaries.yml re-runs the failed jobs, which attaches it.
|
||||
build-binaries:
|
||||
name: Build binaries
|
||||
needs: [release-please]
|
||||
if: ${{ needs.release-please.outputs.release_created == 'true' }}
|
||||
needs: [release-please, find-release]
|
||||
# !cancelled(): on a manual run release-please is skipped, which would skip
|
||||
# this job too by default.
|
||||
if: ${{ !cancelled() && (needs.release-please.outputs.release_created == 'true' || needs.find-release.outputs.build == 'true') }}
|
||||
# The called workflow only reads the repository; upload-binaries does the write.
|
||||
permissions:
|
||||
contents: read
|
||||
uses: ./.github/workflows/binaries.yml
|
||||
with:
|
||||
upload: true
|
||||
release_sha: ${{ needs.find-release.outputs.sha }}
|
||||
|
||||
# Attaches every archive that built, even when another platform's build
|
||||
# failed, so those platforms can download it while the failure is fixed. It
|
||||
# succeeds only once the release has every archive, which is what lets the
|
||||
# registry update run. It checks the release rather than this run's
|
||||
# artifacts, so a re-run after the 7-day artifact retention still completes
|
||||
# the release from the archives attached earlier.
|
||||
upload-binaries:
|
||||
name: Attach binaries to the release
|
||||
runs-on: ubuntu-latest
|
||||
needs: [release-please, build-binaries]
|
||||
needs: [release-please, find-release, build-binaries]
|
||||
if: ${{ !cancelled() && (needs.release-please.outputs.release_created == 'true' || needs.find-release.outputs.build == 'true') }}
|
||||
permissions:
|
||||
contents: write
|
||||
timeout-minutes: 15
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_REPO: ${{ github.repository }}
|
||||
TAG: ${{ needs.release-please.outputs.tag_name || needs.find-release.outputs.tag }}
|
||||
steps:
|
||||
# The workflow's own commit, for scripts/missing-release-archives.sh.
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
|
||||
# Archives from every attempt of this run that are still within the
|
||||
# 7-day retention. With none (every build failed) it downloads nothing.
|
||||
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
path: artifacts
|
||||
merge-multiple: true
|
||||
- name: Upload to the release
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
TAG: ${{ needs.release-please.outputs.tag_name }}
|
||||
run: gh release upload "$TAG" artifacts/* --clobber --repo "$GITHUB_REPOSITORY"
|
||||
- name: Attach the archives the release lacks
|
||||
#language=bash
|
||||
run: |
|
||||
# Never replaces an archive the release already has: someone may have
|
||||
# downloaded it or the registry may hold its sha256, and a rebuild is
|
||||
# not byte-identical. --clobber only replaces an upload that never
|
||||
# finished, which the script lists as missing.
|
||||
missing="$(scripts/missing-release-archives.sh "$TAG")"
|
||||
upload=()
|
||||
while read -r name; do
|
||||
if [ -n "$name" ] && [ -f "artifacts/$name" ]; then
|
||||
upload+=("artifacts/$name")
|
||||
fi
|
||||
done <<<"$missing"
|
||||
if [ "${#upload[@]}" -gt 0 ]; then
|
||||
gh release upload "$TAG" "${upload[@]}" --clobber
|
||||
fi
|
||||
- name: Check the release has every archive
|
||||
# Also after a failed upload, so the notice matches what is attached.
|
||||
if: ${{ !cancelled() }}
|
||||
#language=bash
|
||||
run: |
|
||||
missing="$(scripts/missing-release-archives.sh "$TAG")"
|
||||
|
||||
# Keep a notice at the top of the release notes while archives are
|
||||
# missing, so someone looking for one knows why it isn't there.
|
||||
start="<!-- missing-binaries -->"
|
||||
end="<!-- /missing-binaries -->"
|
||||
body="$(gh release view "$TAG" --json body --jq .body)"
|
||||
# The notes without an earlier notice and the blank line after it.
|
||||
notes="$(awk -v start="$start" -v end="$end" '
|
||||
drop_blank { drop_blank = 0; if ($0 == "") next }
|
||||
$0 == start { skip = 1 }
|
||||
skip { if ($0 == end) { skip = 0; drop_blank = 1 } next }
|
||||
{ print }' <<<"$body")"
|
||||
if [ -n "$missing" ]; then
|
||||
notice="$start"$'\n'"> [!WARNING]"$'\n'"> Not attached yet: $(paste -sd ' ' - <<<"$missing" | sed 's/ /, /g'). They will be attached once their build is fixed."$'\n'"$end"
|
||||
notes="$notice"$'\n\n'"$notes"
|
||||
fi
|
||||
if [ "$notes" != "$body" ]; then
|
||||
gh release edit "$TAG" --notes "$notes"
|
||||
fi
|
||||
|
||||
if [ -n "$missing" ]; then
|
||||
echo "::error title=$TAG lacks archives::The release still lacks $(paste -sd ' ' - <<<"$missing"), so the registry was not updated. retry-binaries.yml re-runs the failed jobs up to twice; after that, run: gh run rerun $GITHUB_RUN_ID --failed --repo $GITHUB_REPOSITORY"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Same shape as publish-npm. Tagging is a separate job, so nothing here needs
|
||||
# write access to the repository.
|
||||
@@ -231,11 +347,13 @@ jobs:
|
||||
echo "Tagged \`v$VERSION\` at \`$SHA\`" >> "$GITHUB_STEP_SUMMARY"
|
||||
|
||||
trigger-registry-update:
|
||||
# upload-binaries too, so a stable release's archives are attached before the
|
||||
# registry reads the release: it takes each archive's sha256 from the release
|
||||
# assets when it bumps the version. It only waits; a failed or skipped upload
|
||||
# (every preview) doesn't stop the dispatch.
|
||||
needs: [publish-npm, publish-npm-preview, upload-binaries]
|
||||
# A stable release dispatches only once its release has every archive:
|
||||
# upload-binaries found them all attached, or find-release found nothing
|
||||
# missing.
|
||||
# The registry takes each archive's sha256 from the release assets when it
|
||||
# bumps the version, and rejects the update while one is missing. Previews
|
||||
# are npm-only and dispatch without archives.
|
||||
needs: [publish-npm, publish-npm-preview, find-release, upload-binaries]
|
||||
# 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
|
||||
@@ -244,9 +362,12 @@ jobs:
|
||||
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)
|
||||
needs.publish-npm-preview.outputs.published == 'true'
|
||||
|| (
|
||||
(needs.publish-npm.result == 'success'
|
||||
|| (github.event_name == 'workflow_dispatch' && inputs.channel == 'stable' && !inputs.publish_npm))
|
||||
&& (needs.upload-binaries.result == 'success' || needs.find-release.outputs.build == 'false')
|
||||
)
|
||||
)
|
||||
}}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
77
.github/workflows/retry-binaries.yml
vendored
Normal file
77
.github/workflows/retry-binaries.yml
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
# Re-runs a release's failed binary builds, up to twice, so that a flaky
|
||||
# runner doesn't leave the GitHub release missing archives and the registry on
|
||||
# the previous version. The usual cause is GitHub finding no macOS arm64 runner
|
||||
# within 15 minutes ("The job was not acquired by Runner of type hosted even
|
||||
# after multiple attempts"). No retry inside binaries.yml can cover that: the
|
||||
# job never starts. Re-running the failed jobs also re-runs upload-binaries and
|
||||
# trigger-registry-update, which depend on them; publish-npm is not re-run.
|
||||
name: Retry release binaries
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: [Publish and Release]
|
||||
types: [completed]
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
rerun:
|
||||
name: Re-run failed binary builds
|
||||
# Only the first attempt: this job waits for its own re-runs, and whether
|
||||
# their completion triggers workflow_run again depends on the GITHUB_TOKEN
|
||||
# rules, so a later attempt must not start a second loop over the same run.
|
||||
if: ${{ github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.run_attempt == 1 }}
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: write # re-run the failed jobs
|
||||
# Two re-runs, each up to 15 minutes in the runner queue plus the build.
|
||||
timeout-minutes: 75
|
||||
steps:
|
||||
- name: Re-run while only the binaries fail
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
RUN_ID: ${{ github.event.workflow_run.id }}
|
||||
#language=bash
|
||||
run: |
|
||||
# filter=latest: each job's most recent attempt, so a job that passed
|
||||
# on an earlier attempt doesn't count as failed.
|
||||
failed_jobs() {
|
||||
gh api --paginate \
|
||||
"repos/$GITHUB_REPOSITORY/actions/runs/$RUN_ID/jobs?filter=latest&per_page=100" \
|
||||
--jq '.jobs[] | select(.conclusion != "success" and .conclusion != "skipped") | "\(.name) (\(.conclusion))"'
|
||||
}
|
||||
|
||||
for rerun in 1 2; do
|
||||
failed="$(failed_jobs)"
|
||||
if [ -z "$failed" ]; then
|
||||
echo "Run $RUN_ID succeeded after $((rerun - 1)) re-run(s)." >> "$GITHUB_STEP_SUMMARY"
|
||||
exit 0
|
||||
fi
|
||||
echo "Jobs of run $RUN_ID that did not succeed:"
|
||||
echo "$failed"
|
||||
|
||||
# Anything else failing (npm, the preview tag, the registry
|
||||
# dispatch) has its own recovery in docs/RELEASES.md; re-running it
|
||||
# blindly could publish twice.
|
||||
if grep -v -e '^Build binaries / ' -e '^Attach binaries to the release ' <<<"$failed"; then
|
||||
echo "::notice::Not re-running run $RUN_ID: the jobs above failed outside the binary builds."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
gh run rerun "$RUN_ID" --failed --repo "$GITHUB_REPOSITORY"
|
||||
echo "Re-ran the failed jobs of run $RUN_ID ($rerun of 2)." >> "$GITHUB_STEP_SUMMARY"
|
||||
# The re-run is queued asynchronously; wait for it to show before
|
||||
# watching, or the watch returns on the previous attempt's result.
|
||||
for _ in $(seq 30); do
|
||||
[ "$(gh run view "$RUN_ID" --repo "$GITHUB_REPOSITORY" --json status --jq .status)" != completed ] && break
|
||||
sleep 2
|
||||
done
|
||||
gh run watch "$RUN_ID" --repo "$GITHUB_REPOSITORY" --interval 30 >/dev/null || true
|
||||
done
|
||||
|
||||
failed="$(failed_jobs)"
|
||||
if [ -n "$failed" ]; then
|
||||
echo "::error title=Release binaries still failing::Run $RUN_ID still has failed jobs after 2 re-runs: $(paste -sd ';' - <<<"$failed")"
|
||||
exit 1
|
||||
fi
|
||||
echo "Run $RUN_ID succeeded after 2 re-runs." >> "$GITHUB_STEP_SUMMARY"
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,3 +5,4 @@ dist
|
||||
CLAUDE.local.md
|
||||
.idea/
|
||||
dist-bin
|
||||
/scratch/
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
".": "0.111.0"
|
||||
".": "0.114.0"
|
||||
}
|
||||
|
||||
@@ -101,6 +101,10 @@ opening a PR.
|
||||
including fields like `origin` it echoes back and fields it omits. A double
|
||||
simpler than the real message hides bugs. If unsure, check against the real
|
||||
CLI (`npm run test:integration`).
|
||||
- For a one-off reproduction against the real CLI (a throwaway MCP server, a
|
||||
raw ACP client driving `dist/index.js`), use `scratch/` at the repo root. Git
|
||||
ignores it, so nothing there is committed; turn what it proves into a test in
|
||||
`src/tests/`.
|
||||
- Cover both ACP v1 and v2 when a change affects what a client receives
|
||||
(updates, responses, replay). A change to internal logic only does not need
|
||||
its tests duplicated per version.
|
||||
|
||||
45
CHANGELOG.md
45
CHANGELOG.md
@@ -1,5 +1,50 @@
|
||||
# Changelog
|
||||
|
||||
## [0.114.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.113.0...v0.114.0) (2026-12-01)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* read stored Claude sessions from a replay cursor ([#1729](https://github.com/agentclientprotocol/claude-agent-acp/issues/1729)) ([22ca229](https://github.com/agentclientprotocol/claude-agent-acp/commit/22ca2293635e0c383392e4ae7b8fab785f633b6f))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **code-splitting:** stop counting JSON modules as 0 bytes (<a ([3f4c405](https://github.com/agentclientprotocol/claude-agent-acp/commit/3f4c4058baaed7b9fe7d94ff5a39737dcaabb4b1))
|
||||
* follow the permission mode that Claude Code reports ([#1740](https://github.com/agentclientprotocol/claude-agent-acp/issues/1740)) ([5ff3411](https://github.com/agentclientprotocol/claude-agent-acp/commit/5ff3411cfa8d8c0fbf939995a4587c254d812735))
|
||||
* record the permission mode that Claude Code names after a mode change ([#1737](https://github.com/agentclientprotocol/claude-agent-acp/issues/1737)) ([4dd607c](https://github.com/agentclientprotocol/claude-agent-acp/commit/4dd607cec1747c6936d9ffc9ccc68e619e36fca4))
|
||||
* refuse to start a session when Claude Code skipped an invalid settings file ([#1719](https://github.com/agentclientprotocol/claude-agent-acp/issues/1719)) ([e28b50d](https://github.com/agentclientprotocol/claude-agent-acp/commit/e28b50d4f401dc9c3a4fdc8eda27e29989658ba8))
|
||||
* Respect remote managed settings for model, effort and permission modes ([#1717](https://github.com/agentclientprotocol/claude-agent-acp/issues/1717)) ([1c2510d](https://github.com/agentclientprotocol/claude-agent-acp/commit/1c2510dd45abd4337e02b15921f57f29573246fd))
|
||||
* send MCP servers and settings over stdin to a Claude Code that CLAUDE_CODE_EXECUTABLE names ([#1741](https://github.com/agentclientprotocol/claude-agent-acp/issues/1741)) ([9f9acd2](https://github.com/agentclientprotocol/claude-agent-acp/commit/9f9acd2b6e59212575917fc788b69853f3a03ee1))
|
||||
* sign in to MCP servers of Claude Code's settings on /mcp reconnect ([#1728](https://github.com/agentclientprotocol/claude-agent-acp/issues/1728)) ([bc752f8](https://github.com/agentclientprotocol/claude-agent-acp/commit/bc752f88e1e7d46ff49064b1971eebfc23e5d020))
|
||||
* stop an autonomous turn while a prompt waits ([#1727](https://github.com/agentclientprotocol/claude-agent-acp/issues/1727)) ([1762ccf](https://github.com/agentclientprotocol/claude-agent-acp/commit/1762ccff2e61197e6b0e642637488552e87c1dc1))
|
||||
* update to @anthropic-ai/claude-agent-sdk 0.3.333 ([#1739](https://github.com/agentclientprotocol/claude-agent-acp/issues/1739)) ([daeda8c](https://github.com/agentclientprotocol/claude-agent-acp/commit/daeda8cce313d50116401e121626fc9820d6cb92))
|
||||
|
||||
## [0.113.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.112.0...v0.113.0) (2026-11-26)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* serve /plugin in ACP sessions ([#1716](https://github.com/agentclientprotocol/claude-agent-acp/issues/1716)) ([0f095f6](https://github.com/agentclientprotocol/claude-agent-acp/commit/0f095f678dac9cf4a7ca3623261fa3f6729e73b0))
|
||||
* start Remote Control with the session when Claude Code asks for it ([#1523](https://github.com/agentclientprotocol/claude-agent-acp/issues/1523)) ([893f768](https://github.com/agentclientprotocol/claude-agent-acp/commit/893f7680c7ed57be7fc7be7f4e9abac268884ff2))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **background:** keep a tool call whose task joins the live set after its result ([#1639](https://github.com/agentclientprotocol/claude-agent-acp/issues/1639)) ([677a6d9](https://github.com/agentclientprotocol/claude-agent-acp/commit/677a6d9afab3c7bad41fdf2587a24b2414236b29))
|
||||
|
||||
## [0.112.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.111.0...v0.112.0) (2026-11-24)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* rewind the same provider session on an edited message ([#1704](https://github.com/agentclientprotocol/claude-agent-acp/issues/1704)) ([f2897d6](https://github.com/agentclientprotocol/claude-agent-acp/commit/f2897d6687f594220c07836c3e3528de552e30ef))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* stop holding an MCP request that Claude Code gave up ([#1711](https://github.com/agentclientprotocol/claude-agent-acp/issues/1711)) ([d5be0e5](https://github.com/agentclientprotocol/claude-agent-acp/commit/d5be0e5827fb111e5e95020d76920fe8a59e671b))
|
||||
|
||||
## [0.111.0](https://github.com/agentclientprotocol/claude-agent-acp/compare/v0.110.1...v0.111.0) (2026-11-24)
|
||||
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ This tool implements an ACP agent by using the official [Claude Agent SDK](https
|
||||
- Client MCP servers, including the ones that the client serves over the ACP connection ([MCP-over-ACP](https://agentclientprotocol.com/rfds/mcp-over-acp), `"type": "acp"`). Where an organization's managed settings (`disableSideloadFlags`) keep them out, a session starts without them and says so in a notice
|
||||
- An Ultracode session config option, which turns on Claude Code's dynamic workflows for every task. It appears when dynamic workflows are enabled and the model supports ultracode (any model with `xhigh` effort)
|
||||
- `/mcp` in the chat: the MCP server status as a list. The adapter runs `/mcp reconnect`, `/mcp enable`, and `/mcp disable` through the SDK control API, because Claude Code refuses them in SDK mode. A reconnect of an ACP server that needs authentication starts MCP OAuth through URL elicitation
|
||||
- `/plugin` (aliases `/plugins`, `/marketplace`) in the chat: the adapter runs `claude plugin …` for install, uninstall, enable, disable, update, and list, and `marketplace add|list|remove|update`, because Claude Code refuses `/plugin` in SDK mode, then reloads the session's plugins. It is not available in remote (`sdk-url`) sessions
|
||||
- Prompt suggestions: the prompt that Claude Code predicts the user sends next, as ACP's unstable `prompt_suggestions_update`, for a client that advertises `session.promptSuggestions`
|
||||
- Session-scoped long-running goals for AIR through the [goal extension](docs/air-extensions.md#goal) under `_meta.jetbrains.air.goal`
|
||||
- Structured errors, recovery, and warnings through the opt-in [session failure extension](docs/air-extensions.md#session-failure)
|
||||
@@ -47,9 +48,9 @@ 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.
|
||||
A CLI named with `CLAUDE_CODE_EXECUTABLE` must be Claude Code 2.1.328 or newer:
|
||||
the adapter sends a session's MCP servers and settings to Claude Code over
|
||||
stdin. With an older one, a session that has either does not start.
|
||||
|
||||
To build one for your machine (needs [Bun](https://bun.sh)) and check it:
|
||||
|
||||
@@ -84,6 +85,8 @@ is inserted once, and the retry gets the first `messageId`. The key is known for
|
||||
Code stores the message, also after a restart. A prompt that Claude Code does not store, such as a
|
||||
local command, keeps its key until `session/close` or the end of the connection.
|
||||
|
||||
A client can [read and follow a stored session](docs/session-read.md) through `_session/read` while a terminal continues writing it.
|
||||
|
||||
The adapter announces a session cursor (`cursor_update`) before each user message that follows
|
||||
another entry of the conversation, live and in a replay. `session/fork` with its `cursorId` copies
|
||||
the history before that message, and fails with `-32602` for any other `cursorId`. A v1 client gets
|
||||
|
||||
@@ -208,12 +208,44 @@ 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.
|
||||
|
||||
### The release has no executables
|
||||
Either way, the run also checks the release's
|
||||
[executables](#the-release-is-missing-executables) before it dispatches. If the
|
||||
release has every archive, nothing is rebuilt. Otherwise it builds them from the
|
||||
tagged commit, attaches the ones the release lacks, then dispatches. Pass the
|
||||
tag as `ref`, as above: when archives need building, a `ref` that is not the
|
||||
tag's commit fails rather than attach archives built from a different commit. A
|
||||
version with no GitHub release fails until the release is created.
|
||||
|
||||
### The release is missing executables
|
||||
|
||||
`build-binaries` and `upload-binaries` don't gate npm, so a failed build only
|
||||
leaves the release without archives. Re-run the failed jobs of that publish run
|
||||
(`gh run rerun <run-id> --failed`); the upload uses `--clobber`, so archives
|
||||
already attached are replaced rather than duplicated.
|
||||
leaves the release without that platform's archive. `upload-binaries` attaches
|
||||
every archive that did build, adds a notice to the top of the release notes
|
||||
naming the missing ones, and fails with a "`v<version>` lacks archives" error.
|
||||
`trigger-registry-update` is skipped until the release has every archive, since
|
||||
the registry rejects a release with any missing.
|
||||
|
||||
[`retry-binaries.yml`](../.github/workflows/retry-binaries.yml) re-runs the
|
||||
failed jobs of that run up to twice, as long as nothing but the binary builds
|
||||
failed. That covers the usual causes: no macOS arm64 runner picking up the job
|
||||
within 15 minutes, and a transient network error in a setup step. Re-running
|
||||
the failed jobs also re-runs the upload, which removes the notice once nothing
|
||||
is missing, and then the registry update.
|
||||
|
||||
If archives are still missing after that, fix the cause and re-run the failed
|
||||
jobs of the publish run yourself (`gh run rerun <run-id> --failed`). The upload
|
||||
checks the release, not the run's build artifacts, so this still works after
|
||||
those expire at 7 days. It only adds archives the release lacks and never
|
||||
replaces one already attached, since a rebuild is not byte-identical and
|
||||
someone may already have downloaded it.
|
||||
|
||||
GitHub re-runs a run only within 30 days of it. After that, run the publish
|
||||
workflow against the tag, which builds the missing archives, attaches them and
|
||||
updates the registry:
|
||||
|
||||
```sh
|
||||
gh workflow run publish.yml -f ref="v<version>" -f publish_npm=false
|
||||
```
|
||||
|
||||
### A preview published but the commit was not tagged
|
||||
|
||||
|
||||
@@ -1116,7 +1116,8 @@ It ends `completed` at the result of the turn or at the SDK `idle` state, and `f
|
||||
A coalesced placeholder result (`num_turns: 0`) does not end it.
|
||||
A prompt that the turn takes in ends the task, because that prompt owns the turn now.
|
||||
A stop request interrupts the turn instead of stopping an SDK task.
|
||||
It returns `{ "stopped": false }` while a prompt waits for its turn, because the interrupt would drop that prompt.
|
||||
A prompt that waits for its turn survives the stop and runs next.
|
||||
It returns `{ "stopped": false }` only while a prompt waits and either Claude Code already took it into the turn or the CLI sends no message lifecycle frames.
|
||||
|
||||
### Stop request
|
||||
|
||||
|
||||
21
docs/session-read.md
Normal file
21
docs/session-read.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Read a stored session
|
||||
|
||||
An ACP v1 or v2 client can poll `_session/read` while a terminal continues a Claude conversation. The adapter reads the transcript and its recorded subagents from disk. Claude Code and MCP servers stay in the writer process. The read sends ordinary `session/update` notifications and ends with a response.
|
||||
|
||||
Check `_meta.sessionRead.supported` in the initialize response. On v1 declare `clientCapabilities.session.cursors: {}` to receive read cursors. V2 supports them automatically.
|
||||
|
||||
1. Send `{"sessionId":"…","replayFrom":{"type":"start"}}`. Collect the replay and its root `cursor_update` with `capabilities.read`. On success, save the response's `cursorId` alongside the transcript. A session with no anchor returns `{}`. Poll it from the start until a cursor is available.
|
||||
2. Send `{"sessionId":"…","replayFrom":{"type":"cursor","cursorId":"…"}}`. Append the updates and save the returned ID only after success. The cursor survives a reader restart with the same protocol, client capabilities, working directory and adapter version. An unchanged session returns the same ID. V2 sends the root `replay_complete` followed by a `session_info_update` with the current title. Apply the title even if the cursor stays the same. A null title clears the previous one. On v1, a change to an already replayed title invalidates the cursor.
|
||||
3. If the read fails with `-32602` and `data.reason: "invalid_cursor"`, read from the start and replace the saved transcript on success. A rewind, compaction, or change to an already rendered tool call or subagent state can invalidate the prefix. On cancellation or a retryable read error, discard the staged updates and keep the last successful cursor.
|
||||
|
||||
Omitting `replayFrom` or setting it to `null` requests a full replay and returns `{}`. A v1 client without cursor support gets the same result from `start`. The optional absolute `cwd` overrides the working directory recorded in the root transcript for replay.
|
||||
|
||||
A missing transcript returns `-32002`. A session already open, opening, closing or being read on the same connection returns `-32600` with reason `session_already_open`. An unreadable history file returns `-32603` with reason `history_read_failed`. A read can also return a retryable error if the writer changes the history between the root and child scans.
|
||||
|
||||
## Polling cost and scope
|
||||
|
||||
A reader with a cached cursor for a root transcript checks the root file identity, size and timestamps, the rewind file, and the stored title when needed. When they match, it skips rendering history. This also covers sessions using Bash, PowerShell, Read, Write, Edit, Glob or Grep. Other tools can depend on child transcripts or workspace files, so their sessions take the full replay path. A reader restart, a pending rewind, or a change to the transcript or its title file also triggers full validation. A new or changed cursor is checked against a second render before delivery. Recorded children share the root request and can append independently. The unit of delivery is the whole suffix, including updates from recorded children. Clients can virtualize that history for display.
|
||||
|
||||
The title is the custom title from the transcript tail or `custom-title.json`, as in Claude’s session index. Otherwise it is the last `custom-title` record, or else the last `ai-title` record, of the whole captured transcript. The index reads only the first and last 64 KB of the file, so a large tool result would otherwise hide an unchanged title. The quiet check assumes the local filesystem updates file identity or timestamps on rewrites. The cursor describes the rendered transcript. For current session activity, AIR clients can use the [session index](air-extensions.md#session-index). For clients also talking to older adapters, a successful cursor request that returns `{}` means a full replay. Replace the saved view and clear the cursor.
|
||||
|
||||
A client switching from a live load to polling closes the session on its own connection and starts a fresh read.
|
||||
503
package-lock.json
generated
503
package-lock.json
generated
@@ -1,16 +1,16 @@
|
||||
{
|
||||
"name": "@agentclientprotocol/claude-agent-acp",
|
||||
"version": "0.111.0",
|
||||
"version": "0.114.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@agentclientprotocol/claude-agent-acp",
|
||||
"version": "0.111.0",
|
||||
"version": "0.114.0",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@agentclientprotocol/sdk": "2.12.0",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.3.331",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.3.333",
|
||||
"diff": "9.0.0",
|
||||
"zod": "4.6.7"
|
||||
},
|
||||
@@ -18,20 +18,20 @@
|
||||
"claude-agent-acp": "dist/index.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@anthropic-ai/sdk": "1.13.0",
|
||||
"@anthropic-ai/sdk": "1.15.0",
|
||||
"@eslint/js": "10.0.1",
|
||||
"@tsconfig/node22": "22.0.7",
|
||||
"@types/node": "26.6.6",
|
||||
"@types/node": "26.6.11",
|
||||
"@typescript-eslint/eslint-plugin": "8.74.0",
|
||||
"@typescript-eslint/parser": "8.74.0",
|
||||
"ajv": "8.20.0",
|
||||
"ajv-formats": "3.0.1",
|
||||
"eslint": "10.15.0",
|
||||
"eslint-config-prettier": "10.1.8",
|
||||
"globals": "17.14.0",
|
||||
"eslint": "10.16.0",
|
||||
"eslint-config-prettier": "10.1.9",
|
||||
"globals": "17.15.0",
|
||||
"prettier": "3.10.1",
|
||||
"typescript": "6.0.3",
|
||||
"vitest": "5.1.1"
|
||||
"vitest": "5.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22"
|
||||
@@ -53,22 +53,22 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk": {
|
||||
"version": "0.3.331",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk/-/claude-agent-sdk-0.3.331.tgz",
|
||||
"integrity": "sha512-ml/MPqgO95tG5zcApBFxEyoDk57d9htP09R8AtPbKPUCHpsobf84IjkN4zhGvQgk8zsA9dXoeMGrQcCc8gQE/w==",
|
||||
"version": "0.3.333",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk/-/claude-agent-sdk-0.3.333.tgz",
|
||||
"integrity": "sha512-1Yuranwacb9CbG7qXtJN47aRnwLC3SbkG2gCD9JqMMr/ztRJFV4GkzGS1ouNC+OPElQtSVA9cWLV/rls6EhpCQ==",
|
||||
"license": "SEE LICENSE IN README.md",
|
||||
"engines": {
|
||||
"node": ">=18.14.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.331",
|
||||
"@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.331",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.331",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.331",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-x64": "0.3.331",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.331",
|
||||
"@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.331",
|
||||
"@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.331"
|
||||
"@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.333",
|
||||
"@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.333",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.333",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.333",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-x64": "0.3.333",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.333",
|
||||
"@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.333",
|
||||
"@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.333"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@anthropic-ai/sdk": ">=0.93.0",
|
||||
@@ -77,9 +77,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-darwin-arm64": {
|
||||
"version": "0.3.331",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-arm64/-/claude-agent-sdk-darwin-arm64-0.3.331.tgz",
|
||||
"integrity": "sha512-PQrn7YTiSV5Bg+ueF2hNvswc+wI7YKC2c32XNedvs6vfMCUUnIlq93VEbZiRY23b+JIVkEm8gb1VhkJTjsYISQ==",
|
||||
"version": "0.3.333",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-arm64/-/claude-agent-sdk-darwin-arm64-0.3.333.tgz",
|
||||
"integrity": "sha512-Jd+OhK0DES/U6d9cko6r1sEsXgdfbNcyXMeYOsK/pToivadk4DkRpwUgbnIalaYhRVP7fkOdZnR3tpHbnzMJUg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -90,9 +90,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-darwin-x64": {
|
||||
"version": "0.3.331",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-x64/-/claude-agent-sdk-darwin-x64-0.3.331.tgz",
|
||||
"integrity": "sha512-dc3iB+CY3jDpKpDpmvYc4V+UKSkudY29iJ62p0s5TK3h+b7Wqa2Hv0bPow0LUs4ZzDUXxEtCEHzk9X29VfLovw==",
|
||||
"version": "0.3.333",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-x64/-/claude-agent-sdk-darwin-x64-0.3.333.tgz",
|
||||
"integrity": "sha512-j+EyETEx2+VAHr0uY/M8yHNDybTIc+0MHivcd349nHvd9BwS6JapGSPYxbLlEc3fLEs+HVkYXj2xay6ySTyP9Q==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -103,9 +103,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-linux-arm64": {
|
||||
"version": "0.3.331",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64/-/claude-agent-sdk-linux-arm64-0.3.331.tgz",
|
||||
"integrity": "sha512-xiRxBxoM8Qa5fnjCFk5iFheL5GUroLuHPJ7UnD4v2Sv1tWxGoSL67AYnMZ6OdjMguZK09X4WlgOn1nL1m6NEOA==",
|
||||
"version": "0.3.333",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64/-/claude-agent-sdk-linux-arm64-0.3.333.tgz",
|
||||
"integrity": "sha512-v0s0Tmf8bOIV3PUX1FuN+4hO44D7W7fvKfEvIkwbMIQfoQw0gQ5IUEZp98AoxhFu7sP0uoYYQZykGvShZ+1pig==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -119,9 +119,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-linux-arm64-musl": {
|
||||
"version": "0.3.331",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64-musl/-/claude-agent-sdk-linux-arm64-musl-0.3.331.tgz",
|
||||
"integrity": "sha512-KdIClOdBUIpvf4PTFe2qedtPCOM3tC/jbsjh8U6WXF0QS8VjYkP0QR9i2AXG1PSAnI24T5xTxQb1scPAgRTIUQ==",
|
||||
"version": "0.3.333",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64-musl/-/claude-agent-sdk-linux-arm64-musl-0.3.333.tgz",
|
||||
"integrity": "sha512-oEUYg+BurCsSNHaTcTMhetICM0+Q8NCiTfTrqDh+3tC4Vnig6VL+DeYJQQF2mMqFF5kuF6+Yr5icH6aB2RAxkg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -135,9 +135,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-linux-x64": {
|
||||
"version": "0.3.331",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64/-/claude-agent-sdk-linux-x64-0.3.331.tgz",
|
||||
"integrity": "sha512-nfHSiLJdkpsVAFsXTriyW3r64gS1sp5zxvaoF2dmNqKixR4rf9ISDDi81gF9L1uk/bAEcBGRx34U6Itw+NYIEg==",
|
||||
"version": "0.3.333",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64/-/claude-agent-sdk-linux-x64-0.3.333.tgz",
|
||||
"integrity": "sha512-vKQb+fHKNDnhkftZduG9heKzsbLsERqnu/wpfWxz2yXtoe6RxJp5/ybodMZwkYlmcp++vUxmmlbs+7+Ek+MXjQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -151,9 +151,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-linux-x64-musl": {
|
||||
"version": "0.3.331",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64-musl/-/claude-agent-sdk-linux-x64-musl-0.3.331.tgz",
|
||||
"integrity": "sha512-CSeT1JF++Vckf6TSXjQeuSjQ/sJnoTVL/XX44v4jHNAtU5i22nI9b27E6wkzudYVxoRoLWIU00V05dXhYYCvlg==",
|
||||
"version": "0.3.333",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64-musl/-/claude-agent-sdk-linux-x64-musl-0.3.333.tgz",
|
||||
"integrity": "sha512-P6PlCMmTwpkdYvilGEED2QA1VkPHzP9nKaUhCJOtu5vgW2XqzQCGn7ZnbiRu3AWdEhQAzEsdBx8VHCGPsQIyUQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -167,9 +167,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-win32-arm64": {
|
||||
"version": "0.3.331",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-arm64/-/claude-agent-sdk-win32-arm64-0.3.331.tgz",
|
||||
"integrity": "sha512-FsPHWUpgHBFgSZESwM53JsbEoQiWPnigSCyjSfHDyiWnH66e0NsuksuJ/Nu9qI8UVgBDh/y1NOnnd4eGrB3eFQ==",
|
||||
"version": "0.3.333",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-arm64/-/claude-agent-sdk-win32-arm64-0.3.333.tgz",
|
||||
"integrity": "sha512-mJVDE+gPoNO1HJny1esj/MOyUuwyTNQ+ZpNQjbA0kFnuL7fmf85UlJ6E3+Kr8GyGHfIDZksh4IP/N9R7WgMTnQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -180,9 +180,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-win32-x64": {
|
||||
"version": "0.3.331",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-x64/-/claude-agent-sdk-win32-x64-0.3.331.tgz",
|
||||
"integrity": "sha512-AsLur4ov9MGTQTrnZ49ZDPasQ35U3X/rZDdF/rPhytN3h1F3w/0IkC6esW3OzldvPlci60QvggOLVGnFlUzdxw==",
|
||||
"version": "0.3.333",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-x64/-/claude-agent-sdk-win32-x64-0.3.333.tgz",
|
||||
"integrity": "sha512-JXxT3cKu7RYrp6rFxHlv682qfblciAHZrqpTR77Bv5Xj9VA7pReHiK2m0x5OTg9TN3iyPJwUPep3NvBcnF9Paw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -193,9 +193,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/sdk": {
|
||||
"version": "1.13.0",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-1.13.0.tgz",
|
||||
"integrity": "sha512-F4Qu3zqRINxTV5xruOvw1gXhEsYH4lOgxffxZx4IworMefc395T458pl5Uj3TZiAlO3+gvhYoHSHU7qDsrchNA==",
|
||||
"version": "1.15.0",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-1.15.0.tgz",
|
||||
"integrity": "sha512-N6noVzTApqN4S7XQvaxjDJtoxlDj36lAdj1DfDmh4puzUJjVlR7cYPLJa8Ch2pRaBhRd3of/4a5apg8Wn52g0A==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@opentelemetry/api": "^1.4.1",
|
||||
@@ -215,9 +215,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/runtime": {
|
||||
"version": "7.29.15",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.15.tgz",
|
||||
"integrity": "sha512-304gsbbGVmQc+cNGHzwHBlqepYdWLKj3VXCQBGt/EGcV7PUPfKI7kAUNW1FZEOCwlQiLvQjg1JEaAlRQ616h+Q==",
|
||||
"version": "7.29.16",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.16.tgz",
|
||||
"integrity": "sha512-LKBjGopxrQE0aFucNL69OyyyF143MOWUULEOftU3oCgyD35Sy84UUpVnt/sNvTb7ZmCyALSt7om+fojlW35zYQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
@@ -247,43 +247,6 @@
|
||||
"keyv": "^5.6.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@emnapi/core": {
|
||||
"version": "2.0.0-beta.2",
|
||||
"resolved": "https://registry.npmjs.org/@emnapi/core/-/core-2.0.0-beta.2.tgz",
|
||||
"integrity": "sha512-MzCVoWtcg4Pm2B3je5mMvYMvj3MmBKw+fU7vbsJc9/iT8ip6/eYIHo/Dsm/mr+wsHB6SEyJDuxB09Yy6r/8+4A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@emnapi/wasi-threads": "2.2.0",
|
||||
"tslib": "^2.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@emnapi/runtime": {
|
||||
"version": "2.0.0-beta.2",
|
||||
"resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-2.0.0-beta.2.tgz",
|
||||
"integrity": "sha512-JcrSPzPvZuNZvJqPTF9Fw25LbOJ8avzFVlaf2grmH4Cku0oGP47tRgqPZadcfj3YoZMHkFVnCYFbQM8I+i5QEw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"tslib": "^2.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@emnapi/wasi-threads": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-2.2.0.tgz",
|
||||
"integrity": "sha512-JP7OYH38Q7+pyTAe14raZHLQIK7BDKbdwji+Xi3pcd/6QkJYQH3SX4wu6EplGrGJWRepoNzedfm0G3B9Z4e9Rw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"tslib": "^2.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint-community/eslint-utils": {
|
||||
"version": "4.10.1",
|
||||
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.10.1.tgz",
|
||||
@@ -304,9 +267,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint-community/regexpp": {
|
||||
"version": "4.12.3",
|
||||
"resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.3.tgz",
|
||||
"integrity": "sha512-R76UKbvsqI68DJJVTVyqFKqU98CN4+B+acxNfEA2IFarSzP0SjtKf/3+fFiXzTyv5Fj3PxLkGHe2wnVWWMxobQ==",
|
||||
"version": "4.12.4",
|
||||
"resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.4.tgz",
|
||||
"integrity": "sha512-1qH3WeISXHFS8P3QI0lntHlMrlfTh1OarxlRbPNDEkSCqoyXC3apBE7MDyRKOL8HpuW48aQtff30wvEFww/4ww==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -314,9 +277,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/config-array": {
|
||||
"version": "0.23.6",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.6.tgz",
|
||||
"integrity": "sha512-WrTH7nioI9QPY4NZGnsywmecswJdgeq4BCM76qok9VgjTO29ZgUzUvcuJLVPYVQM4uDbaPBU0M33R9DIxI8X3w==",
|
||||
"version": "0.23.7",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.7.tgz",
|
||||
"integrity": "sha512-Ix1tmZjA7/OmE7ROAfORe83hVnqlDzLpZVHFjHQt5mvLm1U03qMexpaxKqFIL362QV32SoPaZqmKQr3tdqFY2w==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
@@ -578,29 +541,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@napi-rs/wasm-runtime": {
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.6.tgz",
|
||||
"integrity": "sha512-mRyDmEw9/fCDXCGfL1sbgIw/GUK0PVxRW4YwgPN61F3LQ+fSyoBFarJVzgGyhF6kRzEQZ0FejDqm4WLXSeqQmw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@tybys/wasm-util": "^0.10.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^20.19.0 || ^22.13.0 || >=23.5.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/Brooooooklyn"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@emnapi/core": "^1.7.1 || 2.0.0-beta.2",
|
||||
"@emnapi/runtime": "^1.7.1 || 2.0.0-beta.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@opentelemetry/api": {
|
||||
"version": "1.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.10.0.tgz",
|
||||
@@ -611,9 +551,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-project/types": {
|
||||
"version": "0.156.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.156.0.tgz",
|
||||
"integrity": "sha512-1Duyg48TdJNdyhEB8Xn1L36bT9Pv6GUtlKjHxOys8xkaF/rQq3XJE+bAurSK/AgIz5mGFsb77cn9Pb20+WCScw==",
|
||||
"version": "0.160.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.160.0.tgz",
|
||||
"integrity": "sha512-gw4k9syEmnckbOgw2A2FU1TBDdX9hfwV9jEn/uio65pguPzwWiXQS3OIJDMEhv9m06tj9XiEe6RoD0YA+LgreA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
@@ -622,9 +562,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-android-arm-eabi": {
|
||||
"version": "1.2.19",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.19.tgz",
|
||||
"integrity": "sha512-e+Ebe0WT+9tbXmNKPIiC8YrWAHYwug3m6i4p3rZGGulfZri1jtI4HslT+OZnFf/OIHowWF71DTlHwXBP2SiA7A==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.3.4.tgz",
|
||||
"integrity": "sha512-xCW8CkL/ualx/SbYqeG9iK87lJCZGDQ0soE+kaORJ0Bd+pHALyE4qK7BStmEAyYWLEzZ3/biSIpA6/7GDFvzIg==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -640,9 +580,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-android-arm64": {
|
||||
"version": "1.2.19",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.19.tgz",
|
||||
"integrity": "sha512-hOombrTJ+szt2ciEzS7oCA78lMPBgF5UMQWCJIyNfnrI7GLl8HYoFqCnpL2gcPOaXMqryGCU5ExdQKyDDcC+yA==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.3.4.tgz",
|
||||
"integrity": "sha512-5lifIO+b/prcM9sx/bkPN4w6UEToEfQ3gjhx0+0neuL+dkYskI792CfAq03T51jc8JFcaYXs2hi3l8RjiH/VWQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -658,9 +598,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-darwin-arm64": {
|
||||
"version": "1.2.19",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.19.tgz",
|
||||
"integrity": "sha512-XoMA2pwCKGTQzUjPgtRwkedH4WmXhdIPKT6l6oOxd1PUbNodGI6DcBekgN7EC//+x3pfBYX/qL1gNmZAqivw5g==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.3.4.tgz",
|
||||
"integrity": "sha512-RCgxTI4AJQxhVF//BI3ImQOsXTHrF4Eg+f99jBy8WoETA2kSEGFxpnrVmW0leQq/2aBR4R5AC6csmy3rc66e3Q==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -676,9 +616,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-darwin-x64": {
|
||||
"version": "1.2.19",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.19.tgz",
|
||||
"integrity": "sha512-zo8EsSSwMZCY/e+fRnGaX02YGgvJD0yvhNi/9hpGPA2MJ9ZF8dPCw75UGfpI6OpQ/myR/dIYmogRvqiZD0TrXg==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.3.4.tgz",
|
||||
"integrity": "sha512-zNPJVVPUaDEj+L0lImoK3rFv2b+Z5gNijI6DWu/fcD3/1TfmRXKb9ZyxbSN+2AhlctqjbNzUvCsMa+EBhnEM4Q==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -694,9 +634,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-freebsd-x64": {
|
||||
"version": "1.2.19",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.19.tgz",
|
||||
"integrity": "sha512-O8ISAOfI1nj7AuBPd30FSF47z7f7lzlk5poQVGgiikvQuGEBFYvW8ki+UEnT+YJPnNGjQzn304klt4O9FUE7mA==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.3.4.tgz",
|
||||
"integrity": "sha512-upP6g7ZIRy5by1RDQ/EphHIdJ5xK0eUD7sUgfZFWJ49s4XdbYsIvIlAPtrFpayR70Hhf9J22lb4Pm8/9FhrZmg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -712,9 +652,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-arm-gnueabihf": {
|
||||
"version": "1.2.19",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.19.tgz",
|
||||
"integrity": "sha512-/lYCba5NO0yq4S0jGMH8QTBtkvQxoXjoQWzF5BcWp9MjB9jxVRD1GQDNofkVjcOj30DWyhLIN/4Oe60JKzaONw==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.3.4.tgz",
|
||||
"integrity": "sha512-SAX5C5+poMLCxu8dkPF6h5yst40rkzs+9Y3cbPn2OFSydmHjAEprrGi64zGgnYyPIVZfdGUFqJ2fJbfbnHI+mA==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -730,9 +670,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-arm64-gnu": {
|
||||
"version": "1.2.19",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.19.tgz",
|
||||
"integrity": "sha512-pm/apFMBnSbFb3O6nG5pHO1iqHhZrjGDFEjSm+ot9J17XXPvH9L90y5h+jgfHCE+Qdlsvy8qKEcU4VKxgjD+vA==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.3.4.tgz",
|
||||
"integrity": "sha512-nwHqdlRZS6GWBef3dG5/pMY6RNTBBUjj7s0Da+m6xsFpe7jx6IC46SLZcCu8f46JOfCovZmwnrz51EzGE+7Fyw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -751,9 +691,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-arm64-musl": {
|
||||
"version": "1.2.19",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.19.tgz",
|
||||
"integrity": "sha512-K1SmQp3FFichn8oqrNIwvFoZ5wcvjC7goBzpaMNvLf9FZc+QB/QvLmnpJZgAAGHiD980tP8FZZnXk2K94rvlxg==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.3.4.tgz",
|
||||
"integrity": "sha512-Gr78X2ur/AgLCkmZgHffk/FerIX8S5zb/eII4bCcvJo0ANzeXhTShahdNbpnY6bpiszIAgIfiuKS9ziziWsamw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -772,9 +712,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-ppc64-gnu": {
|
||||
"version": "1.2.19",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.19.tgz",
|
||||
"integrity": "sha512-I0xwD57jP/3A7+5UPZin2w8Y7XHEmEM5zqpYZOcQ45MlNW6tUJUziymV3yRr7rL4vwyfEcRsRksC4a7Kc08p5Q==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.3.4.tgz",
|
||||
"integrity": "sha512-o9Wcn8nWrsQasaBRYM4d//FwhlBsTJYWkPVlhlt6FwzpwEoovY4IopRZjk5Fq3+ntRuSDORJjF/nA8sFeF2q6w==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
@@ -793,9 +733,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-s390x-gnu": {
|
||||
"version": "1.2.19",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.19.tgz",
|
||||
"integrity": "sha512-BrtEHT24SNXj9HiXqy+s/kXiSiQGt6EKCPUlRirAoIioVxKGnbXBUEkbZASAei7iZJB0/Ynm+0JP00Ipx7AnSw==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.3.4.tgz",
|
||||
"integrity": "sha512-UDWu4jkVcx2kiBKm3Ec//4lVCbeTWj8gmJ9SyLWCdLWtTlyq7fQVeVV/14nXvRtSLErvJ2+yA/Ux5taS31Y17Q==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
@@ -814,9 +754,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-x64-gnu": {
|
||||
"version": "1.2.19",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.19.tgz",
|
||||
"integrity": "sha512-rm75/9DkHKeU2WnA8w4X94WGYgLlDCFCfkQC+4bguVJmC/jvDRv2B+2wLOYhyE0fVuv7//Ckk39OoOufyCu76Q==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.3.4.tgz",
|
||||
"integrity": "sha512-W9mGtTa0w4fWh8RLMNPyaEhhcuqUfO07Q4I1bBc4PDMNg7gQSw0yPQNQ3D0qwbkXwxbyL4YrIzc8n6k1vuFExQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -835,9 +775,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-linux-x64-musl": {
|
||||
"version": "1.2.19",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.19.tgz",
|
||||
"integrity": "sha512-irh/4+iYFM4GAzpluDErgjz89bj6NDtqqMAG/6O1LG38Ed3NpyebzCpcVNkFW8uhy+/3/BocUvnXDR33CXWe9A==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.3.4.tgz",
|
||||
"integrity": "sha512-8B+ofyQZ7/aCmkqnyMonPr5zKLqMVNczhRGFNtdIuItiwNn8iQWJawMq2E58r7bxD1XEbtRRsULY/eCWwZQ01Q==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -856,9 +796,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-openharmony-arm64": {
|
||||
"version": "1.2.19",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.19.tgz",
|
||||
"integrity": "sha512-+KWTWNoPt+CfSq94CiceWu3yPE+QzkaG+phPyz9G60tmZLwfQkcA4AeksafzvJAw4pvg1mcd5a1TkUqVv0s4JA==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.3.4.tgz",
|
||||
"integrity": "sha512-TlD0FSZaC7o2B4NCe9V5N11ugTnhzTM9ksj4sgRLvrKosDzjEkvlsTX3ehkw4ZlPv8AADimZZTvJGEa16pfXug==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -874,9 +814,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-wasm32-wasi": {
|
||||
"version": "1.2.19",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.2.19.tgz",
|
||||
"integrity": "sha512-7EH+skOsl5qpWnK0vzamgJFhOv1cwxQpsxm8tI883K9fur5c27p8q87fzEO6BbBPabA2/+s/zR63/pLc137iOg==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.3.4.tgz",
|
||||
"integrity": "sha512-jwO8P3o53ygo7b5061B7BeaJ1BGv3BKZ6jroFdw/01qWry7Z+qNBlDvulzbTle5s/A0Fc1FRgsTxrke9DvsSbA==",
|
||||
"cpu": [
|
||||
"wasm32"
|
||||
],
|
||||
@@ -885,18 +825,16 @@
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@emnapi/core": "2.0.0-beta.2",
|
||||
"@emnapi/runtime": "2.0.0-beta.2",
|
||||
"@napi-rs/wasm-runtime": "1.2.6"
|
||||
"@oxc-project/types": "0.160.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^20.19.0 || ^22.13.0 || >=23.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-win32-arm64-msvc": {
|
||||
"version": "1.2.19",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.19.tgz",
|
||||
"integrity": "sha512-3Q1Yg1Q7tEvBWoZf5rFvG/GKZQPgwfru+p4wBajDfJFBs0SHCpL++dfTjW9gyAKd1T7ZpIYvdaUax7Pa/IhFVQ==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.3.4.tgz",
|
||||
"integrity": "sha512-8adGMrNtrdzi2WD1ozhYapER59gD8Q/DV6SCKJlyG2HqULPdeQUBvMa33lTsiEYwIqTZUaIU2MmvPp5f1wbtXA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -912,9 +850,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-win32-x64-msvc": {
|
||||
"version": "1.2.19",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.19.tgz",
|
||||
"integrity": "sha512-y/sqRRc6d7hECzOFc5n3LSeqctmIp9mMjY1Kq4s14uLPd/LZ4z7i1zrW6fMtp2mPeuQIC4e6ULMcwQzMomqQag==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.3.4.tgz",
|
||||
"integrity": "sha512-rIMjtESdXJCIoOiUTroQ1Y1rjVDZkuUVRUxs3APX2vNv175D7TDWvzdELiIhzGq9cUNUFat+co+PTmPHPqSREg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -950,18 +888,6 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@tybys/wasm-util": {
|
||||
"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,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"tslib": "^2.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/chai": {
|
||||
"version": "5.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz",
|
||||
@@ -988,9 +914,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/estree": {
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.10.tgz",
|
||||
"integrity": "sha512-lTyOMnOcmRBzdCv6/4zUZCrEhV0xrqQiUZBZtVcbmLHBXKLnN8q89v/wKRF/Q0HbwVsqbIG3o5HDoFl9sduM+g==",
|
||||
"version": "1.0.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.11.tgz",
|
||||
"integrity": "sha512-YBdNe5JcjYR0sPhJW1QIeRCmI11YhYvaRuGCs9+WCeTTb+Yhb2BE2XMe5/wAqF10FK5g3+q1PDhQABfT7aX0gg==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
@@ -1002,9 +928,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "26.6.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.6.tgz",
|
||||
"integrity": "sha512-MzQj+8Kx3XI40OmUAE6Qoh58ZMNstNNMwn2nfd3qWsfe7nDNSqJNzes4njhz6AHwrSHOffSLwXU6yb474Q4aog==",
|
||||
"version": "26.6.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.11.tgz",
|
||||
"integrity": "sha512-uUyQ2XLEz+EXh34lmS3GhKrkqn/8FU7KUiKRpk347At2bmnMVWss45yz8b4FG/tUtmV1tV/+TVkITItPROyeeQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -1251,14 +1177,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/mocker": {
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.1.1.tgz",
|
||||
"integrity": "sha512-b2OgTB4+3ImWIVafXKazJXwLKwQxUNnix6b3xUvUTMh7RyXlrtzoxfZr8aEz9zkHOMAS4K5lu3TvFWoiVeVTQg==",
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.1.2.tgz",
|
||||
"integrity": "sha512-UGc97wUIy0Ji2+9GxzHEJiOhiwkaukgE7VYcUNnjpX3sWnwQ8XogmNXX4WyOukxYgKb8Nh2XFa7KId0ZjpmVhQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@jridgewell/trace-mapping": "0.3.31",
|
||||
"@vitest/spy": "5.1.1",
|
||||
"@vitest/spy": "5.1.2",
|
||||
"estree-walker": "^3.0.3",
|
||||
"magic-string": "^1.4.5"
|
||||
},
|
||||
@@ -1279,9 +1205,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/spy": {
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.1.1.tgz",
|
||||
"integrity": "sha512-6K8C6alQG1/Yc8/ZI22iJS7JEsxPdVzqtqDq+/xM4Z0mGVykemMVjLhqMy/q6/IHYG3kKD8hKSwRen/ZdyI9vQ==",
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.1.2.tgz",
|
||||
"integrity": "sha512-PQl0/3+p9GaY71+MHywN6oyHfLhVDD5kcbm7oNRldA2F0ExMU3S8RQdnpteJ9gFAdK5P6KCgE6LqCpUgy57KzA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
@@ -1418,9 +1344,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/brace-expansion": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.1.0.tgz",
|
||||
"integrity": "sha512-aa11Dv491GKnYqxaul3aRJ0szew7yMJMfZPnqD44NjGrZXoj62l41OEDDpdpC4eE2P88vBFfLuSyRhpG91NUvg==",
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.1.2.tgz",
|
||||
"integrity": "sha512-ELhY3JEerIBbhgW+rh0/8glkZAaMqn1x3BAvp3yTULSEGozMK/5PT6WTdBgsdvJqwwmv7MAQNOydfYbvK1Vgfw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -1558,9 +1484,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/cross-spawn": {
|
||||
"version": "7.0.6",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
||||
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
|
||||
"version": "7.1.2",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.1.2.tgz",
|
||||
"integrity": "sha512-8BPK2r+sKWC8sDinRwLwrFMq2lXTBBwzYYEB9LiCznfMurOi4FOvQflq3XOLGG+HPdMSVpe+k/s96+AtDEOgPg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"path-key": "^3.1.0",
|
||||
@@ -1722,9 +1648,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint": {
|
||||
"version": "10.15.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-10.15.0.tgz",
|
||||
"integrity": "sha512-+5Wg4p+ze3sG1WErYgUO/3H1IQIfFBymVUA0Fo/XTeBOLS6UQIUekpSJ8sdRkn7O7wjh84b55w/roqavH2aScg==",
|
||||
"version": "10.16.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-10.16.0.tgz",
|
||||
"integrity": "sha512-Xu3PRLG/wCaZWZ20gkExUcNqL2mWWsXTR+Lln3Sof4Y9WuA678fH9hrlQ8B6UNwbTnsKdDdBYOd2jxtycXVTGQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"workspaces": [
|
||||
@@ -1733,7 +1659,7 @@
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.8.0",
|
||||
"@eslint-community/regexpp": "^4.12.2",
|
||||
"@eslint/config-array": "^0.23.6",
|
||||
"@eslint/config-array": "^0.23.7",
|
||||
"@eslint/config-helpers": "^0.7.0",
|
||||
"@eslint/core": "^1.2.1",
|
||||
"@eslint/plugin-kit": "^0.7.3",
|
||||
@@ -1781,9 +1707,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-config-prettier": {
|
||||
"version": "10.1.8",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz",
|
||||
"integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==",
|
||||
"version": "10.1.9",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.9.tgz",
|
||||
"integrity": "sha512-JnOR0K4u67CWOiSS3vaduGlLUWS32lGiyglMIV6AyvK9DBRpS+QhR2ESKaUe2eWGRsdVmrxy77yaOk2hzDa4Bg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
@@ -2205,9 +2131,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/flatted": {
|
||||
"version": "3.4.4",
|
||||
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.4.tgz",
|
||||
"integrity": "sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q==",
|
||||
"version": "3.5.1",
|
||||
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.5.1.tgz",
|
||||
"integrity": "sha512-qzp88St5qssOkS6hnWEvsFqE6SGoQtamMc6ghNo2s2idGn3rvHl/mdmLKQr5egZeVcqHfVCXtPoY+DP0flzPTg==",
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
@@ -2310,9 +2236,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/globals": {
|
||||
"version": "17.14.0",
|
||||
"resolved": "https://registry.npmjs.org/globals/-/globals-17.14.0.tgz",
|
||||
"integrity": "sha512-UtdkTVyAJePQv0J2M9Xe4L0ruNSDV314XiIJsADI2Zf40bcdAonE/D/OhAU8AT99oij9mhLByb+NvA3QWZYgCg==",
|
||||
"version": "17.15.0",
|
||||
"resolved": "https://registry.npmjs.org/globals/-/globals-17.15.0.tgz",
|
||||
"integrity": "sha512-OyBOdPnzu9B2lFpums9/4wcyNHx4haAxY2X5PgO9LqCvXJgKYMMr/1y4TU7om/vTy4eYqRsVes1ZTJEJYKap8Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -2375,9 +2301,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/hono": {
|
||||
"version": "4.13.21",
|
||||
"resolved": "https://registry.npmjs.org/hono/-/hono-4.13.21.tgz",
|
||||
"integrity": "sha512-h9UsguqfVk4kjUwLvQpHOmOaJpW10jz9lp8bvKUUa04wJG/fabKFBqXZ06D6LFaeKQZtUZRVeg0gfkTTEsX7Mw==",
|
||||
"version": "4.13.23",
|
||||
"resolved": "https://registry.npmjs.org/hono/-/hono-4.13.23.tgz",
|
||||
"integrity": "sha512-OS90dj7dcsftEEWCOef8jRbnHE5lbrOq0hNRqjSyPsOnaGZvvfof1KS05hQNb4kUOCfDq1mG3PmHoX37DMnHQg==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
@@ -2430,9 +2356,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/ignore": {
|
||||
"version": "7.0.16",
|
||||
"resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.16.tgz",
|
||||
"integrity": "sha512-52N+Y4HRMOJmbLmr+DqO4iSRyyB7N52gm7PWCT6h0p978+oKbqHCB7gIJIwZvBUsjlSdWbrBFqUSmIFNZMpn0A==",
|
||||
"version": "7.0.17",
|
||||
"resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.17.tgz",
|
||||
"integrity": "sha512-0c3zcBRlWmcKhcIQWckzkYncJRv5HHB8O32wO/FcWL8DDXWDJgiEF6SX9ThbTv5h/eZ+xJK+VvDjjQ+cQJhp3Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -2457,9 +2383,9 @@
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/ip-address": {
|
||||
"version": "10.7.6",
|
||||
"resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.7.6.tgz",
|
||||
"integrity": "sha512-00LYkM6byILa9eQIx6qoaXCM40xTLd56AZ4vyaPW3YTyb49VZYPo5xsiAq4tuQ54GH4R7gVdYScJ1B7B77PuTg==",
|
||||
"version": "10.7.7",
|
||||
"resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.7.7.tgz",
|
||||
"integrity": "sha512-He15rAs4jip5AEAz7XM9L+S6Y8LBMIDj6YewbYuJfmDnOCKWb+3TLOGnHFBTAIW7wpm5ohtZ+Xyo5PEaG+O2vQ==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
@@ -2513,9 +2439,9 @@
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/jose": {
|
||||
"version": "6.2.18",
|
||||
"resolved": "https://registry.npmjs.org/jose/-/jose-6.2.18.tgz",
|
||||
"integrity": "sha512-doV4thUwgkrycJH4yLeqwTGIIZphHl+pk7CPReuMIhYhncmgzdko85MaCG4YQFTxqMFr1/oEH32tZuKKovcDEg==",
|
||||
"version": "6.2.19",
|
||||
"resolved": "https://registry.npmjs.org/jose/-/jose-6.2.19.tgz",
|
||||
"integrity": "sha512-NnThKzdK4dJTUQOBoMB0bF3Xmw4EtbFTo4xzeLaoBwcuOdBVDQcKB3/86DUTWjVMXkZOdaqZVo2OU6DllhS+9Q==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"funding": {
|
||||
@@ -2955,9 +2881,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/minimatch": {
|
||||
"version": "11.0.9",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.9.tgz",
|
||||
"integrity": "sha512-KCFkfyjqerNlSstjlhIGNXIKZGA/6O4V4RlhZ+Dsr621SPPw0mzlypE9D9ZOoPiVefHID+j7/XuMMlqfD/F60Q==",
|
||||
"version": "11.0.10",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.10.tgz",
|
||||
"integrity": "sha512-L3/cjhQ5E6lft0VCp/2mO3Ic74RnutKy3rz7iGwp/6w1hKcO262g2rbfacFyw6eBig5OdI0nu5PpuA0/WQs9Tw==",
|
||||
"dev": true,
|
||||
"license": "BlueOak-1.0.0",
|
||||
"dependencies": {
|
||||
@@ -2997,6 +2923,25 @@
|
||||
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/napi-windows-process-start-time": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/napi-windows-process-start-time/-/napi-windows-process-start-time-0.1.0.tgz",
|
||||
"integrity": "sha512-zHxhzKsIFu3elch3eFw69WEUGc79DFhbc3nD/WEOzWL/pFFLZRW13EHnuO0c+0YjncE5uCaS9ICHxOBXkb6vPw==",
|
||||
"cpu": [
|
||||
"x64",
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
}
|
||||
},
|
||||
"node_modules/natural-compare": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
|
||||
@@ -3221,9 +3166,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/postcss": {
|
||||
"version": "8.5.33",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.33.tgz",
|
||||
"integrity": "sha512-RVHEU9/Pp1Fnjr/MpAJsZoADukCKhfIi15OunEYiGktIkYLkPVvC1sioWolGDS7XByMTx9m/IGbro0Js13zhnQ==",
|
||||
"version": "8.5.34",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.34.tgz",
|
||||
"integrity": "sha512-P1Qzj0XXZjMda74C7qiVnBG90UKNbyNUAOeQRBW8X63RsIMV57gevRqjnkELdwtZ/S2/uQFksJhmwuN8xShLPw==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -3244,7 +3189,7 @@
|
||||
"dependencies": {
|
||||
"nanoid": "^3.3.20",
|
||||
"picocolors": "^1.1.1",
|
||||
"source-map-js": "^1.2.2"
|
||||
"source-map-js": "^1.2.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10 || ^12 || >=14"
|
||||
@@ -3381,14 +3326,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/rolldown": {
|
||||
"version": "1.2.19",
|
||||
"resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.19.tgz",
|
||||
"integrity": "sha512-QIiV1J9d0pzN4jeeTH4sjPy0AZ6cAy2cG0ExeoE1+U8Rvj+hR3gYkokx0YbeUNGlZqiQJJ2utcETe0oKXwzsuA==",
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.3.4.tgz",
|
||||
"integrity": "sha512-p2rq4bfBmF0M6yaR8+A89fbkBQynZI2fxUW4G07eq9kpctAkpo7q5BZ4X4Mo4XZ7HHROu33cX9PeopUFN6u+2Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@oxc-project/types": "=0.156.0",
|
||||
"@oxc-project/types": "=0.160.0",
|
||||
"@rolldown/pluginutils": "^1.0.0"
|
||||
},
|
||||
"bin": {
|
||||
@@ -3398,22 +3343,22 @@
|
||||
"node": "^20.19.0 || >=22.12.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@rolldown/binding-android-arm-eabi": "1.2.19",
|
||||
"@rolldown/binding-android-arm64": "1.2.19",
|
||||
"@rolldown/binding-darwin-arm64": "1.2.19",
|
||||
"@rolldown/binding-darwin-x64": "1.2.19",
|
||||
"@rolldown/binding-freebsd-x64": "1.2.19",
|
||||
"@rolldown/binding-linux-arm-gnueabihf": "1.2.19",
|
||||
"@rolldown/binding-linux-arm64-gnu": "1.2.19",
|
||||
"@rolldown/binding-linux-arm64-musl": "1.2.19",
|
||||
"@rolldown/binding-linux-ppc64-gnu": "1.2.19",
|
||||
"@rolldown/binding-linux-s390x-gnu": "1.2.19",
|
||||
"@rolldown/binding-linux-x64-gnu": "1.2.19",
|
||||
"@rolldown/binding-linux-x64-musl": "1.2.19",
|
||||
"@rolldown/binding-openharmony-arm64": "1.2.19",
|
||||
"@rolldown/binding-wasm32-wasi": "1.2.19",
|
||||
"@rolldown/binding-win32-arm64-msvc": "1.2.19",
|
||||
"@rolldown/binding-win32-x64-msvc": "1.2.19"
|
||||
"@rolldown/binding-android-arm-eabi": "1.3.4",
|
||||
"@rolldown/binding-android-arm64": "1.3.4",
|
||||
"@rolldown/binding-darwin-arm64": "1.3.4",
|
||||
"@rolldown/binding-darwin-x64": "1.3.4",
|
||||
"@rolldown/binding-freebsd-x64": "1.3.4",
|
||||
"@rolldown/binding-linux-arm-gnueabihf": "1.3.4",
|
||||
"@rolldown/binding-linux-arm64-gnu": "1.3.4",
|
||||
"@rolldown/binding-linux-arm64-musl": "1.3.4",
|
||||
"@rolldown/binding-linux-ppc64-gnu": "1.3.4",
|
||||
"@rolldown/binding-linux-s390x-gnu": "1.3.4",
|
||||
"@rolldown/binding-linux-x64-gnu": "1.3.4",
|
||||
"@rolldown/binding-linux-x64-musl": "1.3.4",
|
||||
"@rolldown/binding-openharmony-arm64": "1.3.4",
|
||||
"@rolldown/binding-wasm32-wasi": "1.3.4",
|
||||
"@rolldown/binding-win32-arm64-msvc": "1.3.4",
|
||||
"@rolldown/binding-win32-x64-msvc": "1.3.4"
|
||||
}
|
||||
},
|
||||
"node_modules/router": {
|
||||
@@ -3609,9 +3554,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/source-map-js": {
|
||||
"version": "1.2.4",
|
||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.4.tgz",
|
||||
"integrity": "sha512-J7ZjMvHd9O1fcT/5V09QWaaSl2BbWx3F6O08spde82Namf9UB0GxRVIPiNbVsdKkoizHiSpTodo3vp2bAy91MA==",
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.3.0.tgz",
|
||||
"integrity": "sha512-pdUVfIWcK0kCgK831ibqkZDcL7I9zljjOu0TQFnA+fiQ6y1CYqYB7RkTOHHO45FGMg5P/Mvk/+4ToQ7gAYAL5Q==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause",
|
||||
"peer": true,
|
||||
@@ -3657,9 +3602,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/tinyexec": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.1.tgz",
|
||||
"integrity": "sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==",
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.4.0.tgz",
|
||||
"integrity": "sha512-PV6lIcJQh57aFeJDwx16JNHmgFRh5xguzallrDW1qe8nAghYgr5MKz2K5k7wEyV/ygZhdnIAP8+HZSarHPBCsg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -3712,15 +3657,6 @@
|
||||
"typescript": ">=4.8.4"
|
||||
}
|
||||
},
|
||||
"node_modules/tslib": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.9.1.tgz",
|
||||
"integrity": "sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==",
|
||||
"dev": true,
|
||||
"license": "0BSD",
|
||||
"optional": true,
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/type-check": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
|
||||
@@ -3819,17 +3755,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/vite": {
|
||||
"version": "8.3.8",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-8.3.8.tgz",
|
||||
"integrity": "sha512-LzOn3h9rG/0vhLdXrV4yJ4QFA9eEoqCl+Yx+kGJd7aB9w6nfNgVHKSYwLPZUHrz4ZGa+t+kXjV9itvcHDLQouA==",
|
||||
"version": "8.4.0",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-8.4.0.tgz",
|
||||
"integrity": "sha512-X2nUJg+9cutlz3hzqyO6p+WTwk9H257DjwAEf9EQYUFrQbDItmetadi9gYmb+l7VDy4r3VXLUnmLTwuPmzejDw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"lightningcss": "^1.33.0",
|
||||
"picomatch": "^4.0.7",
|
||||
"postcss": "^8.5.32",
|
||||
"rolldown": "~1.2.18",
|
||||
"postcss": "^8.5.33",
|
||||
"rolldown": "~1.3.2",
|
||||
"tinyglobby": "^0.2.17"
|
||||
},
|
||||
"bin": {
|
||||
@@ -3842,7 +3778,8 @@
|
||||
"url": "https://github.com/vitejs/vite?sponsor=1"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"fsevents": "~2.3.3"
|
||||
"fsevents": "~2.3.3",
|
||||
"napi-windows-process-start-time": "^0.1.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/node": "^20.19.0 || >=22.12.0",
|
||||
@@ -3898,14 +3835,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/vitest": {
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/vitest/-/vitest-5.1.1.tgz",
|
||||
"integrity": "sha512-trVmzUFOSraCZcI3uZIMD5FqBh4atFkC/XuJP/IU7qtyQay0FCs3Ia+0QiQ2JJwGyWG/xrcBoJNel2+O7kEZ0g==",
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/vitest/-/vitest-5.1.2.tgz",
|
||||
"integrity": "sha512-VIa2wXV208WraXUbzH+dQUrGcFpPuaiRA8HlhXS8R6/sy9cynw6OMqGj8fmAlH1hot7huTCtWUE14+FdXU3eLw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/chai": "^5.2.2",
|
||||
"@vitest/mocker": "5.1.1",
|
||||
"@vitest/mocker": "5.1.2",
|
||||
"chai": "^6.3.0",
|
||||
"es-module-lexer": "^2.3.2",
|
||||
"expect-type": "^1.4.0",
|
||||
@@ -3931,12 +3868,12 @@
|
||||
"@edge-runtime/vm": "*",
|
||||
"@opentelemetry/api": "^1.9.0",
|
||||
"@types/node": "^22.0.0 || >=24.0.0",
|
||||
"@vitest/browser-playwright": "5.1.1",
|
||||
"@vitest/browser-preview": "5.1.1",
|
||||
"@vitest/browser-playwright": "5.1.2",
|
||||
"@vitest/browser-preview": "5.1.2",
|
||||
"@vitest/browser-webdriverio": "^5.0.0-beta.5 || >=5.0.0",
|
||||
"@vitest/coverage-istanbul": "5.1.1",
|
||||
"@vitest/coverage-v8": "5.1.1",
|
||||
"@vitest/ui": "5.1.1",
|
||||
"@vitest/coverage-istanbul": "5.1.2",
|
||||
"@vitest/coverage-v8": "5.1.2",
|
||||
"@vitest/ui": "5.1.2",
|
||||
"happy-dom": "*",
|
||||
"jsdom": "*",
|
||||
"vite": "^6.4.0 || ^7.0.0 || ^8.0.0"
|
||||
|
||||
16
package.json
16
package.json
@@ -3,7 +3,7 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"version": "0.111.0",
|
||||
"version": "0.114.0",
|
||||
"description": "An ACP-compatible coding agent powered by the Claude Agent SDK (TypeScript)",
|
||||
"main": "dist/lib.js",
|
||||
"types": "dist/lib.d.ts",
|
||||
@@ -69,24 +69,24 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@agentclientprotocol/sdk": "2.12.0",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.3.331",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.3.333",
|
||||
"diff": "9.0.0",
|
||||
"zod": "4.6.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@anthropic-ai/sdk": "1.13.0",
|
||||
"@anthropic-ai/sdk": "1.15.0",
|
||||
"@eslint/js": "10.0.1",
|
||||
"@tsconfig/node22": "22.0.7",
|
||||
"@types/node": "26.6.6",
|
||||
"@types/node": "26.6.11",
|
||||
"@typescript-eslint/eslint-plugin": "8.74.0",
|
||||
"@typescript-eslint/parser": "8.74.0",
|
||||
"ajv": "8.20.0",
|
||||
"ajv-formats": "3.0.1",
|
||||
"eslint": "10.15.0",
|
||||
"eslint-config-prettier": "10.1.8",
|
||||
"globals": "17.14.0",
|
||||
"eslint": "10.16.0",
|
||||
"eslint-config-prettier": "10.1.9",
|
||||
"globals": "17.15.0",
|
||||
"prettier": "3.10.1",
|
||||
"typescript": "6.0.3",
|
||||
"vitest": "5.1.1"
|
||||
"vitest": "5.1.2"
|
||||
}
|
||||
}
|
||||
|
||||
25
scripts/missing-release-archives.sh
Executable file
25
scripts/missing-release-archives.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Prints the archives of the build matrix in .github/workflows/binaries.yml that
|
||||
# a GitHub release does not have yet, one per line. Prints nothing when the
|
||||
# release is complete. Fails when the release does not exist.
|
||||
#
|
||||
# scripts/missing-release-archives.sh v0.112.0
|
||||
#
|
||||
# An asset that never finished uploading (state "open") counts as missing.
|
||||
# Requires an authenticated GitHub CLI; set GH_REPO outside a clone.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
tag="${1:?usage: $0 <tag>}"
|
||||
matrix="$(dirname "$0")/../.github/workflows/binaries.yml"
|
||||
|
||||
expected="$(sed -n 's/^ *archive: *//p' "$matrix" | sort)"
|
||||
if [ -z "$expected" ]; then
|
||||
echo "No 'archive:' entries in $matrix." >&2
|
||||
exit 1
|
||||
fi
|
||||
attached="$(gh release view "$tag" --json assets \
|
||||
--jq '.assets[] | select(.state == "uploaded") | .name' | sort)"
|
||||
|
||||
comm -23 <(printf '%s\n' "$expected") <(printf '%s\n' "$attached")
|
||||
@@ -26,6 +26,7 @@ import {
|
||||
copyFileSync,
|
||||
mkdirSync,
|
||||
mkdtempSync,
|
||||
readdirSync,
|
||||
readFileSync,
|
||||
rmSync,
|
||||
symlinkSync,
|
||||
@@ -123,7 +124,29 @@ if (positionals.length === 0) {
|
||||
probe.stdout || probe.error,
|
||||
);
|
||||
} finally {
|
||||
rmSync(scratch, { recursive: true, force: true });
|
||||
removeScratch(scratch);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Windows sometimes refuses to delete a scratch directory right after a
|
||||
* process that ran from it exits: rmSync threw EPERM on `acp-layout-*` in about
|
||||
* 2% of windows-11-arm runs, after every check had passed. rmSync retries EPERM
|
||||
* and EBUSY, waiting 200ms longer each time on Windows. A directory that is
|
||||
* still locked after that is left in the temp directory with a warning that
|
||||
* lists what is left, instead of failing the smoke test.
|
||||
*/
|
||||
function removeScratch(dir) {
|
||||
try {
|
||||
rmSync(dir, { recursive: true, force: true, maxRetries: 10, retryDelay: 200 });
|
||||
} catch (error) {
|
||||
let left;
|
||||
try {
|
||||
left = readdirSync(dir, { recursive: true }).join(", ");
|
||||
} catch (listError) {
|
||||
left = String(listError);
|
||||
}
|
||||
console.warn(`warn could not remove ${dir} (left: ${left}): ${error.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,7 +275,7 @@ if (values.full) {
|
||||
try {
|
||||
await fullSmoke(work);
|
||||
} finally {
|
||||
rmSync(work, { recursive: true, force: true });
|
||||
removeScratch(work);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
146
src/adapter-command.ts
Normal file
146
src/adapter-command.ts
Normal file
@@ -0,0 +1,146 @@
|
||||
/**
|
||||
* The commands the adapter serves itself instead of passing to Claude Code
|
||||
* (`/remote-control` and `/plugin`), in one place so that the command list and
|
||||
* the dispatch in the v1 and v2 cores apply the same rule.
|
||||
*/
|
||||
import type { AvailableCommand } from "@agentclientprotocol/sdk/unstable";
|
||||
import type { Query, SlashCommand } from "@anthropic-ai/claude-agent-sdk";
|
||||
import { claudeCliPath, isRemoteSession } from "./claude-cli.js";
|
||||
import type { NewSessionMeta } from "./new-session-meta.js";
|
||||
import {
|
||||
parsePluginCommand,
|
||||
pluginCommandMarkdown,
|
||||
PLUGIN_AVAILABLE_COMMAND,
|
||||
PLUGIN_COMMAND_NAME,
|
||||
runPluginCommand,
|
||||
} from "./plugin-command.js";
|
||||
import {
|
||||
adapterRemoteControlCommand,
|
||||
claudeCodeOffersCommand,
|
||||
parseRemoteControlCommand,
|
||||
REMOTE_CONTROL_COMMAND_NAME,
|
||||
type RemoteControlCommand,
|
||||
runRemoteControlCommand,
|
||||
supportsRemoteControl,
|
||||
} from "./remote-control.js";
|
||||
|
||||
type PromptContent = ReadonlyArray<{ type: string; text?: unknown }>;
|
||||
|
||||
export interface AdapterCommand {
|
||||
readonly name: typeof REMOTE_CONTROL_COMMAND_NAME | typeof PLUGIN_COMMAND_NAME;
|
||||
/** The `RequestError` text while Claude is working. */
|
||||
readonly busyMessage: string;
|
||||
/** The `RequestError` text while another adapter command runs. */
|
||||
readonly inFlightMessage: string;
|
||||
/** What `/remote-control` was asked to do. A core records it before the
|
||||
* command runs, so that a restart of the query keeps what the user chose
|
||||
* (see `RemoteControlAtStartup.commandRan`). */
|
||||
readonly remoteControl?: RemoteControlCommand;
|
||||
/** Returns the reply text. A failure is in the text: this never throws. */
|
||||
run(signal: AbortSignal): Promise<string>;
|
||||
}
|
||||
|
||||
export interface AdapterCommandContext {
|
||||
cwd: string;
|
||||
env: Record<string, string | undefined>;
|
||||
/** The session runs Claude Code remotely (`sdk-url`). */
|
||||
remoteSession: boolean;
|
||||
query: () => Query | undefined;
|
||||
logError: (message: string) => void;
|
||||
}
|
||||
|
||||
/** The session's client options (`_meta.claudeCode.options`) that decide where
|
||||
* an adapter command runs: the CLI's `env`, and whether Claude Code is remote. */
|
||||
export function sessionAdapterOptions(creationParams: { _meta?: unknown } | undefined): {
|
||||
env: Record<string, string | undefined>;
|
||||
remoteSession: boolean;
|
||||
} {
|
||||
const options = (creationParams?._meta as NewSessionMeta | undefined)?.claudeCode?.options;
|
||||
return {
|
||||
env: { ...process.env, ...options?.env },
|
||||
remoteSession: isRemoteSession(options?.extraArgs),
|
||||
};
|
||||
}
|
||||
|
||||
const REMOTE_CONTROL_ENTRY: AvailableCommand = {
|
||||
name: REMOTE_CONTROL_COMMAND_NAME,
|
||||
description:
|
||||
"Continue this session from claude.ai/code or the Claude mobile app; `off` disconnects",
|
||||
input: { hint: "[session name | off]" },
|
||||
};
|
||||
|
||||
/** A cheap synchronous check for the cores, before any await: the prompt has
|
||||
* the form of an adapter command. Whether the adapter serves it is
|
||||
* {@link adapterCommand}'s decision. */
|
||||
export function mayBeAdapterCommand(prompt: PromptContent): boolean {
|
||||
return parseRemoteControlCommand(prompt) !== null || parsePluginCommand(prompt) !== null;
|
||||
}
|
||||
|
||||
/** The adapter command of `prompt` that the adapter runs, or `null` for a
|
||||
* prompt that goes to Claude Code. */
|
||||
export async function adapterCommand(
|
||||
prompt: PromptContent,
|
||||
query: Query,
|
||||
terminalCommands: readonly string[] | undefined,
|
||||
context: AdapterCommandContext,
|
||||
): Promise<AdapterCommand | null> {
|
||||
const remoteControl = await adapterRemoteControlCommand(prompt, query, terminalCommands);
|
||||
if (remoteControl) {
|
||||
return {
|
||||
name: REMOTE_CONTROL_COMMAND_NAME,
|
||||
busyMessage:
|
||||
"Remote Control can't be changed while Claude is working. Try again when the turn ends.",
|
||||
inFlightMessage: "Remote Control is already being changed. Try again in a moment.",
|
||||
remoteControl: remoteControl.command,
|
||||
run: () =>
|
||||
runRemoteControlCommand(remoteControl.query, remoteControl.command, context.logError),
|
||||
};
|
||||
}
|
||||
|
||||
const command = parsePluginCommand(prompt);
|
||||
// A session with `sdk-url` runs Claude Code on another machine; the CLI that
|
||||
// the adapter would start here changes the plugins of this machine instead.
|
||||
if (!command || context.remoteSession) return null;
|
||||
const typed = typedCommandName(prompt);
|
||||
if (claudeCodeOffersCommand(await query.supportedCommands(), terminalCommands, typed)) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
name: PLUGIN_COMMAND_NAME,
|
||||
busyMessage: "/plugin can't run while Claude is working. Try again when the turn ends.",
|
||||
inFlightMessage: "Another command is still running. Try again in a moment.",
|
||||
run: async (signal) =>
|
||||
pluginCommandMarkdown(
|
||||
await runPluginCommand(command, {
|
||||
cliPath: claudeCliPath,
|
||||
cwd: context.cwd,
|
||||
env: context.env,
|
||||
signal,
|
||||
query: context.query,
|
||||
logError: context.logError,
|
||||
}),
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
/** The name the user typed: `plugin`, `plugins` or `marketplace`. */
|
||||
function typedCommandName(prompt: PromptContent): string {
|
||||
const text = typeof prompt[0]?.text === "string" ? prompt[0].text : "";
|
||||
return /^\/([^\s]+)/.exec(text.trim())?.[1] ?? PLUGIN_COMMAND_NAME;
|
||||
}
|
||||
|
||||
/** The entries of `available_commands_update` that the adapter serves,
|
||||
* without those that Claude Code offers under the same name. */
|
||||
export function adapterAvailableCommands(
|
||||
commands: readonly SlashCommand[],
|
||||
terminalCommands: readonly string[] | undefined,
|
||||
query: Query | undefined,
|
||||
{ remoteSession }: { remoteSession: boolean },
|
||||
): AvailableCommand[] {
|
||||
const entries: AvailableCommand[] = [];
|
||||
if (query && supportsRemoteControl(query)) entries.push(REMOTE_CONTROL_ENTRY);
|
||||
if (!remoteSession) entries.push(PLUGIN_AVAILABLE_COMMAND);
|
||||
return entries.filter(
|
||||
(entry) => !claudeCodeOffersCommand(commands, terminalCommands, entry.name),
|
||||
);
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
import { randomUUID } from "node:crypto";
|
||||
import type { SDKMessage } from "@anthropic-ai/claude-agent-sdk";
|
||||
import type { ClientCapabilities } from "@agentclientprotocol/sdk/unstable";
|
||||
import type { AcpSessionNotification, AsyncTaskState } from "./acp-subagents.js";
|
||||
import { AIR_ASYNC_TASKS_CAPABILITY, clientSupportsAirCapability } from "./air-extension.js";
|
||||
import { AUTONOMOUS_RESULT_ORIGINS, isAbortedResult } from "./result-end.js";
|
||||
import { noticeOrTranscriptUpdate } from "./session-notices.js";
|
||||
|
||||
type Publish = (notification: AcpSessionNotification) => Promise<void>;
|
||||
@@ -154,6 +156,12 @@ export class AsyncTaskRuntime {
|
||||
private readonly outputPathsByToolCall = new Map<string, string[]>();
|
||||
/** The task of the autonomous turn that runs now. */
|
||||
private autonomousTurn?: AsyncTask;
|
||||
/**
|
||||
* Whether a stop interrupted the autonomous turn and its aborted result has
|
||||
* not come yet. Stopping ends the task, so this is the only trace that the
|
||||
* result belongs to that turn, see {@link startedByClaudeCode}.
|
||||
*/
|
||||
private interruptedTurnResultOwed = false;
|
||||
/** The summary of the last task notification, which usually starts the next autonomous turn. */
|
||||
private lastNotificationSummary?: string;
|
||||
|
||||
@@ -410,6 +418,7 @@ export class AsyncTaskRuntime {
|
||||
|
||||
async finishAll(state: Extract<AsyncTaskState, "failed" | "stopped">): Promise<void> {
|
||||
this.autonomousTurn = undefined;
|
||||
this.interruptedTurnResultOwed = false;
|
||||
const errors: unknown[] = [];
|
||||
for (const task of this.tasks.values()) {
|
||||
if ((task.announced || task.held) && !task.ignored && !isTerminal(task.state)) {
|
||||
@@ -520,6 +529,41 @@ export class AsyncTaskRuntime {
|
||||
await this.finish(task, state, undefined, "event");
|
||||
}
|
||||
|
||||
/** A stop is about to interrupt the autonomous turn: its aborted result is owed. */
|
||||
autonomousTurnInterrupting(): void {
|
||||
this.interruptedTurnResultOwed = true;
|
||||
}
|
||||
|
||||
/** The interrupt failed, so the turn goes on and no aborted result is owed. */
|
||||
autonomousTurnInterruptFailed(): void {
|
||||
this.interruptedTurnResultOwed = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether Claude Code started the work that a result reports: the result has
|
||||
* an autonomous origin, or it is the aborted result that a stop owes. Call it
|
||||
* for every result: the first one after the stop ends the debt, even when
|
||||
* the result has an autonomous origin. A turn that a scheduler fire started
|
||||
* has results with no `origin`, so the origin cannot tell it from a waiting
|
||||
* prompt's result. The first result is the turn's when it is aborted and
|
||||
* names no waiting prompt (`answersPrompt`). A non-aborted result means the
|
||||
* interrupted turn finished without an aborted result, and one that names a
|
||||
* waiting prompt means the turn took the prompt in; neither is the turn's.
|
||||
* This relies on the CLI emitting the interrupted turn's result before the
|
||||
* next turn's, which nothing enforces here.
|
||||
*/
|
||||
startedByClaudeCode(
|
||||
result: Extract<SDKMessage, { type: "result" }>,
|
||||
answersPrompt: boolean,
|
||||
): boolean {
|
||||
const owed = this.interruptedTurnResultOwed;
|
||||
this.interruptedTurnResultOwed = false;
|
||||
return (
|
||||
(result.origin != null && AUTONOMOUS_RESULT_ORIGINS.has(result.origin.kind)) ||
|
||||
(owed && isAbortedResult(result) && !answersPrompt)
|
||||
);
|
||||
}
|
||||
|
||||
/** Whether the task stands for an autonomous turn, which a stop interrupts. */
|
||||
isAutonomousTurn(taskId: string): boolean {
|
||||
return this.tasks.get(taskId)?.autonomousTurn === true;
|
||||
@@ -576,6 +620,7 @@ export class AsyncTaskRuntime {
|
||||
this.tasks.clear();
|
||||
this.outputPathsByToolCall.clear();
|
||||
this.autonomousTurn = undefined;
|
||||
this.interruptedTurnResultOwed = false;
|
||||
this.lastNotificationSummary = undefined;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { existsSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { RequestError } from "@agentclientprotocol/sdk/unstable";
|
||||
import type { Options } from "@anthropic-ai/claude-agent-sdk";
|
||||
|
||||
const CLI_FILE_NAME = process.platform === "win32" ? "claude.exe" : "claude";
|
||||
@@ -34,41 +35,71 @@ export async function claudeCliPath(): Promise<string> {
|
||||
/** How an option reaches the Claude CLI: in a flag, or over stdin in the SDK's initialize request. */
|
||||
type Delivery = NonNullable<Options["mcpServersDelivery"]>;
|
||||
|
||||
/** Whether the client's `extraArgs` name `sdk-url`: a remote session. */
|
||||
export function isRemoteSession(clientExtraArgs: Options["extraArgs"]): boolean {
|
||||
return Object.keys(clientExtraArgs ?? {}).some(
|
||||
(name) => name === "sdk-url" || name.startsWith("sdk-url="),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* The SDK options that say how a session's MCP servers and its `settings`
|
||||
* reach the CLI of {@link claudeCliPath}. A client's own options replace them.
|
||||
*
|
||||
* - `'initialize'` for the CLI that the adapter ships: over stdin, in the
|
||||
* SDK's initialize request.
|
||||
* - `'argv'` for a CLI that `CLAUDE_CODE_EXECUTABLE` names: in the
|
||||
* `--mcp-config` and `--settings` flags, as before SDK 0.3.326. Its version
|
||||
* is not known, and a CLI that cannot take them over stdin fails the session
|
||||
* at startup (2.1.323: "too old to read MCP servers from the initialize
|
||||
* request", "unknown option '--initialize-fields=settings'").
|
||||
* - `settings` stay `'argv'` when the client's `extraArgs` hold `settings`:
|
||||
* Claude Code refuses to start with both ("--initialize-fields=settings
|
||||
* cannot be used with --settings"), and in the flag the `settings` option
|
||||
* replaces that argument. They also stay `'argv'` with `sdk-url` in the
|
||||
* `extraArgs`: such a session cannot read the request at launch, and the SDK
|
||||
* sends its MCP servers in the flag for the same reason.
|
||||
* - `'initialize'`: over stdin, in the SDK's initialize request. That needs
|
||||
* Claude Code 2.1.326 for the MCP servers and 2.1.328 for the settings. The
|
||||
* CLI that the adapter ships is newer. An older CLI that
|
||||
* `CLAUDE_CODE_EXECUTABLE` names fails the session at startup, with the
|
||||
* error of {@link outdatedCliError}.
|
||||
* - `settings` are `'argv'`, in the `--settings` flag, when the client's
|
||||
* `extraArgs` hold `settings`: Claude Code refuses to start with both
|
||||
* ("--initialize-fields=settings cannot be used with --settings"), and in
|
||||
* the flag the `settings` option replaces that argument. They are `'argv'`
|
||||
* too with `sdk-url` in the `extraArgs`: such a session cannot read the
|
||||
* request at launch, and the SDK sends its MCP servers in the flag for the
|
||||
* same reason.
|
||||
*
|
||||
* The SDK reads `settingsDelivery` (0.3.328) but does not declare it in
|
||||
* `sdk.d.ts`, so nothing fails to compile if a later SDK drops it. The v2
|
||||
* integration tests check the delivery against the real CLI.
|
||||
*
|
||||
* `mcpServersDelivery` is always set. The adapter names the CLI to start
|
||||
* (`pathToClaudeCodeExecutable`), and for such an app the SDK prints a
|
||||
* `DeprecationWarning` when a session has MCP servers and the option is unset.
|
||||
* `mcpServersDelivery` is set although `'initialize'` is the SDK's default
|
||||
* since 0.3.333: the delivery then does not change with the SDK's default.
|
||||
*/
|
||||
export function cliDelivery(clientExtraArgs: Options["extraArgs"]): {
|
||||
mcpServersDelivery: Delivery;
|
||||
settingsDelivery: Delivery;
|
||||
} {
|
||||
const delivery = process.env.CLAUDE_CODE_EXECUTABLE ? "argv" : "initialize";
|
||||
const settingsInFlag = Object.keys(clientExtraArgs ?? {}).some(
|
||||
(name) => name === "settings" || name === "sdk-url" || name.startsWith("sdk-url="),
|
||||
const settingsInFlag = "settings" in (clientExtraArgs ?? {}) || isRemoteSession(clientExtraArgs);
|
||||
return {
|
||||
mcpServersDelivery: "initialize",
|
||||
settingsDelivery: settingsInFlag ? "argv" : "initialize",
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* How the start of a Claude Code that cannot take a session's MCP servers or
|
||||
* settings over stdin fails:
|
||||
* - before 2.1.326, with MCP servers: the SDK ends the session, "This Claude
|
||||
* Code (version 2.1.323) is too old to read MCP servers over stdin, …";
|
||||
* - before 2.1.328, with settings: the CLI exits, "error: unknown option
|
||||
* '--initialize-fields=settings'".
|
||||
*/
|
||||
const OUTDATED_CLI = /is too old to read MCP servers|unknown option '--initialize-fields/;
|
||||
|
||||
/**
|
||||
* The error for a session that did not start because the CLI that
|
||||
* `CLAUDE_CODE_EXECUTABLE` names is too old (see {@link cliDelivery}), with
|
||||
* the failure's own text in `data.details`. Undefined for any other failure,
|
||||
* and without `CLAUDE_CODE_EXECUTABLE`.
|
||||
*/
|
||||
export function outdatedCliError(error: unknown): RequestError | undefined {
|
||||
const named = process.env.CLAUDE_CODE_EXECUTABLE;
|
||||
if (!named || !(error instanceof Error) || !OUTDATED_CLI.test(error.message)) return undefined;
|
||||
return RequestError.internalError(
|
||||
{ details: error.message },
|
||||
`The Claude Code that CLAUDE_CODE_EXECUTABLE names (${named}) is too old: it cannot take a session's MCP servers and settings over stdin. Update it to 2.1.328 or newer, or unset CLAUDE_CODE_EXECUTABLE to use the Claude Code that comes with the adapter.`,
|
||||
);
|
||||
return { mcpServersDelivery: delivery, settingsDelivery: settingsInFlag ? "argv" : delivery };
|
||||
}
|
||||
|
||||
function bundledClaudeCliPath(directory: string): string {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { AvailableCommand } from "@agentclientprotocol/sdk/unstable";
|
||||
import type { McpServerStatus, Query } from "@anthropic-ai/claude-agent-sdk";
|
||||
import { escapeMarkdown } from "./usage-markdown.js";
|
||||
import { codeSpan, escapeMarkdown } from "./usage-markdown.js";
|
||||
import { raceTimeoutAndAbort } from "./utils.js";
|
||||
|
||||
/** The `/mcp` entry of `available_commands_update`. The adapter shows the
|
||||
@@ -105,20 +105,6 @@ function needsReconnect(status: McpServerStatus): boolean {
|
||||
);
|
||||
}
|
||||
|
||||
/** The text as a Markdown code span. The fence is longer than the longest
|
||||
* backtick run in the text, so the span shows the text unchanged. The user
|
||||
* can copy a server name from it into `/mcp reconnect`. */
|
||||
function codeSpan(text: string): string {
|
||||
const longestRun = Math.max(0, ...(text.match(/`+/g) ?? []).map((run) => run.length));
|
||||
const fence = "`".repeat(longestRun + 1);
|
||||
// CommonMark strips one space from each end of a span that is not all spaces
|
||||
// (line endings count as spaces), so a pad keeps the text unchanged. Plain
|
||||
// string checks, not one regex: `^ .*[^ ].* $` backtracks quadratically.
|
||||
const strippedByCommonMark = text.startsWith(" ") && text.endsWith(" ") && /[^ \r\n]/.test(text);
|
||||
const pad = text.startsWith("`") || text.endsWith("`") || strippedByCommonMark ? " " : "";
|
||||
return `${fence}${pad}${text}${pad}${fence}`;
|
||||
}
|
||||
|
||||
function isErrorCode(segment: string): boolean {
|
||||
return /^-?\d+$/.test(segment);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/**
|
||||
* OAuth for the MCP servers that Claude Code reports as `needs-auth`, as an
|
||||
* ACP URL elicitation. Protocol-neutral: the v1 core and the v2 core
|
||||
* both start it once a session's setup response is sent.
|
||||
* ACP URL elicitation. Protocol-neutral: the v1 core and the v2 core start it
|
||||
* for the session's ACP servers once a session's setup response is sent, and
|
||||
* for the servers that a `/mcp reconnect` tried once its output is sent.
|
||||
*/
|
||||
import { randomUUID } from "node:crypto";
|
||||
import type {
|
||||
@@ -62,11 +63,13 @@ export type McpOAuthSession = {
|
||||
readonly closed: AbortSignal;
|
||||
};
|
||||
|
||||
const mcpAuthentications = new WeakMap<object, Promise<void>>();
|
||||
/** The servers that the session's OAuth run has yet to check, by session key. */
|
||||
const mcpAuthentications = new WeakMap<object, Set<string>>();
|
||||
|
||||
/** Start OAuth in the background for the servers in `requestedServers` that
|
||||
* Claude reports as needing authentication. It does nothing while another
|
||||
* OAuth run of the session is in progress. */
|
||||
* Claude reports as needing authentication. While an OAuth run of the
|
||||
* session is in progress, the servers join it: it checks them after the
|
||||
* sign-in that it waits for now. */
|
||||
export function startMcpServerAuthentication(
|
||||
client: McpOAuthClient,
|
||||
session: McpOAuthSession,
|
||||
@@ -74,43 +77,72 @@ export function startMcpServerAuthentication(
|
||||
): void {
|
||||
if (!client.urlElicitation || requestedServers.size === 0) return;
|
||||
const query = session.currentQuery();
|
||||
if (!query || mcpAuthentications.has(session.key)) return;
|
||||
if (!query) return;
|
||||
const running = mcpAuthentications.get(session.key);
|
||||
if (running) {
|
||||
for (const name of requestedServers) running.add(name);
|
||||
return;
|
||||
}
|
||||
|
||||
const authentication = authenticateMcpServers(client, session, query, requestedServers)
|
||||
.catch((error) => {
|
||||
if (!session.closed.aborted) {
|
||||
client.logger.error(`Failed to inspect MCP servers for OAuth: ${error}`);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
if (mcpAuthentications.get(session.key) === authentication) {
|
||||
mcpAuthentications.delete(session.key);
|
||||
}
|
||||
});
|
||||
mcpAuthentications.set(session.key, authentication);
|
||||
const wanted = new Set(requestedServers);
|
||||
mcpAuthentications.set(session.key, wanted);
|
||||
authenticateMcpServers(client, session, query, wanted).catch((error) => {
|
||||
if (!session.closed.aborted) {
|
||||
client.logger.error(`Failed to inspect MCP servers for OAuth: ${error}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** Signs in to the servers of `wanted` that need it, until `wanted` is empty.
|
||||
* A server that reads `pending` stays in `wanted`: Claude Code connects the
|
||||
* servers in the background, so right after a warm `session/new` a server
|
||||
* that needs OAuth still reads `pending`. The run stops waiting for it
|
||||
* {@link MCP_OAUTH_TIMEOUT_MS} after the run started, or when the session
|
||||
* closes or its query is replaced. The run leaves `mcpAuthentications` in the same synchronous step
|
||||
* that finds `wanted` empty, so a server added later starts a new run. */
|
||||
async function authenticateMcpServers(
|
||||
client: McpOAuthClient,
|
||||
session: McpOAuthSession,
|
||||
query: Query,
|
||||
requestedServers: Set<string>,
|
||||
wanted: Set<string>,
|
||||
): Promise<void> {
|
||||
if (!supportsMcpOAuth(query)) {
|
||||
client.logger.error("The Claude Agent SDK does not expose MCP OAuth authentication.");
|
||||
return;
|
||||
}
|
||||
|
||||
const statuses = await query.mcpServerStatus();
|
||||
for (const status of statuses) {
|
||||
if (status.status !== "needs-auth" || !requestedServers.has(status.name)) continue;
|
||||
try {
|
||||
await authenticateMcpServer(client, session, query, status.name);
|
||||
} catch (error) {
|
||||
if (session.currentQuery() && !session.closed.aborted) {
|
||||
client.logger.error(`Failed to authenticate MCP server ${status.name}: ${error}`);
|
||||
}
|
||||
try {
|
||||
if (!supportsMcpOAuth(query)) {
|
||||
client.logger.error("The Claude Agent SDK does not expose MCP OAuth authentication.");
|
||||
return;
|
||||
}
|
||||
const deadline = Date.now() + MCP_OAUTH_TIMEOUT_MS;
|
||||
while (wanted.size > 0) {
|
||||
if (session.currentQuery() !== query) return;
|
||||
// A server that joins during the read is checked by the next one.
|
||||
const checked = [...wanted];
|
||||
const statuses = new Map(
|
||||
(await query.mcpServerStatus()).map((status) => [status.name, status.status]),
|
||||
);
|
||||
const settled = checked.filter((name) => statuses.get(name) !== "pending");
|
||||
for (const name of settled) wanted.delete(name);
|
||||
for (const name of settled) {
|
||||
if (statuses.get(name) !== "needs-auth") continue;
|
||||
if (session.currentQuery() !== query) return;
|
||||
try {
|
||||
await authenticateMcpServer(client, session, query, name);
|
||||
} catch (error) {
|
||||
if (session.currentQuery() && !session.closed.aborted) {
|
||||
client.logger.error(`Failed to authenticate MCP server ${name}: ${error}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Wait only when every server left read `pending`; read again at once
|
||||
// for one that joined meanwhile.
|
||||
const onlyPending = [...wanted].every(
|
||||
(name) => checked.includes(name) && !settled.includes(name),
|
||||
);
|
||||
if (wanted.size === 0 || !onlyPending) continue;
|
||||
if (Date.now() >= deadline) return;
|
||||
if (!(await waitUnlessAborted(MCP_OAUTH_STATUS_POLL_MS, session.closed))) return;
|
||||
}
|
||||
} finally {
|
||||
if (mcpAuthentications.get(session.key) === wanted) mcpAuthentications.delete(session.key);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
793
src/plugin-command.ts
Normal file
793
src/plugin-command.ts
Normal file
@@ -0,0 +1,793 @@
|
||||
/**
|
||||
* `/plugin` (aliases `/plugins`, `/marketplace`), which the adapter serves
|
||||
* itself. Claude Code's own `/plugin` is an interactive terminal screen and
|
||||
* answers "/plugin isn't available in this environment." in a session without
|
||||
* a terminal, which is every ACP session. The adapter instead runs the CLI's
|
||||
* `claude plugin ...` commands, which have a `--json` form, and then reloads
|
||||
* the live session so the new plugin's commands, skills and MCP servers appear.
|
||||
*
|
||||
* Plugins bring hooks and MCP servers that run as the user, so the set of
|
||||
* commands and flags below is an allowlist, and it is the only guard. Anything
|
||||
* outside it, such as `-y`, `--accept-command` or `--json`, gets the usage
|
||||
* text and never reaches the CLI. Shared by the v1 core and the v2 core.
|
||||
*/
|
||||
import { execFile } from "node:child_process";
|
||||
import type { AvailableCommand } from "@agentclientprotocol/sdk/unstable";
|
||||
import type { Query } from "@anthropic-ai/claude-agent-sdk";
|
||||
import { codeSpan, escapeMarkdown } from "./usage-markdown.js";
|
||||
|
||||
/** The content blocks of a prompt, in v1 or v2 form: the command is one text block. */
|
||||
type PromptContent = ReadonlyArray<{ type: string; text?: unknown }>;
|
||||
|
||||
export const PLUGIN_COMMAND_NAME = "plugin";
|
||||
|
||||
/** The `/plugin` entry of `available_commands_update`. */
|
||||
export const PLUGIN_AVAILABLE_COMMAND: AvailableCommand = {
|
||||
name: PLUGIN_COMMAND_NAME,
|
||||
description: "Manage Claude Code plugins and marketplaces",
|
||||
input: { hint: "[install|uninstall|enable|disable|update|list|marketplace …] …" },
|
||||
};
|
||||
|
||||
/** The CLI operations that the adapter runs. */
|
||||
export type PluginCliOperation =
|
||||
| "list"
|
||||
| "install"
|
||||
| "uninstall"
|
||||
| "enable"
|
||||
| "disable"
|
||||
| "update"
|
||||
| "marketplace-add"
|
||||
| "marketplace-list"
|
||||
| "marketplace-remove"
|
||||
| "marketplace-update";
|
||||
|
||||
export type PluginOperation = PluginCliOperation | "overview" | "usage";
|
||||
|
||||
export type PluginCommand =
|
||||
/** Bare `/plugin` and `/plugin help`: usage, installed plugins and marketplaces. */
|
||||
| { kind: "overview" }
|
||||
/** Anything outside the allowlist, or a missing argument. `reason` says which. */
|
||||
| { kind: "usage"; reason?: string }
|
||||
/** One CLI run. `argv` is what follows `claude plugin`, without `--json`.
|
||||
* `target` is the plugin or marketplace name the command is about, if it has one. */
|
||||
| { kind: "cli"; operation: PluginCliOperation; argv: string[]; target?: string };
|
||||
|
||||
const SCOPES = ["user", "project", "local"];
|
||||
|
||||
type FlagKind = "bool" | "value" | "list" | "variadic";
|
||||
|
||||
interface FlagSpec {
|
||||
/** The flag's names, such as `["-s", "--scope"]`. The first is its key. */
|
||||
names: string[];
|
||||
kind: FlagKind;
|
||||
/** The allowed values; any value if absent. */
|
||||
values?: string[];
|
||||
}
|
||||
|
||||
interface Scanned {
|
||||
positionals: string[];
|
||||
/** Per flag key: `true` for a bool, else the values in the order given. */
|
||||
flags: Map<string, true | string[]>;
|
||||
}
|
||||
|
||||
const SCOPE_FLAG: FlagSpec = { names: ["-s", "--scope"], kind: "value", values: SCOPES };
|
||||
|
||||
/** Splits `tokens` into positionals and the flags of `specs`. Any other token
|
||||
* that starts with `-` is an error, so no user text becomes a CLI option. */
|
||||
function scan(tokens: string[], specs: FlagSpec[]): Scanned | { error: string | undefined } {
|
||||
const positionals: string[] = [];
|
||||
const flags = new Map<string, true | string[]>();
|
||||
for (let i = 0; i < tokens.length; i++) {
|
||||
let token = tokens[i]!;
|
||||
if (!token.startsWith("-")) {
|
||||
positionals.push(token);
|
||||
continue;
|
||||
}
|
||||
if (token === "-h" || token === "--help") return { error: undefined };
|
||||
let inline: string | undefined;
|
||||
const equals = token.startsWith("--") ? token.indexOf("=") : -1;
|
||||
if (equals > 0) {
|
||||
inline = token.slice(equals + 1);
|
||||
token = token.slice(0, equals);
|
||||
if (inline.startsWith("-")) return { error: `\`${token}\` needs a value.` };
|
||||
}
|
||||
const spec = specs.find((candidate) => candidate.names.includes(token));
|
||||
if (!spec) return { error: `\`${token}\` is not supported here.` };
|
||||
const key = spec.names[0]!;
|
||||
if (spec.kind === "bool") {
|
||||
if (inline !== undefined) return { error: `\`${token}\` takes no value.` };
|
||||
flags.set(key, true);
|
||||
continue;
|
||||
}
|
||||
const values: string[] = [];
|
||||
if (inline !== undefined) {
|
||||
values.push(inline);
|
||||
} else if (spec.kind === "variadic") {
|
||||
while (i + 1 < tokens.length && !tokens[i + 1]!.startsWith("-")) values.push(tokens[++i]!);
|
||||
} else if (i + 1 < tokens.length && !tokens[i + 1]!.startsWith("-")) {
|
||||
values.push(tokens[++i]!);
|
||||
}
|
||||
if (values.length === 0 || values.some((value) => value === "")) {
|
||||
return { error: `\`${token}\` needs a value.` };
|
||||
}
|
||||
if (spec.values && !values.every((value) => spec.values!.includes(value))) {
|
||||
return { error: `\`${token}\` takes one of ${spec.values.join(", ")}.` };
|
||||
}
|
||||
const previous = flags.get(key);
|
||||
if (previous !== undefined && spec.kind !== "list" && spec.kind !== "variadic") {
|
||||
return { error: `\`${token}\` is given twice.` };
|
||||
}
|
||||
flags.set(key, [...(Array.isArray(previous) ? previous : []), ...values]);
|
||||
}
|
||||
return { positionals, flags };
|
||||
}
|
||||
|
||||
function flagArgs(scanned: Scanned, specs: FlagSpec[]): string[] {
|
||||
const args: string[] = [];
|
||||
for (const spec of specs) {
|
||||
const key = spec.names[0]!;
|
||||
const value = scanned.flags.get(key);
|
||||
if (value === undefined) continue;
|
||||
const flag = spec.names.find((name) => name.startsWith("--")) ?? key;
|
||||
if (value === true) args.push(flag);
|
||||
else if (spec.kind === "list") for (const item of value) args.push(flag, item);
|
||||
else args.push(flag, ...value);
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
const USAGE_PLUGIN_ARGUMENT = "Give a plugin name, as `name` or `name@marketplace`.";
|
||||
|
||||
/** Parses the arguments of a CLI subcommand into a `cli` command. */
|
||||
function parseSubcommand(
|
||||
operation: PluginCliOperation,
|
||||
words: string[],
|
||||
specs: FlagSpec[],
|
||||
prefix: string[],
|
||||
options: { positional: "none" | "one" | "optional"; missing?: string },
|
||||
): PluginCommand {
|
||||
const scanned = scan(words, specs);
|
||||
if ("error" in scanned) return { kind: "usage", reason: scanned.error };
|
||||
const max = options.positional === "none" ? 0 : 1;
|
||||
if (scanned.positionals.length > max) {
|
||||
return { kind: "usage", reason: `Unexpected argument \`${scanned.positionals[max]}\`.` };
|
||||
}
|
||||
if (options.positional === "one" && scanned.positionals.length === 0) {
|
||||
return { kind: "usage", reason: options.missing };
|
||||
}
|
||||
const target = scanned.positionals[0];
|
||||
return {
|
||||
kind: "cli",
|
||||
operation,
|
||||
argv: [...prefix, ...scanned.positionals, ...flagArgs(scanned, specs)],
|
||||
...(target === undefined ? {} : { target }),
|
||||
};
|
||||
}
|
||||
|
||||
const LIST_FLAGS: FlagSpec[] = [{ names: ["--available"], kind: "bool" }];
|
||||
const INSTALL_FLAGS: FlagSpec[] = [
|
||||
SCOPE_FLAG,
|
||||
{ names: ["--marketplace"], kind: "value" },
|
||||
{ names: ["--config"], kind: "list" },
|
||||
];
|
||||
const UNINSTALL_FLAGS: FlagSpec[] = [SCOPE_FLAG, { names: ["--keep-data"], kind: "bool" }];
|
||||
const ENABLE_FLAGS: FlagSpec[] = [SCOPE_FLAG];
|
||||
const DISABLE_FLAGS: FlagSpec[] = [SCOPE_FLAG, { names: ["-a", "--all"], kind: "bool" }];
|
||||
const MARKETPLACE_ADD_FLAGS: FlagSpec[] = [SCOPE_FLAG, { names: ["--sparse"], kind: "variadic" }];
|
||||
|
||||
function parseMarketplace(words: string[]): PluginCommand {
|
||||
const [sub, ...rest] = words;
|
||||
switch (sub) {
|
||||
case "add":
|
||||
return parseSubcommand(
|
||||
"marketplace-add",
|
||||
rest,
|
||||
MARKETPLACE_ADD_FLAGS,
|
||||
["marketplace", "add"],
|
||||
{
|
||||
positional: "one",
|
||||
missing: "Give a marketplace source: a GitHub `owner/repo`, a git URL, or a path.",
|
||||
},
|
||||
);
|
||||
case "list":
|
||||
case "ls":
|
||||
return parseSubcommand("marketplace-list", rest, [], ["marketplace", "list"], {
|
||||
positional: "none",
|
||||
});
|
||||
case "remove":
|
||||
case "rm":
|
||||
return parseSubcommand("marketplace-remove", rest, [SCOPE_FLAG], ["marketplace", "remove"], {
|
||||
positional: "one",
|
||||
missing: "Give the name of the marketplace to remove.",
|
||||
});
|
||||
case "update":
|
||||
return parseSubcommand("marketplace-update", rest, [], ["marketplace", "update"], {
|
||||
positional: "optional",
|
||||
});
|
||||
default:
|
||||
return { kind: "usage" };
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses `/plugin ...` (also `/plugins ...` and `/marketplace ...`, which are
|
||||
* aliases: `/marketplace marketplace add x` is `/plugin marketplace add x`,
|
||||
* and `/marketplace add x` is usage, like `/plugin add x`) from a single-text
|
||||
* prompt. `null` for any other prompt, which goes to Claude Code.
|
||||
*/
|
||||
export function parsePluginCommand(prompt: PromptContent): PluginCommand | null {
|
||||
const [first] = prompt;
|
||||
if (prompt.length !== 1 || first?.type !== "text" || typeof first.text !== "string") return null;
|
||||
// Check the first word before splitting, so a long prompt is not split into words.
|
||||
const text = first.text.trim();
|
||||
if (!/^\/(?:plugins?|marketplace)(?:\s|$)/.test(text)) return null;
|
||||
const [, ...words] = text.split(/\s+/);
|
||||
const [sub, ...rest] = words;
|
||||
switch (sub) {
|
||||
case undefined:
|
||||
case "help":
|
||||
return { kind: "overview" };
|
||||
case "list":
|
||||
case "ls":
|
||||
return parseSubcommand("list", rest, LIST_FLAGS, ["list"], { positional: "none" });
|
||||
case "install":
|
||||
case "i":
|
||||
return parseSubcommand("install", rest, INSTALL_FLAGS, ["install"], {
|
||||
positional: "one",
|
||||
missing: USAGE_PLUGIN_ARGUMENT,
|
||||
});
|
||||
case "uninstall":
|
||||
case "remove":
|
||||
case "rm":
|
||||
return parseSubcommand("uninstall", rest, UNINSTALL_FLAGS, ["uninstall"], {
|
||||
positional: "one",
|
||||
missing: USAGE_PLUGIN_ARGUMENT,
|
||||
});
|
||||
case "enable":
|
||||
return parseSubcommand("enable", rest, ENABLE_FLAGS, ["enable"], {
|
||||
positional: "one",
|
||||
missing: USAGE_PLUGIN_ARGUMENT,
|
||||
});
|
||||
case "disable": {
|
||||
const command = parseSubcommand("disable", rest, DISABLE_FLAGS, ["disable"], {
|
||||
positional: "optional",
|
||||
});
|
||||
if (command.kind !== "cli") return command;
|
||||
const all = command.argv.includes("--all");
|
||||
if (all === (command.target !== undefined)) {
|
||||
return {
|
||||
kind: "usage",
|
||||
reason: all
|
||||
? "Give either a plugin name or `--all`, not both."
|
||||
: `${USAGE_PLUGIN_ARGUMENT} Or use \`--all\` to disable every plugin.`,
|
||||
};
|
||||
}
|
||||
return command;
|
||||
}
|
||||
case "update":
|
||||
return parseSubcommand("update", rest, [SCOPE_FLAG], ["update"], {
|
||||
positional: "one",
|
||||
missing: USAGE_PLUGIN_ARGUMENT,
|
||||
});
|
||||
case "marketplace":
|
||||
case "market":
|
||||
return parseMarketplace(rest);
|
||||
default:
|
||||
return { kind: "usage", reason: `Unknown subcommand \`${sub}\`.` };
|
||||
}
|
||||
}
|
||||
|
||||
export type PluginReload = {
|
||||
status: "applied" | "busy" | "failed" | "unavailable";
|
||||
/** The names of the plugins the session has after a reload; with `applied`. */
|
||||
plugins?: string[];
|
||||
/** Why the reload failed; with `failed`. */
|
||||
error?: string;
|
||||
};
|
||||
|
||||
export interface PluginCommandResult {
|
||||
ok: boolean;
|
||||
operation: PluginOperation;
|
||||
/** The CLI's own message, or the adapter's when the CLI did not run or did not answer. */
|
||||
message: string;
|
||||
/** The CLI's `failureCode`, such as `not_found` or `command_source_refused`. */
|
||||
failureCode?: string;
|
||||
/** With `command_source_refused`: the command that the marketplace declares as the install. */
|
||||
shownCommand?: string;
|
||||
/** With `shownCommand`: the terminal command that lets the user confirm it. */
|
||||
terminalCommand?: string;
|
||||
/** The parsed `--json` output of a list: an array, or `{installed, available}`; for an overview, `{plugins, marketplaces}` plus `pluginsError` or `marketplacesError` for a list that failed. */
|
||||
data?: unknown;
|
||||
reload?: PluginReload;
|
||||
}
|
||||
|
||||
export interface ExecOptions {
|
||||
cwd: string;
|
||||
env: Record<string, string | undefined>;
|
||||
signal: AbortSignal;
|
||||
timeoutMs: number;
|
||||
}
|
||||
|
||||
export interface ExecOutput {
|
||||
stdout: string;
|
||||
stderr: string;
|
||||
/** The exit code. A run that ends with a non-zero code is a result, not an error. */
|
||||
code: number;
|
||||
}
|
||||
|
||||
/** Runs a program without a shell. Rejects when it cannot start, is aborted,
|
||||
* times out, or prints too much. */
|
||||
export type ExecLike = (file: string, args: string[], options: ExecOptions) => Promise<ExecOutput>;
|
||||
|
||||
export interface PluginCommandDeps {
|
||||
cliPath: () => Promise<string>;
|
||||
cwd: string;
|
||||
env: Record<string, string | undefined>;
|
||||
signal: AbortSignal;
|
||||
/** Read after the CLI ends: the session's query can be replaced while it runs. */
|
||||
query: () => Query | undefined;
|
||||
logError: (message: string) => void;
|
||||
exec?: ExecLike;
|
||||
}
|
||||
|
||||
/** The time that one CLI run can take. A git clone of a marketplace is the slow case. */
|
||||
const PLUGIN_CLI_TIMEOUT_MS = 5 * 60_000;
|
||||
|
||||
const MAX_OUTPUT_BYTES = 16 * 1024 * 1024;
|
||||
|
||||
const defaultExec: ExecLike = (file, args, options) =>
|
||||
new Promise((resolve, reject) => {
|
||||
const child = execFile(
|
||||
file,
|
||||
args,
|
||||
{
|
||||
cwd: options.cwd,
|
||||
env: options.env,
|
||||
signal: options.signal,
|
||||
timeout: options.timeoutMs,
|
||||
maxBuffer: MAX_OUTPUT_BYTES,
|
||||
encoding: "utf8",
|
||||
},
|
||||
(error, stdout, stderr) => {
|
||||
if (!error) return resolve({ stdout, stderr, code: 0 });
|
||||
if (typeof error.code === "number") return resolve({ stdout, stderr, code: error.code });
|
||||
if (error.killed && !options.signal.aborted) {
|
||||
return reject(new Error(`Timed out after ${options.timeoutMs / 60_000} minutes.`));
|
||||
}
|
||||
reject(error);
|
||||
},
|
||||
);
|
||||
// The CLI must not wait on a terminal that does not exist.
|
||||
child.stdin?.end();
|
||||
});
|
||||
|
||||
/** The operations after which the live session reloads its plugins. */
|
||||
const RELOADING_OPERATIONS: ReadonlySet<PluginOperation> = new Set([
|
||||
"install",
|
||||
"uninstall",
|
||||
"enable",
|
||||
"disable",
|
||||
"update",
|
||||
"marketplace-remove",
|
||||
]);
|
||||
|
||||
type CliRun =
|
||||
| { type: "cancelled" }
|
||||
| { type: "error"; message: string }
|
||||
| { type: "done"; code: number; stdout: string; stderr: string };
|
||||
|
||||
interface CliJson {
|
||||
outcome?: unknown;
|
||||
message?: unknown;
|
||||
failureCode?: unknown;
|
||||
alreadyInGoalState?: unknown;
|
||||
shownCommand?: unknown;
|
||||
}
|
||||
|
||||
function isRecord(value: unknown): value is Record<string, unknown> {
|
||||
return typeof value === "object" && value !== null && !Array.isArray(value);
|
||||
}
|
||||
|
||||
/** The result line of a `--json` run: the last non-empty line of stdout. The
|
||||
* CLI can print human-readable lines before it. */
|
||||
function lastJsonLine(stdout: string): CliJson | undefined {
|
||||
const lines = stdout.split(/\r?\n/).filter((line) => line.trim() !== "");
|
||||
const last = lines[lines.length - 1];
|
||||
if (last === undefined) return undefined;
|
||||
try {
|
||||
const parsed: unknown = JSON.parse(last);
|
||||
return isRecord(parsed) ? (parsed as CliJson) : undefined;
|
||||
} catch {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
/** The whole of stdout as JSON: a list prints an indented array or object. */
|
||||
function wholeJson(stdout: string): unknown {
|
||||
try {
|
||||
return JSON.parse(stdout.trim());
|
||||
} catch {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
const MAX_TEXT_LENGTH = 1500;
|
||||
|
||||
function plainText(text: string): string {
|
||||
// eslint-disable-next-line no-control-regex
|
||||
const stripped = text.replace(/\u001b\[[0-9;]*[A-Za-z]/g, "").trim();
|
||||
return stripped.length > MAX_TEXT_LENGTH ? `${stripped.slice(0, MAX_TEXT_LENGTH)}…` : stripped;
|
||||
}
|
||||
|
||||
function isJsonOptionUnknown(run: { stdout: string; stderr: string }): boolean {
|
||||
return /unknown option.*--json/i.test(`${run.stderr}\n${run.stdout}`);
|
||||
}
|
||||
|
||||
/** Whether the CLI takes `--json` for the command: `marketplace update` without a name does not. */
|
||||
function takesJson(command: Extract<PluginCommand, { kind: "cli" }>): boolean {
|
||||
return !(command.operation === "marketplace-update" && command.target === undefined);
|
||||
}
|
||||
|
||||
async function runCli(
|
||||
deps: PluginCommandDeps,
|
||||
exec: ExecLike,
|
||||
env: Record<string, string | undefined>,
|
||||
argv: string[],
|
||||
json: boolean,
|
||||
): Promise<CliRun> {
|
||||
if (deps.signal.aborted) return { type: "cancelled" };
|
||||
const run = async (args: string[]): Promise<CliRun> => {
|
||||
try {
|
||||
const file = await deps.cliPath();
|
||||
const output = await exec(file, args, {
|
||||
cwd: deps.cwd,
|
||||
env,
|
||||
signal: deps.signal,
|
||||
timeoutMs: PLUGIN_CLI_TIMEOUT_MS,
|
||||
});
|
||||
return { type: "done", ...output };
|
||||
} catch (error) {
|
||||
if (deps.signal.aborted) return { type: "cancelled" };
|
||||
const message = error instanceof Error ? error.message : String(error);
|
||||
deps.logError(`Failed to run \`claude plugin ${argv.join(" ")}\`: ${message}`);
|
||||
return { type: "error", message: `Could not run the Claude CLI: ${message}` };
|
||||
}
|
||||
};
|
||||
const first = await run(["plugin", ...argv, ...(json ? ["--json"] : [])]);
|
||||
// A CLI named by CLAUDE_CODE_EXECUTABLE can predate `--json`. It rejects the
|
||||
// flag before doing anything, so the run is repeated for its text and exit code.
|
||||
if (json && first.type === "done" && first.code !== 0 && isJsonOptionUnknown(first)) {
|
||||
return run(["plugin", ...argv]);
|
||||
}
|
||||
return first;
|
||||
}
|
||||
|
||||
function cancelled(operation: PluginOperation): PluginCommandResult {
|
||||
return { ok: false, operation, message: "Cancelled." };
|
||||
}
|
||||
|
||||
function failedToRun(operation: PluginOperation, run: CliRun): PluginCommandResult {
|
||||
return run.type === "cancelled"
|
||||
? cancelled(operation)
|
||||
: { ok: false, operation, message: run.type === "error" ? run.message : "" };
|
||||
}
|
||||
|
||||
function describeCliRun(
|
||||
command: Extract<PluginCommand, { kind: "cli" }>,
|
||||
run: Extract<CliRun, { type: "done" }>,
|
||||
): PluginCommandResult {
|
||||
const { operation } = command;
|
||||
const isList = operation === "list" || operation === "marketplace-list";
|
||||
const json = lastJsonLine(run.stdout);
|
||||
if (isList) {
|
||||
const data = wholeJson(run.stdout);
|
||||
if (run.code === 0 && data !== undefined && typeof data === "object" && data !== null) {
|
||||
return { ok: true, operation, message: "", data };
|
||||
}
|
||||
}
|
||||
if (!json || typeof json.outcome !== "string") {
|
||||
const text = plainText(run.code === 0 ? run.stdout || run.stderr : run.stderr || run.stdout);
|
||||
return {
|
||||
ok: run.code === 0,
|
||||
operation,
|
||||
message: text || (run.code === 0 ? "Done." : `The Claude CLI exited with code ${run.code}.`),
|
||||
};
|
||||
}
|
||||
const message =
|
||||
typeof json.message === "string" && json.message.trim() !== ""
|
||||
? plainText(json.message)
|
||||
: run.code === 0
|
||||
? "Done."
|
||||
: `The Claude CLI exited with code ${run.code}.`;
|
||||
const ok = json.alreadyInGoalState === true || (json.outcome !== "failed" && run.code === 0);
|
||||
const result: PluginCommandResult = { ok, operation, message };
|
||||
if (!ok && typeof json.failureCode === "string") result.failureCode = json.failureCode;
|
||||
if (!ok && isRecord(json.shownCommand) && typeof json.shownCommand.command === "string") {
|
||||
result.shownCommand = json.shownCommand.command;
|
||||
if (operation === "install" || operation === "update") {
|
||||
result.terminalCommand = `claude plugin ${command.argv.map(shellQuote).join(" ")}`;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// terminalCommand is pasted into a POSIX shell, and argv values are arbitrary
|
||||
// text: `&` would background, `*` glob and `$(x)` expand unless quoted.
|
||||
function shellQuote(arg: string): string {
|
||||
return /^[A-Za-z0-9@%+=:,./_-]+$/.test(arg) ? arg : `'${arg.replaceAll("'", "'\\''")}'`;
|
||||
}
|
||||
|
||||
async function reloadSession(deps: PluginCommandDeps): Promise<PluginReload> {
|
||||
const query = deps.query();
|
||||
if (!query) return { status: "unavailable" };
|
||||
try {
|
||||
const response = await query.reloadPlugins({ refuseIfBusy: true });
|
||||
return { status: "applied", plugins: response.plugins.map((plugin) => plugin.name) };
|
||||
} catch (error) {
|
||||
if ((error as { errorCode?: unknown } | null)?.errorCode === "reload_plugins_busy") {
|
||||
return { status: "busy" };
|
||||
}
|
||||
const message = error instanceof Error ? error.message : String(error);
|
||||
deps.logError(`Failed to reload plugins after /plugin: ${message}`);
|
||||
return { status: "failed", error: message };
|
||||
}
|
||||
}
|
||||
|
||||
/** Whether `plugin` (`name` or `name@marketplace`) is among the installed plugin ids. */
|
||||
function isInstalled(installed: unknown[], plugin: string): boolean {
|
||||
return installed.some((entry) => {
|
||||
const id = isRecord(entry) ? entry.id : undefined;
|
||||
if (typeof id !== "string") return false;
|
||||
return plugin.includes("@") ? id === plugin : id.split("@")[0] === plugin;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs a parsed `/plugin` command and, after a change, reloads the session's
|
||||
* plugins. A failure is in the result: this never throws.
|
||||
*/
|
||||
export async function runPluginCommand(
|
||||
command: PluginCommand,
|
||||
deps: PluginCommandDeps,
|
||||
): Promise<PluginCommandResult> {
|
||||
if (command.kind === "usage") {
|
||||
return {
|
||||
ok: false,
|
||||
operation: "usage",
|
||||
message: command.reason ?? "",
|
||||
};
|
||||
}
|
||||
const exec = deps.exec ?? defaultExec;
|
||||
const env = { ...deps.env };
|
||||
delete env.CLAUDECODE;
|
||||
delete env.CLAUDE_CODE_CHILD_SESSION;
|
||||
|
||||
if (command.kind === "overview") {
|
||||
const [plugins, marketplaces] = await Promise.all([
|
||||
runCli(deps, exec, env, ["list"], true),
|
||||
runCli(deps, exec, env, ["marketplace", "list"], true),
|
||||
]);
|
||||
if (plugins.type === "cancelled" || marketplaces.type === "cancelled") {
|
||||
return cancelled("overview");
|
||||
}
|
||||
const read = (run: CliRun): { value?: unknown; error?: string } => {
|
||||
if (run.type === "error") return { error: run.message };
|
||||
if (run.type === "done" && run.code === 0) {
|
||||
const value = wholeJson(run.stdout);
|
||||
return Array.isArray(value)
|
||||
? { value }
|
||||
: { error: "The Claude CLI did not return a list." };
|
||||
}
|
||||
const text = run.type === "done" ? plainText(run.stderr || run.stdout) : "";
|
||||
return {
|
||||
error: text || `The Claude CLI exited with code ${run.type === "done" ? run.code : "?"}.`,
|
||||
};
|
||||
};
|
||||
const listed = { plugins: read(plugins), marketplaces: read(marketplaces) };
|
||||
const errors = [listed.plugins.error, listed.marketplaces.error].filter((e) => e !== undefined);
|
||||
return {
|
||||
ok: errors.length === 0,
|
||||
operation: "overview",
|
||||
message: errors.join("\n"),
|
||||
data: {
|
||||
plugins: listed.plugins.value,
|
||||
marketplaces: listed.marketplaces.value,
|
||||
pluginsError: listed.plugins.error,
|
||||
marketplacesError: listed.marketplaces.error,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
const { operation } = command;
|
||||
if (operation === "enable" && command.target !== undefined) {
|
||||
const listing = await runCli(deps, exec, env, ["list"], true);
|
||||
if (listing.type === "cancelled") return cancelled(operation);
|
||||
// When the list cannot be read (an old CLI), the enable runs as typed.
|
||||
const installed =
|
||||
listing.type === "done" && listing.code === 0 ? wholeJson(listing.stdout) : undefined;
|
||||
if (Array.isArray(installed) && !isInstalled(installed, command.target)) {
|
||||
return {
|
||||
ok: false,
|
||||
operation,
|
||||
message: `Plugin ${command.target} is not installed, so it can't be enabled. Install it first.`,
|
||||
failureCode: "not_installed",
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
const run = await runCli(deps, exec, env, command.argv, takesJson(command));
|
||||
if (run.type !== "done") return failedToRun(operation, run);
|
||||
const result = describeCliRun(command, run);
|
||||
if (result.ok && RELOADING_OPERATIONS.has(operation)) {
|
||||
if (deps.signal.aborted) return cancelled(operation);
|
||||
result.reload = await reloadSession(deps);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
const USAGE_LINES = [
|
||||
"- `/plugin list [--available]`",
|
||||
"- `/plugin install <plugin>[@marketplace] [--scope user|project|local] [--marketplace <source>] [--config key=value]`",
|
||||
"- `/plugin uninstall <plugin> [--scope …] [--keep-data]`",
|
||||
"- `/plugin enable <plugin> [--scope …]`",
|
||||
"- `/plugin disable <plugin>|--all [--scope …]`",
|
||||
"- `/plugin update <plugin> [--scope …]`",
|
||||
"- `/plugin marketplace add <source> [--scope …] [--sparse <path>…]`",
|
||||
"- `/plugin marketplace list`",
|
||||
"- `/plugin marketplace remove <name> [--scope …]`",
|
||||
"- `/plugin marketplace update [<name>]`",
|
||||
];
|
||||
|
||||
function usageMarkdown(): string {
|
||||
return ["**Usage**", "", ...USAGE_LINES].join("\n");
|
||||
}
|
||||
|
||||
/** Escapes CLI or plugin text. A `claude plugin X` hint in backticks becomes
|
||||
* the `/plugin X` that works in this chat. */
|
||||
function renderCliText(text: string): string {
|
||||
return text
|
||||
.split(/\r?\n/)
|
||||
.filter((line) => line.trim() !== "")
|
||||
.map((line) =>
|
||||
line
|
||||
.split(/(`[^`\n]+`)/)
|
||||
.map((part, index) => {
|
||||
if (index % 2 === 0) return escapeMarkdown(part);
|
||||
const code = part.slice(1, -1).replace(/^claude plugins? /, "/plugin ");
|
||||
return codeSpan(code);
|
||||
})
|
||||
.join(""),
|
||||
)
|
||||
.join("\n\n");
|
||||
}
|
||||
|
||||
function str(value: unknown): string | undefined {
|
||||
return typeof value === "string" && value !== "" ? value : undefined;
|
||||
}
|
||||
|
||||
function installedLine(entry: unknown): string | undefined {
|
||||
if (!isRecord(entry)) return undefined;
|
||||
const id = str(entry.id);
|
||||
if (!id) return undefined;
|
||||
const details = [
|
||||
str(entry.version) && `v${str(entry.version)}`,
|
||||
str(entry.scope) && `${str(entry.scope)} scope`,
|
||||
entry.enabled === false ? "disabled" : "enabled",
|
||||
].filter((part): part is string => typeof part === "string");
|
||||
return `- ${codeSpan(id)} — ${escapeMarkdown(details.join(", "))}`;
|
||||
}
|
||||
|
||||
function availableLine(entry: unknown): string | undefined {
|
||||
if (!isRecord(entry)) return undefined;
|
||||
const id = str(entry.pluginId) ?? str(entry.name);
|
||||
if (!id) return undefined;
|
||||
const description = str(entry.description);
|
||||
return `- ${codeSpan(id)}${description ? ` — ${escapeMarkdown(description)}` : ""}`;
|
||||
}
|
||||
|
||||
function marketplaceLine(entry: unknown): string | undefined {
|
||||
if (!isRecord(entry)) return undefined;
|
||||
const name = str(entry.name);
|
||||
if (!name) return undefined;
|
||||
const source = str(entry.repo) ?? str(entry.url) ?? str(entry.path) ?? str(entry.source);
|
||||
return `- ${codeSpan(name)}${source ? ` — ${escapeMarkdown(source)}` : ""}`;
|
||||
}
|
||||
|
||||
/** The most available plugins that a reply lists. The official directory has hundreds. */
|
||||
const MAX_AVAILABLE_LISTED = 40;
|
||||
|
||||
function section(title: string, lines: (string | undefined)[], empty: string): string {
|
||||
const shown = lines.filter((line): line is string => line !== undefined);
|
||||
return shown.length === 0 ? `**${title}**\n\n${empty}` : `**${title}**\n\n${shown.join("\n")}`;
|
||||
}
|
||||
|
||||
function installedSection(data: unknown): string {
|
||||
return section(
|
||||
"Installed plugins",
|
||||
Array.isArray(data) ? data.map(installedLine) : [],
|
||||
"None. Run `/plugin install <plugin>` to add one.",
|
||||
);
|
||||
}
|
||||
|
||||
function marketplacesSection(data: unknown): string {
|
||||
return section(
|
||||
"Marketplaces",
|
||||
Array.isArray(data) ? data.map(marketplaceLine) : [],
|
||||
"None. Run `/plugin marketplace add <source>` to add one.",
|
||||
);
|
||||
}
|
||||
|
||||
function availableSection(entries: unknown[]): string {
|
||||
const lines = entries.map(availableLine).filter((line) => line !== undefined);
|
||||
const more = lines.length - MAX_AVAILABLE_LISTED;
|
||||
if (more > 0) lines.splice(MAX_AVAILABLE_LISTED, more, `- … and ${more} more`);
|
||||
return section("Available plugins", lines, "None.");
|
||||
}
|
||||
|
||||
function reloadLine(reload: PluginReload): string {
|
||||
if (reload.status === "applied") {
|
||||
const plugins = reload.plugins ?? [];
|
||||
return plugins.length === 0
|
||||
? "Reloaded: the session now has no plugins."
|
||||
: `Reloaded: the session now has ${plugins.map(codeSpan).join(", ")}.`;
|
||||
}
|
||||
if (reload.status === "busy") {
|
||||
return "The session is busy, so the change was not loaded into it. It applies to new sessions.";
|
||||
}
|
||||
if (reload.status === "failed") {
|
||||
return `Reloading the session's plugins failed${reload.error ? `: ${escapeMarkdown(reload.error)}` : ""}. The change applies to new sessions.`;
|
||||
}
|
||||
return "The change applies to new sessions.";
|
||||
}
|
||||
|
||||
/** The chat reply for a result of {@link runPluginCommand}. */
|
||||
export function pluginCommandMarkdown(result: PluginCommandResult): string {
|
||||
const blocks: string[] = [];
|
||||
const data = result.data;
|
||||
switch (result.operation) {
|
||||
case "usage":
|
||||
if (result.message) blocks.push(renderCliText(result.message));
|
||||
blocks.push(usageMarkdown());
|
||||
return blocks.join("\n\n");
|
||||
case "overview": {
|
||||
const parts = isRecord(data) ? data : {};
|
||||
const failure = (title: string, error: unknown): string =>
|
||||
`**${title}**\n\nCould not list: ${renderCliText(String(error))}`;
|
||||
return [
|
||||
typeof parts.pluginsError === "string"
|
||||
? failure("Installed plugins", parts.pluginsError)
|
||||
: installedSection(parts.plugins),
|
||||
typeof parts.marketplacesError === "string"
|
||||
? failure("Marketplaces", parts.marketplacesError)
|
||||
: marketplacesSection(parts.marketplaces),
|
||||
usageMarkdown(),
|
||||
].join("\n\n");
|
||||
}
|
||||
case "list":
|
||||
if (result.ok && isRecord(data)) {
|
||||
blocks.push(installedSection(data.installed));
|
||||
blocks.push(availableSection(Array.isArray(data.available) ? data.available : []));
|
||||
} else if (result.ok && data !== undefined) {
|
||||
blocks.push(installedSection(data));
|
||||
}
|
||||
break;
|
||||
case "marketplace-list":
|
||||
if (result.ok && data !== undefined) blocks.push(marketplacesSection(data));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (blocks.length === 0 && result.message) blocks.push(renderCliText(result.message));
|
||||
if (result.shownCommand !== undefined) {
|
||||
blocks.push(
|
||||
`The marketplace declares that this plugin is installed by running a command. The adapter does not run it:\n\n${codeSpan(result.shownCommand)}`,
|
||||
);
|
||||
if (result.terminalCommand) {
|
||||
blocks.push(
|
||||
`To confirm that command, run ${codeSpan(result.terminalCommand)} in a terminal.`,
|
||||
);
|
||||
}
|
||||
}
|
||||
if (result.reload) blocks.push(reloadLine(result.reload));
|
||||
return blocks.join("\n\n");
|
||||
}
|
||||
71
src/query-settings.ts
Normal file
71
src/query-settings.ts
Normal file
@@ -0,0 +1,71 @@
|
||||
import type { Query, SDKSettingsParseError, Settings } from "@anthropic-ai/claude-agent-sdk";
|
||||
import type { SettingsManager } from "./settings.js";
|
||||
|
||||
/** The fields used from Claude Code's `get_settings` control response. */
|
||||
export type QuerySettings = {
|
||||
effective?: Settings;
|
||||
sources?: Array<{ source?: unknown; settings?: Settings }>;
|
||||
applied?: {
|
||||
model?: unknown;
|
||||
ultracodeAvailable?: unknown;
|
||||
ultracodeRequested?: unknown;
|
||||
};
|
||||
errors?: SDKSettingsParseError[];
|
||||
};
|
||||
|
||||
// Query.getSettings exists at runtime but is missing from the SDK's types
|
||||
// as of 0.3.333. Older SDKs/CLIs may not serve it.
|
||||
type SettingsQuery = Query & { getSettings?: () => Promise<QuerySettings | undefined> };
|
||||
|
||||
/**
|
||||
* Claude Code's answer to `get_settings`. Undefined when the SDK has no
|
||||
* `getSettings` or the request fails; a failure is logged when a `logger` is
|
||||
* given.
|
||||
*/
|
||||
export async function readQuerySettings(
|
||||
query: Query,
|
||||
logger?: { error: (...args: unknown[]) => void },
|
||||
): Promise<QuerySettings | undefined> {
|
||||
const getSettings = (query as SettingsQuery).getSettings;
|
||||
if (typeof getSettings !== "function") return undefined;
|
||||
try {
|
||||
return await getSettings.call(query);
|
||||
} catch (error) {
|
||||
logger?.error("Failed to read the settings that Claude Code applies:", error);
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The policy tier the running CLI applies: its managed settings, remote ones
|
||||
* included. Undefined when the CLI reports none.
|
||||
*/
|
||||
export function cliPolicySettings(report: QuerySettings | undefined): Settings | undefined {
|
||||
const sources = Array.isArray(report?.sources) ? report.sources : [];
|
||||
const policy = sources.find((entry) => entry?.source === "policySettings")?.settings;
|
||||
if (!policy || typeof policy !== "object" || Object.keys(policy).length === 0) return undefined;
|
||||
return policy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads the settings that the query's Claude Code applies, once it has
|
||||
* answered `initialize`, and has `settings` follow its policy tier from then
|
||||
* on (see `SettingsManager.followCliPolicy`). Call it before the first reader
|
||||
* of a value that a policy can set, such as the `apiKeyHelper` of the
|
||||
* session's identity. Returns the answer that it read, for the start's other
|
||||
* readers (`getAvailableModels`), or undefined without one: the settings then
|
||||
* stay those of this process, and the failure is logged.
|
||||
*/
|
||||
export async function followQueryPolicy(
|
||||
query: Query,
|
||||
settings: Pick<SettingsManager, "followCliPolicy">,
|
||||
logger: { error: (...args: unknown[]) => void },
|
||||
): Promise<QuerySettings | undefined> {
|
||||
const read = () => readQuerySettings(query, logger);
|
||||
const report = await read();
|
||||
await settings.followCliPolicy(
|
||||
async () => cliPolicySettings(await read()),
|
||||
cliPolicySettings(report),
|
||||
);
|
||||
return report;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
/**
|
||||
* `/remote-control`, which the adapter serves itself, and the messages that a
|
||||
* `/remote-control`, which the adapter serves itself, Remote Control at the
|
||||
* start of a session when Claude Code asks for it, and the messages that a
|
||||
* person types in another client of the session (claude.ai or the Claude
|
||||
* mobile app, over Remote Control). Shared by the v1 core and the v2
|
||||
* core, which run the command each in their own turn model.
|
||||
@@ -9,10 +10,13 @@ type PromptContent = ReadonlyArray<{ type: string; text?: unknown }>;
|
||||
|
||||
import type {
|
||||
Query,
|
||||
SDKControlInitializeResponse,
|
||||
SDKUserMessage,
|
||||
SDKUserMessageReplay,
|
||||
SlashCommand,
|
||||
} from "@anthropic-ai/claude-agent-sdk";
|
||||
import type { Logger } from "./logger.js";
|
||||
import type { SessionNotice } from "./session-notices.js";
|
||||
|
||||
/** Runtime Remote Control control exposed by the pinned Agent SDK. Like
|
||||
* `mcpAuthenticate`, it is not in the public `Query` declaration yet. The CLI's
|
||||
@@ -115,6 +119,129 @@ export async function runRemoteControlCommand(
|
||||
}
|
||||
}
|
||||
|
||||
/** The `initialize` result with `remote_control_auto_enable`, which Claude Code
|
||||
* resolves from `remoteControlAtStartup` in the settings, else the policy
|
||||
* default, else a rollout, so it can be on although the user never turned it
|
||||
* on. An SDK host reads it to start Remote Control with the session as the
|
||||
* terminal does. Like `enableRemoteControl`, it is not in the public
|
||||
* declaration yet. */
|
||||
type RemoteControlInitializeResponse = SDKControlInitializeResponse & {
|
||||
remote_control_auto_enable?: boolean;
|
||||
};
|
||||
|
||||
/** Whether Claude Code asks for Remote Control to start with the session:
|
||||
* `remoteControlAtStartup` in the settings, else the policy default, else a
|
||||
* rollout (see `RemoteControlInitializeResponse`). `false` when the field is
|
||||
* missing, as from a CLI that predates it. */
|
||||
export function startsWithRemoteControl(
|
||||
initializationResult: SDKControlInitializeResponse,
|
||||
): boolean {
|
||||
return (
|
||||
(initializationResult as RemoteControlInitializeResponse).remote_control_auto_enable === true
|
||||
);
|
||||
}
|
||||
|
||||
/** Starts Remote Control for a session that starts with it, and returns the
|
||||
* notice that tells the user how it went. A notice cannot be withdrawn once
|
||||
* sent, so its title reports the connection as an event rather than a state
|
||||
* that `/remote-control off` would make untrue. A refusal, such as Remote
|
||||
* Control being disabled by policy, comes back as a warning instead of a
|
||||
* throw. */
|
||||
export async function startRemoteControl(
|
||||
query: RemoteControlQuery,
|
||||
logger: { error: (...args: unknown[]) => void },
|
||||
): Promise<SessionNotice> {
|
||||
try {
|
||||
const { session_url } = await query.enableRemoteControl(true);
|
||||
const link = session_url
|
||||
? `Continue this session from claude.ai/code or the Claude mobile app: ${session_url}`
|
||||
: "Claude Code did not return a session URL.";
|
||||
return {
|
||||
severity: "info",
|
||||
title: "Remote Control connected",
|
||||
description: `${link}\nRun /remote-control off to disconnect.`,
|
||||
};
|
||||
} catch (error) {
|
||||
logger.error(`Failed to enable Remote Control: ${error}`);
|
||||
return {
|
||||
severity: "warning",
|
||||
title: "Could not start Remote Control",
|
||||
description: error instanceof Error ? error.message : String(error),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/** What starting Remote Control with a query needs of the query's session. */
|
||||
export type RemoteControlAtStartupSession = {
|
||||
readonly sessionId: string;
|
||||
readonly logger: Logger;
|
||||
/** The session's query, or `undefined` when it has none to start Remote Control on. */
|
||||
query(): Query | undefined;
|
||||
/** Whether the session is busy in its core's sense, such as Claude working. */
|
||||
working(): boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* Remote Control at the start of a query that Claude Code asked to start with
|
||||
* it (see {@link startsWithRemoteControl}). Each core keeps one per query and
|
||||
* connects it after the query's setup response and after a restart, whose new
|
||||
* query asks again: closing the old query ended its Remote Control. Unless the
|
||||
* user turned it off: a restart carries the user's last `/remote-control` into
|
||||
* the new query (see {@link restartedFrom}). A session that a failed restart
|
||||
* lost carries nothing: the client sets it up again, and that setup asks
|
||||
* afresh. Holding prompts back and sending the notice are each core's own, as
|
||||
* they follow the core's turn model.
|
||||
*/
|
||||
export class RemoteControlAtStartup {
|
||||
/** Whether the user's last `/remote-control` on this query turned it off. */
|
||||
private turnedOff = false;
|
||||
|
||||
constructor(private asked: boolean) {}
|
||||
|
||||
/**
|
||||
* The user ran `command` on this query. Recorded before its request goes
|
||||
* out, so a restart that overlaps the request already knows.
|
||||
*/
|
||||
commandRan(command: RemoteControlCommand): void {
|
||||
this.turnedOff = command.action === "disconnect";
|
||||
}
|
||||
|
||||
/**
|
||||
* A restart replaced the query of `previous` with this one. Remote Control
|
||||
* that the user turned off there stays off: this query asks again only
|
||||
* because the setting does, and the setting can come from a rollout the user
|
||||
* never chose.
|
||||
*/
|
||||
restartedFrom(previous: RemoteControlAtStartup | undefined): void {
|
||||
if (!previous?.turnedOff) return;
|
||||
this.turnedOff = true;
|
||||
this.asked = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts Remote Control on the first call, and resolves the notice that
|
||||
* tells the user how it went. When nothing starts, it returns `undefined`
|
||||
* rather than a promise, so a core can hold its prompts back in the same
|
||||
* synchronous step: Claude Code did not ask, the user turned it off before
|
||||
* a restart, an earlier call ran, the query is closed or has no Remote
|
||||
* Control, or the session is busy, as the notice would land inside that
|
||||
* work. `/remote-control` still connects the session then.
|
||||
*/
|
||||
connect(session: RemoteControlAtStartupSession): Promise<SessionNotice> | undefined {
|
||||
if (!this.asked) return undefined;
|
||||
this.asked = false;
|
||||
const query = session.query();
|
||||
if (!query || !supportsRemoteControl(query)) return undefined;
|
||||
if (session.working()) {
|
||||
session.logger.log(
|
||||
`Session ${session.sessionId} is busy, so Remote Control does not start with it. /remote-control starts it.`,
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
return startRemoteControl(query, session.logger);
|
||||
}
|
||||
}
|
||||
|
||||
/** A top-level message a person typed in another client of the session, such
|
||||
* as claude.ai or the Claude mobile app over Remote Control. Tool results and
|
||||
* the CLI's own synthetic messages are user-role too, but carry no human
|
||||
|
||||
@@ -5,10 +5,11 @@ import {
|
||||
type SessionStore,
|
||||
type SessionStoreEntry,
|
||||
} from "@anthropic-ai/claude-agent-sdk";
|
||||
import { access, open, readdir } from "node:fs/promises";
|
||||
import { access, open, readdir, type FileHandle } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { isCompactSummaryMessage } from "./context-compaction.js";
|
||||
import { claudeConfigDir } from "./paths.js";
|
||||
import { projectsRoot } from "./paths.js";
|
||||
import { errorCode } from "./session-index/project-dirs.js";
|
||||
import { SessionTiming } from "./session-timing.js";
|
||||
|
||||
/** The size of one backward read of a transcript. */
|
||||
@@ -104,10 +105,13 @@ export async function readHistoryAcrossCompactions(
|
||||
messages: SessionMessage[],
|
||||
logger?: ResumeLogger,
|
||||
dir?: string,
|
||||
snapshot?: SessionStoreEntry[],
|
||||
): Promise<SessionMessage[]> {
|
||||
if (!isCompactSummaryMessage(messages[0])) return messages;
|
||||
try {
|
||||
const entries = (await loadFullSessionHistory(sessionId, dir)).map(linkCompactBoundary);
|
||||
const entries = (snapshot ?? (await loadFullSessionHistory(sessionId, dir))).map(
|
||||
linkCompactBoundary,
|
||||
);
|
||||
const history = await getSessionMessages(sessionId, {
|
||||
dir,
|
||||
sessionStore: { append: async () => {}, load: async () => entries },
|
||||
@@ -115,6 +119,7 @@ export async function readHistoryAcrossCompactions(
|
||||
const leaf = messages.at(-1)?.uuid;
|
||||
const end = history.findIndex((message) => message.uuid === leaf);
|
||||
if (end < 0) {
|
||||
if (snapshot) throw new Error("Compacted history does not reach the active branch");
|
||||
logger?.error(
|
||||
`The history before the last compaction of session ${sessionId} does not reach message ${leaf}: replaying the messages after it`,
|
||||
);
|
||||
@@ -122,6 +127,7 @@ export async function readHistoryAcrossCompactions(
|
||||
}
|
||||
return history.slice(0, end + 1);
|
||||
} catch (error) {
|
||||
if (snapshot) throw error;
|
||||
logger?.error(
|
||||
`Failed to read the history before the last compaction of session ${sessionId}:`,
|
||||
error,
|
||||
@@ -209,26 +215,67 @@ export async function readResumedTail(
|
||||
}
|
||||
|
||||
/** 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");
|
||||
export async function findTranscript(
|
||||
sessionId: string,
|
||||
options?: { strict: boolean },
|
||||
): Promise<string | undefined> {
|
||||
const projects = projectsRoot();
|
||||
let directories: string[];
|
||||
try {
|
||||
directories = await readdir(projects);
|
||||
} catch {
|
||||
} catch (error) {
|
||||
if (options?.strict && errorCode(error) !== "ENOENT") throw error;
|
||||
return undefined;
|
||||
}
|
||||
let lookupError: unknown;
|
||||
for (const directory of directories) {
|
||||
const candidate = path.join(projects, directory, `${sessionId}.jsonl`);
|
||||
try {
|
||||
await access(candidate);
|
||||
return candidate;
|
||||
} catch {
|
||||
} catch (error) {
|
||||
if (options?.strict && errorCode(error) !== "ENOENT" && errorCode(error) !== "ENOTDIR")
|
||||
lookupError ??= error;
|
||||
// Not in this project directory.
|
||||
}
|
||||
}
|
||||
if (lookupError) throw lookupError;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/** Read the records once so the SDK projects the active branch and its compactions
|
||||
* from the same bytes. An unfinished JSON line can be completed by the next poll. */
|
||||
export async function readTranscriptEntries(file: string): Promise<SessionStoreEntry[]> {
|
||||
const handle = await open(file, "r");
|
||||
try {
|
||||
return await readTranscriptEntriesOf(file, handle, (await handle.stat()).size);
|
||||
} finally {
|
||||
await handle.close();
|
||||
}
|
||||
}
|
||||
|
||||
export async function readTranscriptEntriesOf(
|
||||
file: string,
|
||||
handle: FileHandle,
|
||||
size: number,
|
||||
): Promise<SessionStoreEntry[]> {
|
||||
if (size === 0) return [];
|
||||
try {
|
||||
const records: SessionStoreEntry[] = [];
|
||||
for await (const line of handle.readLines({ start: 0, end: size - 1 })) {
|
||||
try {
|
||||
const record = JSON.parse(line);
|
||||
if (record && typeof record.type === "string") records.push(record);
|
||||
} catch {
|
||||
// Claude's transcript reader skips lines that do not parse.
|
||||
}
|
||||
}
|
||||
return records;
|
||||
} catch (error) {
|
||||
throw Object.assign(new Error(`Could not read ${file}`, { cause: error }), { path: file });
|
||||
}
|
||||
}
|
||||
|
||||
/** The model of the last real assistant record and the last permission mode
|
||||
* of the main thread in a JSONL transcript. */
|
||||
async function lastTailRecords(filePath: string, withModel: boolean): Promise<ResumedTail> {
|
||||
|
||||
@@ -474,7 +474,7 @@ export function toAcpNotifications(
|
||||
// Resolve the server tool through the normal result path without rendering
|
||||
// opaque ciphertext. Server tools have no later PostToolUse hook to await.
|
||||
const result = chunk.content;
|
||||
unregisterHookCallback(chunk.tool_use_id);
|
||||
if (registerHooks) unregisterHookCallback(chunk.tool_use_id);
|
||||
output.push(
|
||||
...toAcpNotifications(
|
||||
[
|
||||
@@ -511,7 +511,7 @@ export function toAcpNotifications(
|
||||
case "mcp_tool_result": {
|
||||
const wasEmitted = options?.emittedToolCalls?.has(chunk.tool_use_id) === true;
|
||||
options?.emittedToolCalls?.delete(chunk.tool_use_id);
|
||||
completeHookCallback(chunk.tool_use_id);
|
||||
if (registerHooks) completeHookCallback(chunk.tool_use_id);
|
||||
finishedToolCallId = chunk.tool_use_id;
|
||||
// Why this is_error result carries harness prose instead of tool
|
||||
// output (user-rejected / interrupted / …), when the SDK said so.
|
||||
|
||||
@@ -88,26 +88,37 @@ export class LastReportedEntity {
|
||||
/** Per session, in announcement order: the entity before each announced cursor. */
|
||||
private readonly beforeCursor = new Map<string, Map<string, CursorEntity | undefined>>();
|
||||
|
||||
sending(notification: {
|
||||
sessionId: string;
|
||||
update: { sessionUpdate: string; _meta?: unknown } & Record<string, unknown>;
|
||||
}): void {
|
||||
sending(
|
||||
notification: {
|
||||
sessionId: string;
|
||||
update: { sessionUpdate: string; _meta?: unknown } & Record<string, unknown>;
|
||||
},
|
||||
protocol: 1 | 2 = 1,
|
||||
): void {
|
||||
const { sessionId, update } = notification;
|
||||
const meta = update._meta as { claudeCode?: { parentToolUseId?: unknown } } | null | undefined;
|
||||
if (meta?.claudeCode?.parentToolUseId) return;
|
||||
const messageId = typeof update.messageId === "string" ? update.messageId : undefined;
|
||||
switch (update.sessionUpdate) {
|
||||
case "user_message":
|
||||
case "user_message_chunk":
|
||||
if (messageId) this.bySession.set(sessionId, { type: "user_message", messageId });
|
||||
break;
|
||||
case "agent_message":
|
||||
case "agent_message_chunk":
|
||||
if (messageId) this.bySession.set(sessionId, { type: "agent_message", messageId });
|
||||
break;
|
||||
case "agent_thought":
|
||||
case "agent_thought_chunk":
|
||||
if (messageId) this.bySession.set(sessionId, { type: "agent_thought", messageId });
|
||||
break;
|
||||
case "tool_call":
|
||||
if (typeof update.toolCallId === "string") {
|
||||
case "tool_call_update":
|
||||
if (
|
||||
(update.sessionUpdate === "tool_call" ||
|
||||
(protocol === 2 && typeof update.name === "string")) &&
|
||||
typeof update.toolCallId === "string"
|
||||
) {
|
||||
this.bySession.set(sessionId, { type: "tool_call", toolCallId: update.toolCallId });
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -45,10 +45,11 @@ import {
|
||||
sameProjectPath,
|
||||
} from "./project-dirs.js";
|
||||
import {
|
||||
customTitleSidecarPath,
|
||||
readHeadTail,
|
||||
readHeadTailOf,
|
||||
sdkTitles,
|
||||
tailCustomTitle,
|
||||
readSidecarTitle,
|
||||
readTranscriptTitles,
|
||||
transcriptAgentName,
|
||||
transcriptProjectCwd,
|
||||
} from "./transcript-scan.js";
|
||||
@@ -56,7 +57,6 @@ import {
|
||||
DEFAULT_LIST_LIMIT,
|
||||
MAX_LIST_LIMIT,
|
||||
ARCHIVED_FILTERS,
|
||||
readSidecarTitle,
|
||||
SessionIndex,
|
||||
type ArchivedFilter,
|
||||
type ListCursor,
|
||||
@@ -226,18 +226,12 @@ export function decodeListCursor(cursor: string, scope: ListScope): ListCursor {
|
||||
return { orderAtMs: payload.u, sessionId: payload.id };
|
||||
}
|
||||
|
||||
/** `<projectDir>/<sessionId>/custom-title.json` of a transcript. */
|
||||
function sidecarPath(transcriptPath: string): string {
|
||||
const sessionId = path.basename(transcriptPath, ".jsonl");
|
||||
return path.join(path.dirname(transcriptPath), sessionId, "custom-title.json");
|
||||
}
|
||||
|
||||
/** Writes `<projectDir>/<sessionId>/custom-title.json` the way the CLI's
|
||||
* `/rename` does: file 0600 in a 0700 directory, replaced atomically. The
|
||||
* temporary file has a random name of the CLI's `custom-title.json.tmp.*`
|
||||
* pattern, and only a temporary file this call created is removed. */
|
||||
export async function writeCustomTitleSidecar(transcriptPath: string, title: string) {
|
||||
const target = sidecarPath(transcriptPath);
|
||||
const target = customTitleSidecarPath(transcriptPath);
|
||||
await fs.mkdir(path.dirname(target), { recursive: true, mode: 0o700 });
|
||||
const temporary = `${target}.tmp.${randomBytes(8).toString("hex")}`;
|
||||
const handle = await fs.open(temporary, "wx", 0o600);
|
||||
@@ -311,16 +305,12 @@ async function ensureAgentName(filePath: string, sessionId: string, title: strin
|
||||
* {@link effectiveTitle}): its agent name, else the title the SDK reports.
|
||||
* It carries the archive prefix only when the copy is archived: a generated
|
||||
* title never archives a session. */
|
||||
async function copyTitle(filePath: string, sessionId: string): Promise<string | undefined> {
|
||||
async function copyTitle(filePath: string): Promise<string | undefined> {
|
||||
const { size } = await fs.stat(filePath);
|
||||
const headTail = await readHeadTail(filePath, size);
|
||||
const sidecar =
|
||||
tailCustomTitle(headTail) === undefined
|
||||
? await readSidecarTitle(filePath, sessionId)
|
||||
: undefined;
|
||||
const { title, archived } = effectiveTitle(
|
||||
transcriptAgentName(headTail),
|
||||
sdkTitles(headTail, sidecar),
|
||||
await readTranscriptTitles(filePath, headTail),
|
||||
);
|
||||
return title !== undefined && !archived && isArchivedTitle(title) ? visibleTitle(title) : title;
|
||||
}
|
||||
@@ -334,7 +324,7 @@ async function alignSidecar(
|
||||
sessionId: string,
|
||||
): Promise<void> {
|
||||
if (current === undefined) return;
|
||||
const sidecar = await readSidecarTitle(transcript, sessionId);
|
||||
const sidecar = await readSidecarTitle(transcript);
|
||||
if (sidecar === undefined || isArchivedTitle(sidecar) === isArchivedTitle(current)) return;
|
||||
await writeCustomTitleSidecar(
|
||||
transcript,
|
||||
@@ -627,7 +617,7 @@ export class SessionIndexService {
|
||||
// The transcript holds the current title, also one changed otherwise
|
||||
// (a `/rename`); without one, the title last given to the CLI.
|
||||
const primary = cli ?? others[0];
|
||||
const read = primary ? await copyTitle(primary, sessionId) : undefined;
|
||||
const read = primary ? await copyTitle(primary) : undefined;
|
||||
const current = read ?? live.stored() ?? live.shown;
|
||||
stored = change(current, sessionId);
|
||||
if (stored !== undefined) {
|
||||
@@ -674,7 +664,7 @@ export class SessionIndexService {
|
||||
): Promise<string | undefined> {
|
||||
let first: string | undefined;
|
||||
for (const transcript of transcripts) {
|
||||
const current = await copyTitle(transcript, sessionId);
|
||||
const current = await copyTitle(transcript);
|
||||
const title = change(current, sessionId);
|
||||
if (title === undefined) {
|
||||
await alignSidecar(transcript, current, sessionId);
|
||||
@@ -682,7 +672,7 @@ export class SessionIndexService {
|
||||
}
|
||||
await ensureTitleRecords(transcript, sessionId, title);
|
||||
first ??= title;
|
||||
if (sidecar === "always" || (await exists(sidecarPath(transcript)))) {
|
||||
if (sidecar === "always" || (await exists(customTitleSidecarPath(transcript)))) {
|
||||
await writeCustomTitleSidecar(transcript, title);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* `stat` per transcript. The pages after a cursor reuse that enumeration for
|
||||
* a short while (see {@link SessionIndex.reusableListing}). The metadata of a transcript is
|
||||
* cached by `(path, mtime, size)` in an LRU and read on a miss from one head
|
||||
* and tail read (the titles by the SDK's rule, see {@link sdkTitles}; the
|
||||
* and tail read (the titles by the SDK's rule, see {@link readTranscriptTitles}; the
|
||||
* facts, see {@link scanTranscriptFile}) and the title sidecar. Misses are
|
||||
* read in parallel batches.
|
||||
*
|
||||
@@ -42,15 +42,12 @@ import {
|
||||
isSidechainTranscript,
|
||||
lastTimestamp,
|
||||
readHeadTail,
|
||||
readTranscriptTitles,
|
||||
relocatedCwd,
|
||||
scanTranscriptFile,
|
||||
sdkTitles,
|
||||
tailCustomTitle,
|
||||
transcriptAgentName,
|
||||
transcriptProjectCwd,
|
||||
type HeadTail,
|
||||
type PreviousScan,
|
||||
type SdkTitles,
|
||||
type TranscriptFacts,
|
||||
} from "./transcript-scan.js";
|
||||
import { searchBackgroundTasks } from "./background-tasks.js";
|
||||
@@ -302,23 +299,6 @@ function byMtimeDescending(a: TranscriptCandidate, b: TranscriptCandidate): numb
|
||||
return a.sessionId < b.sessionId ? -1 : a.sessionId > b.sessionId ? 1 : 0;
|
||||
}
|
||||
|
||||
/** The title of the CLI's `custom-title.json` sidecar of a transcript. */
|
||||
export async function readSidecarTitle(
|
||||
filePath: string,
|
||||
sessionId: string,
|
||||
): Promise<string | undefined> {
|
||||
try {
|
||||
const text = await fs.readFile(
|
||||
path.join(path.dirname(filePath), sessionId, "custom-title.json"),
|
||||
"utf8",
|
||||
);
|
||||
const title = (JSON.parse(text) as { customTitle?: unknown }).customTitle;
|
||||
return typeof title === "string" && title.trim() ? title : undefined;
|
||||
} catch {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* On macOS the SDK opens `<projects>/<encoded cwd>` through the file system,
|
||||
* which ignores case on the usual volumes: a directory whose name differs in
|
||||
@@ -1123,7 +1103,7 @@ export class SessionIndex {
|
||||
...(facts.tailCwd ? pathAndAncestors(facts.tailCwd) : []),
|
||||
]);
|
||||
if (fileCwd) this.dirCwds.set(candidate.dirName, fileCwd);
|
||||
const sdk = await this.titlesOf(candidate, headTail);
|
||||
const sdk = await readTranscriptTitles(candidate.filePath, headTail);
|
||||
// No title at all: the SDK does not list it either.
|
||||
if (!sdk.summary) return null;
|
||||
// Archived by its name alone: the agent name, else the custom title.
|
||||
@@ -1165,23 +1145,6 @@ export class SessionIndex {
|
||||
return { ...facts, backgroundTasks };
|
||||
}
|
||||
|
||||
/**
|
||||
* The titles the SDK gives the listed transcript (`customTitle` and
|
||||
* `summary` of its `getSessionInfo`), by the SDK's rule from the head and
|
||||
* tail read here and the sidecar (see {@link sdkTitles}). Not through the
|
||||
* SDK itself: its lookup of the transcript reads the whole project
|
||||
* directory on every call, which made each page of a large project cost a
|
||||
* listing of every transcript per row, and it may read another copy of the
|
||||
* session than the listed one.
|
||||
*/
|
||||
private async titlesOf(candidate: TranscriptCandidate, headTail: HeadTail): Promise<SdkTitles> {
|
||||
const sidecar =
|
||||
tailCustomTitle(headTail) === undefined
|
||||
? await readSidecarTitle(candidate.filePath, candidate.sessionId)
|
||||
: undefined;
|
||||
return sdkTitles(headTail, sidecar);
|
||||
}
|
||||
|
||||
/** Whether a successor of a continued transcript holds history: the SDK
|
||||
* list then hides the predecessor. */
|
||||
private async continuedElsewhere(candidate: TranscriptCandidate, metadata: TranscriptMetadata) {
|
||||
|
||||
@@ -13,8 +13,10 @@
|
||||
*/
|
||||
|
||||
import * as fs from "node:fs/promises";
|
||||
import * as path from "node:path";
|
||||
import { backgroundTasksOf, type BackgroundTasks } from "./background-tasks.js";
|
||||
import { firstPrompt, isUserPrompt, mediaPrompt, promptOf } from "./first-prompt.js";
|
||||
import { errorCode } from "./project-dirs.js";
|
||||
|
||||
const CHUNK_SIZE = 64 * 1024;
|
||||
/** The largest tail window read to find the last message. */
|
||||
@@ -610,10 +612,48 @@ export function isSidechainTranscript(head: string): boolean {
|
||||
|
||||
/** The title of the last `custom-title` record of the tail, as the SDK reads
|
||||
* it (see {@link lastRecordField}). */
|
||||
export function tailCustomTitle({ tail, sdkTail }: HeadTail): string | undefined {
|
||||
function tailCustomTitle({ tail, sdkTail }: HeadTail): string | undefined {
|
||||
return lastRecordField(sdkTail ?? tail, "customTitle", "custom-title");
|
||||
}
|
||||
|
||||
/** `<projectDir>/<sessionId>/custom-title.json` of a transcript. */
|
||||
export function customTitleSidecarPath(transcriptPath: string): string {
|
||||
const sessionId = path.basename(transcriptPath, ".jsonl");
|
||||
return path.join(path.dirname(transcriptPath), sessionId, "custom-title.json");
|
||||
}
|
||||
|
||||
/** The custom title that the SDK reads first: the tail's, else the CLI's
|
||||
* sidecar's, read by `readSidecar`. */
|
||||
export async function readRecentCustomTitle(
|
||||
transcriptPath: string,
|
||||
headTail: HeadTail,
|
||||
readSidecar: (transcriptPath: string) => Promise<string | undefined> = readSidecarTitle,
|
||||
): Promise<string | undefined> {
|
||||
return tailCustomTitle(headTail) ?? (await readSidecar(transcriptPath));
|
||||
}
|
||||
|
||||
/** The title of the CLI's sidecar, if it has a readable title. A strict read
|
||||
* throws when the sidecar exists but cannot be read. */
|
||||
export async function readSidecarTitle(
|
||||
transcriptPath: string,
|
||||
options?: { strict: boolean },
|
||||
): Promise<string | undefined> {
|
||||
const file = customTitleSidecarPath(transcriptPath);
|
||||
let text: string;
|
||||
try {
|
||||
text = await fs.readFile(file, "utf8");
|
||||
} catch (error) {
|
||||
if (options?.strict && errorCode(error) !== "ENOENT") throw error;
|
||||
return undefined;
|
||||
}
|
||||
try {
|
||||
const title = (JSON.parse(text) as { customTitle?: unknown }).customTitle;
|
||||
return typeof title === "string" && title.trim() ? title : undefined;
|
||||
} catch {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
/** The last non-blank top-level `agentName` of the records of `text`, the
|
||||
* name `/rename`, a `rename_session` and AIR write with the custom title. */
|
||||
function lastAgentName(text: string): string | undefined {
|
||||
@@ -650,13 +690,11 @@ export type SdkTitles = {
|
||||
* file, without its lookup of the file. The sidecar title counts only when
|
||||
* the tail has no custom title.
|
||||
*/
|
||||
export function sdkTitles(
|
||||
{ head, tail: wholeLines, sdkTail }: HeadTail,
|
||||
sidecarTitle?: string,
|
||||
): SdkTitles {
|
||||
export function sdkTitles(headTail: HeadTail, sidecarTitle?: string): SdkTitles {
|
||||
const { head, tail: wholeLines, sdkTail } = headTail;
|
||||
const tail = sdkTail ?? wholeLines;
|
||||
const customTitle =
|
||||
lastRecordField(tail, "customTitle", "custom-title") ??
|
||||
tailCustomTitle(headTail) ??
|
||||
sidecarTitle ??
|
||||
lastRecordField(head, "customTitle", "custom-title") ??
|
||||
lastRecordField(tail, "aiTitle", "ai-title") ??
|
||||
@@ -664,6 +702,17 @@ export function sdkTitles(
|
||||
return { customTitle, summary: customTitle ?? generatedTitle({ head, tail }) };
|
||||
}
|
||||
|
||||
/** Reads the titles of this transcript copy without another SDK project lookup. */
|
||||
export async function readTranscriptTitles(
|
||||
transcriptPath: string,
|
||||
headTail: HeadTail,
|
||||
options?: { strict: boolean },
|
||||
): Promise<SdkTitles> {
|
||||
const customTitle = tailCustomTitle(headTail);
|
||||
if (customTitle !== undefined) return { customTitle, summary: customTitle };
|
||||
return sdkTitles(headTail, await readSidecarTitle(transcriptPath, options));
|
||||
}
|
||||
|
||||
/** The title of a transcript without a custom title, in the SDK's order: AI
|
||||
* title, last prompt, summary, first prompt. The last prompt and the summary
|
||||
* are the field of a record of any type. */
|
||||
|
||||
@@ -11,9 +11,10 @@ import type {
|
||||
PermissionMode,
|
||||
PermissionResult,
|
||||
Query,
|
||||
Settings,
|
||||
} from "@anthropic-ai/claude-agent-sdk";
|
||||
import { AIR_KIND_KEY, airOnlyMeta } from "./air-extension.js";
|
||||
import { resolvePermissionMode } from "./permissions/modes.js";
|
||||
import { autoModeDisabled, resolvePermissionMode } from "./permissions/modes.js";
|
||||
import {
|
||||
noticeOrTranscriptUpdate,
|
||||
noticeTranscriptText,
|
||||
@@ -79,10 +80,18 @@ type InitializeSessionModeParams = ModeAvailability & {
|
||||
requestedMode: PermissionMode;
|
||||
/** The mode is the built-in default: no request, transcript or setting chose it. */
|
||||
builtInDefault?: boolean;
|
||||
/**
|
||||
* The mode the query was started in, when `requestedMode` was decided after
|
||||
* that (see {@link startModeUnderPolicy}). Without it, `requestedMode`.
|
||||
*/
|
||||
startedIn?: PermissionMode;
|
||||
currentModelInfo?: ModelInfo;
|
||||
currentModelId: string;
|
||||
};
|
||||
|
||||
/** The modes a session offers and the mode it starts in. */
|
||||
export type StartMode = ModeAvailability & { mode: PermissionMode; builtInDefault: boolean };
|
||||
|
||||
/**
|
||||
* The permission mode a new Claude query starts in.
|
||||
*
|
||||
@@ -137,6 +146,45 @@ export function resolveInitialPermissionMode(
|
||||
return { mode: configuredMode, builtInDefault: false };
|
||||
}
|
||||
|
||||
/**
|
||||
* The start mode of a query that already runs in `started.mode`, decided
|
||||
* again under settings that include the policy Claude Code reported after it
|
||||
* started (see `SettingsManager.followCliPolicy`). That policy can turn off
|
||||
* a mode that the query was started with, or name another
|
||||
* `permissions.defaultMode`. A mode that was off at the start stays off: the
|
||||
* SDK's bypass flag was set then. `started` itself when the policy changes
|
||||
* none of these. `SessionModeManager.initialize` sets another mode on the
|
||||
* query (`startedIn`).
|
||||
*/
|
||||
export function startModeUnderPolicy(
|
||||
started: StartMode,
|
||||
sources: { explicit?: PermissionMode; resumed?: string },
|
||||
settings: { atStart: Settings; withPolicy: Settings },
|
||||
logger: { error: (...args: unknown[]) => void },
|
||||
): StartMode {
|
||||
const { atStart, withPolicy } = settings;
|
||||
const availability: ModeAvailability = {
|
||||
allowBypass:
|
||||
started.allowBypass && withPolicy.permissions?.disableBypassPermissionsMode !== "disable",
|
||||
allowAuto: started.allowAuto && !autoModeDisabled(withPolicy),
|
||||
};
|
||||
if (
|
||||
availability.allowBypass === started.allowBypass &&
|
||||
availability.allowAuto === started.allowAuto &&
|
||||
withPolicy.permissions?.defaultMode === atStart.permissions?.defaultMode
|
||||
) {
|
||||
return started;
|
||||
}
|
||||
return {
|
||||
...availability,
|
||||
...resolveInitialPermissionMode(
|
||||
{ ...sources, defaultMode: withPolicy.permissions?.defaultMode },
|
||||
logger,
|
||||
availability,
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
/** Owns session-mode policy and the ACP/SDK synchronization it requires. */
|
||||
export class SessionModeManager<S extends SessionMode> {
|
||||
constructor(private readonly options: SessionModeManagerOptions<S>) {}
|
||||
@@ -145,6 +193,7 @@ export class SessionModeManager<S extends SessionMode> {
|
||||
query,
|
||||
requestedMode,
|
||||
builtInDefault = false,
|
||||
startedIn = requestedMode,
|
||||
currentModelInfo,
|
||||
currentModelId,
|
||||
allowBypass,
|
||||
@@ -170,21 +219,27 @@ export class SessionModeManager<S extends SessionMode> {
|
||||
`this session; falling back to "default".`,
|
||||
);
|
||||
effectiveMode = "default";
|
||||
await this.trySyncMode(query, effectiveMode, "Failed to sync clamped permissionMode to SDK:");
|
||||
} else if (autoUnsupported && builtInDefault) {
|
||||
// Like Claude Code: a built-in Auto default the model can't serve starts
|
||||
// in Manual, without a warning. Nobody chose Auto, so don't escalate to
|
||||
// acceptEdits.
|
||||
effectiveMode = "default";
|
||||
await this.trySyncMode(query, effectiveMode, "Failed to sync clamped permissionMode to SDK:");
|
||||
} else if (autoUnsupported) {
|
||||
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:");
|
||||
effectiveMode = AUTO_MODE_FALLBACK;
|
||||
}
|
||||
// The query runs in `startedIn`: another mode is set on it.
|
||||
if (effectiveMode !== startedIn) {
|
||||
effectiveMode = await this.trySyncMode(
|
||||
query,
|
||||
availableModes,
|
||||
effectiveMode,
|
||||
"Failed to sync permissionMode to SDK:",
|
||||
);
|
||||
}
|
||||
|
||||
return {
|
||||
@@ -275,18 +330,19 @@ export class SessionModeManager<S extends SessionMode> {
|
||||
|
||||
session.modes = {
|
||||
availableModes: session.modes.availableModes,
|
||||
currentModeId: AUTO_MODE_FALLBACK,
|
||||
currentModeId: await this.trySyncMode(
|
||||
session.query,
|
||||
session.modes.availableModes,
|
||||
AUTO_MODE_FALLBACK,
|
||||
`Failed to sync permissionMode to "${AUTO_MODE_FALLBACK}" after model switch invalidated "auto":`,
|
||||
),
|
||||
};
|
||||
await this.trySyncMode(
|
||||
session.query,
|
||||
AUTO_MODE_FALLBACK,
|
||||
`Failed to sync permissionMode to "${AUTO_MODE_FALLBACK}" after model switch invalidated "auto":`,
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the mode on the query. `auto` on a model without Auto runs as its
|
||||
* Sets the mode on the query, and returns the mode that is then in effect
|
||||
* (see {@link setQueryMode}). `auto` on a model without Auto runs as its
|
||||
* fallback, with the warning. With `deferWarning`, the warning waits for
|
||||
* the next prompt (see {@link deferFallbackWarning}).
|
||||
*/
|
||||
@@ -304,9 +360,10 @@ export class SessionModeManager<S extends SessionMode> {
|
||||
);
|
||||
}
|
||||
|
||||
const effectiveMode = this.effectiveMode(session, requestedMode);
|
||||
const askedMode = this.effectiveMode(session, requestedMode);
|
||||
let modeInEffect;
|
||||
try {
|
||||
await session.query.setPermissionMode(effectiveMode);
|
||||
modeInEffect = await this.setQueryMode(session, askedMode);
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
if (!error.message) error.message = "Invalid Mode";
|
||||
@@ -316,11 +373,50 @@ export class SessionModeManager<S extends SessionMode> {
|
||||
throw new Error("Invalid Mode");
|
||||
}
|
||||
|
||||
if (effectiveMode !== requestedMode) {
|
||||
if (askedMode !== requestedMode) {
|
||||
if (deferWarning) this.deferFallbackWarning(session);
|
||||
else await this.publishFallbackWarning(sessionId, session);
|
||||
}
|
||||
return effectiveMode;
|
||||
return modeInEffect;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets `mode` on the session's query, and returns the mode that Claude Code
|
||||
* names as in effect in its answer (SDK 0.3.332). That is not always the
|
||||
* mode asked for, so the session records the answer.
|
||||
*
|
||||
* Returns `mode` where the answer names no mode, as from a Claude Code
|
||||
* before 2.1.332, or names one that the session does not offer: the
|
||||
* session's current mode is always one of its `availableModes`. Rejects
|
||||
* where Claude Code refuses the mode, e.g. "Cannot set permission mode to
|
||||
* auto: auto mode disabled by settings".
|
||||
*/
|
||||
async setQueryMode(
|
||||
session: Pick<SessionMode, "query" | "modes">,
|
||||
mode: PermissionMode,
|
||||
): Promise<PermissionMode> {
|
||||
return this.namedMode(
|
||||
session.modes.availableModes,
|
||||
mode,
|
||||
await session.query.setPermissionMode(mode),
|
||||
);
|
||||
}
|
||||
|
||||
/** The mode of Claude Code's `answer` to a request for `asked` (see {@link setQueryMode}). */
|
||||
private namedMode(
|
||||
availableModes: SessionModeState["availableModes"],
|
||||
asked: PermissionMode,
|
||||
answer: Awaited<ReturnType<Query["setPermissionMode"]>>,
|
||||
): PermissionMode {
|
||||
const named = answer?.mode;
|
||||
if (named === undefined || named === asked) return asked;
|
||||
if (!this.isAvailable(availableModes, named)) {
|
||||
this.options.logError(
|
||||
`Claude Code is in permission mode "${named}" after a request for "${asked}", and the session does not offer "${named}"; keeping "${asked}".`,
|
||||
);
|
||||
return asked;
|
||||
}
|
||||
return named;
|
||||
}
|
||||
|
||||
async setSessionMode(params: SetSessionModeRequest): Promise<SetSessionModeResponse> {
|
||||
@@ -339,6 +435,37 @@ export class SessionModeManager<S extends SessionMode> {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Records the mode that Claude Code reports for `session`, and tells the
|
||||
* client. Claude Code reports the mode in the `init` frame at the start of
|
||||
* each turn, and in a `status` frame after a change. That covers a change
|
||||
* of its own: a session that starts in `auto` while settings disable Auto
|
||||
* mode is in `default` a moment later, with a `status` frame or, when the
|
||||
* change came before the answer to the initialize request, without one.
|
||||
*
|
||||
* Changes nothing for the mode already recorded, which is what a frame
|
||||
* names after a change that the adapter asked for, and for a mode that the
|
||||
* session does not offer, which is logged (see {@link setQueryMode}).
|
||||
*
|
||||
* Nothing ties a frame to the request that caused it. After two quick
|
||||
* changes by the client, the first one's frame can arrive when the second
|
||||
* mode is already recorded: the session then shows the first mode until
|
||||
* the second frame arrives.
|
||||
*/
|
||||
async modeReported(sessionId: string, session: S, mode: PermissionMode): Promise<void> {
|
||||
// A frame of a query that the session no longer runs on is not its mode.
|
||||
if (this.options.getSession(sessionId) !== session) return;
|
||||
if (session.modes.currentModeId === mode) return;
|
||||
if (!this.isAvailable(session.modes.availableModes, mode)) {
|
||||
this.options.logError(
|
||||
`Claude Code reports permission mode "${mode}", which the session does not offer; keeping "${session.modes.currentModeId}".`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
await this.publishCurrent(sessionId, mode);
|
||||
await this.options.updateConfigOption(sessionId, MODE_CONFIG_ID, mode);
|
||||
}
|
||||
|
||||
async publishFallbackWarning(sessionId: string, session: SessionMode): Promise<void> {
|
||||
session.autoModeFallbackWarningPending = false;
|
||||
if (session.autoModeFallbackWarningShown) return;
|
||||
@@ -412,15 +539,21 @@ export class SessionModeManager<S extends SessionMode> {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets `mode` on the query, and returns the mode then in effect (see
|
||||
* {@link setQueryMode}). A failure is logged, and `mode` is returned.
|
||||
*/
|
||||
private async trySyncMode(
|
||||
query: Pick<Query, "setPermissionMode">,
|
||||
availableModes: SessionModeState["availableModes"],
|
||||
mode: PermissionMode,
|
||||
errorMessage: string,
|
||||
): Promise<void> {
|
||||
): Promise<PermissionMode> {
|
||||
try {
|
||||
await query.setPermissionMode(mode);
|
||||
return this.namedMode(availableModes, mode, await query.setPermissionMode(mode));
|
||||
} catch (error) {
|
||||
this.options.logError(errorMessage, error);
|
||||
return mode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
import { AIR_RECOMMENDED_CONFIG_VALUE_CAPABILITY, withAirMeta } from "./air-extension.js";
|
||||
import { bedrockRegionPrefix } from "./gateway-models.js";
|
||||
import { modelReasoningEffortsMeta } from "./session-effort.js";
|
||||
import type { QuerySettings } from "./query-settings.js";
|
||||
|
||||
export const MODEL_CONFIG_ID = "model";
|
||||
|
||||
@@ -727,6 +728,8 @@ export async function getAvailableModels(
|
||||
sessionId: string,
|
||||
resumedModelHint?: string,
|
||||
narrowedByGateway = false,
|
||||
/** Claude Code's `get_settings` answer for this query, read after `initialize`. */
|
||||
cliSettings?: QuerySettings,
|
||||
): Promise<SessionModelState> {
|
||||
// A gateway that lists none of the SDK's models leaves none to offer
|
||||
// (`narrowToGatewayModels`). The session stays on the model the SDK runs,
|
||||
@@ -738,7 +741,14 @@ export async function getAvailableModels(
|
||||
};
|
||||
}
|
||||
|
||||
const settings = settingsManager.getSettings();
|
||||
// The `model` setting as the running CLI resolved it, which also counts the
|
||||
// tiers that `settingsManager` does not read (the `settings` option of the
|
||||
// query). Without the CLI's answer, the settings of this process.
|
||||
const settings = cliSettings?.effective ?? settingsManager.getSettings();
|
||||
const appliedModel =
|
||||
typeof cliSettings?.applied?.model === "string" && cliSettings.applied.model.trim()
|
||||
? cliSettings.applied.model
|
||||
: undefined;
|
||||
|
||||
let currentModel = models[0];
|
||||
let resolvedFromInput: string | undefined;
|
||||
@@ -772,7 +782,7 @@ export async function getAvailableModels(
|
||||
}
|
||||
|
||||
// Skip the setModel round-trip when we can prove the SDK has already landed
|
||||
// on the same model. Two cases qualify:
|
||||
// on the same model. Three 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
|
||||
@@ -782,6 +792,8 @@ export async function getAvailableModels(
|
||||
// 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.
|
||||
// (c) The CLI reports that it runs the model that `currentModel` resolves
|
||||
// to (`cliRunsSelectedModel` below), on a fresh or a resumed session.
|
||||
// Anything else (fuzzy match, allowlist-synthesized value, alias) gets a
|
||||
// setModel call so we don't drift from the user's intended pin.
|
||||
// Case (a) does not hold when `narrowToGatewayModels` left the SDK on a
|
||||
@@ -810,7 +822,20 @@ export async function getAvailableModels(
|
||||
// When the switch fails, the SDK stays on the model it ran before it.
|
||||
const modelBeforeSwitch = (): ModelInfo =>
|
||||
switchToListed && sdkDefault !== undefined ? sdkDefault : models[0];
|
||||
// `applied.model` is the model that the CLI runs: `claude-sonnet-5-5` for a
|
||||
// `claude-sonnet-5-5[1m]` pin (it drops the hint of a model whose only
|
||||
// window is 1M), `claude-sonnet-4-6[1m]` for the 1M lane of a model that
|
||||
// also has a 200k one. The ids are compared with their hints, so a session
|
||||
// on the 200k lane still gets a `[1m]` row set. On a resumed session the
|
||||
// CLI has restored the transcript's model before it answers `get_settings`
|
||||
// (seen on 2.1.333); nothing here enforces that order.
|
||||
const cliRunsSelectedModel =
|
||||
appliedModel !== undefined &&
|
||||
sdkSawSameValue &&
|
||||
canonicalizeModelId(currentModel.resolvedModel ?? currentModel.value) ===
|
||||
canonicalizeModelId(appliedModel);
|
||||
const skipSetModel =
|
||||
cliRunsSelectedModel ||
|
||||
(resolvedFromInput === undefined && !switchToListed) ||
|
||||
(!isResumedSession && currentModel.value === resolvedFromInput && sdkSawSameValue);
|
||||
if (!skipSetModel) {
|
||||
|
||||
536
src/session-read.ts
Normal file
536
src/session-read.ts
Normal file
@@ -0,0 +1,536 @@
|
||||
import { RequestError } from "@agentclientprotocol/sdk/unstable";
|
||||
import { getSessionMessages, type SessionStoreEntry } from "@anthropic-ai/claude-agent-sdk";
|
||||
import { createHash } from "node:crypto";
|
||||
import type { BigIntStats } from "node:fs";
|
||||
import { lstat, open } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { z } from "zod";
|
||||
import packageJson from "../package.json" with { type: "json" };
|
||||
import { claudeConfigDir, isSessionId } from "./paths.js";
|
||||
import {
|
||||
findTranscript,
|
||||
readHistoryAcrossCompactions,
|
||||
readTranscriptEntriesOf,
|
||||
} from "./resumed-session.js";
|
||||
import { LastReportedEntity } from "./session-cursors.js";
|
||||
import {
|
||||
readHeadTailOf,
|
||||
readRecentCustomTitle,
|
||||
readSidecarTitle,
|
||||
type HeadTail,
|
||||
} from "./session-index/transcript-scan.js";
|
||||
import { sanitizeTitle } from "./session-titles.js";
|
||||
import { activeSessionMessages, readRewindPoint } from "./session-rewind.js";
|
||||
|
||||
export const SESSION_READ_METHOD = "_session/read";
|
||||
export const SESSION_READ_CAPABILITY = { supported: true } as const;
|
||||
|
||||
export type SessionReadFrame = {
|
||||
sessionId: string;
|
||||
update: { sessionUpdate: string; [key: string]: unknown };
|
||||
[key: string]: unknown;
|
||||
};
|
||||
|
||||
const request = z.object({
|
||||
sessionId: z.string().trim().min(1),
|
||||
_meta: z.record(z.string(), z.unknown()).nullish(),
|
||||
cwd: z.string().refine(path.isAbsolute, "cwd must be an absolute path").nullish(),
|
||||
replayFrom: z
|
||||
.discriminatedUnion("type", [
|
||||
z.object({ type: z.literal("start") }),
|
||||
z.object({ type: z.literal("cursor"), cursorId: z.unknown().optional() }),
|
||||
])
|
||||
.nullish(),
|
||||
});
|
||||
|
||||
type ReadOptions = {
|
||||
protocol: 1 | 2;
|
||||
capabilities: unknown;
|
||||
cursors: boolean;
|
||||
signal?: AbortSignal;
|
||||
isOpen(sessionId: string): boolean;
|
||||
assertRoot?(sessionId: string): void;
|
||||
replay(
|
||||
sessionId: string,
|
||||
cwd: string | undefined,
|
||||
observeStorage: boolean,
|
||||
): Promise<{
|
||||
frames: SessionReadFrame[];
|
||||
cwd: string;
|
||||
historyEnd?: number;
|
||||
title?: string;
|
||||
storage?: SessionReadStorage;
|
||||
}>;
|
||||
send(frame: SessionReadFrame): Promise<void> | void;
|
||||
};
|
||||
|
||||
export type SessionReadStorage = {
|
||||
transcript: string;
|
||||
version: string;
|
||||
/** Undefined when replay skipped the sidecar, null when it had no title. */
|
||||
sidecarTitle?: string | null;
|
||||
};
|
||||
|
||||
function fileVersion(stats: BigIntStats): string {
|
||||
const { dev, ino, mode, size, mtimeNs, ctimeNs } = stats;
|
||||
return [dev, ino, mode, size, mtimeNs, ctimeNs].join(":");
|
||||
}
|
||||
|
||||
/** Checks the transcript's metadata and the sidecar inputs read by the replay. */
|
||||
async function storageUnchanged(sessionId: string, storage: SessionReadStorage): Promise<boolean> {
|
||||
try {
|
||||
// A move or a different matching project must go through the ordinary lookup.
|
||||
const transcript = await findTranscript(sessionId, { strict: true });
|
||||
if (transcript !== storage.transcript) return false;
|
||||
const matchesTranscript = async () => {
|
||||
const root = await lstat(transcript, { bigint: true });
|
||||
return root.isFile() && fileVersion(root) === storage.version;
|
||||
};
|
||||
if (!(await matchesTranscript())) return false;
|
||||
if (storage.sidecarTitle !== undefined) {
|
||||
const title = await readSidecarTitle(transcript, { strict: true });
|
||||
if ((title ?? null) !== storage.sidecarTitle) return false;
|
||||
}
|
||||
if (await readRewindPoint(sessionId, undefined, { transcript })) return false;
|
||||
return await matchesTranscript();
|
||||
} catch {
|
||||
// An uncertain probe leaves validation and errors to the ordinary replay.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/** These tools render their stored input and result, with no child or workspace reads. */
|
||||
const ROOT_ONLY_TOOLS = new Set(["Bash", "PowerShell", "Read", "Write", "Edit", "Glob", "Grep"]);
|
||||
|
||||
function hasIndependentHistory(content: unknown): boolean {
|
||||
return (
|
||||
Array.isArray(content) &&
|
||||
content.some(
|
||||
(block) =>
|
||||
["tool_use", "server_tool_use", "mcp_tool_use"].includes(block?.type) &&
|
||||
!ROOT_ONLY_TOOLS.has(block.name),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
function currentDirectory(): string | undefined {
|
||||
try {
|
||||
return process.cwd();
|
||||
} catch {
|
||||
// The working directory could be gone; a replay with a stored cwd may still work.
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
/** The SDK follows parent links in these records, including the branch selected by rewind.json. */
|
||||
export async function readSessionTranscript(
|
||||
sessionId: string,
|
||||
cwd?: string,
|
||||
observeStorage = false,
|
||||
) {
|
||||
if (!isSessionId(sessionId)) {
|
||||
throw RequestError.invalidParams({ sessionId }, "Read the root Claude session by its UUID.");
|
||||
}
|
||||
const transcript = await findTranscript(sessionId, { strict: true });
|
||||
if (!transcript) throw RequestError.sessionNotFound(sessionId);
|
||||
const handle = await open(transcript, "r");
|
||||
let headTail: HeadTail;
|
||||
let records: SessionStoreEntry[];
|
||||
let version: string | undefined;
|
||||
try {
|
||||
const stat = await handle.stat({ bigint: true });
|
||||
if (observeStorage) version = fileVersion(stat);
|
||||
const size = Number(stat.size);
|
||||
headTail = await readHeadTailOf(handle, size);
|
||||
records = await readTranscriptEntriesOf(transcript, handle, size);
|
||||
} finally {
|
||||
await handle.close();
|
||||
}
|
||||
let sidecarTitle: string | null | undefined;
|
||||
const readTitle = async (file: string) => {
|
||||
const title = await readSidecarTitle(file, { strict: true });
|
||||
sidecarTitle = title ?? null;
|
||||
return title;
|
||||
};
|
||||
const title =
|
||||
records[0]?.isSidechain === true
|
||||
? undefined
|
||||
: ((await readRecentCustomTitle(transcript, headTail, readTitle)) ??
|
||||
lastRecordedTitle(records, "custom-title", "customTitle") ??
|
||||
lastRecordedTitle(records, "ai-title", "aiTitle"));
|
||||
const dir = cwd ?? records.find((r) => typeof r.cwd === "string" && path.isAbsolute(r.cwd))?.cwd;
|
||||
const effectiveCwd = typeof dir === "string" ? dir : process.cwd();
|
||||
const options = {
|
||||
dir: effectiveCwd,
|
||||
sessionStore: { append: async () => {}, load: async () => records },
|
||||
};
|
||||
const chain = await getSessionMessages(sessionId, options);
|
||||
const rewind = await readRewindPoint(sessionId, undefined, { transcript });
|
||||
const retained = activeSessionMessages(chain, rewind);
|
||||
const messages = await readHistoryAcrossCompactions(
|
||||
sessionId,
|
||||
retained,
|
||||
undefined,
|
||||
effectiveCwd,
|
||||
records,
|
||||
);
|
||||
return {
|
||||
messages,
|
||||
cwd: effectiveCwd,
|
||||
transcript,
|
||||
title: title && sanitizeTitle(title),
|
||||
storage:
|
||||
version &&
|
||||
!rewind &&
|
||||
!messages.some((message) =>
|
||||
hasIndependentHistory((message.message as { content?: unknown } | null)?.content),
|
||||
)
|
||||
? { transcript, version, sidecarTitle }
|
||||
: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* The `field` of the last `type` record of the snapshot, undefined when it is
|
||||
* empty. The SDK reads the head and tail 64 KB windows instead, so a large
|
||||
* tool result appended after the last `ai-title` would hide it from the read
|
||||
* and change the title of an unchanged session.
|
||||
*/
|
||||
function lastRecordedTitle(
|
||||
records: SessionStoreEntry[],
|
||||
type: string,
|
||||
field: string,
|
||||
): string | undefined {
|
||||
for (let i = records.length - 1; i >= 0; i--) {
|
||||
const record = records[i]!;
|
||||
const value = record.type === type ? (record as Record<string, unknown>)[field] : undefined;
|
||||
if (typeof value === "string") return value || undefined;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function invalidCursor(): RequestError {
|
||||
return RequestError.invalidParams(
|
||||
{ reason: "invalid_cursor" },
|
||||
"This cursor cannot continue the replay. Read from start.",
|
||||
);
|
||||
}
|
||||
|
||||
function alreadyOpen(sessionId: string): RequestError {
|
||||
return RequestError.invalidRequest(
|
||||
{ reason: "session_already_open", sessionId },
|
||||
"The session is open or changing on this connection. Retry after it closes.",
|
||||
);
|
||||
}
|
||||
|
||||
function json(value: unknown): string {
|
||||
return JSON.stringify(value, (_key, member: unknown) =>
|
||||
member && typeof member === "object" && !Array.isArray(member)
|
||||
? Object.fromEntries(
|
||||
Object.keys(member)
|
||||
.sort()
|
||||
.map((key) => [key, (member as Record<string, unknown>)[key]]),
|
||||
)
|
||||
: member,
|
||||
);
|
||||
}
|
||||
|
||||
function digest(value: string) {
|
||||
return createHash("sha256").update(value).digest("base64url");
|
||||
}
|
||||
|
||||
// A cursor carries the number of delivered updates per session. Its digest binds
|
||||
// those counts to the rendering options, exact history prefixes and post-replay metadata.
|
||||
const lengths = z.record(z.string(), z.int().nonnegative());
|
||||
function decodeLengths(id: string): Map<string, number> {
|
||||
const match = /^read:v1:[\w-]{43}\.([\w-]+)$/.exec(id);
|
||||
if (match) {
|
||||
try {
|
||||
return new Map(
|
||||
Object.entries(
|
||||
lengths.parse(JSON.parse(Buffer.from(match[1]!, "base64url").toString("utf8"))),
|
||||
),
|
||||
);
|
||||
} catch {
|
||||
/* Invalid and expired cursors have the same recovery. */
|
||||
}
|
||||
}
|
||||
throw invalidCursor();
|
||||
}
|
||||
|
||||
function snapshot(
|
||||
frames: SessionReadFrame[],
|
||||
root: string,
|
||||
protocol: 1 | 2,
|
||||
scope: string,
|
||||
previous?: string,
|
||||
historyEnd = frames.length,
|
||||
) {
|
||||
const saved = previous ? decodeLengths(previous) : new Map<string, number>();
|
||||
const streams = new Map<
|
||||
string,
|
||||
{
|
||||
count: number;
|
||||
history: ReturnType<typeof createHash>;
|
||||
prefix: string;
|
||||
}
|
||||
>();
|
||||
const entities = new LastReportedEntity();
|
||||
const outgoing: SessionReadFrame[] = [];
|
||||
for (const [index, frame] of frames.entries()) {
|
||||
const { sessionId, update } = frame;
|
||||
// The renderer emits each child's final state on its parent after all messages.
|
||||
// A later parent message precedes that same state in the next full replay.
|
||||
const boundary = update.sessionUpdate === "replay_complete";
|
||||
const key =
|
||||
index < historyEnd || boundary
|
||||
? sessionId
|
||||
: json([sessionId, update.sessionUpdate, update.sessionId ?? update.subagentSessionId]);
|
||||
let stream = streams.get(key);
|
||||
if (!stream) {
|
||||
stream = {
|
||||
count: 0,
|
||||
history: createHash("sha256"),
|
||||
prefix: digest(""),
|
||||
};
|
||||
streams.set(key, stream);
|
||||
}
|
||||
const before = saved.get(key);
|
||||
if (boundary) {
|
||||
if (before === undefined || sessionId === root || stream.count > before) outgoing.push(frame);
|
||||
} else {
|
||||
stream.history.update(json(frame) + "\n");
|
||||
stream.count++;
|
||||
if (stream.count === before) stream.prefix = stream.history.copy().digest("base64url");
|
||||
if (before === undefined || stream.count > before) outgoing.push(frame);
|
||||
entities.sending(frame, protocol);
|
||||
}
|
||||
}
|
||||
|
||||
function cursor(prefix: boolean) {
|
||||
const counts = new Map<string, number>();
|
||||
const hashes = new Map<string, string>();
|
||||
for (const [id, stream] of streams) {
|
||||
const count = prefix ? saved.get(id) : stream.count;
|
||||
if (count === undefined) continue;
|
||||
if (count > stream.count) throw invalidCursor();
|
||||
counts.set(id, count);
|
||||
hashes.set(id, prefix ? stream.prefix : stream.history.copy().digest("base64url"));
|
||||
}
|
||||
const encoded = Buffer.from(json(Object.fromEntries(counts))).toString("base64url");
|
||||
return "read:v1:" + digest(json([scope, encoded, Object.fromEntries(hashes)])) + "." + encoded;
|
||||
}
|
||||
|
||||
if (previous && cursor(true) !== previous) throw invalidCursor();
|
||||
const anchor = entities.after(root);
|
||||
if (previous && !anchor) throw invalidCursor();
|
||||
return { outgoing, anchor, cursorId: anchor ? cursor(false) : undefined };
|
||||
}
|
||||
|
||||
type Checkpoint = {
|
||||
cursorId: string;
|
||||
scope: string;
|
||||
requestedCwd: string | undefined;
|
||||
cwd: string;
|
||||
processCwd: string;
|
||||
storage: SessionReadStorage;
|
||||
boundaries: SessionReadFrame[];
|
||||
title?: string;
|
||||
};
|
||||
|
||||
/** A read owns only a replay on this connection. Closing it invalidates the pending delivery. */
|
||||
export class SessionReads {
|
||||
private readonly active = new Map<string, { invalidated: boolean }>();
|
||||
|
||||
private readonly transitions = new Map<string, number>();
|
||||
|
||||
private readonly checkpoints = new Map<string, Checkpoint>();
|
||||
|
||||
/** Reserve a session before load, resume, close or delete can yield. */
|
||||
async transition<T>(
|
||||
sessionId: string | undefined,
|
||||
kind: "open" | "close",
|
||||
run: () => Promise<T>,
|
||||
): Promise<T> {
|
||||
if (sessionId === undefined) return run();
|
||||
const read = this.active.get(sessionId);
|
||||
if (read) {
|
||||
if (kind === "open") throw alreadyOpen(sessionId);
|
||||
read.invalidated = true;
|
||||
}
|
||||
this.checkpoints.delete(sessionId);
|
||||
this.transitions.set(sessionId, (this.transitions.get(sessionId) ?? 0) + 1);
|
||||
try {
|
||||
return await run();
|
||||
} finally {
|
||||
const remaining = this.transitions.get(sessionId)! - 1;
|
||||
if (remaining === 0) this.transitions.delete(sessionId);
|
||||
else this.transitions.set(sessionId, remaining);
|
||||
}
|
||||
}
|
||||
|
||||
async read(params: unknown, options: ReadOptions): Promise<{ cursorId?: string }> {
|
||||
const parsed = request.safeParse(params);
|
||||
if (!parsed.success)
|
||||
throw RequestError.invalidParams(undefined, parsed.error.issues[0]?.message);
|
||||
const { sessionId, replayFrom } = parsed.data;
|
||||
const cwd = parsed.data.cwd ?? undefined;
|
||||
const previous = replayFrom?.type === "cursor" ? replayFrom.cursorId : undefined;
|
||||
if (
|
||||
replayFrom?.type === "cursor" &&
|
||||
(typeof previous !== "string" || !previous || !options.cursors)
|
||||
)
|
||||
throw invalidCursor();
|
||||
const cursor = typeof previous === "string" ? previous : undefined;
|
||||
if (this.active.has(sessionId)) throw alreadyOpen(sessionId);
|
||||
const read = { invalidated: false };
|
||||
const check = () => {
|
||||
if (options.signal?.aborted) throw RequestError.requestCancelled();
|
||||
if (read.invalidated || this.transitions.has(sessionId) || options.isOpen(sessionId))
|
||||
throw alreadyOpen(sessionId);
|
||||
};
|
||||
check();
|
||||
options.assertRoot?.(sessionId);
|
||||
this.active.set(sessionId, read);
|
||||
const useCursor = options.cursors && replayFrom != null;
|
||||
const processCwd = useCursor ? currentDirectory() : undefined;
|
||||
const scopeFor = (effectiveCwd: string) =>
|
||||
json([
|
||||
sessionId,
|
||||
effectiveCwd,
|
||||
claudeConfigDir(),
|
||||
options.protocol,
|
||||
options.capabilities,
|
||||
packageJson.version,
|
||||
]);
|
||||
const replay = async () => {
|
||||
try {
|
||||
const view = await options.replay(sessionId, cwd, useCursor);
|
||||
if (options.protocol === 1 && view.title)
|
||||
view.frames.push({
|
||||
sessionId,
|
||||
update: { sessionUpdate: "session_info_update", title: view.title },
|
||||
});
|
||||
return view;
|
||||
} catch (error) {
|
||||
check();
|
||||
if (error instanceof RequestError) throw error;
|
||||
const file = (error as { path?: string } | null)?.path;
|
||||
throw RequestError.internalError(
|
||||
{
|
||||
sessionId,
|
||||
reason: "history_read_failed",
|
||||
retryable: true,
|
||||
...(file && { paths: [file] }),
|
||||
},
|
||||
`Could not read the history of ${sessionId}. Retry the read. ${String(error)}`,
|
||||
);
|
||||
}
|
||||
};
|
||||
const deliver = async (
|
||||
outgoing: SessionReadFrame[],
|
||||
cursorId: string | undefined,
|
||||
title: string | undefined,
|
||||
) => {
|
||||
for (const frame of outgoing) {
|
||||
check();
|
||||
await options.send(frame);
|
||||
}
|
||||
// On v2 the title is current session info, outside the replay cursor.
|
||||
if (options.protocol === 2 && (title || useCursor)) {
|
||||
check();
|
||||
await options.send({
|
||||
sessionId,
|
||||
update: { sessionUpdate: "session_info_update", title: title || null },
|
||||
});
|
||||
}
|
||||
check();
|
||||
return cursorId ? { cursorId } : {};
|
||||
};
|
||||
try {
|
||||
const cached = cursor ? this.checkpoints.get(sessionId) : undefined;
|
||||
if (
|
||||
cached &&
|
||||
cached.cursorId === cursor &&
|
||||
(cached.requestedCwd === cwd || cached.cwd === cwd) &&
|
||||
cached.processCwd === processCwd &&
|
||||
cached.scope === scopeFor(cached.cwd) &&
|
||||
(await storageUnchanged(sessionId, cached.storage)) &&
|
||||
cached.processCwd === currentDirectory()
|
||||
) {
|
||||
return await deliver(cached.boundaries, cached.cursorId, cached.title);
|
||||
}
|
||||
check();
|
||||
if (useCursor) this.checkpoints.delete(sessionId);
|
||||
const { frames, cwd: effectiveCwd, historyEnd, title, storage } = await replay();
|
||||
check();
|
||||
if (!useCursor) return await deliver(frames, undefined, title);
|
||||
const scope = scopeFor(effectiveCwd);
|
||||
const { outgoing, cursorId, anchor } = snapshot(
|
||||
frames,
|
||||
sessionId,
|
||||
options.protocol,
|
||||
scope,
|
||||
cursor,
|
||||
historyEnd,
|
||||
);
|
||||
let verifiedStorage = storage;
|
||||
const isRootBoundary = (frame: SessionReadFrame) =>
|
||||
frame.sessionId === sessionId && frame.update.sessionUpdate === "replay_complete";
|
||||
if (cursorId && cursorId !== cursor) {
|
||||
// A terminal can append or rewind between the reads of the root and a child.
|
||||
const again = await replay();
|
||||
check();
|
||||
if (
|
||||
again.cwd !== effectiveCwd ||
|
||||
again.historyEnd !== historyEnd ||
|
||||
frames.length !== again.frames.length ||
|
||||
frames.some((frame, i) => json(frame) !== json(again.frames[i]))
|
||||
) {
|
||||
throw RequestError.internalError(
|
||||
{ sessionId, retryable: true },
|
||||
"History changed during the read. Retry with the last successful cursor.",
|
||||
);
|
||||
}
|
||||
if (
|
||||
again.storage?.transcript !== storage?.transcript ||
|
||||
again.storage?.version !== storage?.version ||
|
||||
again.storage?.sidecarTitle !== storage?.sidecarTitle
|
||||
) {
|
||||
verifiedStorage = undefined;
|
||||
}
|
||||
const end = outgoing.findIndex(isRootBoundary);
|
||||
outgoing.splice(end < 0 ? outgoing.length : end, 0, {
|
||||
sessionId,
|
||||
update: {
|
||||
sessionUpdate: "cursor_update",
|
||||
cursorId,
|
||||
anchor,
|
||||
capabilities: { read: {} },
|
||||
},
|
||||
});
|
||||
}
|
||||
// Pair the cursor only with the inputs read by its render, never a later append.
|
||||
const result = await deliver(outgoing, cursorId, title);
|
||||
check();
|
||||
if (cursorId && verifiedStorage && processCwd && processCwd === currentDirectory()) {
|
||||
this.checkpoints.set(sessionId, {
|
||||
cursorId,
|
||||
scope,
|
||||
requestedCwd: cwd,
|
||||
cwd: effectiveCwd,
|
||||
processCwd,
|
||||
storage: verifiedStorage,
|
||||
boundaries: frames.filter(isRootBoundary),
|
||||
title,
|
||||
});
|
||||
if (this.checkpoints.size > 32) {
|
||||
this.checkpoints.delete(this.checkpoints.keys().next().value!);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
} finally {
|
||||
this.active.delete(sessionId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -293,8 +293,9 @@ export async function cutAtRewindPoint<M extends { uuid?: string | null }>(
|
||||
sessionId: string,
|
||||
stored: readonly M[],
|
||||
logger?: Logger,
|
||||
options?: { transcript: string },
|
||||
): Promise<M[]> {
|
||||
return activeSessionMessages(stored, await readRewindPoint(sessionId, logger));
|
||||
return activeSessionMessages(stored, await readRewindPoint(sessionId, logger, options));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -393,9 +394,12 @@ export async function writeRewindPoint(sessionId: string, point: RewindPoint): P
|
||||
export async function readRewindPoint(
|
||||
sessionId: string,
|
||||
logger?: Logger,
|
||||
options?: { transcript: string },
|
||||
): Promise<RewindPoint | undefined> {
|
||||
try {
|
||||
const file = await rewindPointFile(sessionId);
|
||||
const file = options
|
||||
? path.join(path.dirname(options.transcript), sessionId, "rewind.json")
|
||||
: await rewindPointFile(sessionId);
|
||||
if (!file) return undefined;
|
||||
let point: Partial<RewindPoint>;
|
||||
try {
|
||||
@@ -410,6 +414,12 @@ export async function readRewindPoint(
|
||||
}
|
||||
return { resumeSessionAt, droppedPromptUuid };
|
||||
} catch (error) {
|
||||
if (options) {
|
||||
if (typeof (error as { path?: unknown } | null)?.path === "string") throw error;
|
||||
throw Object.assign(new Error("Failed to read the rewind point", { cause: error }), {
|
||||
path: path.join(path.dirname(options.transcript), sessionId, "rewind.json"),
|
||||
});
|
||||
}
|
||||
logger?.error(`Failed to read the rewind point of session ${sessionId}:`, error);
|
||||
throw RequestError.internalError(
|
||||
undefined,
|
||||
|
||||
@@ -3,8 +3,9 @@ import type {
|
||||
SessionConfigOption,
|
||||
SetSessionConfigOptionRequest,
|
||||
} from "@agentclientprotocol/sdk/unstable";
|
||||
import type { ModelInfo, Query } from "@anthropic-ai/claude-agent-sdk";
|
||||
import type { ModelInfo, Query, SDKSettingsParseError } from "@anthropic-ai/claude-agent-sdk";
|
||||
import { ULTRACODE_CONFIG_ID } from "./session-config-ids.js";
|
||||
import { readQuerySettings } from "./query-settings.js";
|
||||
|
||||
export { ULTRACODE_CONFIG_ID } from "./session-config-ids.js";
|
||||
|
||||
@@ -24,33 +25,35 @@ export type UltracodeSettingsReport = {
|
||||
requested?: boolean;
|
||||
};
|
||||
|
||||
// `Query.getSettings()` exists at runtime (sdk.mjs) but is missing from the
|
||||
// SDK's type declarations as of 0.3.319.
|
||||
type GetSettingsQuery = Query & {
|
||||
getSettings?: () => Promise<{
|
||||
applied?: { ultracodeAvailable?: unknown; ultracodeRequested?: unknown };
|
||||
}>;
|
||||
/** What the CLI's `get_settings` control response says about the session. */
|
||||
export type SettingsReport = {
|
||||
/** Undefined when the SDK has no `getSettings` or the request fails; callers
|
||||
* then fall back to {@link modelSupportsUltracode}. */
|
||||
ultracode: UltracodeSettingsReport | undefined;
|
||||
/** Settings files that the CLI skipped, e.g. `{ file: "/home/u/.claude/settings.json",
|
||||
* path: "", message: "Invalid or malformed JSON" }`. Empty when the CLI
|
||||
* reports none or cannot be asked. */
|
||||
settingsErrors: SDKSettingsParseError[];
|
||||
};
|
||||
|
||||
/** Ask the CLI whether ultracode is available and requested for the session.
|
||||
* Returns undefined when the SDK has no `getSettings` or the request fails;
|
||||
* callers then fall back to {@link modelSupportsUltracode}. */
|
||||
export async function readUltracodeSettings(
|
||||
query: Query,
|
||||
): Promise<UltracodeSettingsReport | undefined> {
|
||||
const getSettings = (query as GetSettingsQuery).getSettings;
|
||||
if (typeof getSettings !== "function") return undefined;
|
||||
try {
|
||||
const applied = (await getSettings.call(query))?.applied;
|
||||
return {
|
||||
/** Ask the CLI whether ultracode is available and requested for the session,
|
||||
* and which settings files it skipped. Its own request, after the session's
|
||||
* model is settled: `applied.ultracodeAvailable` is for the model that the
|
||||
* CLI runs at the request, and `getAvailableModels` can have set another one
|
||||
* since the start's first `get_settings` answer (`followQueryPolicy`). */
|
||||
export async function readSettingsReport(query: Query): Promise<SettingsReport> {
|
||||
const settings = await readQuerySettings(query);
|
||||
if (!settings) return { ultracode: undefined, settingsErrors: [] };
|
||||
const applied = settings.applied;
|
||||
return {
|
||||
ultracode: {
|
||||
available:
|
||||
typeof applied?.ultracodeAvailable === "boolean" ? applied.ultracodeAvailable : undefined,
|
||||
requested:
|
||||
typeof applied?.ultracodeRequested === "boolean" ? applied.ultracodeRequested : undefined,
|
||||
};
|
||||
} catch {
|
||||
return undefined;
|
||||
}
|
||||
},
|
||||
settingsErrors: settings.errors ?? [],
|
||||
};
|
||||
}
|
||||
|
||||
/** The CLI supports ultracode on exactly the models that support `xhigh`
|
||||
|
||||
@@ -40,6 +40,13 @@ export interface SettingsManagerOptions {
|
||||
|
||||
type ModelSelectionSettings = Pick<Settings, "availableModels" | "modelOverrides">;
|
||||
|
||||
/**
|
||||
* Reads the policy tier that the session's Claude Code applies now (see
|
||||
* `SettingsManager.followCliPolicy`). Undefined when it reports none, or when
|
||||
* it cannot be asked.
|
||||
*/
|
||||
export type CliPolicyReader = () => Promise<Settings | undefined>;
|
||||
|
||||
/** The settings that decide whether Claude Code compacts (see `idle-compaction.ts`). */
|
||||
export type CompactionSettings = {
|
||||
idleCompaction?: boolean;
|
||||
@@ -64,6 +71,12 @@ export class SettingsManager {
|
||||
private managedApiKeyHelper?: string;
|
||||
private managedCompactionSettings: CompactionSettings = {};
|
||||
private managedShowClearContextOnPlanAccept?: boolean;
|
||||
/** Asked at every load once the session's CLI runs (see {@link followCliPolicy}). */
|
||||
private readCliPolicy?: CliPolicyReader;
|
||||
/** Whether the last load resolved with a policy tier that the CLI reported. */
|
||||
private cliPolicyApplied = false;
|
||||
/** The load that was started last. The next one starts when it has ended. */
|
||||
private loading: Promise<void> = Promise.resolve();
|
||||
/** The policy sources last logged as not loaded (see {@link unloadedPolicySources}). */
|
||||
private unloadedPolicy?: string;
|
||||
private watchers: fs.FSWatcher[] = [];
|
||||
@@ -92,7 +105,7 @@ export class SettingsManager {
|
||||
}
|
||||
|
||||
this.disposed = false;
|
||||
this.initPromise = this.loadAllSettings().then(() => {
|
||||
this.initPromise = this.load().then(() => {
|
||||
if (!this.disposed) {
|
||||
this.setupWatchers();
|
||||
this.initialized = true;
|
||||
@@ -115,13 +128,34 @@ export class SettingsManager {
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the settings after every load that was started before this one.
|
||||
* Loads that overlap could end in another order than they started in, and
|
||||
* the settings of the older one would stay.
|
||||
*/
|
||||
private load(readCliPolicy: CliPolicyReader | undefined = this.readCliPolicy): Promise<void> {
|
||||
// `loadAllSettings` does not reject.
|
||||
this.loading = this.loading.then(() => this.loadAllSettings(readCliPolicy));
|
||||
return this.loading;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves the effective settings via the SDK and applies the CLI's trust
|
||||
* filter for escalating `permissions.defaultMode` values.
|
||||
*/
|
||||
private async loadAllSettings(): Promise<void> {
|
||||
private async loadAllSettings(readCliPolicy?: CliPolicyReader): Promise<void> {
|
||||
let cliPolicy: Settings | undefined;
|
||||
try {
|
||||
const resolved = await resolveSettings({ cwd: this.cwd });
|
||||
cliPolicy = await readCliPolicy?.();
|
||||
} catch (error) {
|
||||
this.logger.error("Failed to read the policy that Claude Code applies:", error);
|
||||
}
|
||||
this.cliPolicyApplied = cliPolicy !== undefined;
|
||||
try {
|
||||
const resolved = await resolveSettings({
|
||||
cwd: this.cwd,
|
||||
...(cliPolicy && { serverManagedSettings: cliPolicy }),
|
||||
});
|
||||
// Once per change: a reload after each settings file edit would repeat it.
|
||||
const unloaded = unloadedPolicySources(resolved);
|
||||
if (unloaded !== this.unloadedPolicy) {
|
||||
@@ -217,7 +251,7 @@ export class SettingsManager {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await this.loadAllSettings();
|
||||
await this.load();
|
||||
if (!this.disposed) {
|
||||
this.onChange?.();
|
||||
}
|
||||
@@ -227,6 +261,29 @@ export class SettingsManager {
|
||||
}, 100);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves the settings with the policy tier that the session's CLI
|
||||
* reports, now (`current`, which the caller has just read) and at every
|
||||
* later load (`read`). `resolveSettings` in this process does not read the
|
||||
* remote managed settings that the CLI applies (SDK 0.3.333), and then
|
||||
* every value read here (the model, the effort, the bypass and auto mode
|
||||
* locks, the model allowlist) is the user's own instead of the policy's.
|
||||
* What the CLI reports is the tier that it applies, so it goes in as the
|
||||
* server-managed tier.
|
||||
*
|
||||
* `read` is asked again at each load and its last answer is not kept, so a
|
||||
* load after a settings file change resolves with the policy of that
|
||||
* moment. Without an answer the load resolves the settings of this process
|
||||
* alone.
|
||||
*/
|
||||
async followCliPolicy(read: CliPolicyReader, current: Settings | undefined): Promise<void> {
|
||||
if (this.disposed) return;
|
||||
this.readCliPolicy = read;
|
||||
// Nothing to resolve again: no policy to add, and none to take out.
|
||||
if (current === undefined && !this.cliPolicyApplied) return;
|
||||
await this.load(async () => current);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current merged settings
|
||||
*/
|
||||
|
||||
@@ -4,13 +4,9 @@
|
||||
*/
|
||||
import type { AvailableCommand } from "@agentclientprotocol/sdk/unstable";
|
||||
import type { Query, SlashCommand } from "@anthropic-ai/claude-agent-sdk";
|
||||
import { adapterAvailableCommands } from "./adapter-command.js";
|
||||
import { AIR_KIND_KEY, AIR_SKILL_PATH_KEY, withAirMeta } from "./air-extension.js";
|
||||
import { MCP_AVAILABLE_COMMAND } from "./mcp-command.js";
|
||||
import {
|
||||
claudeCodeOffersCommand,
|
||||
REMOTE_CONTROL_COMMAND_NAME,
|
||||
supportsRemoteControl,
|
||||
} from "./remote-control.js";
|
||||
import { resolveSkillPath, type SkillScanCache } from "./tool-calls/reporters/interaction.js";
|
||||
|
||||
export function getAvailableSlashCommands(
|
||||
@@ -29,6 +25,8 @@ export function getAvailableSlashCommands(
|
||||
// A listed skill gets its path from here; one that is not listed, or has no
|
||||
// path (remote connections), is looked up on disk.
|
||||
skillFiles?: ReadonlyMap<string, { path?: string }>,
|
||||
// A session that runs Claude Code remotely (`sdk-url`): the adapter cannot serve `/plugin` for it.
|
||||
remoteSession = false,
|
||||
): AvailableCommand[] {
|
||||
// The container listings of this one pass, so a list of a hundred commands lists each container once.
|
||||
const skillScans: SkillScanCache = new Map();
|
||||
@@ -51,18 +49,6 @@ export function getAvailableSlashCommands(
|
||||
"todos",
|
||||
];
|
||||
|
||||
const remoteControlCommands: AvailableCommand[] =
|
||||
query && supportsRemoteControl(query)
|
||||
? [
|
||||
{
|
||||
name: REMOTE_CONTROL_COMMAND_NAME,
|
||||
description:
|
||||
"Continue this session from claude.ai/code or the Claude mobile app; `off` disconnects",
|
||||
input: { hint: "[session name | off]" },
|
||||
},
|
||||
]
|
||||
: [];
|
||||
|
||||
// The adapter replaces the terminal text of `/mcp` and runs its actions,
|
||||
// even when Claude Code tags the command terminal-bound.
|
||||
const advertised = commands
|
||||
@@ -113,9 +99,7 @@ export function getAvailableSlashCommands(
|
||||
return [
|
||||
...advertised,
|
||||
MCP_AVAILABLE_COMMAND,
|
||||
...remoteControlCommands.filter(
|
||||
(command) => !claudeCodeOffersCommand(commands, terminalCommands, command.name),
|
||||
),
|
||||
...adapterAvailableCommands(commands, terminalCommands, query, { remoteSession }),
|
||||
].filter((command) => {
|
||||
if (/\s/.test(command.name) || names.has(command.name)) return false;
|
||||
names.add(command.name);
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import { RequestError } from "@agentclientprotocol/sdk/unstable";
|
||||
import type { SDKStartupFailureReason } from "@anthropic-ai/claude-agent-sdk";
|
||||
import type {
|
||||
SDKSettingsParseError,
|
||||
SDKStartupFailureReason,
|
||||
} from "@anthropic-ai/claude-agent-sdk";
|
||||
import { outdatedCliError } from "./claude-cli.js";
|
||||
|
||||
/** Makes the CLI write an `error_during_execution` result with a
|
||||
* `startup_failure_reason` before it exits on a known startup failure. Without
|
||||
@@ -22,8 +26,12 @@ const AUTH_REQUIRED_REASONS: ReadonlySet<SDKStartupFailureReason> = new Set([
|
||||
* carries no `startupFailureReason` (older CLIs, failures without a known
|
||||
* cause). The message is the CLI's own, which says what to fix, e.g.
|
||||
* `Invalid proxy URL in HTTPS_PROXY: … Fix or unset HTTPS_PROXY and restart
|
||||
* Claude Code.`; `data.startupFailureReason` carries the reason. */
|
||||
* Claude Code.`; `data.startupFailureReason` carries the reason. A CLI of
|
||||
* `CLAUDE_CODE_EXECUTABLE` that is too old gets the error of
|
||||
* `outdatedCliError`. */
|
||||
export function startupFailureError(error: unknown): RequestError | undefined {
|
||||
const outdated = outdatedCliError(error);
|
||||
if (outdated) return outdated;
|
||||
if (!(error instanceof Error)) return undefined;
|
||||
const reason = (error as { startupFailureReason?: unknown }).startupFailureReason;
|
||||
if (typeof reason !== "string" || reason === "") return undefined;
|
||||
@@ -48,3 +56,32 @@ export function startupFailureReasonOf(error: unknown): string | undefined {
|
||||
?.startupFailureReason;
|
||||
return typeof reason === "string" ? reason : undefined;
|
||||
}
|
||||
|
||||
/** Throws the ACP error for a session whose settings files the CLI skipped,
|
||||
* and does nothing for an empty list. A skipped file's permission rules,
|
||||
* sandbox and hooks do not apply, so the session does not start. E.g. `Claude Code
|
||||
* skipped the invalid settings file /home/u/.claude/settings.json (Invalid or
|
||||
* malformed JSON), so its permission rules, sandbox settings and hooks would
|
||||
* not apply. Fix the file and start the session again.` */
|
||||
export function rejectSkippedSettings(errors: SDKSettingsParseError[]): void {
|
||||
if (errors.length === 0) return;
|
||||
throw RequestError.internalError({ settingsErrors: errors }, invalidSettingsMessage(errors));
|
||||
}
|
||||
|
||||
function invalidSettingsMessage(errors: SDKSettingsParseError[]): string {
|
||||
const skipped = errors.map(describeSkippedFile).join("; ");
|
||||
if (errors.length === 1) {
|
||||
return `Claude Code skipped ${skipped}, so its permission rules, sandbox settings and hooks would not apply. Fix the file and start the session again.`;
|
||||
}
|
||||
return `Claude Code skipped ${skipped}, so their permission rules, sandbox settings and hooks would not apply. Fix the files and start the session again.`;
|
||||
}
|
||||
|
||||
/** E.g. `the invalid settings file /home/u/.claude/settings.json (permissions.deny: Expected array)`. */
|
||||
function describeSkippedFile(error: SDKSettingsParseError): string {
|
||||
const name =
|
||||
error.file === undefined
|
||||
? "an invalid settings file"
|
||||
: `the invalid settings file ${error.file}`;
|
||||
const detail = error.path === "" ? error.message : `${error.path}: ${error.message}`;
|
||||
return `${name} (${detail})`;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import { readdir, readFile } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import readline from "node:readline";
|
||||
import { isNativeSubagentControlTool, type HistoricalSubagent } from "./native-subagents.js";
|
||||
import { findTranscript } from "./resumed-session.js";
|
||||
import { findTranscript, readTranscriptEntries } from "./resumed-session.js";
|
||||
|
||||
/** What the metadata file of a subagent says about it. */
|
||||
export interface SubagentRecord {
|
||||
@@ -16,6 +16,7 @@ export interface SubagentRecord {
|
||||
agentId: string;
|
||||
/** The `name` that the Agent call gave it. */
|
||||
name?: string;
|
||||
parentAgentId?: string;
|
||||
/** Its role, the `subagent_type` of the Agent call. */
|
||||
agentType?: string;
|
||||
/** The short `description` of the Agent call. */
|
||||
@@ -40,6 +41,8 @@ export interface SubagentHistory {
|
||||
* it, the SDK reads a subagent transcript without a search of every project.
|
||||
*/
|
||||
dir?: string;
|
||||
/** The subagent folder next to the resolved root transcript. */
|
||||
directory?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,36 +55,42 @@ export interface SubagentHistory {
|
||||
* `inheritedWorktreePath` or `cwd`; then the child's working directory is the
|
||||
* `cwd` of its transcript's records. The ids are empty for a session without a local transcript.
|
||||
*/
|
||||
export async function subagentHistory(sessionId: string): Promise<SubagentHistory> {
|
||||
export async function subagentHistory(
|
||||
sessionId: string,
|
||||
options: { strict?: boolean; transcript?: string } = {},
|
||||
): Promise<SubagentHistory> {
|
||||
const agents = new Map<string, SubagentRecord>();
|
||||
const transcript = await findTranscript(sessionId);
|
||||
const transcript = options.transcript ?? (await findTranscript(sessionId));
|
||||
if (!transcript) return { agents };
|
||||
const directory = subagentsDirectory(transcript, sessionId);
|
||||
let names: string[];
|
||||
try {
|
||||
names = await readdir(directory);
|
||||
} catch {
|
||||
return { agents };
|
||||
} catch (error) {
|
||||
if (options.strict && !isMissing(error)) throw error;
|
||||
return { agents, directory };
|
||||
}
|
||||
await Promise.all(
|
||||
names.map(async (name) => {
|
||||
const match = /^agent-(.+)\.meta\.json$/.exec(name);
|
||||
if (!match) return;
|
||||
const file = path.join(directory, name);
|
||||
try {
|
||||
const meta = JSON.parse(await readFile(path.join(directory, name), "utf8")) as Record<
|
||||
string,
|
||||
unknown
|
||||
> | null;
|
||||
const meta = JSON.parse(await readFile(file, "utf8")) as Record<string, unknown> | null;
|
||||
if (typeof meta?.toolUseId !== "string") return;
|
||||
const text = (value: unknown) => (typeof value === "string" ? value : undefined);
|
||||
const placement = [meta.cwd, meta.worktreePath, meta.inheritedWorktreePath]
|
||||
.map(text)
|
||||
.find((value) => value && path.isAbsolute(value));
|
||||
const cwd = placement
|
||||
? ((await recordedCwd(path.join(directory, `agent-${match[1]!}.jsonl`))) ?? placement)
|
||||
? ((await recordedCwd(
|
||||
path.join(directory, `agent-${match[1]!}.jsonl`),
|
||||
options.strict,
|
||||
)) ?? placement)
|
||||
: undefined;
|
||||
agents.set(meta.toolUseId, {
|
||||
agentId: match[1]!,
|
||||
parentAgentId: text(meta.parentAgentId),
|
||||
name: text(meta.name),
|
||||
agentType: text(meta.agentType),
|
||||
description: text(meta.description),
|
||||
@@ -89,16 +98,17 @@ export async function subagentHistory(sessionId: string): Promise<SubagentHistor
|
||||
stoppedByUser: meta.stoppedByUser === true,
|
||||
...(cwd ? { cwd } : {}),
|
||||
});
|
||||
} catch {
|
||||
} catch (error) {
|
||||
if (options.strict) throw withPath(error, file);
|
||||
// A damaged meta file leaves its subagent without history.
|
||||
}
|
||||
}),
|
||||
);
|
||||
if (agents.size === 0) return { agents };
|
||||
if (options.strict || agents.size === 0) return { agents, directory };
|
||||
// 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 ? { agents, dir } : { agents };
|
||||
return dir ? { agents, dir, directory } : { agents, directory };
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -106,7 +116,7 @@ export async function subagentHistory(sessionId: string): Promise<SubagentHistor
|
||||
* undefined when the file cannot be read. Claude Code writes the working
|
||||
* directory of the session or subagent on each record.
|
||||
*/
|
||||
async function recordedCwd(file: string): Promise<string | undefined> {
|
||||
async function recordedCwd(file: string, strict = false): Promise<string | undefined> {
|
||||
const stream = createReadStream(file, { encoding: "utf8" });
|
||||
try {
|
||||
for await (const line of readline.createInterface({ input: stream, crlfDelay: Infinity })) {
|
||||
@@ -118,7 +128,8 @@ async function recordedCwd(file: string): Promise<string | undefined> {
|
||||
// A damaged record; a later one can have the `cwd`.
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
} catch (error) {
|
||||
if (strict && !isMissing(error)) throw withPath(error, file);
|
||||
// An unreadable transcript; the caller falls back to the metadata's path.
|
||||
} finally {
|
||||
stream.destroy();
|
||||
@@ -305,6 +316,47 @@ export async function readSubagentMessages(
|
||||
}
|
||||
}
|
||||
|
||||
/** Whether a filesystem error means a file does not exist. */
|
||||
function isMissing(error: unknown): boolean {
|
||||
return (error as { code?: unknown } | null)?.code === "ENOENT";
|
||||
}
|
||||
|
||||
/** Retain the failed file for the caller's retryable error. */
|
||||
function withPath(error: unknown, file: string): Error & { path: string } {
|
||||
if (error instanceof Error && typeof (error as { path?: unknown }).path === "string") {
|
||||
return error as Error & { path: string };
|
||||
}
|
||||
return Object.assign(new Error(`Failed to read ${file}`, { cause: error }), { path: file });
|
||||
}
|
||||
|
||||
/** Read a child from the resolved project without silently omitting read failures. */
|
||||
export async function readSubagentMessagesOrFail(
|
||||
sessionId: string,
|
||||
agentId: string,
|
||||
history: SubagentHistory,
|
||||
launchId: string,
|
||||
): Promise<SessionMessage[]> {
|
||||
if (!history.directory) throw new Error("Subagent directory was not resolved");
|
||||
const file = path.join(history.directory, `agent-${agentId}.jsonl`);
|
||||
try {
|
||||
const entries = await readTranscriptEntries(file);
|
||||
const sessionStore = { append: async () => {}, load: async () => entries };
|
||||
const messages = await getSubagentMessages(sessionId, agentId, { sessionStore });
|
||||
// The SDK reads these fields from agent-*.meta.json only with its filesystem store.
|
||||
const parent = history.agents.get(launchId)?.parentAgentId ?? null;
|
||||
return stripForkPrefix(
|
||||
messages.map((message) => ({
|
||||
...message,
|
||||
parent_tool_use_id: launchId,
|
||||
parent_agent_id: parent,
|
||||
})),
|
||||
);
|
||||
} catch (error) {
|
||||
if (isMissing(error)) return [];
|
||||
throw withPath(error, file);
|
||||
}
|
||||
}
|
||||
|
||||
/** How Claude Code opens the directive message of a `subagent_type: "fork"` child. */
|
||||
const FORK_BOILERPLATE_OPEN = "<fork-boilerplate>";
|
||||
/** What follows the boilerplate, right before the prompt of the Agent call. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"asyncTaskId":"workflow_3","canStop":true,"description":"Watch the logs","name":"Watch the logs","sessionUpdate":"async_task_spawned","showInTranscript":true,"taskType":"workflow","toolCallId":"toolu_workflow"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"asyncTaskId":"workflow_3","sessionUpdate":"async_task_progress","summary":"first line","usage":{"durationMs":5,"toolUses":0,"totalTokens":0}}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"asyncTaskId":"workflow_3","sessionUpdate":"async_task_progress","summary":"second line","usage":{"durationMs":6,"toolUses":0,"totalTokens":0}}}}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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"}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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"}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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"}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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"}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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"}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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"}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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"}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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}}}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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"}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"_claude/model":"claude-sonnet-4-6"},"sessionUpdate":"usage_update","size":200000,"used":2}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"_meta":{"claudeCode":{"toolName":"mcp__docs__search"},"is_mcp_tool_call":true,"jetbrains":{"air":{"mcp":{"server":"docs","tool":"search"},"version":1}}},"content":[],"kind":"other","name":"mcp__docs__search","sessionUpdate":"tool_call","status":"pending","title":"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}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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":"sessionUpdate","payload":{"sessionId":"<session>","update":{"sessionUpdate":"tool_call_update","status":"completed","toolCallId":"toolu_net"}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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"}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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"}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"initialize","payload":{"_meta":{"jetbrains":{"air":{"capabilities":["sessionFailure","agentFileChangeReport","nativeSubagentSessions","asyncTasks","customInstructions","recommendedValue","diffPatch","planFile","backgroundSubagents"],"goal":{"actions":["set","clear"],"controlMethod":"_session/goal","version":1},"version":1}},"steering":{"supported":true}},"agentCapabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"logout":{},"status":{}},"loadSession":true,"mcpCapabilities":{"acp":true,"http":true,"sse":true},"promptCapabilities":{"embeddedContext":true,"image":true},"providers":{},"sessionCapabilities":{"additionalDirectories":{},"close":{},"delete":{},"fork":{},"list":{},"options":{},"resume":{},"status":{},"subagents":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"agentInfo":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"authMethods":[],"protocolVersion":1}}
|
||||
{"kind":"initialize","payload":{"_meta":{"jetbrains":{"air":{"capabilities":["sessionFailure","agentFileChangeReport","nativeSubagentSessions","asyncTasks","customInstructions","recommendedValue","diffPatch","planFile","backgroundSubagents"],"goal":{"actions":["set","clear"],"controlMethod":"_session/goal","version":1},"version":1}},"sessionRead":{"supported":true},"steering":{"supported":true}},"agentCapabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"logout":{},"status":{}},"loadSession":true,"mcpCapabilities":{"acp":true,"http":true,"sse":true},"promptCapabilities":{"embeddedContext":true,"image":true},"providers":{},"sessionCapabilities":{"additionalDirectories":{},"close":{},"delete":{},"fork":{},"list":{},"options":{},"resume":{},"status":{},"subagents":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"agentInfo":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"authMethods":[],"protocolVersion":1}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":{"text":"Fix the bug","type":"text"},"messageId":"00000000-0000-4000-8000-00000000c001","sessionUpdate":"user_message_chunk"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":{"text":"Check the file.","type":"text"},"messageId":"msg_r1","sessionUpdate":"agent_thought_chunk"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"content":{"text":"I will edit it.","type":"text"},"messageId":"msg_r1","sessionUpdate":"agent_message_chunk"}}}
|
||||
@@ -14,4 +14,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"sessionUpdate":"subagent_state_update","state":"completed","subagentSessionId":"<session>:replay-subagent:toolu_r_task"}}}
|
||||
{"kind":"loadSession","payload":{"configOptions":[{"category":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","id":"model","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","currentValue":"auto","description":"Session permission mode","id":"mode","name":"Mode","options":[{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Always ask before making changes","name":"Manual","value":"default"},{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"_meta":{"jetbrains":{"air":{"kind":"plan","version":1}}},"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"_meta":{"jetbrains":{"air":{"kind":"auto_review","version":1}}},"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"_meta":{"jetbrains":{"air":{"kind":"full_access","version":1}}},"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"modes":{"availableModes":[{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Always ask before making changes","id":"default","name":"Manual"},{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Automatically accept all file edits","id":"acceptEdits","name":"Accept edits"},{"_meta":{"jetbrains":{"air":{"kind":"plan","version":1}}},"description":"Create a plan before making changes","id":"plan","name":"Plan"},{"_meta":{"jetbrains":{"air":{"kind":"auto_review","version":1}}},"description":"Claude handles permission decisions","id":"auto","name":"Auto"},{"_meta":{"jetbrains":{"air":{"kind":"full_access","version":1}}},"description":"Accepts all permissions","id":"bypassPermissions","name":"Bypass permissions"}],"currentModeId":"auto"},"sessionId":"<session>"}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>:replay-subagent:toolu_r_task","update":{"configOptions":[{"category":"model","currentValue":"claude-sonnet-4-6","id":"model","name":"Model","options":[{"name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"}],"sessionUpdate":"config_option_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{"kind":"initialize","payload":{"_meta":{"jetbrains":{"air":{"capabilities":["sessionFailure","agentFileChangeReport","nativeSubagentSessions","asyncTasks","customInstructions","recommendedValue","diffPatch","planFile","backgroundSubagents"],"goal":{"actions":["set","clear"],"controlMethod":"_session/goal","version":1},"version":1}},"steering":{"supported":true}},"agentCapabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"logout":{},"status":{}},"loadSession":true,"mcpCapabilities":{"acp":true,"http":true,"sse":true},"promptCapabilities":{"embeddedContext":true,"image":true},"providers":{},"sessionCapabilities":{"additionalDirectories":{},"close":{},"delete":{},"fork":{},"list":{},"options":{},"resume":{},"status":{},"subagents":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"agentInfo":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"authMethods":[],"protocolVersion":1}}
|
||||
{"kind":"initialize","payload":{"_meta":{"jetbrains":{"air":{"capabilities":["sessionFailure","agentFileChangeReport","nativeSubagentSessions","asyncTasks","customInstructions","recommendedValue","diffPatch","planFile","backgroundSubagents"],"goal":{"actions":["set","clear"],"controlMethod":"_session/goal","version":1},"version":1}},"sessionRead":{"supported":true},"steering":{"supported":true}},"agentCapabilities":{"_meta":{"authStatus":{},"claudeCode":{"promptQueueing":true}},"auth":{"logout":{},"status":{}},"loadSession":true,"mcpCapabilities":{"acp":true,"http":true,"sse":true},"promptCapabilities":{"embeddedContext":true,"image":true},"providers":{},"sessionCapabilities":{"additionalDirectories":{},"close":{},"delete":{},"fork":{},"list":{},"options":{},"resume":{},"status":{},"subagents":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"agentInfo":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"authMethods":[],"protocolVersion":1}}
|
||||
{"kind":"newSession","payload":{"configOptions":[{"category":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","id":"model","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","currentValue":"auto","description":"Session permission mode","id":"mode","name":"Mode","options":[{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Always ask before making changes","name":"Manual","value":"default"},{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"_meta":{"jetbrains":{"air":{"kind":"plan","version":1}}},"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"_meta":{"jetbrains":{"air":{"kind":"auto_review","version":1}}},"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"_meta":{"jetbrains":{"air":{"kind":"full_access","version":1}}},"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"modes":{"availableModes":[{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Always ask before making changes","id":"default","name":"Manual"},{"_meta":{"jetbrains":{"air":{"kind":"standard","version":1}}},"description":"Automatically accept all file edits","id":"acceptEdits","name":"Accept edits"},{"_meta":{"jetbrains":{"air":{"kind":"plan","version":1}}},"description":"Create a plan before making changes","id":"plan","name":"Plan"},{"_meta":{"jetbrains":{"air":{"kind":"auto_review","version":1}}},"description":"Claude handles permission decisions","id":"auto","name":"Auto"},{"_meta":{"jetbrains":{"air":{"kind":"full_access","version":1}}},"description":"Accepts all permissions","id":"bypassPermissions","name":"Bypass permissions"}],"currentModeId":"auto"},"sessionId":"<session>"}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"sessionUpdate":"available_commands_update"}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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":"Background review","prompt":"Review the diff","sessionUpdate":"subagent_spawned","subagentSessionId":"a2","task":"Review the diff"}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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"}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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"}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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"}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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"}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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"}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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"}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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"}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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"}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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":"WebFetch"}},"content":[],"kind":"fetch","name":"WebFetch","sessionUpdate":"tool_call","status":"pending","title":"Fetch","toolCallId":"toolu_fetch"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"sessionUpdate":"tool_call_update","title":"Fetch https://example.com","toolCallId":"toolu_fetch"}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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":"Write"}},"content":[],"kind":"edit","locations":[],"name":"Write","sessionUpdate":"tool_call","status":"pending","title":"Preparing file…","toolCallId":"toolu_write"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"locations":[{"path":"<cwd>/old.ts"}],"sessionUpdate":"tool_call_update","title":"Write old.ts","toolCallId":"toolu_write"}}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"}],"sessionUpdate":"available_commands_update"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]"},"name":"mcp"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …"},"name":"plugin"}],"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":"Write"}},"content":[],"kind":"edit","locations":[],"name":"Write","sessionUpdate":"tool_call","status":"pending","title":"Preparing file…","toolCallId":"toolu_write"}}}
|
||||
{"kind":"sessionUpdate","payload":{"sessionId":"<session>","update":{"locations":[{"path":"<cwd>/new.ts"}],"sessionUpdate":"tool_call_update","title":"Write new.ts","toolCallId":"toolu_write"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"_meta":{"sessionRead":{"supported":true}},"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …","type":"text"},"name":"plugin","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"_meta":{"sessionRead":{"supported":true}},"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …","type":"text"},"name":"plugin","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"_meta":{"sessionRead":{"supported":true}},"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …","type":"text"},"name":"plugin","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"_meta":{"sessionRead":{"supported":true}},"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …","type":"text"},"name":"plugin","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"_meta":{"sessionRead":{"supported":true}},"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …","type":"text"},"name":"plugin","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"_meta":{"sessionRead":{"supported":true}},"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …","type":"text"},"name":"plugin","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"_meta":{"sessionRead":{"supported":true}},"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …","type":"text"},"name":"plugin","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"_meta":{"sessionRead":{"supported":true}},"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …","type":"text"},"name":"plugin","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"_meta":{"sessionRead":{"supported":true}},"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …","type":"text"},"name":"plugin","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"_meta":{"sessionRead":{"supported":true}},"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …","type":"text"},"name":"plugin","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"_meta":{"sessionRead":{"supported":true}},"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …","type":"text"},"name":"plugin","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"_meta":{"sessionRead":{"supported":true}},"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …","type":"text"},"name":"plugin","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"_meta":{"sessionRead":{"supported":true}},"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …","type":"text"},"name":"plugin","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"_meta":{"sessionRead":{"supported":true}},"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …","type":"text"},"name":"plugin","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"_meta":{"sessionRead":{"supported":true}},"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …","type":"text"},"name":"plugin","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"/goal Ship the feature","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"_meta":{"sessionRead":{"supported":true}},"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …","type":"text"},"name":"plugin","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"_meta":{"sessionRead":{"supported":true}},"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …","type":"text"},"name":"plugin","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"_meta":{"sessionRead":{"supported":true}},"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …","type":"text"},"name":"plugin","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"_meta":{"sessionRead":{"supported":true}},"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …","type":"text"},"name":"plugin","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"_meta":{"sessionRead":{"supported":true}},"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …","type":"text"},"name":"plugin","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{"kind":"response","method":"initialize","payload":{"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"response","method":"initialize","payload":{"_meta":{"sessionRead":{"supported":true}},"authMethods":[],"capabilities":{"_meta":{"authStatus":{}},"auth":{"status":{}},"providers":{},"session":{"additionalDirectories":{},"delete":{},"fork":{},"mcp":{"acp":{},"http":{},"stdio":{}},"options":{},"prompt":{"embeddedContext":{},"image":{}},"status":{},"systemPrompt":{"mode":{"override":{}}},"title":{}}},"info":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"<version>"},"protocolVersion":2}}
|
||||
{"kind":"response","method":"session/new","payload":{"availableCommands":[{"description":"Show the MCP servers and their status, or reconnect, enable, or disable a server","input":{"hint":"[reconnect|enable|disable [<server>|all]]","type":"text"},"name":"mcp","type":"command"},{"description":"Manage Claude Code plugins and marketplaces","input":{"hint":"[install|uninstall|enable|disable|update|list|marketplace …] …","type":"text"},"name":"plugin","type":"command"}],"configOptions":[{"category":"model","configId":"model","currentValue":"claude-sonnet-4-6","description":"AI model to use","name":"Model","options":[{"description":"Fast","name":"Claude Sonnet 4.6","value":"claude-sonnet-4-6"}],"type":"select"},{"category":"mode","configId":"mode","currentValue":"auto","description":"Session permission mode","name":"Mode","options":[{"description":"Always ask before making changes","name":"Manual","value":"default"},{"description":"Automatically accept all file edits","name":"Accept edits","value":"acceptEdits"},{"description":"Create a plan before making changes","name":"Plan","value":"plan"},{"description":"Claude handles permission decisions","name":"Auto","value":"auto"},{"description":"Accepts all permissions","name":"Bypass permissions","value":"bypassPermissions"}],"type":"select"}],"sessionId":"<session>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"content":[{"text":"prompt 1","type":"text"}],"messageId":"<id-1>","sessionUpdate":"user_message"}}}
|
||||
{"kind":"response","method":"session/prompt","payload":{"messageId":"<id-1>"}}
|
||||
{"kind":"notification","method":"session/update","payload":{"sessionId":"<session>","update":{"background":[],"sessionUpdate":"state_update","state":"running"}}}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user