asap-protocol 0.1.0__py3-none-any.whl → 0.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- asap/__init__.py +1 -1
- asap/errors.py +42 -0
- asap/examples/coordinator.py +1 -1
- asap/examples/echo_agent.py +1 -1
- asap/models/constants.py +1 -0
- asap/observability/metrics.py +1 -0
- asap/transport/executors.py +156 -0
- asap/transport/handlers.py +17 -5
- asap/transport/middleware.py +298 -3
- asap/transport/server.py +668 -274
- {asap_protocol-0.1.0.dist-info → asap_protocol-0.3.0.dist-info}/METADATA +49 -73
- {asap_protocol-0.1.0.dist-info → asap_protocol-0.3.0.dist-info}/RECORD +15 -14
- {asap_protocol-0.1.0.dist-info → asap_protocol-0.3.0.dist-info}/WHEEL +0 -0
- {asap_protocol-0.1.0.dist-info → asap_protocol-0.3.0.dist-info}/entry_points.txt +0 -0
- {asap_protocol-0.1.0.dist-info → asap_protocol-0.3.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: asap-protocol
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Async Simple Agent Protocol - A streamlined protocol for agent-to-agent communication
|
|
5
5
|
Project-URL: Homepage, https://github.com/adriannoes/asap-protocol
|
|
6
6
|
Project-URL: Documentation, https://adriannoes.github.io/asap-protocol
|
|
7
7
|
Project-URL: Repository, https://github.com/adriannoes/asap-protocol
|
|
8
8
|
Project-URL: Issues, https://github.com/adriannoes/asap-protocol/issues
|
|
9
|
+
Project-URL: PyPI, https://pypi.org/project/asap-protocol/
|
|
9
10
|
Author: ASAP Protocol Contributors
|
|
10
11
|
License: Apache-2.0
|
|
11
12
|
License-File: LICENSE
|
|
@@ -19,11 +20,12 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
|
19
20
|
Classifier: Topic :: System :: Distributed Computing
|
|
20
21
|
Classifier: Typing :: Typed
|
|
21
22
|
Requires-Python: >=3.13
|
|
22
|
-
Requires-Dist: fastapi>=0.
|
|
23
|
+
Requires-Dist: fastapi>=0.128.0
|
|
23
24
|
Requires-Dist: httpx>=0.28.1
|
|
24
25
|
Requires-Dist: packaging>=25.0
|
|
25
26
|
Requires-Dist: pydantic>=2.12.5
|
|
26
27
|
Requires-Dist: python-ulid>=3.0
|
|
28
|
+
Requires-Dist: slowapi>=0.1.9
|
|
27
29
|
Requires-Dist: structlog>=24.1
|
|
28
30
|
Requires-Dist: typer>=0.21.1
|
|
29
31
|
Requires-Dist: uvicorn>=0.34
|
|
@@ -33,6 +35,7 @@ Requires-Dist: pip-audit>=2.7; extra == 'dev'
|
|
|
33
35
|
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
|
|
34
36
|
Requires-Dist: pytest-benchmark>=5.1; extra == 'dev'
|
|
35
37
|
Requires-Dist: pytest-cov>=6.0; extra == 'dev'
|
|
38
|
+
Requires-Dist: pytest-xdist>=3.5.0; extra == 'dev'
|
|
36
39
|
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
37
40
|
Requires-Dist: ruff>=0.14.14; extra == 'dev'
|
|
38
41
|
Provides-Extra: docs
|
|
@@ -42,11 +45,17 @@ Description-Content-Type: text/markdown
|
|
|
42
45
|
|
|
43
46
|
# ASAP: Async Simple Agent Protocol
|
|
44
47
|
|
|
45
|
-
|
|
48
|
+

|
|
49
|
+
|
|
50
|
+
> A streamlined, scalable, asynchronous protocol for agent-to-agent communication and task coordination. Built as a simpler, more powerful alternative to A2A with native MCP integration and stateful orchestration.
|
|
51
|
+
|
|
52
|
+
**Quick Info**: `v0.3.0` | `Apache 2.0` | `Python 3.13+` | [Documentation](docs/index.md) | [PyPI](https://pypi.org/project/asap-protocol/) | [Changelog](CHANGELOG.md)
|
|
53
|
+
|
|
54
|
+
⚠️ **Alpha Release**: ASAP Protocol is currently in **alpha** (v0.3.0). We're actively developing and improving the protocol based on real-world usage. Your feedback, contributions, and suggestions are essential to help us evolve and make ASAP better for the entire community. See our [Contributing](#contributing) section to get involved!
|
|
46
55
|
|
|
47
56
|
## Why ASAP?
|
|
48
57
|
|
|
49
|
-
Building multi-agent systems today suffers from three core technical challenges:
|
|
58
|
+
Building multi-agent systems today suffers from three core technical challenges that existing protocols like A2A don't fully address:
|
|
50
59
|
1. **$N^2$ Connection Complexity**: Most protocols assume static point-to-point HTTP connections that don't scale.
|
|
51
60
|
2. **State Drift**: Lack of native persistence makes it impossible to reliably resume long-running agentic workflows.
|
|
52
61
|
3. **Fragmentation**: No unified way to handle task delegation, artifact exchange, and tool execution (MCP) in a single envelope.
|
|
@@ -61,8 +70,9 @@ Building multi-agent systems today suffers from three core technical challenges:
|
|
|
61
70
|
- **Observable Chains**: First-class support for `trace_id` and `correlation_id` to debug complex multi-agent delegation.
|
|
62
71
|
- **MCP Integration**: Uses the Model Context Protocol (MCP) as a tool-execution substrate, wrapped in a high-level coordination envelope.
|
|
63
72
|
- **Async-Native**: Engineered from the ground up for high-concurrency environments using `asyncio` and `httpx`. Supports both sync and async handlers with automatic event loop management.
|
|
73
|
+
- **DoS Protection**: Built-in rate limiting (100 req/min), request size limits (10MB), and thread pool bounds to prevent resource exhaustion attacks.
|
|
64
74
|
|
|
65
|
-
|
|
75
|
+
💡 **Performance Note**: Pure Python codebase leveraging Rust-accelerated dependencies (`pydantic-core`, `orjson`, `python-ulid`) for native-level performance without build complexity.
|
|
66
76
|
|
|
67
77
|
## Installation
|
|
68
78
|
|
|
@@ -78,8 +88,16 @@ Or with pip:
|
|
|
78
88
|
pip install asap-protocol
|
|
79
89
|
```
|
|
80
90
|
|
|
91
|
+
📦 **Available on [PyPI](https://pypi.org/project/asap-protocol/)**
|
|
92
|
+
|
|
81
93
|
For reproducible environments, prefer `uv` when possible.
|
|
82
94
|
|
|
95
|
+
## Requirements
|
|
96
|
+
|
|
97
|
+
- **Python**: 3.13 or higher
|
|
98
|
+
- **Dependencies**: Automatically installed via `uv` or `pip`
|
|
99
|
+
- **Optional**: For development, see [Contributing](CONTRIBUTING.md)
|
|
100
|
+
|
|
83
101
|
## Quick Start
|
|
84
102
|
|
|
85
103
|
### 1. Create an Agent (Server)
|
|
@@ -92,7 +110,7 @@ from asap.transport.server import create_app
|
|
|
92
110
|
manifest = Manifest(
|
|
93
111
|
id="urn:asap:agent:echo-agent",
|
|
94
112
|
name="Echo Agent",
|
|
95
|
-
version="0.
|
|
113
|
+
version="0.3.0",
|
|
96
114
|
description="Echoes task input as output",
|
|
97
115
|
capabilities=Capability(
|
|
98
116
|
asap_version="0.1",
|
|
@@ -158,91 +176,49 @@ Transport:
|
|
|
158
176
|
- [Spec](.cursor/docs/general-specs.md)
|
|
159
177
|
- [Docs](docs/index.md)
|
|
160
178
|
- [API Reference](docs/api-reference.md)
|
|
179
|
+
- [Changelog](CHANGELOG.md)
|
|
180
|
+
- [PyPI Package](https://pypi.org/project/asap-protocol/)
|
|
161
181
|
|
|
162
|
-
##
|
|
182
|
+
## When to Use ASAP?
|
|
163
183
|
|
|
164
|
-
|
|
184
|
+
ASAP is ideal for:
|
|
185
|
+
- **Multi-agent orchestration**: Coordinate tasks across multiple AI agents
|
|
186
|
+
- **Stateful workflows**: Long-running tasks that need persistence and resumability
|
|
187
|
+
- **MCP integration**: Agents that need to execute tools via Model Context Protocol
|
|
188
|
+
- **Production systems**: High-performance, type-safe agent communication
|
|
165
189
|
|
|
166
|
-
|
|
167
|
-
from datetime import datetime, timezone
|
|
168
|
-
from asap.models.entities import StateSnapshot
|
|
169
|
-
from asap.state import InMemorySnapshotStore
|
|
170
|
-
|
|
171
|
-
store = InMemorySnapshotStore()
|
|
172
|
-
snapshot = StateSnapshot(
|
|
173
|
-
id="snap_01HX5K7R...",
|
|
174
|
-
task_id="task_01HX5K4N...",
|
|
175
|
-
version=1,
|
|
176
|
-
data={"status": "submitted", "progress": 0},
|
|
177
|
-
created_at=datetime.now(timezone.utc),
|
|
178
|
-
)
|
|
179
|
-
store.save(snapshot)
|
|
180
|
-
latest = store.get("task_01HX5K4N...")
|
|
181
|
-
```
|
|
190
|
+
If you're building simple point-to-point agent communication, a basic HTTP API might suffice. ASAP shines when you need orchestration, state management, and multi-agent coordination.
|
|
182
191
|
|
|
183
|
-
|
|
192
|
+
## Advanced Topics
|
|
184
193
|
|
|
185
|
-
|
|
186
|
-
from asap.errors import InvalidTransitionError
|
|
194
|
+
Explore these guides for detailed information on specific features:
|
|
187
195
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
196
|
+
- **[State Management](docs/state-management.md)**: Task lifecycle, state machine, and snapshot persistence for resumable workflows.
|
|
197
|
+
- **[Error Handling](docs/error-handling.md)**: Structured error taxonomy and recovery patterns for robust agent communication.
|
|
198
|
+
- **[Transport Layer](docs/transport.md)**: HTTP/JSON-RPC binding details, async handlers, and server configuration.
|
|
199
|
+
- **[Security](docs/security.md)**: Production security practices, rate limiting, DoS protection, and authentication.
|
|
200
|
+
- **[Observability](docs/observability.md)**: Tracing, metrics, and logging for debugging multi-agent systems.
|
|
201
|
+
- **[Testing](docs/testing.md)**: Testing strategies and utilities for ASAP-based agents.
|
|
194
202
|
|
|
195
|
-
###
|
|
203
|
+
### Examples & Demos
|
|
196
204
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
```python
|
|
200
|
-
# Sync handler
|
|
201
|
-
def my_sync_handler(envelope: Envelope, manifest: Manifest) -> Envelope:
|
|
202
|
-
# Process synchronously
|
|
203
|
-
return response_envelope
|
|
204
|
-
|
|
205
|
-
# Async handler
|
|
206
|
-
async def my_async_handler(envelope: Envelope, manifest: Manifest) -> Envelope:
|
|
207
|
-
# Process asynchronously (e.g., database calls, API requests)
|
|
208
|
-
result = await some_async_operation()
|
|
209
|
-
return response_envelope
|
|
210
|
-
|
|
211
|
-
registry.register("task.request", my_async_handler) # Works with both!
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
### Multi-Agent Flow
|
|
215
|
-
|
|
216
|
-
Run the built-in demo to see two agents exchanging messages:
|
|
205
|
+
Run the built-in multi-agent demo to see ASAP in action:
|
|
217
206
|
|
|
218
207
|
```bash
|
|
219
208
|
uv run python -m asap.examples.run_demo
|
|
220
209
|
```
|
|
221
210
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
The ASAP CLI provides utilities for schema management:
|
|
225
|
-
|
|
226
|
-
```bash
|
|
227
|
-
# Export all JSON schemas
|
|
228
|
-
asap export-schemas --output-dir ./schemas
|
|
229
|
-
|
|
230
|
-
# List available schemas
|
|
231
|
-
asap list-schemas
|
|
232
|
-
|
|
233
|
-
# Show a specific schema
|
|
234
|
-
asap show-schema envelope
|
|
211
|
+
See [`src/asap/examples/`](src/asap/examples/) for complete example implementations.
|
|
235
212
|
|
|
236
|
-
|
|
237
|
-
asap validate-schema message.json --schema-type envelope
|
|
213
|
+
### CLI Tools
|
|
238
214
|
|
|
239
|
-
#
|
|
240
|
-
asap export-schemas --verbose
|
|
241
|
-
```
|
|
215
|
+
The ASAP CLI provides utilities for schema management. See [CLI documentation](docs/index.md#cli) or run `asap --help` for available commands.
|
|
242
216
|
|
|
243
217
|
## Contributing
|
|
244
218
|
|
|
245
|
-
We love contributions! Whether it's fixing a bug, improving documentation
|
|
219
|
+
We love contributions! Whether it's fixing a bug, improving documentation or proposing a new feature.. your help is welcome.
|
|
220
|
+
|
|
221
|
+
**As an alpha release, community feedback and contributions are essential** for ASAP Protocol's evolution. We're actively working on improvements and your input helps shape the future of the protocol. Every contribution, from bug reports to feature suggestions, documentation improvements and code contributions, makes a real difference.
|
|
246
222
|
|
|
247
223
|
Check out our [Contributing Guidelines](CONTRIBUTING.md) to get started. It's easier than you think! 🚀
|
|
248
224
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
asap/__init__.py,sha256=
|
|
1
|
+
asap/__init__.py,sha256=kyqepZHflLpgwKPTQYlSrCZpSa9i9moeiyiaYMTvbHw,169
|
|
2
2
|
asap/cli.py,sha256=JzMA3t2Gn94kunkn5bgAkl6ZgzgwGtL5QFcKLYqWZYA,6621
|
|
3
|
-
asap/errors.py,sha256=
|
|
3
|
+
asap/errors.py,sha256=Kqj6fLhVjwHWYcZU_U7ZgK75HPGKUq5jAgL1-wQjb40,6396
|
|
4
4
|
asap/schemas.py,sha256=c9MttEoI4mgXFHDFzphSRAJhw7cpy2rcnXH31jlo1sQ,6135
|
|
5
5
|
asap/examples/README.md,sha256=xqMIMcZANi1eML6t4cNJ3rG6MjySf2SchgFiecxKpik,765
|
|
6
6
|
asap/examples/__init__.py,sha256=LaEkmPQ4tpYrkLFjBE_aodjW3_XUcKWoFLGVFD5kuvo,56
|
|
7
|
-
asap/examples/coordinator.py,sha256=
|
|
8
|
-
asap/examples/echo_agent.py,sha256=
|
|
7
|
+
asap/examples/coordinator.py,sha256=C5Ugi47PGwtbRao8eD29v2l_9tww2_sL-kXK5jQaWGw,5370
|
|
8
|
+
asap/examples/echo_agent.py,sha256=cmNjEx28jCNcU4waYFOZ8ZcHxth1znMOhmaGXIquJzA,2947
|
|
9
9
|
asap/examples/run_demo.py,sha256=bFHH4IY-xYXIw66opgKGfmuXSC7_6astkERLtN0a9pw,3700
|
|
10
10
|
asap/models/__init__.py,sha256=iUriI2CN9NcpH1_TyY5PkWiX3Mz7UnJDC9IeJzcWFUI,2511
|
|
11
11
|
asap/models/base.py,sha256=PvLkFinOzfU6DDJ4pXMku7PK_2Xsaprh055mJKbdPUA,2008
|
|
12
|
-
asap/models/constants.py,sha256=
|
|
12
|
+
asap/models/constants.py,sha256=AEPklwTNZbYnSRsZ6HIeVI8F8T_zt1nZVzZPkqXo1rY,425
|
|
13
13
|
asap/models/entities.py,sha256=siZCt-XqbOSPleXFBvwCSC9sVfZCrydNrUiKso8RHDo,16742
|
|
14
14
|
asap/models/enums.py,sha256=q8tnW10AT94hxDFoH1Psg1a1x4tzs47x12N7RTGLNRQ,1644
|
|
15
15
|
asap/models/envelope.py,sha256=MTlFEmYcT47gpQhOxWYGEUe99hw_woMWqWdp3rZl-co,3733
|
|
@@ -19,18 +19,19 @@ asap/models/payloads.py,sha256=l0taURdWy09BASSJkiCrR6VixbqzD3HrFdVrFad7YqQ,14867
|
|
|
19
19
|
asap/models/types.py,sha256=ldWyz6gThlK_cxywxfcIiMLD74_BRV0lbfyussvSURg,978
|
|
20
20
|
asap/observability/__init__.py,sha256=V1bBAZix7_IAoy09ETTlkSsi-1ENq5_EpBhi599EBxE,1145
|
|
21
21
|
asap/observability/logging.py,sha256=1nK1OP-3BBpOf8d5UFmpSP8_mULF5kZ27YoS3S3U1a0,6733
|
|
22
|
-
asap/observability/metrics.py,sha256=
|
|
22
|
+
asap/observability/metrics.py,sha256=5yvXfvQ8FpigJ6pJ3vTQetSCQhPnoUCKywWigrxgnCI,14778
|
|
23
23
|
asap/state/__init__.py,sha256=bV1oO86TReF48C5IaglNr8WHczzAWTpw3n7SyDw04nk,565
|
|
24
24
|
asap/state/machine.py,sha256=1Obl1BcwwU-Xz20MX-layuPh1BVzcI1Kiowl_CueuU4,2795
|
|
25
25
|
asap/state/snapshot.py,sha256=wPc2pnQD_EdPecEndbjIC9mXJep-LCJwtdazGMJSUJc,8654
|
|
26
26
|
asap/transport/__init__.py,sha256=rX_hcnm0c-XxJKvxc4H2b_APNIVmdvXphRIqDrDWC8U,2506
|
|
27
27
|
asap/transport/client.py,sha256=fHzz8M_qeNMLZhDxsOWeAVMXMNeOHFnmovptBMDsN2I,14325
|
|
28
|
-
asap/transport/
|
|
28
|
+
asap/transport/executors.py,sha256=0UH2cd5fVPGPGtnzmnFq1W8IF9BLjp5grCz3Oucj7CQ,5737
|
|
29
|
+
asap/transport/handlers.py,sha256=BGnAF-RDiZYjdh0V-AqmvqrAkCh_QfI0yO-x1wzxOGQ,15924
|
|
29
30
|
asap/transport/jsonrpc.py,sha256=Cnh6ahoXr4Dkmt2KqoXESDKKs_9MwfsgIjn-TDjpkEQ,5800
|
|
30
|
-
asap/transport/middleware.py,sha256=
|
|
31
|
-
asap/transport/server.py,sha256=
|
|
32
|
-
asap_protocol-0.
|
|
33
|
-
asap_protocol-0.
|
|
34
|
-
asap_protocol-0.
|
|
35
|
-
asap_protocol-0.
|
|
36
|
-
asap_protocol-0.
|
|
31
|
+
asap/transport/middleware.py,sha256=pcY3SIynXY2ZrHg4_xlSHrPQeyjfrnOT51bNXevEAqQ,23276
|
|
32
|
+
asap/transport/server.py,sha256=Ev5Q--9ZdEHd2m-xi-TH24HHT0o6UX6pLzlsoU0l29Q,42575
|
|
33
|
+
asap_protocol-0.3.0.dist-info/METADATA,sha256=cjtpIzaR1QND7YiGII29-3PhhrhmDhShMbe2FHtHRQs,9954
|
|
34
|
+
asap_protocol-0.3.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
35
|
+
asap_protocol-0.3.0.dist-info/entry_points.txt,sha256=H_u_JamRG5mGQTXwnCFljBFep6lZPuln9NPLfgq1naM,39
|
|
36
|
+
asap_protocol-0.3.0.dist-info/licenses/LICENSE,sha256=JmjzvAfg8BUP_0y_hu4SQSUgnSniWe2eBS7x2WPTo2A,10771
|
|
37
|
+
asap_protocol-0.3.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|