Skip to content

Commit 4e7bc77

Browse files
authored
feat(a2a): implement M11 A2A types, discovery, and client (#97)
* feat(a2a): implement M11 A2A types, discovery, and client (#78) New zeph-a2a crate with A2A protocol support: - Protocol types (Task, Message, Part, Artifact, AgentCard) with camelCase serde - JSON-RPC 2.0 envelopes and method constants - AgentCardBuilder for runtime card generation - AgentRegistry with well-known URI discovery and TTL cache - A2aClient with send_message, stream_message (SSE), get_task, cancel_task - Bearer token authentication for all client operations - 42 unit tests covering serialization, discovery, and client operations * feat(a2a): gate zeph-a2a behind optional "a2a" feature flag Enabled by default. Build without A2A support via --no-default-features. * chore: bump version to 0.6.0, update changelog and readme
1 parent b358b55 commit 4e7bc77

File tree

12 files changed

+1470
-19
lines changed

12 files changed

+1470
-19
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
66

77
## [Unreleased]
88

9+
## [0.6.0] - 2026-02-08
10+
11+
### Added
12+
- New `zeph-a2a` crate: A2A protocol implementation for agent-to-agent communication (Issue #78)
13+
- A2A protocol types: `Task`, `TaskState`, `TaskStatus`, `Message`, `Part`, `Artifact`, `AgentCard`, `AgentSkill`, `AgentCapabilities` with full serde camelCase serialization (Issue #79)
14+
- JSON-RPC 2.0 envelope types (`JsonRpcRequest`, `JsonRpcResponse`, `JsonRpcError`) with method constants for A2A operations (Issue #79)
15+
- `AgentCardBuilder` for constructing A2A agent cards from runtime config and skills (Issue #79)
16+
- `AgentRegistry` with well-known URI discovery (`/.well-known/agent.json`), TTL-based caching, and manual registration (Issue #80)
17+
- `A2aClient` with `send_message`, `stream_message` (SSE), `get_task`, `cancel_task` via JSON-RPC 2.0 (Issue #81)
18+
- Bearer token authentication support for all A2A client operations (Issue #81)
19+
- SSE streaming via `eventsource-stream` with `TaskEvent` enum (`StatusUpdate`, `ArtifactUpdate`) (Issue #81)
20+
- `A2aError` enum with variants for HTTP, JSON, JSON-RPC, discovery, and stream errors (Issue #79)
21+
- Optional `a2a` feature flag (enabled by default) to gate A2A functionality
22+
- 42 new unit tests for protocol types, JSON-RPC envelopes, agent card builder, discovery registry, and client operations
23+
924
## [0.5.0] - 2026-02-08
1025

1126
### Added

Cargo.lock

Lines changed: 25 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ resolver = "3"
55
[workspace.package]
66
edition = "2024"
77
rust-version = "1.88"
8-
version = "0.5.0"
8+
version = "0.6.0"
99
authors = ["bug-ops"]
1010
license = "MIT"
1111
repository = "https://github.com/bug-ops/zeph"
@@ -35,12 +35,13 @@ toml = "0.9"
3535
tracing = "0.1"
3636
tracing-subscriber = "0.3"
3737
uuid = "1.20"
38-
zeph-channels = { path = "crates/zeph-channels", version = "0.5.0" }
39-
zeph-core = { path = "crates/zeph-core", version = "0.5.0" }
40-
zeph-llm = { path = "crates/zeph-llm", version = "0.5.0" }
41-
zeph-memory = { path = "crates/zeph-memory", version = "0.5.0" }
42-
zeph-skills = { path = "crates/zeph-skills", version = "0.5.0" }
43-
zeph-tools = { path = "crates/zeph-tools", version = "0.5.0" }
38+
zeph-a2a = { path = "crates/zeph-a2a", version = "0.6.0" }
39+
zeph-channels = { path = "crates/zeph-channels", version = "0.6.0" }
40+
zeph-core = { path = "crates/zeph-core", version = "0.6.0" }
41+
zeph-llm = { path = "crates/zeph-llm", version = "0.6.0" }
42+
zeph-memory = { path = "crates/zeph-memory", version = "0.6.0" }
43+
zeph-skills = { path = "crates/zeph-skills", version = "0.6.0" }
44+
zeph-tools = { path = "crates/zeph-tools", version = "0.6.0" }
4445

4546
[workspace.lints.clippy]
4647
all = "warn"
@@ -54,11 +55,16 @@ authors.workspace = true
5455
license.workspace = true
5556
repository.workspace = true
5657

58+
[features]
59+
default = ["a2a"]
60+
a2a = ["dep:zeph-a2a"]
61+
5762
[dependencies]
5863
anyhow.workspace = true
5964
tokio = { workspace = true, features = ["full"] }
6065
tracing.workspace = true
6166
tracing-subscriber.workspace = true
67+
zeph-a2a = { workspace = true, optional = true }
6268
zeph-channels.workspace = true
6369
zeph-core.workspace = true
6470
zeph-llm.workspace = true

README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[![MSRV](https://img.shields.io/badge/MSRV-1.88-blue)](https://www.rust-lang.org)
99
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
1010

11-
Lightweight AI agent with hybrid inference (Ollama / Claude), skills-first architecture, semantic memory with Qdrant, and multi-channel I/O. **Cross-platform**: Linux, macOS, Windows (x86_64 + ARM64).
11+
Lightweight AI agent with hybrid inference (Ollama / Claude), skills-first architecture, semantic memory with Qdrant, A2A protocol support, and multi-channel I/O. **Cross-platform**: Linux, macOS, Windows (x86_64 + ARM64).
1212

1313
## Installation
1414

@@ -45,7 +45,7 @@ docker pull ghcr.io/bug-ops/zeph:latest
4545
Or use a specific version:
4646

4747
```bash
48-
docker pull ghcr.io/bug-ops/zeph:v0.5.0
48+
docker pull ghcr.io/bug-ops/zeph:v0.6.0
4949
```
5050

5151
**Security:** Images are scanned with [Trivy](https://trivy.dev/) in CI/CD and use Oracle Linux 9 Slim base with **0 HIGH/CRITICAL CVEs**. Multi-platform: linux/amd64, linux/arm64.
@@ -261,7 +261,7 @@ context_budget_tokens = 8000 # Set to LLM context window size (0 = unlimited)
261261

262262
## Docker
263263

264-
**Note:** Docker Compose automatically pulls the latest image from GitHub Container Registry. To use a specific version, set `ZEPH_IMAGE=ghcr.io/bug-ops/zeph:v0.5.0`.
264+
**Note:** Docker Compose automatically pulls the latest image from GitHub Container Registry. To use a specific version, set `ZEPH_IMAGE=ghcr.io/bug-ops/zeph:v0.6.0`.
265265

266266
<details>
267267
<summary><b>🐳 Docker Deployment Options</b> (click to expand)</summary>
@@ -304,7 +304,7 @@ docker compose --profile gpu -f docker-compose.yml -f docker-compose.gpu.yml up
304304

305305
```bash
306306
# Use a specific release version
307-
ZEPH_IMAGE=ghcr.io/bug-ops/zeph:v0.5.0 docker compose up
307+
ZEPH_IMAGE=ghcr.io/bug-ops/zeph:v0.6.0 docker compose up
308308

309309
# Always pull latest
310310
docker compose pull && docker compose up
@@ -408,6 +408,18 @@ Found a vulnerability? See [SECURITY.md](SECURITY.md) for responsible disclosure
408408

409409
**Security contact:** Submit via GitHub Security Advisories (confidential)
410410

411+
## Feature Flags
412+
413+
| Feature | Default | Description |
414+
|---------|---------|-------------|
415+
| `a2a` | Enabled | [A2A protocol](https://github.com/a2aproject/A2A) client for agent-to-agent communication |
416+
417+
Disable optional features for a smaller binary:
418+
419+
```bash
420+
cargo build --release --no-default-features
421+
```
422+
411423
## Architecture
412424

413425
<details>
@@ -420,7 +432,8 @@ zeph (binary)
420432
├── zeph-skills SKILL.md parser, registry, embedding matcher, hot-reload watcher
421433
├── zeph-memory SQLite + Qdrant, SemanticMemory orchestrator, summarization
422434
├── zeph-channels Telegram adapter (teloxide) with streaming
423-
└── zeph-tools ToolExecutor trait, ShellExecutor with bash parser
435+
├── zeph-tools ToolExecutor trait, ShellExecutor with bash parser
436+
└── zeph-a2a A2A protocol client, agent discovery, JSON-RPC 2.0 (optional)
424437
```
425438

426439
</details>

crates/zeph-a2a/Cargo.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[package]
2+
name = "zeph-a2a"
3+
version.workspace = true
4+
edition.workspace = true
5+
authors.workspace = true
6+
license.workspace = true
7+
repository.workspace = true
8+
9+
[dependencies]
10+
eventsource-stream.workspace = true
11+
futures-core.workspace = true
12+
reqwest = { workspace = true, features = ["json", "stream"] }
13+
serde = { workspace = true, features = ["derive"] }
14+
serde_json.workspace = true
15+
thiserror.workspace = true
16+
tokio = { workspace = true, features = ["sync"] }
17+
tokio-stream.workspace = true
18+
tracing.workspace = true
19+
uuid = { workspace = true, features = ["v4", "serde"] }
20+
21+
[dev-dependencies]
22+
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
23+
24+
[lints]
25+
workspace = true

0 commit comments

Comments
 (0)