Metadata-Version: 2.4
Name: theprotocol-sdk
Version: 0.1.1
Summary: TheProtocol SDK — Build and call A2A agents. Protocol bridges for ACP, ADK, and more.
Project-URL: Homepage, https://theprotocol.cloud
Project-URL: Documentation, https://api.theprotocol.cloud/docs
Project-URL: Repository, https://github.com/theprotocol/theprotocol-sdk
Author-email: TheProtocol <sdk@theprotocol.cloud>
License: Apache-2.0
License-File: LICENSE
Keywords: a2a,agents,ai,mcp,protocol,theprotocol
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.10
Requires-Dist: httpx[http2]>=0.27
Requires-Dist: pydantic<3.0,>=2.0
Requires-Dist: python-dotenv>=1.0
Provides-Extra: all
Requires-Dist: cryptography>=42.0; extra == 'all'
Requires-Dist: fastapi>=0.111; extra == 'all'
Requires-Dist: keyring>=24; extra == 'all'
Provides-Extra: anp
Requires-Dist: cryptography>=42.0; extra == 'anp'
Provides-Extra: keyring
Requires-Dist: keyring>=24; extra == 'keyring'
Provides-Extra: server
Requires-Dist: fastapi>=0.111; extra == 'server'
Provides-Extra: test
Requires-Dist: cryptography>=42.0; extra == 'test'
Requires-Dist: httpx>=0.27; extra == 'test'
Requires-Dist: pytest-asyncio>=0.21; extra == 'test'
Requires-Dist: pytest>=7.0; extra == 'test'
Requires-Dist: respx>=0.20; extra == 'test'
Description-Content-Type: text/markdown

# theprotocol-sdk

Build and call A2A (Agent-to-Agent) agents on [TheProtocol](https://theprotocol.cloud).

## Install

```bash
pip install theprotocol-sdk           # Client only (call agents)
pip install theprotocol-sdk[server]   # + FastAPI router (build agents)
pip install theprotocol-sdk[all]      # Everything
```

## Build an Agent (10 lines)

```python
from theprotocol.agent import BaseA2AAgent, create_a2a_router
from theprotocol.models import Message, TextPart
from fastapi import FastAPI

class MyAgent(BaseA2AAgent):
    async def handle_task_send(self, task_id, message):
        return "task-1"  # Return task ID
    async def handle_task_get(self, task_id):
        ...  # Return Task object
    async def handle_task_cancel(self, task_id):
        return True
    async def handle_subscribe_request(self, task_id):
        yield  # SSE events

app = FastAPI()
app.include_router(create_a2a_router(MyAgent()))
```

## Call a Remote Agent

```python
from theprotocol.client import A2AClient, KeyManager
from theprotocol.models import Message, TextPart

async with A2AClient() as client:
    task_id = await client.initiate_task(agent_card, message, key_manager)
    task = await client.get_task_status(agent_card, task_id, key_manager)
    print(task.state)  # COMPLETED
```

## Protocol Bridges

Translate between A2A and other agent protocols:

```python
from theprotocol.bridges.acp import ACPBridge          # ACP ↔ A2A (IBM BeeAI)
from theprotocol.bridges.google_a2a import GoogleA2ABridge  # Google A2A ↔ A2A
from theprotocol.bridges.mcp import MCPBridge          # MCP ↔ A2A (JSON-RPC 2.0)
from theprotocol.bridges.anp import ANPBridge          # ANP ↔ A2A (DID:WBA)
```

## Registry Operations

For governance, staking, transfers, and discovery — use [MCP tools](https://api.theprotocol.cloud/docs) instead of SDK functions. 19 tools available via Claude Desktop or any MCP client.

## License

Apache-2.0
