asap-protocol 0.3.0__py3-none-any.whl → 1.0.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.
Files changed (62) hide show
  1. asap/__init__.py +1 -1
  2. asap/cli.py +137 -2
  3. asap/errors.py +167 -0
  4. asap/examples/README.md +81 -10
  5. asap/examples/auth_patterns.py +212 -0
  6. asap/examples/error_recovery.py +248 -0
  7. asap/examples/long_running.py +287 -0
  8. asap/examples/mcp_integration.py +240 -0
  9. asap/examples/multi_step_workflow.py +134 -0
  10. asap/examples/orchestration.py +293 -0
  11. asap/examples/rate_limiting.py +137 -0
  12. asap/examples/run_demo.py +9 -4
  13. asap/examples/secure_handler.py +84 -0
  14. asap/examples/state_migration.py +240 -0
  15. asap/examples/streaming_response.py +108 -0
  16. asap/examples/websocket_concept.py +129 -0
  17. asap/mcp/__init__.py +43 -0
  18. asap/mcp/client.py +224 -0
  19. asap/mcp/protocol.py +179 -0
  20. asap/mcp/server.py +333 -0
  21. asap/mcp/server_runner.py +40 -0
  22. asap/models/__init__.py +4 -0
  23. asap/models/base.py +0 -3
  24. asap/models/constants.py +76 -1
  25. asap/models/entities.py +58 -7
  26. asap/models/envelope.py +14 -1
  27. asap/models/ids.py +8 -4
  28. asap/models/parts.py +33 -3
  29. asap/models/validators.py +16 -0
  30. asap/observability/__init__.py +6 -0
  31. asap/observability/dashboards/README.md +24 -0
  32. asap/observability/dashboards/asap-detailed.json +131 -0
  33. asap/observability/dashboards/asap-red.json +129 -0
  34. asap/observability/logging.py +81 -1
  35. asap/observability/metrics.py +15 -1
  36. asap/observability/trace_parser.py +238 -0
  37. asap/observability/trace_ui.py +218 -0
  38. asap/observability/tracing.py +293 -0
  39. asap/state/machine.py +15 -2
  40. asap/state/snapshot.py +0 -9
  41. asap/testing/__init__.py +31 -0
  42. asap/testing/assertions.py +108 -0
  43. asap/testing/fixtures.py +113 -0
  44. asap/testing/mocks.py +152 -0
  45. asap/transport/__init__.py +31 -0
  46. asap/transport/cache.py +180 -0
  47. asap/transport/circuit_breaker.py +194 -0
  48. asap/transport/client.py +989 -72
  49. asap/transport/compression.py +389 -0
  50. asap/transport/handlers.py +106 -53
  51. asap/transport/middleware.py +64 -39
  52. asap/transport/server.py +461 -94
  53. asap/transport/validators.py +320 -0
  54. asap/utils/__init__.py +7 -0
  55. asap/utils/sanitization.py +134 -0
  56. asap_protocol-1.0.0.dist-info/METADATA +264 -0
  57. asap_protocol-1.0.0.dist-info/RECORD +70 -0
  58. asap_protocol-0.3.0.dist-info/METADATA +0 -227
  59. asap_protocol-0.3.0.dist-info/RECORD +0 -37
  60. {asap_protocol-0.3.0.dist-info → asap_protocol-1.0.0.dist-info}/WHEEL +0 -0
  61. {asap_protocol-0.3.0.dist-info → asap_protocol-1.0.0.dist-info}/entry_points.txt +0 -0
  62. {asap_protocol-0.3.0.dist-info → asap_protocol-1.0.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,264 @@
1
+ Metadata-Version: 2.4
2
+ Name: asap-protocol
3
+ Version: 1.0.0
4
+ Summary: Async Simple Agent Protocol - A streamlined protocol for agent-to-agent communication
5
+ Project-URL: Homepage, https://github.com/adriannoes/asap-protocol
6
+ Project-URL: Documentation, https://adriannoes.github.io/asap-protocol
7
+ Project-URL: Repository, https://github.com/adriannoes/asap-protocol
8
+ Project-URL: Issues, https://github.com/adriannoes/asap-protocol/issues
9
+ Project-URL: PyPI, https://pypi.org/project/asap-protocol/
10
+ Author: ASAP Protocol Contributors
11
+ License: Apache-2.0
12
+ License-File: LICENSE
13
+ Keywords: a2a,agent,async,communication,mcp,protocol
14
+ Classifier: Development Status :: 5 - Production/Stable
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: License :: OSI Approved :: Apache Software License
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
+ Classifier: Topic :: System :: Distributed Computing
21
+ Classifier: Typing :: Typed
22
+ Requires-Python: >=3.13
23
+ Requires-Dist: brotli>=1.2.0
24
+ Requires-Dist: fastapi>=0.128.0
25
+ Requires-Dist: httpx[http2]>=0.28.1
26
+ Requires-Dist: jsonschema>=4.23.0
27
+ Requires-Dist: opentelemetry-api>=1.20
28
+ Requires-Dist: opentelemetry-exporter-otlp-proto-grpc>=1.20
29
+ Requires-Dist: opentelemetry-instrumentation-fastapi>=0.41
30
+ Requires-Dist: opentelemetry-instrumentation-httpx>=0.41
31
+ Requires-Dist: opentelemetry-sdk>=1.20
32
+ Requires-Dist: packaging>=25.0
33
+ Requires-Dist: pydantic>=2.12.5
34
+ Requires-Dist: python-ulid>=3.0
35
+ Requires-Dist: slowapi>=0.1.9
36
+ Requires-Dist: structlog>=24.1
37
+ Requires-Dist: typer>=0.21.1
38
+ Requires-Dist: uvicorn>=0.34
39
+ Requires-Dist: watchfiles>=0.21.0
40
+ Provides-Extra: dev
41
+ Requires-Dist: brotli>=1.1.0; extra == 'dev'
42
+ Requires-Dist: mypy>=1.19.1; extra == 'dev'
43
+ Requires-Dist: pip-audit>=2.7; extra == 'dev'
44
+ Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
45
+ Requires-Dist: pytest-benchmark>=5.1; extra == 'dev'
46
+ Requires-Dist: pytest-cov>=6.0; extra == 'dev'
47
+ Requires-Dist: pytest-xdist>=3.5.0; extra == 'dev'
48
+ Requires-Dist: pytest>=8.0; extra == 'dev'
49
+ Requires-Dist: ruff>=0.14.14; extra == 'dev'
50
+ Requires-Dist: types-jsonschema>=4.0.0; extra == 'dev'
51
+ Provides-Extra: docs
52
+ Requires-Dist: mkdocs-material>=9.5; extra == 'docs'
53
+ Requires-Dist: mkdocstrings[python]>=0.27; extra == 'docs'
54
+ Description-Content-Type: text/markdown
55
+
56
+ # ASAP: Async Simple Agent Protocol
57
+
58
+ ![ASAP Protocol Banner](https://raw.githubusercontent.com/adriannoes/asap-protocol/main/.github/assets/asap-protocol-banner.png)
59
+
60
+
61
+ > 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.
62
+
63
+ **Quick Info**: `v1.0.0` | `Apache 2.0` | `Python 3.13+` | [Documentation](https://github.com/adriannoes/asap-protocol/blob/main/docs/index.md) | [PyPI](https://pypi.org/project/asap-protocol/1.0.0/) | [Changelog](https://github.com/adriannoes/asap-protocol/blob/main/CHANGELOG.md)
64
+
65
+ **Stable** — ASAP Protocol v1.0.0 is production-ready. We welcome feedback and contributions. See our [Contributing](https://github.com/adriannoes/asap-protocol#contributing) section to get involved!
66
+
67
+ ## Why ASAP?
68
+
69
+ Building multi-agent systems today suffers from three core technical challenges that existing protocols like A2A don't fully address:
70
+ 1. **$N^2$ Connection Complexity**: Most protocols assume static point-to-point HTTP connections that don't scale.
71
+ 2. **State Drift**: Lack of native persistence makes it impossible to reliably resume long-running agentic workflows.
72
+ 3. **Fragmentation**: No unified way to handle task delegation, artifact exchange, and tool execution (MCP) in a single envelope.
73
+
74
+ **ASAP** provides a production-ready communication layer that simplifies these complexities. It introduces a standardized, stateful orchestration framework that ensures your agents can coordinate reliably across distributed environments. → [Spec](https://github.com/adriannoes/asap-protocol/blob/main/.cursor/product-specs/v0-original-specs.md)
75
+
76
+ ### Key Features
77
+
78
+ - **Stateful orchestration** — Task state machine with snapshotting for resumable workflows.
79
+ - **Schema-first** — Pydantic v2 + JSON Schema for cross-agent interoperability.
80
+ - **Async-native** — `asyncio` + `httpx`; sync and async handlers supported.
81
+ - **MCP integration** — Tool execution and coordination in a single envelope.
82
+ - **Observable** — `trace_id` and `correlation_id` for debugging.
83
+ - **Security (v1.0.0)** — Bearer auth, replay prevention, HTTPS, rate limiting (100 req/min). Opt-in.
84
+
85
+ ## Installation
86
+
87
+ We recommend using [uv](https://github.com/astral-sh/uv) for dependency management:
88
+
89
+ ```bash
90
+ uv add asap-protocol
91
+ ```
92
+
93
+ Or with pip:
94
+
95
+ ```bash
96
+ pip install asap-protocol
97
+ ```
98
+
99
+ 📦 **Available on [PyPI](https://pypi.org/project/asap-protocol/1.0.0/)**
100
+
101
+ For reproducible environments, prefer `uv` when possible.
102
+
103
+ ## Requirements
104
+
105
+ - **Python**: 3.13 or higher
106
+ - **Dependencies**: Automatically installed via `uv` or `pip`
107
+ - **Optional**: For development, see [Contributing](https://github.com/adriannoes/asap-protocol/blob/main/CONTRIBUTING.md).
108
+
109
+ ## Quick Start
110
+
111
+ ### 1. Create an Agent (Server)
112
+
113
+ ```python
114
+ from asap.models.entities import Capability, Endpoint, Manifest, Skill
115
+ from asap.transport.handlers import HandlerRegistry, create_echo_handler
116
+ from asap.transport.server import create_app
117
+
118
+ manifest = Manifest(
119
+ id="urn:asap:agent:echo-agent",
120
+ name="Echo Agent",
121
+ version="1.0.0",
122
+ description="Echoes task input as output",
123
+ capabilities=Capability(
124
+ asap_version="0.1",
125
+ skills=[Skill(id="echo", description="Echo back the input")],
126
+ state_persistence=False,
127
+ ),
128
+ # Development: HTTP localhost is allowed
129
+ # Production: Always use HTTPS (e.g., "https://api.example.com/asap")
130
+ endpoints=Endpoint(asap="http://127.0.0.1:8001/asap"),
131
+ )
132
+
133
+ registry = HandlerRegistry()
134
+ registry.register("task.request", create_echo_handler())
135
+
136
+ app = create_app(manifest, registry)
137
+ ```
138
+
139
+ ### 2. Send a Task (Client)
140
+
141
+ ```python
142
+ import asyncio
143
+ from asap.models.envelope import Envelope
144
+ from asap.models.payloads import TaskRequest
145
+ from asap.transport.client import ASAPClient
146
+
147
+ async def main():
148
+ request = TaskRequest(
149
+ conversation_id="conv_01HX5K3MQVN8",
150
+ skill_id="echo",
151
+ input={"message": "hello from client"},
152
+ )
153
+ envelope = Envelope(
154
+ asap_version="0.1",
155
+ sender="urn:asap:agent:client",
156
+ recipient="urn:asap:agent:echo-agent",
157
+ payload_type="task.request",
158
+ payload=request.model_dump(),
159
+ )
160
+ # Development: HTTP localhost is allowed (with warning)
161
+ # Production: Always use HTTPS (e.g., "https://api.example.com")
162
+ async with ASAPClient("http://127.0.0.1:8001") as client:
163
+ response = await client.send(envelope)
164
+ print(response.payload)
165
+
166
+ if __name__ == "__main__":
167
+ asyncio.run(main())
168
+ ```
169
+
170
+ ## Try it
171
+
172
+ **Run the multi-agent demo** (echo agent + coordinator, one round-trip):
173
+
174
+ ```bash
175
+ uv run python -m asap.examples.run_demo
176
+ ```
177
+
178
+ **Run any of 14+ examples** (auth, MCP, state migration, etc.):
179
+
180
+ ```bash
181
+ uv run python -m asap.examples.<module_name> [options]
182
+ ```
183
+
184
+ → Full list: [Examples README](https://github.com/adriannoes/asap-protocol/blob/main/src/asap/examples/README.md)
185
+
186
+ | Category | Examples |
187
+ |----------|----------|
188
+ | **Core** | `run_demo`, `echo_agent`, `coordinator`, `secure_handler` |
189
+ | **Orchestration** | `orchestration` (multi-agent, task coordination, state tracking) |
190
+ | **State** | `long_running` (checkpoints, resume after crash), `state_migration` (move state between agents) |
191
+ | **Resilience** | `error_recovery` (retry, circuit breaker, fallback) |
192
+ | **Integration** | `mcp_integration` (MCP tools via envelopes) |
193
+ | **Auth & limits** | `auth_patterns` (Bearer, validators, OAuth2 concept), `rate_limiting` (per-sender, per-endpoint) |
194
+ | **Concepts** | `websocket_concept` (WebSocket design), `streaming_response` (TaskUpdate streaming), `multi_step_workflow` (pipeline) |
195
+
196
+ ## Testing
197
+
198
+ ```bash
199
+ uv run pytest -n auto --tb=short
200
+ ```
201
+
202
+ With coverage:
203
+
204
+ ```bash
205
+ uv run pytest --cov=src --cov-report=term-missing
206
+ ```
207
+
208
+ → [Testing Guide](https://github.com/adriannoes/asap-protocol/blob/main/docs/testing.md) — structure, fixtures, property/load/chaos tests
209
+ → [Contributing](https://github.com/adriannoes/asap-protocol/blob/main/CONTRIBUTING.md) — dev setup, CI
210
+
211
+ ## Benchmarks
212
+
213
+ → [Benchmark Results](https://github.com/adriannoes/asap-protocol/blob/main/benchmarks/RESULTS.md) — Load (1,500+ RPS), stress, memory
214
+
215
+ ## API Overview
216
+
217
+ Core models: `Envelope`, `TaskRequest`/`TaskResponse`/`TaskUpdate`/`TaskCancel`, `MessageSend`, `ArtifactNotify`, `StateQuery`/`StateRestore`, `McpToolCall`/`McpToolResult`/`McpResourceFetch`/`McpResourceData`. → [API Reference](https://github.com/adriannoes/asap-protocol/blob/main/docs/api-reference.md)
218
+
219
+ Transport: `create_app`, `HandlerRegistry`, `ASAPClient`. → [Transport](https://github.com/adriannoes/asap-protocol/blob/main/docs/transport.md)
220
+
221
+ ## When to Use ASAP?
222
+
223
+ ASAP is ideal for:
224
+ - **Multi-agent orchestration**: Coordinate tasks across multiple AI agents
225
+ - **Stateful workflows**: Long-running tasks that need persistence and resumability
226
+ - **MCP integration**: Agents that need to execute tools via Model Context Protocol
227
+ - **Production systems**: High-performance, type-safe agent communication
228
+
229
+ 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.
230
+
231
+ ## Documentation
232
+
233
+ **Learn**
234
+ - [Docs](https://github.com/adriannoes/asap-protocol/blob/main/docs/index.md) | [API Reference](https://github.com/adriannoes/asap-protocol/blob/main/docs/api-reference.md)
235
+ - [Tutorials](https://github.com/adriannoes/asap-protocol/tree/main/docs/tutorials) — First agent → production checklist
236
+ - [Migration from A2A/MCP](https://github.com/adriannoes/asap-protocol/blob/main/docs/migration.md)
237
+
238
+ **Deep dive**
239
+ - [State Management](https://github.com/adriannoes/asap-protocol/blob/main/docs/state-management.md) | [Error Handling](https://github.com/adriannoes/asap-protocol/blob/main/docs/error-handling.md)
240
+ - [Transport](https://github.com/adriannoes/asap-protocol/blob/main/docs/transport.md) | [Security](https://github.com/adriannoes/asap-protocol/blob/main/docs/security.md)
241
+ - [Observability](https://github.com/adriannoes/asap-protocol/blob/main/docs/observability.md) | [Testing](https://github.com/adriannoes/asap-protocol/blob/main/docs/testing.md)
242
+
243
+ **Decisions & ops**
244
+ - [ADRs](https://github.com/adriannoes/asap-protocol/tree/main/docs/adr) — 17 Architecture Decision Records
245
+ - [Deployment](https://github.com/adriannoes/asap-protocol/blob/main/docs/deployment/kubernetes.md) | [Troubleshooting](https://github.com/adriannoes/asap-protocol/blob/main/docs/troubleshooting.md)
246
+
247
+ **Release**
248
+ - [Changelog](https://github.com/adriannoes/asap-protocol/blob/main/CHANGELOG.md) | [PyPI](https://pypi.org/project/asap-protocol/1.0.0/)
249
+
250
+ ## CLI
251
+
252
+ `asap --version` | `asap export-schemas` | `asap list-schemas` | `asap show-schema` — [CLI docs](https://github.com/adriannoes/asap-protocol/blob/main/docs/index.md#cli) or `asap --help`
253
+
254
+ ## Contributing
255
+
256
+ We love contributions! Whether it's fixing a bug, improving documentation or proposing a new feature.. your help is welcome.
257
+
258
+ **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.
259
+
260
+ Check out our [Contributing Guidelines](https://github.com/adriannoes/asap-protocol/blob/main/CONTRIBUTING.md) to get started. It's easier than you think! 🚀
261
+
262
+ ## License
263
+
264
+ This project is licensed under the Apache 2.0 License - see the [LICENSE](https://github.com/adriannoes/asap-protocol/blob/main/LICENSE) file for details.
@@ -0,0 +1,70 @@
1
+ asap/__init__.py,sha256=K2PhO3EHYthoYxUJgjZEPt_E1c8Uh0Kt2YO3fNa5_fI,169
2
+ asap/cli.py,sha256=1mpk6BdApazJCWY_w5OJQOdcmvmBD9V-ztBVhmAf--I,11280
3
+ asap/errors.py,sha256=pc4QQfseteEujGp3bDH-IiPpr-xh1N6DvDL5faiFY9M,11917
4
+ asap/schemas.py,sha256=c9MttEoI4mgXFHDFzphSRAJhw7cpy2rcnXH31jlo1sQ,6135
5
+ asap/examples/README.md,sha256=ydk02C1tjzSZU3W5yfTgT89tuC5S6BjmzIMu4uiMDMg,4460
6
+ asap/examples/__init__.py,sha256=LaEkmPQ4tpYrkLFjBE_aodjW3_XUcKWoFLGVFD5kuvo,56
7
+ asap/examples/auth_patterns.py,sha256=OC-NOfX3q8-TbJn5Zk-SfbGw52h3hAKwELbMScyXcFw,7171
8
+ asap/examples/coordinator.py,sha256=C5Ugi47PGwtbRao8eD29v2l_9tww2_sL-kXK5jQaWGw,5370
9
+ asap/examples/echo_agent.py,sha256=cmNjEx28jCNcU4waYFOZ8ZcHxth1znMOhmaGXIquJzA,2947
10
+ asap/examples/error_recovery.py,sha256=LI-8ediOqSfoddjgUgvycs28Hk9K-d6uxZq9nRJO2Rk,7822
11
+ asap/examples/long_running.py,sha256=0DGLHsjbOoYU_aUetjPiV3PUzo6Xn-DybmHbI45ajJQ,8841
12
+ asap/examples/mcp_integration.py,sha256=rkKja6kAFnGje2lQMStLybfDi7M3s-0yDId-llhz7aU,7943
13
+ asap/examples/multi_step_workflow.py,sha256=XsVAaqhFCfOktahV1Qcyp7pyr4JusKAjH48V9QrYaYk,4070
14
+ asap/examples/orchestration.py,sha256=idTIDsgoO0WqFCysi58z3NnfQJa5gMhDLTRMGDZcVSo,9904
15
+ asap/examples/rate_limiting.py,sha256=WfETgDsPCB82TxDrFutfDShKlCm_WXrW9P5TWlQogic,4452
16
+ asap/examples/run_demo.py,sha256=kxCsCrX3i34bqc_nsy_QtnBG8FxgC4Hwkyz5JNP8cmo,3953
17
+ asap/examples/secure_handler.py,sha256=SmrgRc0Ntw3FGaip18OwzJIKtrjCvGChNSjMG7tJeZA,3138
18
+ asap/examples/state_migration.py,sha256=IS7P5gbnpuBLJ4OAb__IHLtA3OgkBmGaUPPWI8JI2fk,7915
19
+ asap/examples/streaming_response.py,sha256=Jh-8F6QsEal-xbsk3mSJs_LwacLsegp7sXikqCAe9mY,3254
20
+ asap/examples/websocket_concept.py,sha256=l96gvdEVxZ5yyDZn4fQR3M-a_-zUX4e60eOhljkRRRU,5159
21
+ asap/mcp/__init__.py,sha256=u_F-o9ZlleraUbOo05zkRpZrW06mpuxnO_uFVA22Dr8,1121
22
+ asap/mcp/client.py,sha256=qt71Q1eEkRWrymlz4LKZ3GfMYe8r5Ho2n3TigfGMobk,7958
23
+ asap/mcp/protocol.py,sha256=EwStOJP0Tf7ga6iWGeejD7kNBdV7lbPB4mZnREVEGQ4,5438
24
+ asap/mcp/server.py,sha256=8LnjcloGTp3sH_HsKgeylgo1r97TpU33WZqgc0G_0sc,12458
25
+ asap/mcp/server_runner.py,sha256=cGH3AyiQ3v7SzizwPNMOUSV-TCrI2Az4sudUzFOwKNU,1011
26
+ asap/models/__init__.py,sha256=c9TDscYv-_2U8OlEt7G-Il02flISgGbckZu4RtDwgDk,2643
27
+ asap/models/base.py,sha256=BVydcmBLDU2hD7SzjfROcm1njeqTG82OARMUH5y4wlY,1863
28
+ asap/models/constants.py,sha256=nDlUALrkWM3bKv-MUzqbvJZyJhRXp1bF3vvGa8IDKG8,3271
29
+ asap/models/entities.py,sha256=bePFLqCR7Ikg-cfVqt6U94xOvDAvhriw4lnQiBEYOWU,18342
30
+ asap/models/enums.py,sha256=q8tnW10AT94hxDFoH1Psg1a1x4tzs47x12N7RTGLNRQ,1644
31
+ asap/models/envelope.py,sha256=qVBVQh7nnFURlSz1LbXPXn2EmL4kRcJ28-MkHURhlZA,4297
32
+ asap/models/ids.py,sha256=w8A3SNUkEB_U80C6F4kL30yB9-THh-okVD-wTqCkQZQ,1807
33
+ asap/models/parts.py,sha256=0QxwQJndIPpjOkJ5BCvj6SCRX6hyIxVAIdc4DXGfEu0,7978
34
+ asap/models/payloads.py,sha256=l0taURdWy09BASSJkiCrR6VixbqzD3HrFdVrFad7YqQ,14867
35
+ asap/models/types.py,sha256=ldWyz6gThlK_cxywxfcIiMLD74_BRV0lbfyussvSURg,978
36
+ asap/models/validators.py,sha256=xbLMzP_vao64m-SpM00nBFhWnI7aPUdlOYiSfRZd7Ps,563
37
+ asap/observability/__init__.py,sha256=jJZ3-9OCFjtmb_erz54Gh1bZRGQAeBh8vT71ZnamffQ,1287
38
+ asap/observability/logging.py,sha256=j8pGL_KISvflyYE3koEISu6afp-9khl5HOgVDnR_Y-U,9603
39
+ asap/observability/metrics.py,sha256=YgDJaEF8wsTxEphuBTMP5sNgIH0XtTQOyTd1OVxuK9U,15952
40
+ asap/observability/trace_parser.py,sha256=U4bGYEGA9Z-oNr2Uk94eXztXKDmBeGtY-7w1zl9QQBM,7874
41
+ asap/observability/trace_ui.py,sha256=4gHR2rdo8qEKW4dSBF78bgcIhyfEX3fTVeuXsjf8YS4,7621
42
+ asap/observability/tracing.py,sha256=2adDzwYLbOoitBLUJcXlwCrkoIjduR9b7Jjmiv9a52c,9945
43
+ asap/observability/dashboards/README.md,sha256=lyZ_jyuDKvmiGdLYmWQ_iJzV-bjIdfTpzXDJKmNVQOI,1208
44
+ asap/observability/dashboards/asap-detailed.json,sha256=W6h9BKK3Ss9WHIJXcpQw5U5t2KMcaXl1-_Ghe0jCFyA,5354
45
+ asap/observability/dashboards/asap-red.json,sha256=5nPUkm9ZI88val6cWlsCsNT1ni0qz140DFRn8FMqfpM,5231
46
+ asap/state/__init__.py,sha256=bV1oO86TReF48C5IaglNr8WHczzAWTpw3n7SyDw04nk,565
47
+ asap/state/machine.py,sha256=p5qdA_z3VhiLU448O5WOoBiUsSPPc42JYYAjHHO6fWI,3246
48
+ asap/state/snapshot.py,sha256=INbjRtfsLLXFkbgIySvgG3nKsKAdjPIeCB6gaT6DqtY,8318
49
+ asap/testing/__init__.py,sha256=EQV8-cYvM__NT_0rA3nPvz4_RlRTpIYKzqhGEtpdQhM,1009
50
+ asap/testing/assertions.py,sha256=4KumraQSBolb9db3J4P3rZOT_1JRyS9dLqI4hhbBHDc,4149
51
+ asap/testing/fixtures.py,sha256=OVfsfrgs1P1I2GjsNByKOssOXENwf-nDm2lPV6vZY-A,3114
52
+ asap/testing/mocks.py,sha256=AcCcI3fKKXwpf1nvGR2NZt2RBkCxIhBhJ1dO6ZxzEWc,5045
53
+ asap/transport/__init__.py,sha256=g-A04M9BsDeVF5TCBNcFgFIpJOlRmljs67M8RV8yGK0,3289
54
+ asap/transport/cache.py,sha256=2ccVU9Ki2xn6Yl-mVQ9fqOnWCCqD9VEHtkAAi2OsdxU,5583
55
+ asap/transport/circuit_breaker.py,sha256=8MdEpJqbhpIFdXorpycQIbtnGrTeOdORwfBgT4M9MrU,6302
56
+ asap/transport/client.py,sha256=XX-EZvanEKzfrUHnTjF5_TYVyE3k1gNg5Ki6wKpg_C0,59163
57
+ asap/transport/compression.py,sha256=XGeO1rNURMDqYHDFOI5z3KOrRc06v4LnCtnveZu_eN8,11746
58
+ asap/transport/executors.py,sha256=0UH2cd5fVPGPGtnzmnFq1W8IF9BLjp5grCz3Oucj7CQ,5737
59
+ asap/transport/handlers.py,sha256=AZOTQppMiDHqnPqaz8fenq0SmEc3130gXLP-zspEufY,17794
60
+ asap/transport/jsonrpc.py,sha256=Cnh6ahoXr4Dkmt2KqoXESDKKs_9MwfsgIjn-TDjpkEQ,5800
61
+ asap/transport/middleware.py,sha256=s9PXq4pnTC6fwiME7Tc1h89r-7qJ61luhxyxZJnE6nw,24435
62
+ asap/transport/server.py,sha256=eZDPjbO7axJVKzfvIOCdsAlwyJtNAjIAUl3X-uY0s0s,58103
63
+ asap/transport/validators.py,sha256=UgP13IaLBraRAy4yCqJOymh9EUnXT3OVWBLHDjrefGM,10847
64
+ asap/utils/__init__.py,sha256=aWEjhGOgrzvBjvMVW1Dg5yJH_xixaOqrsilNdU7zz4A,206
65
+ asap/utils/sanitization.py,sha256=Quv9TxVimiD7Ho1RV2RC-LukQgjORNHcbIqXBVQe2cQ,4056
66
+ asap_protocol-1.0.0.dist-info/METADATA,sha256=5-raewZ-1lFgJc5h_Re2GE-R9PevPTlJs4MQ3C59e-4,12087
67
+ asap_protocol-1.0.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
68
+ asap_protocol-1.0.0.dist-info/entry_points.txt,sha256=H_u_JamRG5mGQTXwnCFljBFep6lZPuln9NPLfgq1naM,39
69
+ asap_protocol-1.0.0.dist-info/licenses/LICENSE,sha256=JmjzvAfg8BUP_0y_hu4SQSUgnSniWe2eBS7x2WPTo2A,10771
70
+ asap_protocol-1.0.0.dist-info/RECORD,,
@@ -1,227 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: asap-protocol
3
- Version: 0.3.0
4
- Summary: Async Simple Agent Protocol - A streamlined protocol for agent-to-agent communication
5
- Project-URL: Homepage, https://github.com/adriannoes/asap-protocol
6
- Project-URL: Documentation, https://adriannoes.github.io/asap-protocol
7
- Project-URL: Repository, https://github.com/adriannoes/asap-protocol
8
- Project-URL: Issues, https://github.com/adriannoes/asap-protocol/issues
9
- Project-URL: PyPI, https://pypi.org/project/asap-protocol/
10
- Author: ASAP Protocol Contributors
11
- License: Apache-2.0
12
- License-File: LICENSE
13
- Keywords: a2a,agent,async,communication,mcp,protocol
14
- Classifier: Development Status :: 3 - Alpha
15
- Classifier: Intended Audience :: Developers
16
- Classifier: License :: OSI Approved :: Apache Software License
17
- Classifier: Programming Language :: Python :: 3
18
- Classifier: Programming Language :: Python :: 3.13
19
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
- Classifier: Topic :: System :: Distributed Computing
21
- Classifier: Typing :: Typed
22
- Requires-Python: >=3.13
23
- Requires-Dist: fastapi>=0.128.0
24
- Requires-Dist: httpx>=0.28.1
25
- Requires-Dist: packaging>=25.0
26
- Requires-Dist: pydantic>=2.12.5
27
- Requires-Dist: python-ulid>=3.0
28
- Requires-Dist: slowapi>=0.1.9
29
- Requires-Dist: structlog>=24.1
30
- Requires-Dist: typer>=0.21.1
31
- Requires-Dist: uvicorn>=0.34
32
- Provides-Extra: dev
33
- Requires-Dist: mypy>=1.19.1; extra == 'dev'
34
- Requires-Dist: pip-audit>=2.7; extra == 'dev'
35
- Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
36
- Requires-Dist: pytest-benchmark>=5.1; extra == 'dev'
37
- Requires-Dist: pytest-cov>=6.0; extra == 'dev'
38
- Requires-Dist: pytest-xdist>=3.5.0; extra == 'dev'
39
- Requires-Dist: pytest>=8.0; extra == 'dev'
40
- Requires-Dist: ruff>=0.14.14; extra == 'dev'
41
- Provides-Extra: docs
42
- Requires-Dist: mkdocs-material>=9.5; extra == 'docs'
43
- Requires-Dist: mkdocstrings[python]>=0.27; extra == 'docs'
44
- Description-Content-Type: text/markdown
45
-
46
- # ASAP: Async Simple Agent Protocol
47
-
48
- ![ASAP Protocol Banner](.cursor/docs/asap-protocol-banner.png)
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!
55
-
56
- ## Why ASAP?
57
-
58
- Building multi-agent systems today suffers from three core technical challenges that existing protocols like A2A don't fully address:
59
- 1. **$N^2$ Connection Complexity**: Most protocols assume static point-to-point HTTP connections that don't scale.
60
- 2. **State Drift**: Lack of native persistence makes it impossible to reliably resume long-running agentic workflows.
61
- 3. **Fragmentation**: No unified way to handle task delegation, artifact exchange, and tool execution (MCP) in a single envelope.
62
-
63
- **ASAP** provides a production-ready communication layer that simplifies these complexities. It introduces a standardized, stateful orchestration framework that ensures your agents can coordinate reliably across distributed environments.
64
-
65
- ### Key Features
66
-
67
- - **Stateful Orchestration**: Native task state machine with built-in snapshotting for durable, resumable agent workflows.
68
- - **Schema-First Design**: Strict Pydantic v2 models providing automatic JSON Schema generation for guaranteed cross-agent interoperability.
69
- - **High-Performance Core**: Built on Python 3.13+, leveraging `uvloop` (C) and `pydantic-core` (Rust) for ultra-low latency validation and I/O.
70
- - **Observable Chains**: First-class support for `trace_id` and `correlation_id` to debug complex multi-agent delegation.
71
- - **MCP Integration**: Uses the Model Context Protocol (MCP) as a tool-execution substrate, wrapped in a high-level coordination envelope.
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.
74
-
75
- 💡 **Performance Note**: Pure Python codebase leveraging Rust-accelerated dependencies (`pydantic-core`, `orjson`, `python-ulid`) for native-level performance without build complexity.
76
-
77
- ## Installation
78
-
79
- We recommend using [uv](https://github.com/astral-sh/uv) for dependency management:
80
-
81
- ```bash
82
- uv add asap-protocol
83
- ```
84
-
85
- Or with pip:
86
-
87
- ```bash
88
- pip install asap-protocol
89
- ```
90
-
91
- 📦 **Available on [PyPI](https://pypi.org/project/asap-protocol/)**
92
-
93
- For reproducible environments, prefer `uv` when possible.
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
-
101
- ## Quick Start
102
-
103
- ### 1. Create an Agent (Server)
104
-
105
- ```python
106
- from asap.models.entities import Capability, Endpoint, Manifest, Skill
107
- from asap.transport.handlers import HandlerRegistry, create_echo_handler
108
- from asap.transport.server import create_app
109
-
110
- manifest = Manifest(
111
- id="urn:asap:agent:echo-agent",
112
- name="Echo Agent",
113
- version="0.3.0",
114
- description="Echoes task input as output",
115
- capabilities=Capability(
116
- asap_version="0.1",
117
- skills=[Skill(id="echo", description="Echo back the input")],
118
- state_persistence=False,
119
- ),
120
- endpoints=Endpoint(asap="http://127.0.0.1:8001/asap"),
121
- )
122
-
123
- registry = HandlerRegistry()
124
- registry.register("task.request", create_echo_handler())
125
-
126
- app = create_app(manifest, registry)
127
- ```
128
-
129
- ### 2. Send a Task (Client)
130
-
131
- ```python
132
- import asyncio
133
- from asap.models.envelope import Envelope
134
- from asap.models.payloads import TaskRequest
135
- from asap.transport.client import ASAPClient
136
-
137
- async def main():
138
- request = TaskRequest(
139
- conversation_id="conv_01HX5K3MQVN8",
140
- skill_id="echo",
141
- input={"message": "hello from client"},
142
- )
143
- envelope = Envelope(
144
- asap_version="0.1",
145
- sender="urn:asap:agent:client",
146
- recipient="urn:asap:agent:echo-agent",
147
- payload_type="task.request",
148
- payload=request.model_dump(),
149
- )
150
- async with ASAPClient("http://127.0.0.1:8001") as client:
151
- response = await client.send(envelope)
152
- print(response.payload)
153
-
154
- if __name__ == "__main__":
155
- asyncio.run(main())
156
- ```
157
-
158
- ## API Overview
159
-
160
- Core models:
161
-
162
- - `Envelope`: protocol wrapper with routing and tracing metadata
163
- - `TaskRequest`, `TaskResponse`, `TaskUpdate`, `TaskCancel`: task lifecycle payloads
164
- - `MessageSend`, `ArtifactNotify`: messaging and artifacts
165
- - `StateQuery`, `StateRestore`: snapshot state operations
166
- - `McpToolCall`, `McpToolResult`, `McpResourceFetch`, `McpResourceData`: MCP integration
167
-
168
- Transport:
169
-
170
- - `create_app`: FastAPI application factory
171
- - `HandlerRegistry`: payload dispatch registry (supports both sync and async handlers)
172
- - `ASAPClient`: async HTTP client with automatic retry for server errors (5xx)
173
-
174
- ## Documentation
175
-
176
- - [Spec](.cursor/docs/general-specs.md)
177
- - [Docs](docs/index.md)
178
- - [API Reference](docs/api-reference.md)
179
- - [Changelog](CHANGELOG.md)
180
- - [PyPI Package](https://pypi.org/project/asap-protocol/)
181
-
182
- ## When to Use ASAP?
183
-
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
189
-
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.
191
-
192
- ## Advanced Topics
193
-
194
- Explore these guides for detailed information on specific features:
195
-
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.
202
-
203
- ### Examples & Demos
204
-
205
- Run the built-in multi-agent demo to see ASAP in action:
206
-
207
- ```bash
208
- uv run python -m asap.examples.run_demo
209
- ```
210
-
211
- See [`src/asap/examples/`](src/asap/examples/) for complete example implementations.
212
-
213
- ### CLI Tools
214
-
215
- The ASAP CLI provides utilities for schema management. See [CLI documentation](docs/index.md#cli) or run `asap --help` for available commands.
216
-
217
- ## Contributing
218
-
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.
222
-
223
- Check out our [Contributing Guidelines](CONTRIBUTING.md) to get started. It's easier than you think! 🚀
224
-
225
- ## License
226
-
227
- This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details.
@@ -1,37 +0,0 @@
1
- asap/__init__.py,sha256=kyqepZHflLpgwKPTQYlSrCZpSa9i9moeiyiaYMTvbHw,169
2
- asap/cli.py,sha256=JzMA3t2Gn94kunkn5bgAkl6ZgzgwGtL5QFcKLYqWZYA,6621
3
- asap/errors.py,sha256=Kqj6fLhVjwHWYcZU_U7ZgK75HPGKUq5jAgL1-wQjb40,6396
4
- asap/schemas.py,sha256=c9MttEoI4mgXFHDFzphSRAJhw7cpy2rcnXH31jlo1sQ,6135
5
- asap/examples/README.md,sha256=xqMIMcZANi1eML6t4cNJ3rG6MjySf2SchgFiecxKpik,765
6
- asap/examples/__init__.py,sha256=LaEkmPQ4tpYrkLFjBE_aodjW3_XUcKWoFLGVFD5kuvo,56
7
- asap/examples/coordinator.py,sha256=C5Ugi47PGwtbRao8eD29v2l_9tww2_sL-kXK5jQaWGw,5370
8
- asap/examples/echo_agent.py,sha256=cmNjEx28jCNcU4waYFOZ8ZcHxth1znMOhmaGXIquJzA,2947
9
- asap/examples/run_demo.py,sha256=bFHH4IY-xYXIw66opgKGfmuXSC7_6astkERLtN0a9pw,3700
10
- asap/models/__init__.py,sha256=iUriI2CN9NcpH1_TyY5PkWiX3Mz7UnJDC9IeJzcWFUI,2511
11
- asap/models/base.py,sha256=PvLkFinOzfU6DDJ4pXMku7PK_2Xsaprh055mJKbdPUA,2008
12
- asap/models/constants.py,sha256=AEPklwTNZbYnSRsZ6HIeVI8F8T_zt1nZVzZPkqXo1rY,425
13
- asap/models/entities.py,sha256=siZCt-XqbOSPleXFBvwCSC9sVfZCrydNrUiKso8RHDo,16742
14
- asap/models/enums.py,sha256=q8tnW10AT94hxDFoH1Psg1a1x4tzs47x12N7RTGLNRQ,1644
15
- asap/models/envelope.py,sha256=MTlFEmYcT47gpQhOxWYGEUe99hw_woMWqWdp3rZl-co,3733
16
- asap/models/ids.py,sha256=ttTebUohYD_7Gmyg1GRi1jnRtnLcAL2SiXuOi4vGtb0,1425
17
- asap/models/parts.py,sha256=XiNvlEEqqb0W8cvvvLHYfzYzLULg7oFStMxm817-IZo,6939
18
- asap/models/payloads.py,sha256=l0taURdWy09BASSJkiCrR6VixbqzD3HrFdVrFad7YqQ,14867
19
- asap/models/types.py,sha256=ldWyz6gThlK_cxywxfcIiMLD74_BRV0lbfyussvSURg,978
20
- asap/observability/__init__.py,sha256=V1bBAZix7_IAoy09ETTlkSsi-1ENq5_EpBhi599EBxE,1145
21
- asap/observability/logging.py,sha256=1nK1OP-3BBpOf8d5UFmpSP8_mULF5kZ27YoS3S3U1a0,6733
22
- asap/observability/metrics.py,sha256=5yvXfvQ8FpigJ6pJ3vTQetSCQhPnoUCKywWigrxgnCI,14778
23
- asap/state/__init__.py,sha256=bV1oO86TReF48C5IaglNr8WHczzAWTpw3n7SyDw04nk,565
24
- asap/state/machine.py,sha256=1Obl1BcwwU-Xz20MX-layuPh1BVzcI1Kiowl_CueuU4,2795
25
- asap/state/snapshot.py,sha256=wPc2pnQD_EdPecEndbjIC9mXJep-LCJwtdazGMJSUJc,8654
26
- asap/transport/__init__.py,sha256=rX_hcnm0c-XxJKvxc4H2b_APNIVmdvXphRIqDrDWC8U,2506
27
- asap/transport/client.py,sha256=fHzz8M_qeNMLZhDxsOWeAVMXMNeOHFnmovptBMDsN2I,14325
28
- asap/transport/executors.py,sha256=0UH2cd5fVPGPGtnzmnFq1W8IF9BLjp5grCz3Oucj7CQ,5737
29
- asap/transport/handlers.py,sha256=BGnAF-RDiZYjdh0V-AqmvqrAkCh_QfI0yO-x1wzxOGQ,15924
30
- asap/transport/jsonrpc.py,sha256=Cnh6ahoXr4Dkmt2KqoXESDKKs_9MwfsgIjn-TDjpkEQ,5800
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,,