Observed since 20 Oct, 21:55 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
agentflowbus
Python SDK for AgentFlowBus — ACP-compatible Envelope protocol on top of NATS / asyncio.
ACP-compatible Envelope protocol on top of NATS / asyncio. The protocol is shared with the Go SDK at the repo root; transport layers are implemented independently per language.
v0.2 skeleton — feature-equivalent surface to Go v0.1.
sdk/python/
├── pyproject.toml
├── src/agentflowbus/
│ ├── event/ # Envelope dataclass, event-type constants, payload shapes
│ ├── codec/ # JSON codec
│ ├── transport/ # base ABC + InMemoryDriver + NATSDriver
│ └── bus/ # Bus, Stream, StreamWriter, subject layout
├── tests/ # pytest, pytest-asyncio
└── examples/
└── echo_agent.py
cd sdk/python
python3.11 -m venv .venv # already done in this repo
.venv/bin/pip install -e ".[dev]"
.venv/bin/pytest # unit tests (in-memory transport)
AFB_NATS_URL=nats://localhost:4222 .venv/bin/pytest tests/test_nats_integration.py
The NATS integration tests are gated on the AFB_NATS_URL env var. Start a
local broker first, e.g. nats-server -p 4222.
import asyncio
from agentflowbus import Bus, InMemoryDriver
async def main() -> None:
bus = Bus(agent_id="echo", transport=InMemoryDriver())
await bus.connect()
async def echo(env):
return env.payload_json()
await bus.handle_invoke("echo", echo)
resp = await bus.invoke("echo", {"msg": "hello"})
print(resp.event_type, resp.payload_json())
await bus.close()
asyncio.run(main())
See examples/echo_agent.py for a runnable version that mirrors
examples/echo-agent/main.go from the Go SDK.
The wire format is shared with the Go SDK:
spec_version = "acp/1.0", schema_version = 1event_id (RFC 9562) with UUIDv4 fallbackacp.v1.events.<event_type> and acp.v1.invoke.<target>
(with optional <tenant> segment)tests/test_envelope.py use shared sample envelopes from
<repo>/schema/samples/.| Surface | Status |
|---|---|
| Envelope (v0.1) | ✅ wire-compatible |
| In-memory transport | ✅ |
| NATS transport | ✅ (nats-py) |
| Pub / Sub | ✅ |
| Invoke / Reply | ✅ |
| Stream Invoke | ✅ |
| Middleware framework | ⏭ v0.3 |
| JetStream | ⏭ v0.3 |
| Sync wrapper | ⏭ v0.3 |
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
nats-pyEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.11",
"evaluation": "NOT_EVALUATED"
} | nats-py>=2.6 | runtime |
jsonschemaEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.11",
"evaluation": "NOT_EVALUATED"
} | jsonschema>=4.21; extra == "dev" | runtime |
pytest-asyncioEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.11",
"evaluation": "NOT_EVALUATED"
} | pytest-asyncio>=0.23; extra == "dev" | runtime |
pytestEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.11",
"evaluation": "NOT_EVALUATED"
} | pytest>=8.0; extra == "dev" | runtime |
jsonschemaEnvironment{
"extras": "",
"marker": "extra == \"validation\"",
"requires_python": ">=3.11",
"evaluation": "NOT_EVALUATED"
} | jsonschema>=4.21; extra == "validation" | runtime |
bdist_wheel · 21 KB · Python py3
sdist · 20.57 KB · Python source
Observed since 20 Oct, 21:55 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:4e92c53850e884907124bae68d9a18ea171ba3a8a7759450dffc74342b4b30a1