Metadata-Version: 2.4
Name: agentforge-a2a
Version: 0.2.3
Summary: A2A (Agent-to-Agent) protocol client + server for AgentForge
Project-URL: Homepage, https://github.com/Scaffoldic/agentforge-py
Project-URL: Repository, https://github.com/Scaffoldic/agentforge-py
Project-URL: Changelog, https://github.com/Scaffoldic/agentforge-py/blob/main/CHANGELOG.md
Author: The AgentForge Authors
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: a2a,agent,ai,multi-agent,protocol
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.13
Requires-Dist: agentforge-core~=0.2.3
Requires-Dist: agentforge-py~=0.2.3
Requires-Dist: fastapi>=0.115
Requires-Dist: httpx>=0.27
Requires-Dist: uvicorn>=0.32
Description-Content-Type: text/markdown

# agentforge-a2a

A2A (Agent-to-Agent) protocol support for AgentForge: cross-framework
agent invocation over HTTP, with bearer / mTLS auth, run_id chain,
and budget propagation.

See [`docs/features/feat-014-a2a-protocol.md`](https://github.com/Scaffoldic/agentforge-py/blob/main/docs/features/feat-014-a2a-protocol.md)
for the design and runbook.

## Install

```bash
pip install agentforge-a2a
# or, from a scaffolded project:
agentforge add module a2a
```

## Call another agent

```python
from agentforge_a2a import A2APeer, agent_call

peer = A2APeer.from_config({
    "name": "fact-checker",
    "url": "https://internal.fact-checker.example/a2a",
    "auth": {"type": "bearer", "token": "${FACT_CHECKER_TOKEN}"},
})

result = await agent_call(
    "fact-checker:verify",
    {"claim": "The capital of Australia is Sydney."},
    timeout_s=30,
    peers={"fact-checker": peer},
)
print(result.output)
```

## Expose this agent

```python
from agentforge import Agent, EnvBearerAuth
from agentforge_a2a import A2AServer

server = A2AServer(
    agent=Agent(model="anthropic:claude-sonnet-4-6", strategy="react"),
    auth=EnvBearerAuth("A2A_TOKENS"),
    endpoints=["review-pr"],
    host="0.0.0.0",
    port=8080,
)
await server.serve()
```
