a2acode 0.7.1__tar.gz → 0.9.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {a2acode-0.7.1 → a2acode-0.9.0}/PKG-INFO +33 -32
- {a2acode-0.7.1 → a2acode-0.9.0}/README.md +31 -30
- {a2acode-0.7.1 → a2acode-0.9.0}/pyproject.toml +4 -4
- {a2acode-0.7.1 → a2acode-0.9.0}/pyproject.toml.orig +4 -4
- {a2acode-0.7.1 → a2acode-0.9.0}/src/a2acode/card.py +11 -12
- {a2acode-0.7.1 → a2acode-0.9.0}/src/a2acode/__init__.py +0 -0
- {a2acode-0.7.1 → a2acode-0.9.0}/src/a2acode/auth.py +0 -0
- {a2acode-0.7.1 → a2acode-0.9.0}/src/a2acode/backends/__init__.py +0 -0
- {a2acode-0.7.1 → a2acode-0.9.0}/src/a2acode/backends/acp.py +0 -0
- {a2acode-0.7.1 → a2acode-0.9.0}/src/a2acode/backends/attach.py +0 -0
- {a2acode-0.7.1 → a2acode-0.9.0}/src/a2acode/backends/base.py +0 -0
- {a2acode-0.7.1 → a2acode-0.9.0}/src/a2acode/backends/claude.py +0 -0
- {a2acode-0.7.1 → a2acode-0.9.0}/src/a2acode/backends/diff.py +0 -0
- {a2acode-0.7.1 → a2acode-0.9.0}/src/a2acode/backends/echo.py +0 -0
- {a2acode-0.7.1 → a2acode-0.9.0}/src/a2acode/backends/session.py +0 -0
- {a2acode-0.7.1 → a2acode-0.9.0}/src/a2acode/backends/terminal.py +0 -0
- {a2acode-0.7.1 → a2acode-0.9.0}/src/a2acode/cli.py +0 -0
- {a2acode-0.7.1 → a2acode-0.9.0}/src/a2acode/executor.py +0 -0
- {a2acode-0.7.1 → a2acode-0.9.0}/src/a2acode/py.typed +0 -0
- {a2acode-0.7.1 → a2acode-0.9.0}/src/a2acode/server.py +0 -0
- {a2acode-0.7.1 → a2acode-0.9.0}/src/a2acode/tracing.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: a2acode
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.9.0
|
|
4
4
|
Summary: Serve Claude Code and other ACP coding agents over the A2A protocol.
|
|
5
5
|
Keywords: a2a,acp,claude-code,agent,agent2agent
|
|
6
6
|
Author: kanywst
|
|
@@ -14,7 +14,7 @@ Requires-Dist: claude-agent-sdk>=0.2.101 ; extra == 'claude'
|
|
|
14
14
|
Requires-Dist: a2a-sdk[sqlite]>=1.1,<2 ; extra == 'persistence'
|
|
15
15
|
Requires-Dist: a2a-sdk[telemetry]>=1.1,<2 ; extra == 'telemetry'
|
|
16
16
|
Requires-Dist: opentelemetry-api>=1.33 ; extra == 'telemetry'
|
|
17
|
-
Requires-Python: >=3.
|
|
17
|
+
Requires-Python: >=3.11
|
|
18
18
|
Project-URL: Repository, https://github.com/kanywst/a2acode
|
|
19
19
|
Provides-Extra: claude
|
|
20
20
|
Provides-Extra: persistence
|
|
@@ -25,15 +25,22 @@ Description-Content-Type: text/markdown
|
|
|
25
25
|
|
|
26
26
|
# a2acode
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
Put Claude Code, Codex, Gemini CLI — any coding agent that speaks Zed's [Agent Client Protocol](https://agentclientprotocol.com) (ACP) — behind the [A2A](https://a2aprotocol.ai/) protocol, and keep what most adapters throw away: the tools it runs, the diffs it writes, the approvals it needs, and what it costs. Other agents discover it through its agent card, delegate coding work, and get the run streamed back as it happens — with every permission prompt routed to the caller as an A2A `input-required` pause.
|
|
29
29
|
|
|
30
30
|
[](https://github.com/kanywst/a2acode/actions/workflows/ci.yml)
|
|
31
31
|
[](LICENSE)
|
|
32
|
-
[](https://www.python.org/)
|
|
33
33
|
[](https://a2aprotocol.ai/)
|
|
34
34
|
|
|
35
35
|

|
|
36
36
|
|
|
37
|
+
Try it in ten seconds, no clone and no API key (the `echo` backend mirrors the prompt):
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
uvx a2acode serve --backend echo &
|
|
41
|
+
uvx a2acode call "fix the failing test"
|
|
42
|
+
```
|
|
43
|
+
|
|
37
44
|
Most adapters that put a coding agent behind A2A flatten everything to text in, text out. a2acode keeps the structure the agent produces: the tools it runs, the files it changes, what it costs, the approvals it needs, and how to continue on the next turn. It bridges two Linux Foundation interop standards — **ACP** (how editors and clients talk to coding agents) on the agent side, **A2A** (how agents delegate to each other) on the caller side — so any ACP agent becomes a peer any A2A orchestrator can call.
|
|
38
45
|
|
|
39
46
|
## How it maps to A2A
|
|
@@ -66,7 +73,7 @@ ACP already standardizes the editor↔agent side and a dozen agents speak it; a2
|
|
|
66
73
|
|
|
67
74
|
## Requirements
|
|
68
75
|
|
|
69
|
-
- Python 3.
|
|
76
|
+
- Python 3.11+
|
|
70
77
|
- [uv](https://docs.astral.sh/uv/)
|
|
71
78
|
- An ACP agent adapter for the `acp` backend, launched as a subprocess. Every preset launches one with `npx`, so Node is the only prerequisite besides that agent's own credential:
|
|
72
79
|
|
|
@@ -82,18 +89,12 @@ Or point `--agent-command` at any other ACP agent.
|
|
|
82
89
|
|
|
83
90
|
## Quick start
|
|
84
91
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
uv sync
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
The `echo` backend needs no API key and no Claude install, so you can exercise the whole path offline first:
|
|
92
|
+
a2acode is on PyPI, so [`uvx`](https://docs.astral.sh/uv/guides/tools/) runs it without a clone or an install step (`uv tool install a2acode` or `pipx install a2acode` keep it around). The `echo` backend needs no API key and no Claude install, so you can exercise the whole path offline first:
|
|
92
93
|
|
|
93
94
|
```bash
|
|
94
|
-
|
|
95
|
+
uvx a2acode serve --backend echo &
|
|
95
96
|
# once the "Uvicorn running" line appears:
|
|
96
|
-
|
|
97
|
+
uvx a2acode call "fix the failing test"
|
|
97
98
|
```
|
|
98
99
|
|
|
99
100
|
```text
|
|
@@ -101,6 +102,7 @@ task 189b1c63-1a7b-4908-87c4-c8f3bba8f6b5
|
|
|
101
102
|
context 0b2a901e-2b6f-4c56-bba2-d0da546936e9
|
|
102
103
|
|
|
103
104
|
· Echo
|
|
105
|
+
· ✓ Echo
|
|
104
106
|
fix the failing test
|
|
105
107
|
[completed] $0.0 · 1 turns
|
|
106
108
|
```
|
|
@@ -108,21 +110,21 @@ fix the failing test
|
|
|
108
110
|
Then point it at a real project. The default backend is `acp`, fronting Claude Code through its ACP adapter:
|
|
109
111
|
|
|
110
112
|
```bash
|
|
111
|
-
|
|
112
|
-
|
|
113
|
+
uvx a2acode serve --cwd /path/to/project # acp + claude by default
|
|
114
|
+
uvx a2acode call "add a /health endpoint" --url http://localhost:9100/
|
|
113
115
|
```
|
|
114
116
|
|
|
115
117
|
Swap the agent without touching anything else:
|
|
116
118
|
|
|
117
119
|
```bash
|
|
118
|
-
|
|
119
|
-
|
|
120
|
+
uvx a2acode serve --agent gemini --cwd /path/to/project
|
|
121
|
+
uvx a2acode serve --agent-command "npx -y some-other-acp-agent"
|
|
120
122
|
```
|
|
121
123
|
|
|
122
124
|
Continue the same conversation by passing the `context` from a previous turn:
|
|
123
125
|
|
|
124
126
|
```bash
|
|
125
|
-
|
|
127
|
+
uvx a2acode call "now add a test for it" --context <context-id>
|
|
126
128
|
```
|
|
127
129
|
|
|
128
130
|
Continuity needs the agent to support ACP's `session/load`. When it does not, the turn still runs, but on a fresh session — and the task says so in a status update rather than answering as if it remembered.
|
|
@@ -131,7 +133,7 @@ Continuity needs the agent to support ACP's `session/load`. When it does not, th
|
|
|
131
133
|
|
|
132
134
|
Every release publishes a `linux/amd64` and `linux/arm64` image to GHCR, holding the same wheel as the PyPI release with all three extras installed — so which backend and which task store it runs is a flag, not a rebuild. It runs as a non-root user and works in your project by way of whatever you mount over `/workspace`.
|
|
133
135
|
|
|
134
|
-
A container has to listen on every interface to be reachable at all, so the default command binds `0.0.0.0` where the `
|
|
136
|
+
A container has to listen on every interface to be reachable at all, so the default command binds `0.0.0.0` where the `uvx` quick start binds loopback. That makes *where you publish the port* the boundary: whoever reaches it can run a coding agent in your workspace. Publish it to your own loopback while you try it out —
|
|
135
137
|
|
|
136
138
|
```bash
|
|
137
139
|
docker run --rm -p 127.0.0.1:9100:9100 \
|
|
@@ -175,7 +177,7 @@ An A2A message is not only text. A caller can attach the failing log, the patch
|
|
|
175
177
|
A backend turns a prompt into a stream of normalized events. Three ship today:
|
|
176
178
|
|
|
177
179
|
- `acp` (default): drives any agent that speaks Zed's Agent Client Protocol as a subprocess. `--agent claude|gemini|codex` selects a launch preset; `--agent-command` drives any other ACP agent. This is the vendor-neutral path. The subprocess is kept alive per conversation, so a follow-up turn skips the process launch, the ACP handshake, and the session reload and talks straight to the agent that already holds the conversation.
|
|
178
|
-
- `claude`: drives Claude Code directly through the Claude Agent SDK, no subprocess. Install with `uv sync --extra claude
|
|
180
|
+
- `claude`: drives Claude Code directly through the Claude Agent SDK, no subprocess. Install with `uv tool install 'a2acode[claude]'` (or `uv sync --extra claude` from a clone). Use it when you want the SDK-native path (e.g. `--max-budget-usd`) rather than ACP.
|
|
179
181
|
- `echo`: no dependencies, mirrors the input. For wiring checks and tests.
|
|
180
182
|
|
|
181
183
|
The split keeps the A2A layer independent of how the agent is invoked: backends emit normalized events and never import `a2a.*`; the executor maps those events onto the protocol and never imports an agent SDK. Adding a backend never touches the server or the protocol mapping.
|
|
@@ -189,7 +191,7 @@ Each agent authenticates the way its own tooling does, inherited from the server
|
|
|
189
191
|
A caller that discovers this server only has the agent card to go on. Sign it so the caller can confirm the card came from you and was not swapped in transit:
|
|
190
192
|
|
|
191
193
|
```bash
|
|
192
|
-
|
|
194
|
+
uvx a2acode serve --sign-key card-signing.pem --sign-kid my-key-1 --sign-alg ES256
|
|
193
195
|
```
|
|
194
196
|
|
|
195
197
|
The card is then served with a JWS signature over its canonical form. `--sign-key` is a path to a file holding the key: a PEM private key for asymmetric algorithms (`ES256`, `RS256`), or a shared secret for `HS256`. `--sign-kid` is the key id a verifier uses to look up the matching public key. Unsigned is still the default.
|
|
@@ -199,7 +201,7 @@ The card is then served with a JWS signature over its canonical form. `--sign-ke
|
|
|
199
201
|
A signed card proves who the server is; this proves the caller is allowed in. Require a bearer token and the server rejects any task request that does not carry it:
|
|
200
202
|
|
|
201
203
|
```bash
|
|
202
|
-
|
|
204
|
+
uvx a2acode serve --auth-token-file caller-token.txt
|
|
203
205
|
```
|
|
204
206
|
|
|
205
207
|
When `--auth-token-file` is set, callers must send `Authorization: Bearer <token>`; a request without a valid token gets `401 Unauthorized`. The agent card stays public so a caller can still fetch it to discover the requirement, and the card advertises the bearer scheme in `securitySchemes`. Without the flag the server stays open, as before.
|
|
@@ -211,10 +213,10 @@ A2A keeps the credential at the HTTP layer, so this composes with whatever your
|
|
|
211
213
|
A tool that needs approval pauses the task in the A2A `input-required` state instead of being skipped. The caller answers with a follow-up message on the same task:
|
|
212
214
|
|
|
213
215
|
```bash
|
|
214
|
-
|
|
216
|
+
uvx a2acode call "sudo reboot"
|
|
215
217
|
# ... [input-required] Permission requested for Bash: $ sudo reboot
|
|
216
218
|
# reply: a2acode call "allow" --task <id> --context <id> --request <id>
|
|
217
|
-
|
|
219
|
+
uvx a2acode call "allow" --task <id> --context <id> --request <id>
|
|
218
220
|
```
|
|
219
221
|
|
|
220
222
|
An answer of `allow`, `yes`, `y`, `ok`, `approve`, `accept`, or `grant` — the whole answer, nothing around it — approves. Anything else denies, which is what makes it safe to answer in prose. The agent session stays alive across the pause, so it resumes exactly where it stopped. Over ACP this is the agent's `session/request_permission` call answered from the A2A caller's reply; with the `claude` backend it routes through the Claude SDK's `can_use_tool`.
|
|
@@ -226,12 +228,12 @@ Some gates are not yes/no. Claude Code's end-of-plan gate offers three choices
|
|
|
226
228
|
Not every gate is a request to act. When Claude has a clarifying question it calls `AskUserQuestion`, which asks and does nothing else, so approving it says nothing on its own — the answer is the outcome. The pause carries the questions and their choices, and the reply's metadata carries what was picked, keyed by question:
|
|
227
229
|
|
|
228
230
|
```bash
|
|
229
|
-
|
|
231
|
+
uvx a2acode call "port the tests" --url http://localhost:9100/
|
|
230
232
|
# ... [input-required] Permission requested for AskUserQuestion: ...
|
|
231
233
|
# Which test runner? [Runner]
|
|
232
234
|
# pytest: what the repo uses
|
|
233
235
|
# unittest: stdlib only
|
|
234
|
-
|
|
236
|
+
uvx a2acode call "allow" --task <id> --context <id> --request <id> \
|
|
235
237
|
--answer "Which test runner?=pytest"
|
|
236
238
|
```
|
|
237
239
|
|
|
@@ -252,8 +254,7 @@ The agent card advertises push notifications. A caller can register a webhook fo
|
|
|
252
254
|
Tasks live in memory by default, so a restart loses their history and any webhook registrations. Point `--task-db` at a database to keep them:
|
|
253
255
|
|
|
254
256
|
```bash
|
|
255
|
-
|
|
256
|
-
uv run a2acode serve --task-db "sqlite+aiosqlite:///a2acode.db"
|
|
257
|
+
uvx --from 'a2acode[persistence]' a2acode serve --task-db "sqlite+aiosqlite:///a2acode.db"
|
|
257
258
|
```
|
|
258
259
|
|
|
259
260
|
Any SQLAlchemy async DSN works; the extra ships the SQLite driver because it needs no server. What survives is task history, artifacts, and push registrations — **not** a live agent session, which is a process and dies with the server either way, so a task paused on a permission cannot be answered after a restart.
|
|
@@ -263,7 +264,7 @@ Any SQLAlchemy async DSN works; the extra ships the SQLite driver because it nee
|
|
|
263
264
|
Debugging one agent is hard; debugging a chain of them without traces is worse. Because A2A runs over HTTP, it drops straight into OpenTelemetry: install the extra and the A2A SDK's instrumentation plus a per-task `a2acode.execute` span light up, with W3C trace context propagating across the call so client and server spans share one trace.
|
|
264
265
|
|
|
265
266
|
```bash
|
|
266
|
-
uv sync --extra telemetry
|
|
267
|
+
uv tool install 'a2acode[telemetry]' # or: uv sync --extra telemetry
|
|
267
268
|
```
|
|
268
269
|
|
|
269
270
|
Tracing is off unless OpenTelemetry is installed, and you configure the exporter the standard way (e.g. `OTEL_EXPORTER_OTLP_ENDPOINT`, or run under `opentelemetry-instrument`). It works against an on-prem or air-gapped collector, so traces never have to leave your network.
|
|
@@ -278,7 +279,7 @@ uv run mypy
|
|
|
278
279
|
uv run pytest
|
|
279
280
|
```
|
|
280
281
|
|
|
281
|
-
CI runs these on Python 3.
|
|
282
|
+
CI runs these on Python 3.11 through 3.14, plus a Markdown lint, on every push and pull request.
|
|
282
283
|
|
|
283
284
|
## Releasing
|
|
284
285
|
|
|
@@ -294,7 +295,7 @@ git push origin main vX.Y.Z
|
|
|
294
295
|
|
|
295
296
|
## Status
|
|
296
297
|
|
|
297
|
-
The mapping is complete end to end and verified against real Claude: text round trip, tool calls and their outcomes, the agent's plan, streaming artifacts, file diffs as artifacts, caller attachments, run metadata, session continuity, the permission-to-`input-required` round trip, answering the agent's clarifying questions, and push notifications. The offline `echo` backend covers every path including permissions and attachments, so it can all be exercised without an API key.
|
|
298
|
+
The mapping is complete end to end and verified against real Claude: text round trip, tool calls and their outcomes, the agent's plan, streaming artifacts, file diffs as artifacts, caller attachments, run metadata, session continuity, the permission-to-`input-required` round trip, answering the agent's clarifying questions, and push notifications. The server speaks A2A 1.0 and still serves v0.3 clients — the card lists both versions on the same endpoints, so a client built on a v0.3 SDK can discover it and run a task. The offline `echo` backend covers every path including permissions and attachments, so it can all be exercised without an API key.
|
|
298
299
|
|
|
299
300
|
## License
|
|
300
301
|
|
|
@@ -2,15 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
# a2acode
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Put Claude Code, Codex, Gemini CLI — any coding agent that speaks Zed's [Agent Client Protocol](https://agentclientprotocol.com) (ACP) — behind the [A2A](https://a2aprotocol.ai/) protocol, and keep what most adapters throw away: the tools it runs, the diffs it writes, the approvals it needs, and what it costs. Other agents discover it through its agent card, delegate coding work, and get the run streamed back as it happens — with every permission prompt routed to the caller as an A2A `input-required` pause.
|
|
6
6
|
|
|
7
7
|
[](https://github.com/kanywst/a2acode/actions/workflows/ci.yml)
|
|
8
8
|
[](LICENSE)
|
|
9
|
-
[](https://www.python.org/)
|
|
10
10
|
[](https://a2aprotocol.ai/)
|
|
11
11
|
|
|
12
12
|

|
|
13
13
|
|
|
14
|
+
Try it in ten seconds, no clone and no API key (the `echo` backend mirrors the prompt):
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
uvx a2acode serve --backend echo &
|
|
18
|
+
uvx a2acode call "fix the failing test"
|
|
19
|
+
```
|
|
20
|
+
|
|
14
21
|
Most adapters that put a coding agent behind A2A flatten everything to text in, text out. a2acode keeps the structure the agent produces: the tools it runs, the files it changes, what it costs, the approvals it needs, and how to continue on the next turn. It bridges two Linux Foundation interop standards — **ACP** (how editors and clients talk to coding agents) on the agent side, **A2A** (how agents delegate to each other) on the caller side — so any ACP agent becomes a peer any A2A orchestrator can call.
|
|
15
22
|
|
|
16
23
|
## How it maps to A2A
|
|
@@ -43,7 +50,7 @@ ACP already standardizes the editor↔agent side and a dozen agents speak it; a2
|
|
|
43
50
|
|
|
44
51
|
## Requirements
|
|
45
52
|
|
|
46
|
-
- Python 3.
|
|
53
|
+
- Python 3.11+
|
|
47
54
|
- [uv](https://docs.astral.sh/uv/)
|
|
48
55
|
- An ACP agent adapter for the `acp` backend, launched as a subprocess. Every preset launches one with `npx`, so Node is the only prerequisite besides that agent's own credential:
|
|
49
56
|
|
|
@@ -59,18 +66,12 @@ Or point `--agent-command` at any other ACP agent.
|
|
|
59
66
|
|
|
60
67
|
## Quick start
|
|
61
68
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
uv sync
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
The `echo` backend needs no API key and no Claude install, so you can exercise the whole path offline first:
|
|
69
|
+
a2acode is on PyPI, so [`uvx`](https://docs.astral.sh/uv/guides/tools/) runs it without a clone or an install step (`uv tool install a2acode` or `pipx install a2acode` keep it around). The `echo` backend needs no API key and no Claude install, so you can exercise the whole path offline first:
|
|
69
70
|
|
|
70
71
|
```bash
|
|
71
|
-
|
|
72
|
+
uvx a2acode serve --backend echo &
|
|
72
73
|
# once the "Uvicorn running" line appears:
|
|
73
|
-
|
|
74
|
+
uvx a2acode call "fix the failing test"
|
|
74
75
|
```
|
|
75
76
|
|
|
76
77
|
```text
|
|
@@ -78,6 +79,7 @@ task 189b1c63-1a7b-4908-87c4-c8f3bba8f6b5
|
|
|
78
79
|
context 0b2a901e-2b6f-4c56-bba2-d0da546936e9
|
|
79
80
|
|
|
80
81
|
· Echo
|
|
82
|
+
· ✓ Echo
|
|
81
83
|
fix the failing test
|
|
82
84
|
[completed] $0.0 · 1 turns
|
|
83
85
|
```
|
|
@@ -85,21 +87,21 @@ fix the failing test
|
|
|
85
87
|
Then point it at a real project. The default backend is `acp`, fronting Claude Code through its ACP adapter:
|
|
86
88
|
|
|
87
89
|
```bash
|
|
88
|
-
|
|
89
|
-
|
|
90
|
+
uvx a2acode serve --cwd /path/to/project # acp + claude by default
|
|
91
|
+
uvx a2acode call "add a /health endpoint" --url http://localhost:9100/
|
|
90
92
|
```
|
|
91
93
|
|
|
92
94
|
Swap the agent without touching anything else:
|
|
93
95
|
|
|
94
96
|
```bash
|
|
95
|
-
|
|
96
|
-
|
|
97
|
+
uvx a2acode serve --agent gemini --cwd /path/to/project
|
|
98
|
+
uvx a2acode serve --agent-command "npx -y some-other-acp-agent"
|
|
97
99
|
```
|
|
98
100
|
|
|
99
101
|
Continue the same conversation by passing the `context` from a previous turn:
|
|
100
102
|
|
|
101
103
|
```bash
|
|
102
|
-
|
|
104
|
+
uvx a2acode call "now add a test for it" --context <context-id>
|
|
103
105
|
```
|
|
104
106
|
|
|
105
107
|
Continuity needs the agent to support ACP's `session/load`. When it does not, the turn still runs, but on a fresh session — and the task says so in a status update rather than answering as if it remembered.
|
|
@@ -108,7 +110,7 @@ Continuity needs the agent to support ACP's `session/load`. When it does not, th
|
|
|
108
110
|
|
|
109
111
|
Every release publishes a `linux/amd64` and `linux/arm64` image to GHCR, holding the same wheel as the PyPI release with all three extras installed — so which backend and which task store it runs is a flag, not a rebuild. It runs as a non-root user and works in your project by way of whatever you mount over `/workspace`.
|
|
110
112
|
|
|
111
|
-
A container has to listen on every interface to be reachable at all, so the default command binds `0.0.0.0` where the `
|
|
113
|
+
A container has to listen on every interface to be reachable at all, so the default command binds `0.0.0.0` where the `uvx` quick start binds loopback. That makes *where you publish the port* the boundary: whoever reaches it can run a coding agent in your workspace. Publish it to your own loopback while you try it out —
|
|
112
114
|
|
|
113
115
|
```bash
|
|
114
116
|
docker run --rm -p 127.0.0.1:9100:9100 \
|
|
@@ -152,7 +154,7 @@ An A2A message is not only text. A caller can attach the failing log, the patch
|
|
|
152
154
|
A backend turns a prompt into a stream of normalized events. Three ship today:
|
|
153
155
|
|
|
154
156
|
- `acp` (default): drives any agent that speaks Zed's Agent Client Protocol as a subprocess. `--agent claude|gemini|codex` selects a launch preset; `--agent-command` drives any other ACP agent. This is the vendor-neutral path. The subprocess is kept alive per conversation, so a follow-up turn skips the process launch, the ACP handshake, and the session reload and talks straight to the agent that already holds the conversation.
|
|
155
|
-
- `claude`: drives Claude Code directly through the Claude Agent SDK, no subprocess. Install with `uv sync --extra claude
|
|
157
|
+
- `claude`: drives Claude Code directly through the Claude Agent SDK, no subprocess. Install with `uv tool install 'a2acode[claude]'` (or `uv sync --extra claude` from a clone). Use it when you want the SDK-native path (e.g. `--max-budget-usd`) rather than ACP.
|
|
156
158
|
- `echo`: no dependencies, mirrors the input. For wiring checks and tests.
|
|
157
159
|
|
|
158
160
|
The split keeps the A2A layer independent of how the agent is invoked: backends emit normalized events and never import `a2a.*`; the executor maps those events onto the protocol and never imports an agent SDK. Adding a backend never touches the server or the protocol mapping.
|
|
@@ -166,7 +168,7 @@ Each agent authenticates the way its own tooling does, inherited from the server
|
|
|
166
168
|
A caller that discovers this server only has the agent card to go on. Sign it so the caller can confirm the card came from you and was not swapped in transit:
|
|
167
169
|
|
|
168
170
|
```bash
|
|
169
|
-
|
|
171
|
+
uvx a2acode serve --sign-key card-signing.pem --sign-kid my-key-1 --sign-alg ES256
|
|
170
172
|
```
|
|
171
173
|
|
|
172
174
|
The card is then served with a JWS signature over its canonical form. `--sign-key` is a path to a file holding the key: a PEM private key for asymmetric algorithms (`ES256`, `RS256`), or a shared secret for `HS256`. `--sign-kid` is the key id a verifier uses to look up the matching public key. Unsigned is still the default.
|
|
@@ -176,7 +178,7 @@ The card is then served with a JWS signature over its canonical form. `--sign-ke
|
|
|
176
178
|
A signed card proves who the server is; this proves the caller is allowed in. Require a bearer token and the server rejects any task request that does not carry it:
|
|
177
179
|
|
|
178
180
|
```bash
|
|
179
|
-
|
|
181
|
+
uvx a2acode serve --auth-token-file caller-token.txt
|
|
180
182
|
```
|
|
181
183
|
|
|
182
184
|
When `--auth-token-file` is set, callers must send `Authorization: Bearer <token>`; a request without a valid token gets `401 Unauthorized`. The agent card stays public so a caller can still fetch it to discover the requirement, and the card advertises the bearer scheme in `securitySchemes`. Without the flag the server stays open, as before.
|
|
@@ -188,10 +190,10 @@ A2A keeps the credential at the HTTP layer, so this composes with whatever your
|
|
|
188
190
|
A tool that needs approval pauses the task in the A2A `input-required` state instead of being skipped. The caller answers with a follow-up message on the same task:
|
|
189
191
|
|
|
190
192
|
```bash
|
|
191
|
-
|
|
193
|
+
uvx a2acode call "sudo reboot"
|
|
192
194
|
# ... [input-required] Permission requested for Bash: $ sudo reboot
|
|
193
195
|
# reply: a2acode call "allow" --task <id> --context <id> --request <id>
|
|
194
|
-
|
|
196
|
+
uvx a2acode call "allow" --task <id> --context <id> --request <id>
|
|
195
197
|
```
|
|
196
198
|
|
|
197
199
|
An answer of `allow`, `yes`, `y`, `ok`, `approve`, `accept`, or `grant` — the whole answer, nothing around it — approves. Anything else denies, which is what makes it safe to answer in prose. The agent session stays alive across the pause, so it resumes exactly where it stopped. Over ACP this is the agent's `session/request_permission` call answered from the A2A caller's reply; with the `claude` backend it routes through the Claude SDK's `can_use_tool`.
|
|
@@ -203,12 +205,12 @@ Some gates are not yes/no. Claude Code's end-of-plan gate offers three choices
|
|
|
203
205
|
Not every gate is a request to act. When Claude has a clarifying question it calls `AskUserQuestion`, which asks and does nothing else, so approving it says nothing on its own — the answer is the outcome. The pause carries the questions and their choices, and the reply's metadata carries what was picked, keyed by question:
|
|
204
206
|
|
|
205
207
|
```bash
|
|
206
|
-
|
|
208
|
+
uvx a2acode call "port the tests" --url http://localhost:9100/
|
|
207
209
|
# ... [input-required] Permission requested for AskUserQuestion: ...
|
|
208
210
|
# Which test runner? [Runner]
|
|
209
211
|
# pytest: what the repo uses
|
|
210
212
|
# unittest: stdlib only
|
|
211
|
-
|
|
213
|
+
uvx a2acode call "allow" --task <id> --context <id> --request <id> \
|
|
212
214
|
--answer "Which test runner?=pytest"
|
|
213
215
|
```
|
|
214
216
|
|
|
@@ -229,8 +231,7 @@ The agent card advertises push notifications. A caller can register a webhook fo
|
|
|
229
231
|
Tasks live in memory by default, so a restart loses their history and any webhook registrations. Point `--task-db` at a database to keep them:
|
|
230
232
|
|
|
231
233
|
```bash
|
|
232
|
-
|
|
233
|
-
uv run a2acode serve --task-db "sqlite+aiosqlite:///a2acode.db"
|
|
234
|
+
uvx --from 'a2acode[persistence]' a2acode serve --task-db "sqlite+aiosqlite:///a2acode.db"
|
|
234
235
|
```
|
|
235
236
|
|
|
236
237
|
Any SQLAlchemy async DSN works; the extra ships the SQLite driver because it needs no server. What survives is task history, artifacts, and push registrations — **not** a live agent session, which is a process and dies with the server either way, so a task paused on a permission cannot be answered after a restart.
|
|
@@ -240,7 +241,7 @@ Any SQLAlchemy async DSN works; the extra ships the SQLite driver because it nee
|
|
|
240
241
|
Debugging one agent is hard; debugging a chain of them without traces is worse. Because A2A runs over HTTP, it drops straight into OpenTelemetry: install the extra and the A2A SDK's instrumentation plus a per-task `a2acode.execute` span light up, with W3C trace context propagating across the call so client and server spans share one trace.
|
|
241
242
|
|
|
242
243
|
```bash
|
|
243
|
-
uv sync --extra telemetry
|
|
244
|
+
uv tool install 'a2acode[telemetry]' # or: uv sync --extra telemetry
|
|
244
245
|
```
|
|
245
246
|
|
|
246
247
|
Tracing is off unless OpenTelemetry is installed, and you configure the exporter the standard way (e.g. `OTEL_EXPORTER_OTLP_ENDPOINT`, or run under `opentelemetry-instrument`). It works against an on-prem or air-gapped collector, so traces never have to leave your network.
|
|
@@ -255,7 +256,7 @@ uv run mypy
|
|
|
255
256
|
uv run pytest
|
|
256
257
|
```
|
|
257
258
|
|
|
258
|
-
CI runs these on Python 3.
|
|
259
|
+
CI runs these on Python 3.11 through 3.14, plus a Markdown lint, on every push and pull request.
|
|
259
260
|
|
|
260
261
|
## Releasing
|
|
261
262
|
|
|
@@ -271,7 +272,7 @@ git push origin main vX.Y.Z
|
|
|
271
272
|
|
|
272
273
|
## Status
|
|
273
274
|
|
|
274
|
-
The mapping is complete end to end and verified against real Claude: text round trip, tool calls and their outcomes, the agent's plan, streaming artifacts, file diffs as artifacts, caller attachments, run metadata, session continuity, the permission-to-`input-required` round trip, answering the agent's clarifying questions, and push notifications. The offline `echo` backend covers every path including permissions and attachments, so it can all be exercised without an API key.
|
|
275
|
+
The mapping is complete end to end and verified against real Claude: text round trip, tool calls and their outcomes, the agent's plan, streaming artifacts, file diffs as artifacts, caller attachments, run metadata, session continuity, the permission-to-`input-required` round trip, answering the agent's clarifying questions, and push notifications. The server speaks A2A 1.0 and still serves v0.3 clients — the card lists both versions on the same endpoints, so a client built on a v0.3 SDK can discover it and run a task. The offline `echo` backend covers every path including permissions and attachments, so it can all be exercised without an API key.
|
|
275
276
|
|
|
276
277
|
## License
|
|
277
278
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "a2acode"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.9.0"
|
|
4
4
|
description = "Serve Claude Code and other ACP coding agents over the A2A protocol."
|
|
5
5
|
readme = "README.md"
|
|
6
|
-
requires-python = ">=3.
|
|
6
|
+
requires-python = ">=3.11"
|
|
7
7
|
license = "Apache-2.0"
|
|
8
8
|
keywords = [
|
|
9
9
|
"a2a",
|
|
@@ -54,7 +54,7 @@ build-backend = "uv_build"
|
|
|
54
54
|
|
|
55
55
|
[tool.ruff]
|
|
56
56
|
line-length = 88
|
|
57
|
-
target-version = "
|
|
57
|
+
target-version = "py311"
|
|
58
58
|
|
|
59
59
|
[tool.ruff.lint]
|
|
60
60
|
select = [
|
|
@@ -72,6 +72,6 @@ testpaths = ["tests"]
|
|
|
72
72
|
|
|
73
73
|
[tool.mypy]
|
|
74
74
|
files = ["src"]
|
|
75
|
-
python_version = "3.
|
|
75
|
+
python_version = "3.11"
|
|
76
76
|
ignore_missing_imports = true
|
|
77
77
|
check_untyped_defs = true
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "a2acode"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.9.0"
|
|
4
4
|
description = "Serve Claude Code and other ACP coding agents over the A2A protocol."
|
|
5
5
|
readme = "README.md"
|
|
6
|
-
requires-python = ">=3.
|
|
6
|
+
requires-python = ">=3.11"
|
|
7
7
|
license = "Apache-2.0"
|
|
8
8
|
authors = [{ name = "kanywst" }]
|
|
9
9
|
keywords = ["a2a", "acp", "claude-code", "agent", "agent2agent"]
|
|
@@ -56,7 +56,7 @@ build-backend = "uv_build"
|
|
|
56
56
|
|
|
57
57
|
[tool.ruff]
|
|
58
58
|
line-length = 88
|
|
59
|
-
target-version = "
|
|
59
|
+
target-version = "py311"
|
|
60
60
|
|
|
61
61
|
[tool.ruff.lint]
|
|
62
62
|
select = ["E", "F", "I", "UP", "B", "SIM"]
|
|
@@ -67,6 +67,6 @@ testpaths = ["tests"]
|
|
|
67
67
|
|
|
68
68
|
[tool.mypy]
|
|
69
69
|
files = ["src"]
|
|
70
|
-
python_version = "3.
|
|
70
|
+
python_version = "3.11"
|
|
71
71
|
ignore_missing_imports = true
|
|
72
72
|
check_untyped_defs = true
|
|
@@ -20,7 +20,11 @@ from a2a.types import (
|
|
|
20
20
|
AgentSkill,
|
|
21
21
|
SecurityRequirement,
|
|
22
22
|
)
|
|
23
|
-
from a2a.utils.constants import
|
|
23
|
+
from a2a.utils.constants import (
|
|
24
|
+
PROTOCOL_VERSION_0_3,
|
|
25
|
+
PROTOCOL_VERSION_CURRENT,
|
|
26
|
+
TransportProtocol,
|
|
27
|
+
)
|
|
24
28
|
|
|
25
29
|
# The id used for the bearer scheme in the card's security_schemes map and in
|
|
26
30
|
# each security requirement that references it.
|
|
@@ -104,18 +108,13 @@ def build_card(
|
|
|
104
108
|
),
|
|
105
109
|
# The server mounts both JSON-RPC and REST (HTTP+JSON) routes, so the
|
|
106
110
|
# card advertises both bindings; a caller picks whichever its client
|
|
107
|
-
# speaks instead of assuming JSON-RPC.
|
|
111
|
+
# speaks instead of assuming JSON-RPC. Both also accept v0.3 requests,
|
|
112
|
+
# and listing that version is what puts the top-level url a v0.3
|
|
113
|
+
# client looks for on the served card.
|
|
108
114
|
supported_interfaces=[
|
|
109
|
-
AgentInterface(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
protocol_version=PROTOCOL_VERSION_CURRENT,
|
|
113
|
-
),
|
|
114
|
-
AgentInterface(
|
|
115
|
-
url=url,
|
|
116
|
-
protocol_binding=TransportProtocol.HTTP_JSON,
|
|
117
|
-
protocol_version=PROTOCOL_VERSION_CURRENT,
|
|
118
|
-
),
|
|
115
|
+
AgentInterface(url=url, protocol_binding=binding, protocol_version=v)
|
|
116
|
+
for v in (PROTOCOL_VERSION_CURRENT, PROTOCOL_VERSION_0_3)
|
|
117
|
+
for binding in (TransportProtocol.JSONRPC, TransportProtocol.HTTP_JSON)
|
|
119
118
|
],
|
|
120
119
|
skills=SKILLS,
|
|
121
120
|
default_input_modes=["text/plain"],
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|