JSON-RPC on stdio with permission requests, hx/step|message|interrupt|compact in and hx/step_result|intent|edit|usage|decision|plan out. Sessions persist by id. Limits are soft: a limit stop is blocked with reason "limit" and no catch; catch is only a validated name from the step's catches list. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
16 lines
857 B
Bash
Executable File
16 lines
857 B
Bash
Executable File
#!/bin/sh
|
|
# ACP e2e: `hx serve --acp` driven by a fake orchestrator (tests/acp_client.py) against a fake Anthropic API:
|
|
# permission requests, hx/edit|usage|intent|decision|plan|step_result, limits, hx/message, session continuation.
|
|
set -eu
|
|
root=$(cd "$(dirname "$0")/.." && pwd)
|
|
tmp=$(mktemp -d)
|
|
trap 'kill $srv 2>/dev/null; rm -rf "$tmp"' EXIT
|
|
port=$((20000 + $$ % 20000))
|
|
python3 "$root/tests/fake_anthropic.py" $port "$root/tests/acp_turns.json" & srv=$!
|
|
mkdir -p "$tmp/home/.hx" "$tmp/repo"
|
|
echo '{"claude":{"access":"fake-token","refresh":"r","expires":99999999999999}}' > "$tmp/home/.hx/auth.json"
|
|
printf 'claude_cli = false\n[lsp]\nmode = "off"\ntests = "off"\n' > "$tmp/home/.hx/config.toml"
|
|
sleep 0.5
|
|
export HOME="$tmp/home" HX_BASE_URL="http://127.0.0.1:$port"
|
|
python3 "$root/tests/acp_client.py" "$root/target/debug/hx" "$tmp/repo" demo-1 $port
|