a2acode 0.9.0__tar.gz → 0.9.2__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.
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: a2acode
3
- Version: 0.9.0
3
+ Version: 0.9.2
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
7
7
  License-Expression: Apache-2.0
8
8
  Requires-Dist: a2a-sdk[http-server,signing]>=1.1,<2
9
- Requires-Dist: agent-client-protocol>=0.12,<1
9
+ Requires-Dist: agent-client-protocol>=1.0.0,<2
10
10
  Requires-Dist: uvicorn>=0.49
11
11
  Requires-Dist: httpx>=0.28
12
12
  Requires-Dist: typer>=0.26
@@ -25,7 +25,7 @@ Description-Content-Type: text/markdown
25
25
 
26
26
  # a2acode
27
27
 
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.
28
+ Put Claude Code, Codex, opencode — 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
  [![CI](https://github.com/kanywst/a2acode/actions/workflows/ci.yml/badge.svg)](https://github.com/kanywst/a2acode/actions/workflows/ci.yml)
31
31
  [![License: Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
@@ -38,6 +38,7 @@ Try it in ten seconds, no clone and no API key (the `echo` backend mirrors the p
38
38
 
39
39
  ```bash
40
40
  uvx a2acode serve --backend echo &
41
+ # once the "Uvicorn running" line appears:
41
42
  uvx a2acode call "fix the failing test"
42
43
  ```
43
44
 
@@ -67,10 +68,12 @@ a2acode solves a different problem: making any coding agent a first-class peer o
67
68
 
68
69
  - another agent (not a human at a prompt) is the caller, and it speaks A2A;
69
70
  - you want the run on your own infrastructure and data boundary, not a vendor VM;
70
- - you do not want to bet on one vendor's coding agent: ACP makes the backend a launch-command choice, so swapping Claude Code for Codex, Gemini CLI, or OpenHands does not touch the protocol surface your callers depend on.
71
+ - you do not want to bet on one vendor's coding agent: ACP makes the backend a launch-command choice, so swapping Claude Code for Codex, Gemini CLI, or opencode does not touch the protocol surface your callers depend on.
71
72
 
72
73
  ACP already standardizes the editor↔agent side and a dozen agents speak it; a2acode is the piece that exposes an ACP agent to *remote autonomous callers* over A2A, with permission round-trips and cost preserved as first-class protocol citizens — the part ACP leaves out because it assumes a human in an editor. The practical user is the platform team building that mesh, not the individual developer.
73
74
 
75
+ [a2a-serve](https://github.com/a2aproject/a2a-serve), from the A2A project, also puts ACP coding agents behind A2A. It does much more than the bridge: it runs the agent in Docker containers (one per member, one shared by guests), and adds Telegram/Discord/email front ends, relays and tailnets, and pairing codes. a2acode is narrower — one Python package you can `uvx`, no Docker, nothing between the caller and the agent but the protocol mapping. Pick a2a-serve if you want the sandbox, the access model and the networking in the same tool; pick a2acode if you already have those and want a bridge you can read in an afternoon, a Claude Agent SDK backend next to the ACP one, and permission answers bound to the exact prompt they name (`requestId`, `option:<id>`, answers to `AskUserQuestion`).
76
+
74
77
  ## Requirements
75
78
 
76
79
  - Python 3.11+
@@ -279,7 +282,7 @@ uv run mypy
279
282
  uv run pytest
280
283
  ```
281
284
 
282
- CI runs these on Python 3.11 through 3.14, plus a Markdown lint, on every push and pull request.
285
+ CI runs these on Python 3.11 through 3.15, plus a Markdown lint, on every push and pull request.
283
286
 
284
287
  ## Releasing
285
288
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # a2acode
4
4
 
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.
5
+ Put Claude Code, Codex, opencode — 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
  [![CI](https://github.com/kanywst/a2acode/actions/workflows/ci.yml/badge.svg)](https://github.com/kanywst/a2acode/actions/workflows/ci.yml)
8
8
  [![License: Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
@@ -15,6 +15,7 @@ Try it in ten seconds, no clone and no API key (the `echo` backend mirrors the p
15
15
 
16
16
  ```bash
17
17
  uvx a2acode serve --backend echo &
18
+ # once the "Uvicorn running" line appears:
18
19
  uvx a2acode call "fix the failing test"
19
20
  ```
20
21
 
@@ -44,10 +45,12 @@ a2acode solves a different problem: making any coding agent a first-class peer o
44
45
 
45
46
  - another agent (not a human at a prompt) is the caller, and it speaks A2A;
46
47
  - you want the run on your own infrastructure and data boundary, not a vendor VM;
47
- - you do not want to bet on one vendor's coding agent: ACP makes the backend a launch-command choice, so swapping Claude Code for Codex, Gemini CLI, or OpenHands does not touch the protocol surface your callers depend on.
48
+ - you do not want to bet on one vendor's coding agent: ACP makes the backend a launch-command choice, so swapping Claude Code for Codex, Gemini CLI, or opencode does not touch the protocol surface your callers depend on.
48
49
 
49
50
  ACP already standardizes the editor↔agent side and a dozen agents speak it; a2acode is the piece that exposes an ACP agent to *remote autonomous callers* over A2A, with permission round-trips and cost preserved as first-class protocol citizens — the part ACP leaves out because it assumes a human in an editor. The practical user is the platform team building that mesh, not the individual developer.
50
51
 
52
+ [a2a-serve](https://github.com/a2aproject/a2a-serve), from the A2A project, also puts ACP coding agents behind A2A. It does much more than the bridge: it runs the agent in Docker containers (one per member, one shared by guests), and adds Telegram/Discord/email front ends, relays and tailnets, and pairing codes. a2acode is narrower — one Python package you can `uvx`, no Docker, nothing between the caller and the agent but the protocol mapping. Pick a2a-serve if you want the sandbox, the access model and the networking in the same tool; pick a2acode if you already have those and want a bridge you can read in an afternoon, a Claude Agent SDK backend next to the ACP one, and permission answers bound to the exact prompt they name (`requestId`, `option:<id>`, answers to `AskUserQuestion`).
53
+
51
54
  ## Requirements
52
55
 
53
56
  - Python 3.11+
@@ -256,7 +259,7 @@ uv run mypy
256
259
  uv run pytest
257
260
  ```
258
261
 
259
- CI runs these on Python 3.11 through 3.14, plus a Markdown lint, on every push and pull request.
262
+ CI runs these on Python 3.11 through 3.15, plus a Markdown lint, on every push and pull request.
260
263
 
261
264
  ## Releasing
262
265
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "a2acode"
3
- version = "0.9.0"
3
+ version = "0.9.2"
4
4
  description = "Serve Claude Code and other ACP coding agents over the A2A protocol."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -14,7 +14,7 @@ keywords = [
14
14
  ]
15
15
  dependencies = [
16
16
  "a2a-sdk[http-server,signing]>=1.1,<2",
17
- "agent-client-protocol>=0.12,<1",
17
+ "agent-client-protocol>=1.0.0,<2",
18
18
  "uvicorn>=0.49",
19
19
  "httpx>=0.28",
20
20
  "typer>=0.26",
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "a2acode"
3
- version = "0.9.0"
3
+ version = "0.9.2"
4
4
  description = "Serve Claude Code and other ACP coding agents over the A2A protocol."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -9,7 +9,7 @@ authors = [{ name = "kanywst" }]
9
9
  keywords = ["a2a", "acp", "claude-code", "agent", "agent2agent"]
10
10
  dependencies = [
11
11
  "a2a-sdk[http-server,signing]>=1.1,<2",
12
- "agent-client-protocol>=0.12,<1",
12
+ "agent-client-protocol>=1.0.0,<2",
13
13
  "uvicorn>=0.49",
14
14
  "httpx>=0.28",
15
15
  "typer>=0.26",
@@ -50,13 +50,7 @@ from pathlib import Path
50
50
  from typing import Any
51
51
  from uuid import uuid4
52
52
 
53
- from acp import (
54
- PROTOCOL_VERSION,
55
- Client,
56
- image_block,
57
- spawn_agent_process,
58
- text_block,
59
- )
53
+ from acp import PROTOCOL_VERSION, Client, spawn_agent_process
60
54
  from acp import schema as s
61
55
  from acp.exceptions import RequestError
62
56
 
@@ -149,9 +143,8 @@ def events_from_update(update: object) -> Iterator[BackendEvent]:
149
143
  yield _plan_content(update.plan)
150
144
  elif isinstance(update, s.CurrentModeUpdate):
151
145
  yield Notice(text=f"the agent switched to {update.current_mode_id} mode")
152
- elif isinstance(update, s.SessionInfoUpdate):
153
- if update.title:
154
- yield Notice(text=f"the agent titled this session {update.title!r}")
146
+ elif isinstance(update, s.SessionInfoUpdate) and update.title:
147
+ yield Notice(text=f"the agent titled this session {update.title!r}")
155
148
 
156
149
 
157
150
  def select_option(
@@ -234,14 +227,18 @@ def prompt_blocks(
234
227
  and attachment.media_type.startswith("image/")
235
228
  ):
236
229
  images.append(
237
- image_block(
238
- base64.b64encode(attachment.data).decode("ascii"),
239
- attachment.media_type,
230
+ s.ImageContentBlock(
231
+ type="image",
232
+ data=base64.b64encode(attachment.data).decode("ascii"),
233
+ mime_type=attachment.media_type,
240
234
  )
241
235
  )
242
236
  else:
243
237
  inlined.append(attachment)
244
- return [text_block(append_to_prompt(request.prompt, inlined)), *images]
238
+ text = s.TextContentBlock(
239
+ type="text", text=append_to_prompt(request.prompt, inlined)
240
+ )
241
+ return [text, *images]
245
242
 
246
243
 
247
244
  def _plan_content(plan: object) -> Plan:
@@ -212,7 +212,12 @@ def serve(
212
212
  auth_token=auth_token,
213
213
  task_db=task_db,
214
214
  )
215
- label = f"{backend}:{agent}" if backend == "acp" else backend
215
+ if backend != "acp":
216
+ label = backend
217
+ elif agent_command:
218
+ label = f"acp:{shlex.split(agent_command)[0]}"
219
+ else:
220
+ label = f"acp:{agent}"
216
221
  typer.echo(f"a2acode: backend={label} card={_local_url(host, port)}")
217
222
  uvicorn.run(asgi_app, host=host, port=port, log_level="info")
218
223
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes