Metadata-Version: 2.4
Name: arc-sdk
Version: 1.3.0
Summary: Python implementation of the Agent Remote Communication (ARC) Protocol
Home-page: https://github.com/arcprotocol/python-sdk
Author: Moein Roghani
Author-email: Moein Roghani <moein.roghani@proton.me>
License: Apache-2.0
Project-URL: Homepage, https://arc-protocol.org
Project-URL: Documentation, https://docs.arc-protocol.org
Project-URL: Repository, https://github.com/arcprotocol/python-sdk
Project-URL: Bug Tracker, https://github.com/arcprotocol/python-sdk/issues
Project-URL: Protocol Specification, https://arc-protocol.org/spec
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Environment :: Web Environment
Classifier: Environment :: Console
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Communications
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: System :: Distributed Computing
Classifier: Topic :: System :: Networking
Classifier: Typing :: Typed
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic>=2.0.0
Requires-Dist: httpx>=0.25.0
Requires-Dist: fastapi>=0.104.0
Requires-Dist: uvicorn[standard]>=0.24.0
Requires-Dist: jsonschema>=4.19.0
Requires-Dist: authlib>=1.2.0
Requires-Dist: python-jose[cryptography]>=3.3.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: typer>=0.9.0
Provides-Extra: server
Requires-Dist: fastapi>=0.104.0; extra == "server"
Requires-Dist: uvicorn[standard]>=0.24.0; extra == "server"
Provides-Extra: client
Requires-Dist: httpx>=0.25.0; extra == "client"
Provides-Extra: fastapi
Requires-Dist: fastapi>=0.104.0; extra == "fastapi"
Provides-Extra: starlette
Requires-Dist: starlette>=0.27.0; extra == "starlette"
Provides-Extra: all
Requires-Dist: fastapi>=0.104.0; extra == "all"
Requires-Dist: starlette>=0.27.0; extra == "all"
Requires-Dist: uvicorn[standard]>=0.24.0; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: flake8>=6.0.0; extra == "dev"
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# Agent Remote Communication (ARC) Protocol

[![PyPI version](https://badge.fury.io/py/arc-sdk.svg)](https://badge.fury.io/py/arc-sdk)
[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
[![Downloads](https://pepy.tech/badge/arc-sdk)](https://pepy.tech/project/arc-sdk)
[![GitHub stars](https://img.shields.io/github/stars/arcprotocol/python-sdk.svg?style=social&label=Star)](https://github.com/arcprotocol/python-sdk)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

## Agent-to-Agent Communication Protocol

**ARC (Agent Remote Communication)** is an agent-to-agent protocol with built-in agent routing, workflow tracing, and SSE streaming. Deploy multiple agent types on a single endpoint.

### Quantum-Resistant Security

ARC SDK implements end-to-end encryption using hybrid TLS (X25519 + Kyber-768), combining classical cryptography with post-quantum algorithms (FIPS 203 ML-KEM). Protects against quantum computing attacks.

### Server Architecture

Single package with multiple deployment options:
- **Custom ASGI Server** - Standalone server with built-in middleware (zero dependencies)
- **FastAPI Integration** - Router for existing FastAPI applications (optional: `pip install arc-sdk[fastapi]`)
- **Starlette Integration** - Lightweight ASGI toolkit integration (optional: `pip install arc-sdk[starlette]`)

### Key Features

- **Single Endpoint, Multiple Agents** - Deploy multiple agents behind one endpoint
- **Cross-Agent Workflows** - Agent A → Agent B → Agent C with full traceability via `traceId`
- **Agent Routing** - Built-in routing to target agents
- **End-to-End Tracing** - Track workflows across agent interactions

### ARC vs Other Agent-to-Agent Protocols

| Feature | **ARC Protocol** | **A2A (Google)** | **ACP (IBM/Linux Foundation)** |
|---------|------------------|-------------------|--------------------------------|
| **Streaming Model** | ✅ SSE (Server-Sent Events) | ✅ SSE downstream | ⚠️ Chunked HTTP, not duplex |
| **Transport** | ✅ HTTP/1.1 + SSE | ✅ HTTP/1.1 + SSE | ❌ HTTP/1.x only |
| **Message Format** | ✅ JSON with structured parts | ✅ JSON with parts | ✅ JSON with MIME parts |
| **Task Lifecycle** | ✅ Native task methods + webhooks | ⚠️ SSE + webhook registration | ⚠️ Client polling/resume |
| **Multi-Agent Routing** | ✅ Single endpoint, built-in | ✅ Agent Card discovery | ⚠️ Manifest-based, looser |
| **Agent Discovery** | ✅ Built-in agent routing | ✅ Agent Card system | ⚠️ Manifest-based discovery |
| **Error Handling** | ✅ Rich error taxonomy (500+ codes) | ⚠️ JSON-RPC error codes | ⚠️ HTTP status codes |
| **Workflow Tracing** | ✅ Native `traceId` support | ⚠️ Custom implementation | ⚠️ Custom implementation |
| **Learning Curve** | ✅ Simple RPC-style | ✅ Familiar JSON-RPC | ✅ REST-like HTTP |
| **Governance** | ✅ Open Protocol | ⚠️ Google-led | ✅ Linux Foundation |

## Installation

### Core Package

```bash
pip install arc-sdk
```

### With Post-Quantum Cryptography

```bash
pip install arc-sdk[pqc]
```
Adds quantum-resistant hybrid TLS (X25519 + Kyber-768). See [PQC Documentation](README_QUANTUM_SAFE.md).

### With FastAPI Integration
```bash
pip install arc-sdk[fastapi]
```

### With Starlette Integration

```bash
pip install arc-sdk[starlette]
```

### All Features

```bash
pip install arc-sdk[all,pqc]
```

## Quick Start

### Client

```python
from arc import Client

client = Client("https://company.com/arc", token="your-oauth2-token")

# Create task
task = await client.task.create(
    target_agent="document-analyzer",
    initial_message={"role": "user", "parts": [{"type": "text", "content": "Analyze report"}]}
)

# Start chat
chat = await client.chat.start(
    target_agent="support-agent",
    initial_message={"role": "user", "parts": [{"type": "text", "content": "Help with account"}]}
)
```

### Server

```python
from arc import Server

server = Server(server_id="my-server")

@server.agent_handler("finance-agent", "chat.start")
async def handle_chat(params, context):
    return {"type": "chat", "chat": {...}}

server.run(host="0.0.0.0", port=8000)
```

## Documentation

- [Protocol Specification](https://arc-protocol.org/spec)
- [Examples](https://github.com/arcprotocol/examples)

## License

Apache License 2.0. See [LICENSE](LICENSE) for details.
