theprotocol-sdk 0.7.6__tar.gz → 0.8.0__tar.gz
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.
- theprotocol_sdk-0.7.6/README.md → theprotocol_sdk-0.8.0/PKG-INFO +136 -6
- theprotocol_sdk-0.7.6/PKG-INFO → theprotocol_sdk-0.8.0/README.md +34 -49
- theprotocol_sdk-0.8.0/proxy/Dockerfile +28 -0
- theprotocol_sdk-0.8.0/proxy/Dockerfile.dockerignore +8 -0
- theprotocol_sdk-0.8.0/proxy/README.md +142 -0
- theprotocol_sdk-0.8.0/proxy/compose.yaml +25 -0
- theprotocol_sdk-0.8.0/proxy/proxy.example.yaml +37 -0
- theprotocol_sdk-0.8.0/proxy/proxy.outbound.example.yaml +42 -0
- theprotocol_sdk-0.8.0/proxy/proxy.quantum.example.yaml +83 -0
- theprotocol_sdk-0.8.0/proxy/recipes/README.md +16 -0
- theprotocol_sdk-0.8.0/proxy/recipes/bazaar/README.md +21 -0
- theprotocol_sdk-0.8.0/proxy/recipes/bazaar/fake/fake_shop.py +38 -0
- theprotocol_sdk-0.8.0/proxy/recipes/bazaar/fake/mock_wms.py +43 -0
- theprotocol_sdk-0.8.0/proxy/recipes/bazaar/proxy.yaml +58 -0
- theprotocol_sdk-0.8.0/proxy/recipes/dynamo/README.md +21 -0
- theprotocol_sdk-0.8.0/proxy/recipes/dynamo/fake/fake_meters.py +43 -0
- theprotocol_sdk-0.8.0/proxy/recipes/dynamo/proxy.yaml +43 -0
- theprotocol_sdk-0.8.0/proxy/recipes/hansa/README.md +21 -0
- theprotocol_sdk-0.8.0/proxy/recipes/hansa/fake/fake_tos.py +40 -0
- theprotocol_sdk-0.8.0/proxy/recipes/hansa/fake/mock_erp.py +43 -0
- theprotocol_sdk-0.8.0/proxy/recipes/hansa/proxy.yaml +54 -0
- theprotocol_sdk-0.8.0/proxy/recipes/keystone/README.md +21 -0
- theprotocol_sdk-0.8.0/proxy/recipes/keystone/fake/fake_logger.py +52 -0
- theprotocol_sdk-0.8.0/proxy/recipes/keystone/proxy.yaml +53 -0
- theprotocol_sdk-0.8.0/proxy/recipes/lyceum/README.md +21 -0
- theprotocol_sdk-0.8.0/proxy/recipes/lyceum/fake/fake_sis.py +40 -0
- theprotocol_sdk-0.8.0/proxy/recipes/lyceum/proxy.yaml +41 -0
- theprotocol_sdk-0.8.0/proxy/recipes/meridian/README.md +21 -0
- theprotocol_sdk-0.8.0/proxy/recipes/meridian/fake/fake_oms.py +36 -0
- theprotocol_sdk-0.8.0/proxy/recipes/meridian/proxy.yaml +53 -0
- theprotocol_sdk-0.8.0/proxy/recipes/scrivener/README.md +21 -0
- theprotocol_sdk-0.8.0/proxy/recipes/scrivener/fake/fake_pms.py +39 -0
- theprotocol_sdk-0.8.0/proxy/recipes/scrivener/proxy.yaml +50 -0
- theprotocol_sdk-0.8.0/proxy/recipes/trunk/README.md +21 -0
- theprotocol_sdk-0.8.0/proxy/recipes/trunk/fake/fake_mediation.py +36 -0
- theprotocol_sdk-0.8.0/proxy/recipes/trunk/proxy.yaml +66 -0
- theprotocol_sdk-0.8.0/pyproject.toml +97 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/__init__.py +2 -1
- theprotocol_sdk-0.8.0/src/theprotocol/agent/caller_errors.py +45 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/agent/router.py +27 -15
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/agent/well_known.py +12 -10
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/auth/did_jwt.py +3 -3
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/authz.py +2 -2
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/bridges/acp.py +3 -2
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/bridges/anp/bridge.py +2 -1
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/bridges/google_a2a.py +3 -2
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/bridges/mcp.py +2 -1
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/client/a2a_client.py +65 -8
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/client/credentials.py +16 -4
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/dids.py +3 -3
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/exceptions.py +9 -2
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/messenger.py +1 -1
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/mtls.py +18 -5
- theprotocol_sdk-0.8.0/src/theprotocol/proxy/__init__.py +33 -0
- theprotocol_sdk-0.8.0/src/theprotocol/proxy/actions_builtin.py +393 -0
- theprotocol_sdk-0.8.0/src/theprotocol/proxy/cli.py +466 -0
- theprotocol_sdk-0.8.0/src/theprotocol/proxy/evidence.py +409 -0
- theprotocol_sdk-0.8.0/src/theprotocol/proxy/identity.py +142 -0
- theprotocol_sdk-0.8.0/src/theprotocol/proxy/logs.py +81 -0
- theprotocol_sdk-0.8.0/src/theprotocol/proxy/mapping.py +95 -0
- theprotocol_sdk-0.8.0/src/theprotocol/proxy/outbox.py +231 -0
- theprotocol_sdk-0.8.0/src/theprotocol/proxy/plugins.py +334 -0
- theprotocol_sdk-0.8.0/src/theprotocol/proxy/quantum/__init__.py +11 -0
- theprotocol_sdk-0.8.0/src/theprotocol/proxy/quantum/backends.py +269 -0
- theprotocol_sdk-0.8.0/src/theprotocol/proxy/quantum/card.py +99 -0
- theprotocol_sdk-0.8.0/src/theprotocol/proxy/quantum/jobs.py +112 -0
- theprotocol_sdk-0.8.0/src/theprotocol/proxy/quantum/meter.py +212 -0
- theprotocol_sdk-0.8.0/src/theprotocol/proxy/quantum/plugins.py +203 -0
- theprotocol_sdk-0.8.0/src/theprotocol/proxy/quantum/qasm.py +174 -0
- theprotocol_sdk-0.8.0/src/theprotocol/proxy/registry.py +110 -0
- theprotocol_sdk-0.8.0/src/theprotocol/proxy/runtime.py +563 -0
- theprotocol_sdk-0.8.0/src/theprotocol/proxy/service.py +109 -0
- theprotocol_sdk-0.8.0/src/theprotocol/proxy/sinks_builtin.py +457 -0
- theprotocol_sdk-0.8.0/src/theprotocol/proxy/sources/__init__.py +18 -0
- theprotocol_sdk-0.8.0/src/theprotocol/proxy/sources/filedrop.py +193 -0
- theprotocol_sdk-0.8.0/src/theprotocol/proxy/sources/logtail.py +172 -0
- theprotocol_sdk-0.8.0/src/theprotocol/proxy/sources/mqtt.py +1082 -0
- theprotocol_sdk-0.8.0/src/theprotocol/proxy/sources/sftp.py +1016 -0
- theprotocol_sdk-0.8.0/src/theprotocol/proxy/sources/sqlpoll.py +886 -0
- theprotocol_sdk-0.8.0/src/theprotocol/proxy/sources_builtin.py +226 -0
- theprotocol_sdk-0.8.0/src/theprotocol/proxy/spec.py +374 -0
- theprotocol_sdk-0.8.0/src/theprotocol/proxy/testing.py +228 -0
- theprotocol_sdk-0.8.0/src/theprotocol/quantum/__init__.py +54 -0
- theprotocol_sdk-0.8.0/src/theprotocol/quantum/models.py +373 -0
- theprotocol_sdk-0.8.0/src/theprotocol/quantum/quantum_workload_v1.0.schema.json +399 -0
- theprotocol_sdk-0.8.0/src/theprotocol/quantum/receipts.py +924 -0
- theprotocol_sdk-0.8.0/src/theprotocol/quantum/verify.py +50 -0
- theprotocol_sdk-0.8.0/tests/mqtt_broker.sh +36 -0
- theprotocol_sdk-0.8.0/tests/mqtt_fake.py +297 -0
- theprotocol_sdk-0.8.0/tests/proxy_fake.py +208 -0
- theprotocol_sdk-0.8.0/tests/sftp_server/run.sh +83 -0
- theprotocol_sdk-0.8.0/tests/sftp_server/sshd_config +14 -0
- theprotocol_sdk-0.8.0/tests/test_a2a_client_token.py +99 -0
- theprotocol_sdk-0.8.0/tests/test_a2a_client_v1_card.py +86 -0
- theprotocol_sdk-0.8.0/tests/test_caller_errors_v0653.py +79 -0
- theprotocol_sdk-0.8.0/tests/test_credentials.py +106 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/tests/test_did_jwt.py +1 -1
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/tests/test_messenger.py +1 -1
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/tests/test_mtls_enroll.py +36 -0
- theprotocol_sdk-0.8.0/tests/test_proxy_actions.py +215 -0
- theprotocol_sdk-0.8.0/tests/test_proxy_builtins.py +211 -0
- theprotocol_sdk-0.8.0/tests/test_proxy_cli.py +177 -0
- theprotocol_sdk-0.8.0/tests/test_proxy_core.py +478 -0
- theprotocol_sdk-0.8.0/tests/test_proxy_events.py +172 -0
- theprotocol_sdk-0.8.0/tests/test_proxy_plugins.py +324 -0
- theprotocol_sdk-0.8.0/tests/test_proxy_quantum_backend.py +220 -0
- theprotocol_sdk-0.8.0/tests/test_proxy_quantum_card.py +146 -0
- theprotocol_sdk-0.8.0/tests/test_proxy_quantum_cli.py +161 -0
- theprotocol_sdk-0.8.0/tests/test_proxy_quantum_meter.py +181 -0
- theprotocol_sdk-0.8.0/tests/test_proxy_quantum_plugins.py +245 -0
- theprotocol_sdk-0.8.0/tests/test_proxy_recipes.py +238 -0
- theprotocol_sdk-0.8.0/tests/test_proxy_sinks.py +372 -0
- theprotocol_sdk-0.8.0/tests/test_proxy_source_filedrop.py +236 -0
- theprotocol_sdk-0.8.0/tests/test_proxy_source_logtail.py +229 -0
- theprotocol_sdk-0.8.0/tests/test_proxy_source_mqtt.py +1129 -0
- theprotocol_sdk-0.8.0/tests/test_proxy_source_mqtt_broker.py +783 -0
- theprotocol_sdk-0.8.0/tests/test_proxy_source_sftp.py +1050 -0
- theprotocol_sdk-0.8.0/tests/test_proxy_source_sftp_server.py +435 -0
- theprotocol_sdk-0.8.0/tests/test_proxy_source_sftp_transport.py +335 -0
- theprotocol_sdk-0.8.0/tests/test_proxy_source_sqlpoll.py +999 -0
- theprotocol_sdk-0.8.0/tests/test_proxy_source_sqlpoll_engines.py +710 -0
- theprotocol_sdk-0.8.0/tests/test_proxy_spec.py +135 -0
- theprotocol_sdk-0.8.0/tests/test_quantum_receipts.py +143 -0
- theprotocol_sdk-0.8.0/tests/test_quantum_workload.py +192 -0
- theprotocol_sdk-0.8.0/tests/test_release_version.py +41 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/tests/test_well_known.py +23 -3
- theprotocol_sdk-0.7.6/pyproject.toml +0 -66
- theprotocol_sdk-0.7.6/tests/test_credentials.py +0 -60
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/LICENSE +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/examples/simple_agent.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/agent/__init__.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/agent/base.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/agent/decorators.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/agent/task_store.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/auth/__init__.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/auth/jws_card.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/auth/jwt_verifier.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/bridges/__init__.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/bridges/anp/__init__.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/bridges/anp/auth.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/bridges/anp/did_wba.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/bridges/anp/translation.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/bridges/base.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/client/__init__.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/exchange/__init__.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/exchange/client.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/forge.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/guild.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/models/__init__.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/models/a2a_protocol.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/models/agent_card.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/models/v1_compat.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/payment/__init__.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/payment/authenticator.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/payment/client.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/payment/mtls_client.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/payment/verifier.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/registry/__init__.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/registry/card_verify.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/registry/cost_composition.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/transfer/__init__.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/src/theprotocol/transfer/client.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/tests/registry/__init__.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/tests/registry/test_card_verify.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/tests/registry/test_cost_composition.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/tests/test_agent.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/tests/test_artifact_roundtrip.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/tests/test_auth.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/tests/test_authz.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/tests/test_bridge_acp.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/tests/test_bridge_anp.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/tests/test_bridge_google_a2a.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/tests/test_bridge_mcp.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/tests/test_dependency_binding.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/tests/test_dids.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/tests/test_exchange_launch.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/tests/test_forge.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/tests/test_guild.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/tests/test_jws_card.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/tests/test_models.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/tests/test_mtls_client_presents_cert.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/tests/test_transfer.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/tests/test_v1_compat.py +0 -0
- {theprotocol_sdk-0.7.6 → theprotocol_sdk-0.8.0}/tests/test_verifier_reuse.py +0 -0
|
@@ -1,3 +1,105 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: theprotocol-sdk
|
|
3
|
+
Version: 0.8.0
|
|
4
|
+
Summary: Build sovereign AI agents with DID identity on TheProtocol. Speaks the A2A protocol (v1.0) natively, with bridges for Google A2A, ANP, and MCP. Works with Vertex AI, AWS AgentCore, LangGraph, CrewAI.
|
|
5
|
+
Project-URL: Homepage, https://theprotocol.cloud
|
|
6
|
+
Project-URL: Documentation, https://docs.theprotocol.cloud
|
|
7
|
+
Project-URL: API Reference, https://api.theprotocol.cloud/docs
|
|
8
|
+
Author-email: TheProtocol <sdk@theprotocol.cloud>
|
|
9
|
+
License: Apache-2.0
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: a2a,a2a-protocol,agent-to-agent,agents,ai-agents,crewai,did,fastapi,federation,json-rpc,langchain,mcp,sovereign,theprotocol,vertex-ai
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Requires-Dist: httpx[http2]>=0.27
|
|
24
|
+
Requires-Dist: pydantic<3.0,>=2.0
|
|
25
|
+
Requires-Dist: python-dotenv>=1.0
|
|
26
|
+
Provides-Extra: all
|
|
27
|
+
Requires-Dist: aiohttp>=3.9; extra == 'all'
|
|
28
|
+
Requires-Dist: cryptography>=42.0; extra == 'all'
|
|
29
|
+
Requires-Dist: fastapi>=0.111; extra == 'all'
|
|
30
|
+
Requires-Dist: jsonschema>=4.18; extra == 'all'
|
|
31
|
+
Requires-Dist: keyring>=24; extra == 'all'
|
|
32
|
+
Requires-Dist: pyyaml>=6.0; extra == 'all'
|
|
33
|
+
Provides-Extra: anp
|
|
34
|
+
Requires-Dist: cryptography>=42.0; extra == 'anp'
|
|
35
|
+
Provides-Extra: keyring
|
|
36
|
+
Requires-Dist: keyring>=24; extra == 'keyring'
|
|
37
|
+
Provides-Extra: proxy
|
|
38
|
+
Requires-Dist: aiohttp>=3.9; extra == 'proxy'
|
|
39
|
+
Requires-Dist: cryptography>=42.0; extra == 'proxy'
|
|
40
|
+
Requires-Dist: jsonschema>=4.18; extra == 'proxy'
|
|
41
|
+
Requires-Dist: pyyaml>=6.0; extra == 'proxy'
|
|
42
|
+
Provides-Extra: proxy-mqtt
|
|
43
|
+
Requires-Dist: aiohttp>=3.9; extra == 'proxy-mqtt'
|
|
44
|
+
Requires-Dist: cryptography>=42.0; extra == 'proxy-mqtt'
|
|
45
|
+
Requires-Dist: jsonschema>=4.18; extra == 'proxy-mqtt'
|
|
46
|
+
Requires-Dist: paho-mqtt<3,>=2.0; extra == 'proxy-mqtt'
|
|
47
|
+
Requires-Dist: pyyaml>=6.0; extra == 'proxy-mqtt'
|
|
48
|
+
Provides-Extra: proxy-mysql
|
|
49
|
+
Requires-Dist: aiohttp>=3.9; extra == 'proxy-mysql'
|
|
50
|
+
Requires-Dist: cryptography>=42.0; extra == 'proxy-mysql'
|
|
51
|
+
Requires-Dist: jsonschema>=4.18; extra == 'proxy-mysql'
|
|
52
|
+
Requires-Dist: pymysql[rsa]>=1.1; extra == 'proxy-mysql'
|
|
53
|
+
Requires-Dist: pyyaml>=6.0; extra == 'proxy-mysql'
|
|
54
|
+
Provides-Extra: proxy-postgresql
|
|
55
|
+
Requires-Dist: aiohttp>=3.9; extra == 'proxy-postgresql'
|
|
56
|
+
Requires-Dist: cryptography>=42.0; extra == 'proxy-postgresql'
|
|
57
|
+
Requires-Dist: jsonschema>=4.18; extra == 'proxy-postgresql'
|
|
58
|
+
Requires-Dist: psycopg[binary]>=3.1; extra == 'proxy-postgresql'
|
|
59
|
+
Requires-Dist: pyyaml>=6.0; extra == 'proxy-postgresql'
|
|
60
|
+
Provides-Extra: proxy-quantum
|
|
61
|
+
Requires-Dist: aiohttp>=3.9; extra == 'proxy-quantum'
|
|
62
|
+
Requires-Dist: cryptography>=42.0; extra == 'proxy-quantum'
|
|
63
|
+
Requires-Dist: jsonschema>=4.18; extra == 'proxy-quantum'
|
|
64
|
+
Requires-Dist: pyyaml>=6.0; extra == 'proxy-quantum'
|
|
65
|
+
Provides-Extra: proxy-s3
|
|
66
|
+
Requires-Dist: aiohttp>=3.9; extra == 'proxy-s3'
|
|
67
|
+
Requires-Dist: boto3>=1.34; extra == 'proxy-s3'
|
|
68
|
+
Requires-Dist: cryptography>=42.0; extra == 'proxy-s3'
|
|
69
|
+
Requires-Dist: jsonschema>=4.18; extra == 'proxy-s3'
|
|
70
|
+
Requires-Dist: pyyaml>=6.0; extra == 'proxy-s3'
|
|
71
|
+
Provides-Extra: proxy-sftp
|
|
72
|
+
Requires-Dist: aiohttp>=3.9; extra == 'proxy-sftp'
|
|
73
|
+
Requires-Dist: cryptography>=42.0; extra == 'proxy-sftp'
|
|
74
|
+
Requires-Dist: defusedxml>=0.7; extra == 'proxy-sftp'
|
|
75
|
+
Requires-Dist: jsonschema>=4.18; extra == 'proxy-sftp'
|
|
76
|
+
Requires-Dist: paramiko>=3.4; extra == 'proxy-sftp'
|
|
77
|
+
Requires-Dist: pyyaml>=6.0; extra == 'proxy-sftp'
|
|
78
|
+
Provides-Extra: proxy-sql
|
|
79
|
+
Requires-Dist: aiohttp>=3.9; extra == 'proxy-sql'
|
|
80
|
+
Requires-Dist: cryptography>=42.0; extra == 'proxy-sql'
|
|
81
|
+
Requires-Dist: jsonschema>=4.18; extra == 'proxy-sql'
|
|
82
|
+
Requires-Dist: psycopg[binary]>=3.1; extra == 'proxy-sql'
|
|
83
|
+
Requires-Dist: pymssql>=2.3; extra == 'proxy-sql'
|
|
84
|
+
Requires-Dist: pymysql[rsa]>=1.1; extra == 'proxy-sql'
|
|
85
|
+
Requires-Dist: pyyaml>=6.0; extra == 'proxy-sql'
|
|
86
|
+
Provides-Extra: proxy-sqlserver
|
|
87
|
+
Requires-Dist: aiohttp>=3.9; extra == 'proxy-sqlserver'
|
|
88
|
+
Requires-Dist: cryptography>=42.0; extra == 'proxy-sqlserver'
|
|
89
|
+
Requires-Dist: jsonschema>=4.18; extra == 'proxy-sqlserver'
|
|
90
|
+
Requires-Dist: pymssql>=2.3; extra == 'proxy-sqlserver'
|
|
91
|
+
Requires-Dist: pyyaml>=6.0; extra == 'proxy-sqlserver'
|
|
92
|
+
Provides-Extra: server
|
|
93
|
+
Requires-Dist: fastapi>=0.111; extra == 'server'
|
|
94
|
+
Provides-Extra: test
|
|
95
|
+
Requires-Dist: cryptography>=42.0; extra == 'test'
|
|
96
|
+
Requires-Dist: httpx>=0.27; extra == 'test'
|
|
97
|
+
Requires-Dist: jsonschema>=4.18; extra == 'test'
|
|
98
|
+
Requires-Dist: pytest-asyncio>=0.21; extra == 'test'
|
|
99
|
+
Requires-Dist: pytest>=7.0; extra == 'test'
|
|
100
|
+
Requires-Dist: respx>=0.20; extra == 'test'
|
|
101
|
+
Description-Content-Type: text/markdown
|
|
102
|
+
|
|
1
103
|
# theprotocol-sdk
|
|
2
104
|
|
|
3
105
|
Build and call AI agents on [TheProtocol](https://theprotocol.cloud). Speaks the A2A protocol (v1.0) natively, with bridges for Google A2A, ANP, and MCP.
|
|
@@ -8,6 +110,7 @@ Build and call AI agents on [TheProtocol](https://theprotocol.cloud). Speaks the
|
|
|
8
110
|
pip install theprotocol-sdk # Client only (call agents)
|
|
9
111
|
pip install theprotocol-sdk[server] # + FastAPI router (build agents)
|
|
10
112
|
pip install theprotocol-sdk[anp] # + Ed25519 crypto for ANP DID:WBA
|
|
113
|
+
pip install theprotocol-sdk[proxy] # + TheProtocol Proxy (tp-proxy): a legacy system's agent on TheProtocol
|
|
11
114
|
pip install theprotocol-sdk[all] # Everything
|
|
12
115
|
```
|
|
13
116
|
|
|
@@ -122,7 +225,7 @@ assert verify_registry_card(card, jwks)
|
|
|
122
225
|
|
|
123
226
|
## mTLS identity, wherever your agent runs
|
|
124
227
|
|
|
125
|
-
`enable-mtls` adapts to where your agent is deployed. On the registry's own host it points you at the SPIFFE Workload API socket; anywhere else it
|
|
228
|
+
`enable-mtls` adapts to where your agent is deployed. On the registry's own host it points you at the SPIFFE Workload API socket; anywhere else it issues a short-lived X509-SVID and returns it inline. `IronhandClient` handles both, writes the inline case in the layout `MtlsAgentClient` reads, and keeps it fresh:
|
|
126
229
|
|
|
127
230
|
```python
|
|
128
231
|
from theprotocol.mtls import IronhandClient
|
|
@@ -133,20 +236,47 @@ enrollment = await iron.enroll(agent_jwt)
|
|
|
133
236
|
|
|
134
237
|
if enrollment.delivery == "inline": # your own infrastructure
|
|
135
238
|
client = MtlsAgentClient(cert_dir=iron.cert_dir)
|
|
136
|
-
|
|
239
|
+
# SVIDs are short-lived by design; pass a function that returns the current agent token: the loop outlives a token
|
|
240
|
+
task = iron.start_auto_rotate(current_agent_token)
|
|
137
241
|
elif enrollment.delivery == "workload_api": # co-located with the registry
|
|
138
242
|
... # fetch from the socket instead
|
|
139
243
|
```
|
|
140
244
|
|
|
141
245
|
The private key is written `0600` into a `0700` directory, via a temp file and rename so a reader never sees it half-written. A registry that cannot issue a certificate says so and raises `IronhandUnavailableError` rather than leaving you believing you have an identity: nothing is enrolled in that case, and agent-JWT plus payment-token auth continue to work. Enrollment needs the `identity.mtls` permission, which rides the `client` and `service-provider` roles.
|
|
142
246
|
|
|
247
|
+
## TheProtocol Proxy
|
|
248
|
+
|
|
249
|
+
A small process beside a legacy system (an ERP, a scale, a meter, a terminal operating system) that gives it an agent
|
|
250
|
+
identity on TheProtocol and translates in both directions, from one spec file: sources read the system, mappings turn
|
|
251
|
+
its records into actions on TheProtocol (an attestation, a task, a payment under a mandate), and sinks deliver
|
|
252
|
+
TheProtocol's events back. A durable outbox and exactly-once keys mean a record is sent once however often it is read,
|
|
253
|
+
`--dry-run` sends nothing, and refused records wait in the dead letters for `tp-proxy replay`.
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
pip install "theprotocol-sdk[proxy]"
|
|
257
|
+
tp-proxy init --from ./my-agent # the Agent Forge starter's download: a proxy.yaml that names its credentials
|
|
258
|
+
tp-proxy run my-agent/proxy.yaml --dry-run
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Connectors are plugins on a published interface (`theprotocol.proxy.plugins`) with contract tests
|
|
262
|
+
(`theprotocol.proxy.testing`). The image, the compose example and the full guide are in `proxy/`.
|
|
263
|
+
|
|
143
264
|
## Changelog
|
|
144
265
|
|
|
145
|
-
**0.
|
|
266
|
+
**0.8.0** (V0659 and V0660: TheProtocol Proxy and the quantum workload pieces; uploaded to PyPI with V0660's roll)
|
|
267
|
+
- TheProtocol Proxy: the module `theprotocol.proxy`, the `tp-proxy` command and the `[proxy]` extra (PyYAML, jsonschema, aiohttp, cryptography). The core: the spec, the plugin interface, the agent identity, the durable outbox with exactly-once keys, the dead letters and replay, dry runs, the breaker, the rate limits, `/health` and `/metrics`, and redacted JSON logs.
|
|
268
|
+
- The proxy's built-in parts. Sources: `webhook`, `filedrop`, `logtail`, `mqtt`, `sftp`, `sqlpoll` and `theprotocol_events`. Actions: `attestation`, `a2a_task`, `payment`, `milestone_evidence` and `chat_message`. Sinks: `webhook`, `journal`, `calendar`, `email_digest` and `evidence`. A part that needs a client library has its own extra, imported only when it starts: `[proxy-mqtt]` (paho-mqtt 2), `[proxy-sftp]` (paramiko, defusedxml; the SFTP source and the evidence mirror to SFTP), `[proxy-s3]` (boto3; the evidence mirror to S3), and, for the SQL poll, `[proxy-postgresql]`, `[proxy-mysql]`, `[proxy-sqlserver]` or all three as `[proxy-sql]`. Eight ready recipes, one per blueprint bridge, are in the repository under `theprotocol-sdk/proxy/recipes/`, with a fake of each legacy system to try them against.
|
|
269
|
+
- Quantum workloads (V0660). `theprotocol.quantum` reads and writes the quantum workload agent card extension and carries its JSON Schema. `theprotocol.quantum.receipts` is the job receipt chain and its acceptance tests, the same code a registry runs at its verify and release steps, and `python -m theprotocol.quantum.verify` checks a job offline, with no registry. The QPU recipe (`[proxy-quantum]`; `quantum_submit` sink, `quantum_results` source, `quantum_report` action, `tp-proxy quantum-card`) runs simulators only; a provider points it at its own backend class. These need a registry with the quantum mode on, and it is off by default. The recipe runs on your own side: TheProtocol hosts neither the model nor the agent.
|
|
270
|
+
- `IronhandClient.start_auto_rotate` takes a function that returns the agent's current token (sync or async), asked only when a renewal is due. With the token as a fixed string, every renewal after the token expired was a 401, retried forever, because an agent token expires long before the loop ends.
|
|
271
|
+
|
|
272
|
+
**0.7.6** (2026-10-20)
|
|
146
273
|
- `PaymentVerifier` and `AgentJwtVerifier` receive the request when FastAPI calls them. Both annotated it as `Any`, which FastAPI reads as a query parameter: every call through a router carrying either one was refused with 422, so an agent that switched payment on with `REGISTRY_URL` and `AGENT_DID` refused every call instead of asking for a payment token (402). Calling them directly, as the unit tests did, was not affected. The new tests go through FastAPI, with a control that reproduces the old 422.
|
|
274
|
+
- `KeyManager` reads a name=value key file as it reads the environment: both lines of an OAuth pair come back (0.7.5 returned only the first line and ignored the environment's copy of the second), `THEPROTOCOL_KEY_<SERVICE_ID>` is found by `get_key("<service id>")` (it was stored under the whole line name), and a file named exactly `.env` is read (pathlib gives it no suffix, so it was skipped). A key file that is neither `.env` nor `.json` is reported in the log instead of being skipped in silence.
|
|
275
|
+
- `A2AClient` asks a registry's agent token route (`/api/v1/auth/agent/token`, what a registry's own agent cards name as their token URL) for a token with the form that route reads: `grant_type=password`, the client id as `username`, the client secret as `password`. 0.7.5 sent the client-credentials form there and got 422. Every other token URL still gets the client-credentials form.
|
|
276
|
+
- Docstrings that described other behaviour: `serve_well_known_card` signs a static card with `sign_with` (it was described as reserved and unused), and `create_a2a_router` injects no `PaymentVerifier` at all with `PAYMENT_REQUIRED=false` (it was described as verifying without rejecting); a free agent switches payment off, because the registry refuses a payment authorization whose amount is not greater than zero.
|
|
147
277
|
|
|
148
278
|
**0.7.5** (2026-10-02)
|
|
149
|
-
- Agent DIDs that name their frame (`did:theprotocol:<trust domain>:<uuid4>`, what registries
|
|
279
|
+
- Agent DIDs that name their frame (`did:theprotocol:<trust domain>:<uuid4>`, what registries issue since the issuer namespace) map to the did:wba a registry recognises for a DIDWba signer: `did:wba:<trust domain>:<uuid4>` (`did_wba_from_cos`; the new `native_did_from_wba` goes back). Every other shape maps as before.
|
|
150
280
|
- `A2AAuthenticator` reads such a DID back from an agent SVID's SPIFFE path with its colons; 0.7.4 returned the issuer and the uuid joined by a hyphen.
|
|
151
281
|
- `A2AAuthenticator(trust_domain=None)` takes `THEPROTOCOL_TRUST_DOMAIN` from the environment. With neither set it keeps the old `agentvault.com` and logs a warning, so nothing that worked stops working.
|
|
152
282
|
- `theprotocol.bridges.anp` exports `KeyPair`, `did_wba_from_cos` and `native_did_from_wba`; the new `theprotocol.dids` holds the registry's DID shapes.
|
|
@@ -173,7 +303,7 @@ The private key is written `0600` into a `0700` directory, via a temp file and r
|
|
|
173
303
|
**0.6.0** (2026-07-19, never uploaded to PyPI; first ships as part of 0.6.1)
|
|
174
304
|
- NEW `theprotocol.guild.GuildClient` — the agent work exchange: post an escrowed bounty, discover/bid (`POST …/orders/{id}/bids`, firms via `on_behalf_of_org_id`), award, submit, verify+pay with a star rating, `my_work()` (`GET /api/v1/guild/mine`), federation-wide `network_board()`. `GuildClient.eval_bounty_spec(suite_id, min_score, body)` builds the `eval_bounty://` spec header for objective quorum-scored auto-settle. Non-2xx raises `GuildError` (status code + structured detail).
|
|
175
305
|
- NEW `theprotocol.forge.ForgeClient` — the GÖDEL FORGE self-improving-harness arena: `get_status()` (dark arenas return `{"enabled": False}` instead of raising), `get_lineage()` Evolution Tree, agent-tier `fork_bundle()` (`bundle.write`, fork lineage + royalty bps), `self_version()` / `activate_version()` (`cicd.version`, response normalized to `version_id`), and `run_eval()` (verifier-quorum scored, never self-reported). Dark-arena 403s raise `ForgeDisabledError`; other failures `ForgeError`.
|
|
176
|
-
- NEW `theprotocol.authz.AuthzClient` — IRONKEY L3/L4: `list_delegations()` (developer JWT), `issue_capability()` (
|
|
306
|
+
- NEW `theprotocol.authz.AuthzClient` — IRONKEY L3/L4: `list_delegations()` (developer JWT), `issue_capability()` (issues an `att_` token under `authz.delegate`; caveats + budget + TTL), `attenuate()` (strictly-weaker child, rides the token), `my_capabilities()`, `revoke_capability()` (subtree cascade), and `AuthzClient.capability_headers(token)` → `{"X-Capability-Token": …}`. Non-2xx raises `AuthzError`.
|
|
177
307
|
|
|
178
308
|
**0.5.1** (2026-07-09)
|
|
179
309
|
- FastAPI ≥ 0.139 / Starlette 1.x compatibility: `serve_well_known_card` federated mode no longer relies on the removed `add_event_handler` API — startup registration now degrades gracefully (`add_event_handler` → `router.on_startup` → lifespan-context wrap). Verified 173/173 tests on both fastapi 0.111 (floor) and 0.139.
|
|
@@ -223,7 +353,7 @@ result = await client.call(target_url, payload)
|
|
|
223
353
|
|
|
224
354
|
## MCP Tools
|
|
225
355
|
|
|
226
|
-
For governance, transfers and discovery, connect any MCP client (Claude Desktop, Claude Code, ...) to the registry's [MCP server](https://api.theprotocol.cloud/mcp/sse). The public tool surface spans discovery, wallet,
|
|
356
|
+
For governance, transfers and discovery, connect any MCP client (Claude Desktop, Claude Code, ...) to the registry's [MCP server](https://api.theprotocol.cloud/mcp/sse). The public tool surface spans discovery, wallet, locks, governance, the Guild, and the AGORA market; append `?mode=gateway` to browse it on demand instead of loading the full catalog.
|
|
227
357
|
|
|
228
358
|
## License
|
|
229
359
|
|
|
@@ -1,46 +1,3 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: theprotocol-sdk
|
|
3
|
-
Version: 0.7.6
|
|
4
|
-
Summary: Build sovereign AI agents with DID identity on TheProtocol. Speaks the A2A protocol (v1.0) natively, with bridges for Google A2A, ANP, and MCP. Works with Vertex AI, AWS AgentCore, LangGraph, CrewAI.
|
|
5
|
-
Project-URL: Homepage, https://theprotocol.cloud
|
|
6
|
-
Project-URL: Documentation, https://docs.theprotocol.cloud
|
|
7
|
-
Project-URL: API Reference, https://api.theprotocol.cloud/docs
|
|
8
|
-
Author-email: TheProtocol <sdk@theprotocol.cloud>
|
|
9
|
-
License: Apache-2.0
|
|
10
|
-
License-File: LICENSE
|
|
11
|
-
Keywords: a2a,a2a-protocol,agent-to-agent,agents,ai-agents,crewai,did,fastapi,federation,json-rpc,langchain,mcp,sovereign,theprotocol,vertex-ai
|
|
12
|
-
Classifier: Development Status :: 3 - Alpha
|
|
13
|
-
Classifier: Intended Audience :: Developers
|
|
14
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
|
-
Classifier: Programming Language :: Python :: 3
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
-
Classifier: Topic :: Software Development :: Libraries
|
|
22
|
-
Requires-Python: >=3.10
|
|
23
|
-
Requires-Dist: httpx[http2]>=0.27
|
|
24
|
-
Requires-Dist: pydantic<3.0,>=2.0
|
|
25
|
-
Requires-Dist: python-dotenv>=1.0
|
|
26
|
-
Provides-Extra: all
|
|
27
|
-
Requires-Dist: cryptography>=42.0; extra == 'all'
|
|
28
|
-
Requires-Dist: fastapi>=0.111; extra == 'all'
|
|
29
|
-
Requires-Dist: keyring>=24; extra == 'all'
|
|
30
|
-
Provides-Extra: anp
|
|
31
|
-
Requires-Dist: cryptography>=42.0; extra == 'anp'
|
|
32
|
-
Provides-Extra: keyring
|
|
33
|
-
Requires-Dist: keyring>=24; extra == 'keyring'
|
|
34
|
-
Provides-Extra: server
|
|
35
|
-
Requires-Dist: fastapi>=0.111; extra == 'server'
|
|
36
|
-
Provides-Extra: test
|
|
37
|
-
Requires-Dist: cryptography>=42.0; extra == 'test'
|
|
38
|
-
Requires-Dist: httpx>=0.27; extra == 'test'
|
|
39
|
-
Requires-Dist: pytest-asyncio>=0.21; extra == 'test'
|
|
40
|
-
Requires-Dist: pytest>=7.0; extra == 'test'
|
|
41
|
-
Requires-Dist: respx>=0.20; extra == 'test'
|
|
42
|
-
Description-Content-Type: text/markdown
|
|
43
|
-
|
|
44
1
|
# theprotocol-sdk
|
|
45
2
|
|
|
46
3
|
Build and call AI agents on [TheProtocol](https://theprotocol.cloud). Speaks the A2A protocol (v1.0) natively, with bridges for Google A2A, ANP, and MCP.
|
|
@@ -51,6 +8,7 @@ Build and call AI agents on [TheProtocol](https://theprotocol.cloud). Speaks the
|
|
|
51
8
|
pip install theprotocol-sdk # Client only (call agents)
|
|
52
9
|
pip install theprotocol-sdk[server] # + FastAPI router (build agents)
|
|
53
10
|
pip install theprotocol-sdk[anp] # + Ed25519 crypto for ANP DID:WBA
|
|
11
|
+
pip install theprotocol-sdk[proxy] # + TheProtocol Proxy (tp-proxy): a legacy system's agent on TheProtocol
|
|
54
12
|
pip install theprotocol-sdk[all] # Everything
|
|
55
13
|
```
|
|
56
14
|
|
|
@@ -165,7 +123,7 @@ assert verify_registry_card(card, jwks)
|
|
|
165
123
|
|
|
166
124
|
## mTLS identity, wherever your agent runs
|
|
167
125
|
|
|
168
|
-
`enable-mtls` adapts to where your agent is deployed. On the registry's own host it points you at the SPIFFE Workload API socket; anywhere else it
|
|
126
|
+
`enable-mtls` adapts to where your agent is deployed. On the registry's own host it points you at the SPIFFE Workload API socket; anywhere else it issues a short-lived X509-SVID and returns it inline. `IronhandClient` handles both, writes the inline case in the layout `MtlsAgentClient` reads, and keeps it fresh:
|
|
169
127
|
|
|
170
128
|
```python
|
|
171
129
|
from theprotocol.mtls import IronhandClient
|
|
@@ -176,20 +134,47 @@ enrollment = await iron.enroll(agent_jwt)
|
|
|
176
134
|
|
|
177
135
|
if enrollment.delivery == "inline": # your own infrastructure
|
|
178
136
|
client = MtlsAgentClient(cert_dir=iron.cert_dir)
|
|
179
|
-
|
|
137
|
+
# SVIDs are short-lived by design; pass a function that returns the current agent token: the loop outlives a token
|
|
138
|
+
task = iron.start_auto_rotate(current_agent_token)
|
|
180
139
|
elif enrollment.delivery == "workload_api": # co-located with the registry
|
|
181
140
|
... # fetch from the socket instead
|
|
182
141
|
```
|
|
183
142
|
|
|
184
143
|
The private key is written `0600` into a `0700` directory, via a temp file and rename so a reader never sees it half-written. A registry that cannot issue a certificate says so and raises `IronhandUnavailableError` rather than leaving you believing you have an identity: nothing is enrolled in that case, and agent-JWT plus payment-token auth continue to work. Enrollment needs the `identity.mtls` permission, which rides the `client` and `service-provider` roles.
|
|
185
144
|
|
|
145
|
+
## TheProtocol Proxy
|
|
146
|
+
|
|
147
|
+
A small process beside a legacy system (an ERP, a scale, a meter, a terminal operating system) that gives it an agent
|
|
148
|
+
identity on TheProtocol and translates in both directions, from one spec file: sources read the system, mappings turn
|
|
149
|
+
its records into actions on TheProtocol (an attestation, a task, a payment under a mandate), and sinks deliver
|
|
150
|
+
TheProtocol's events back. A durable outbox and exactly-once keys mean a record is sent once however often it is read,
|
|
151
|
+
`--dry-run` sends nothing, and refused records wait in the dead letters for `tp-proxy replay`.
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
pip install "theprotocol-sdk[proxy]"
|
|
155
|
+
tp-proxy init --from ./my-agent # the Agent Forge starter's download: a proxy.yaml that names its credentials
|
|
156
|
+
tp-proxy run my-agent/proxy.yaml --dry-run
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Connectors are plugins on a published interface (`theprotocol.proxy.plugins`) with contract tests
|
|
160
|
+
(`theprotocol.proxy.testing`). The image, the compose example and the full guide are in `proxy/`.
|
|
161
|
+
|
|
186
162
|
## Changelog
|
|
187
163
|
|
|
188
|
-
**0.
|
|
164
|
+
**0.8.0** (V0659 and V0660: TheProtocol Proxy and the quantum workload pieces; uploaded to PyPI with V0660's roll)
|
|
165
|
+
- TheProtocol Proxy: the module `theprotocol.proxy`, the `tp-proxy` command and the `[proxy]` extra (PyYAML, jsonschema, aiohttp, cryptography). The core: the spec, the plugin interface, the agent identity, the durable outbox with exactly-once keys, the dead letters and replay, dry runs, the breaker, the rate limits, `/health` and `/metrics`, and redacted JSON logs.
|
|
166
|
+
- The proxy's built-in parts. Sources: `webhook`, `filedrop`, `logtail`, `mqtt`, `sftp`, `sqlpoll` and `theprotocol_events`. Actions: `attestation`, `a2a_task`, `payment`, `milestone_evidence` and `chat_message`. Sinks: `webhook`, `journal`, `calendar`, `email_digest` and `evidence`. A part that needs a client library has its own extra, imported only when it starts: `[proxy-mqtt]` (paho-mqtt 2), `[proxy-sftp]` (paramiko, defusedxml; the SFTP source and the evidence mirror to SFTP), `[proxy-s3]` (boto3; the evidence mirror to S3), and, for the SQL poll, `[proxy-postgresql]`, `[proxy-mysql]`, `[proxy-sqlserver]` or all three as `[proxy-sql]`. Eight ready recipes, one per blueprint bridge, are in the repository under `theprotocol-sdk/proxy/recipes/`, with a fake of each legacy system to try them against.
|
|
167
|
+
- Quantum workloads (V0660). `theprotocol.quantum` reads and writes the quantum workload agent card extension and carries its JSON Schema. `theprotocol.quantum.receipts` is the job receipt chain and its acceptance tests, the same code a registry runs at its verify and release steps, and `python -m theprotocol.quantum.verify` checks a job offline, with no registry. The QPU recipe (`[proxy-quantum]`; `quantum_submit` sink, `quantum_results` source, `quantum_report` action, `tp-proxy quantum-card`) runs simulators only; a provider points it at its own backend class. These need a registry with the quantum mode on, and it is off by default. The recipe runs on your own side: TheProtocol hosts neither the model nor the agent.
|
|
168
|
+
- `IronhandClient.start_auto_rotate` takes a function that returns the agent's current token (sync or async), asked only when a renewal is due. With the token as a fixed string, every renewal after the token expired was a 401, retried forever, because an agent token expires long before the loop ends.
|
|
169
|
+
|
|
170
|
+
**0.7.6** (2026-10-20)
|
|
189
171
|
- `PaymentVerifier` and `AgentJwtVerifier` receive the request when FastAPI calls them. Both annotated it as `Any`, which FastAPI reads as a query parameter: every call through a router carrying either one was refused with 422, so an agent that switched payment on with `REGISTRY_URL` and `AGENT_DID` refused every call instead of asking for a payment token (402). Calling them directly, as the unit tests did, was not affected. The new tests go through FastAPI, with a control that reproduces the old 422.
|
|
172
|
+
- `KeyManager` reads a name=value key file as it reads the environment: both lines of an OAuth pair come back (0.7.5 returned only the first line and ignored the environment's copy of the second), `THEPROTOCOL_KEY_<SERVICE_ID>` is found by `get_key("<service id>")` (it was stored under the whole line name), and a file named exactly `.env` is read (pathlib gives it no suffix, so it was skipped). A key file that is neither `.env` nor `.json` is reported in the log instead of being skipped in silence.
|
|
173
|
+
- `A2AClient` asks a registry's agent token route (`/api/v1/auth/agent/token`, what a registry's own agent cards name as their token URL) for a token with the form that route reads: `grant_type=password`, the client id as `username`, the client secret as `password`. 0.7.5 sent the client-credentials form there and got 422. Every other token URL still gets the client-credentials form.
|
|
174
|
+
- Docstrings that described other behaviour: `serve_well_known_card` signs a static card with `sign_with` (it was described as reserved and unused), and `create_a2a_router` injects no `PaymentVerifier` at all with `PAYMENT_REQUIRED=false` (it was described as verifying without rejecting); a free agent switches payment off, because the registry refuses a payment authorization whose amount is not greater than zero.
|
|
190
175
|
|
|
191
176
|
**0.7.5** (2026-10-02)
|
|
192
|
-
- Agent DIDs that name their frame (`did:theprotocol:<trust domain>:<uuid4>`, what registries
|
|
177
|
+
- Agent DIDs that name their frame (`did:theprotocol:<trust domain>:<uuid4>`, what registries issue since the issuer namespace) map to the did:wba a registry recognises for a DIDWba signer: `did:wba:<trust domain>:<uuid4>` (`did_wba_from_cos`; the new `native_did_from_wba` goes back). Every other shape maps as before.
|
|
193
178
|
- `A2AAuthenticator` reads such a DID back from an agent SVID's SPIFFE path with its colons; 0.7.4 returned the issuer and the uuid joined by a hyphen.
|
|
194
179
|
- `A2AAuthenticator(trust_domain=None)` takes `THEPROTOCOL_TRUST_DOMAIN` from the environment. With neither set it keeps the old `agentvault.com` and logs a warning, so nothing that worked stops working.
|
|
195
180
|
- `theprotocol.bridges.anp` exports `KeyPair`, `did_wba_from_cos` and `native_did_from_wba`; the new `theprotocol.dids` holds the registry's DID shapes.
|
|
@@ -216,7 +201,7 @@ The private key is written `0600` into a `0700` directory, via a temp file and r
|
|
|
216
201
|
**0.6.0** (2026-07-19, never uploaded to PyPI; first ships as part of 0.6.1)
|
|
217
202
|
- NEW `theprotocol.guild.GuildClient` — the agent work exchange: post an escrowed bounty, discover/bid (`POST …/orders/{id}/bids`, firms via `on_behalf_of_org_id`), award, submit, verify+pay with a star rating, `my_work()` (`GET /api/v1/guild/mine`), federation-wide `network_board()`. `GuildClient.eval_bounty_spec(suite_id, min_score, body)` builds the `eval_bounty://` spec header for objective quorum-scored auto-settle. Non-2xx raises `GuildError` (status code + structured detail).
|
|
218
203
|
- NEW `theprotocol.forge.ForgeClient` — the GÖDEL FORGE self-improving-harness arena: `get_status()` (dark arenas return `{"enabled": False}` instead of raising), `get_lineage()` Evolution Tree, agent-tier `fork_bundle()` (`bundle.write`, fork lineage + royalty bps), `self_version()` / `activate_version()` (`cicd.version`, response normalized to `version_id`), and `run_eval()` (verifier-quorum scored, never self-reported). Dark-arena 403s raise `ForgeDisabledError`; other failures `ForgeError`.
|
|
219
|
-
- NEW `theprotocol.authz.AuthzClient` — IRONKEY L3/L4: `list_delegations()` (developer JWT), `issue_capability()` (
|
|
204
|
+
- NEW `theprotocol.authz.AuthzClient` — IRONKEY L3/L4: `list_delegations()` (developer JWT), `issue_capability()` (issues an `att_` token under `authz.delegate`; caveats + budget + TTL), `attenuate()` (strictly-weaker child, rides the token), `my_capabilities()`, `revoke_capability()` (subtree cascade), and `AuthzClient.capability_headers(token)` → `{"X-Capability-Token": …}`. Non-2xx raises `AuthzError`.
|
|
220
205
|
|
|
221
206
|
**0.5.1** (2026-07-09)
|
|
222
207
|
- FastAPI ≥ 0.139 / Starlette 1.x compatibility: `serve_well_known_card` federated mode no longer relies on the removed `add_event_handler` API — startup registration now degrades gracefully (`add_event_handler` → `router.on_startup` → lifespan-context wrap). Verified 173/173 tests on both fastapi 0.111 (floor) and 0.139.
|
|
@@ -266,7 +251,7 @@ result = await client.call(target_url, payload)
|
|
|
266
251
|
|
|
267
252
|
## MCP Tools
|
|
268
253
|
|
|
269
|
-
For governance, transfers and discovery, connect any MCP client (Claude Desktop, Claude Code, ...) to the registry's [MCP server](https://api.theprotocol.cloud/mcp/sse). The public tool surface spans discovery, wallet,
|
|
254
|
+
For governance, transfers and discovery, connect any MCP client (Claude Desktop, Claude Code, ...) to the registry's [MCP server](https://api.theprotocol.cloud/mcp/sse). The public tool surface spans discovery, wallet, locks, governance, the Guild, and the AGORA market; append `?mode=gateway` to browse it on demand instead of loading the full catalog.
|
|
270
255
|
|
|
271
256
|
## License
|
|
272
257
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# TheProtocol Proxy: the tp-proxy command in a small image, for amd64 and arm64 (a server room or a Raspberry Pi).
|
|
3
|
+
# Built from theprotocol-sdk/ (the build context), for both platforms:
|
|
4
|
+
# docker buildx build --platform linux/amd64,linux/arm64 -f proxy/Dockerfile -t theprotocol-proxy:dev .
|
|
5
|
+
# An evidence export mirrored to SFTP or S3 needs its client in the image: --build-arg EXTRAS=proxy,proxy-sftp,proxy-s3
|
|
6
|
+
ARG EXTRAS=proxy
|
|
7
|
+
FROM python:3.12-slim AS build
|
|
8
|
+
ARG EXTRAS
|
|
9
|
+
WORKDIR /src
|
|
10
|
+
COPY pyproject.toml README.md LICENSE ./
|
|
11
|
+
COPY src ./src
|
|
12
|
+
RUN pip wheel --no-cache-dir --wheel-dir /wheels ".[${EXTRAS}]"
|
|
13
|
+
|
|
14
|
+
FROM python:3.12-slim
|
|
15
|
+
ARG EXTRAS
|
|
16
|
+
RUN useradd --system --uid 10001 --home-dir /data --shell /usr/sbin/nologin tpproxy \
|
|
17
|
+
&& mkdir -p /data /config && chown tpproxy:tpproxy /data
|
|
18
|
+
COPY --from=build /wheels /wheels
|
|
19
|
+
RUN pip install --no-cache-dir --no-index --find-links /wheels "theprotocol-sdk[${EXTRAS}]" && rm -rf /wheels
|
|
20
|
+
USER tpproxy
|
|
21
|
+
WORKDIR /data
|
|
22
|
+
# the spec is mounted read-only at /config/proxy.yaml; the outbox and the SVID live in /data (a volume)
|
|
23
|
+
ENV TP_PROXY_SPEC=/config/proxy.yaml PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1
|
|
24
|
+
EXPOSE 9108
|
|
25
|
+
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s \
|
|
26
|
+
CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:9108/health', timeout=4)" || exit 1
|
|
27
|
+
ENTRYPOINT ["tp-proxy"]
|
|
28
|
+
CMD ["run"]
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# TheProtocol Proxy
|
|
2
|
+
|
|
3
|
+
A small process beside a legacy system that gives the system an agent identity on TheProtocol and translates in both
|
|
4
|
+
directions. It runs where the system runs (on premises, a VM, a Raspberry Pi), dials out only (unless you turn on its
|
|
5
|
+
webhook receiver), and sends only what its mapping names. The legacy system stays the operational truth; the ledger
|
|
6
|
+
becomes the shared record.
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
legacy system ──source──▶ [ mapping ] ──action──▶ TheProtocol (inbound: attest, ask, pay, deliver)
|
|
10
|
+
legacy system ◀──sink──── [ mapping ] ◀──events── TheProtocol (outbound: evidence, settlement, cards)
|
|
11
|
+
durable outbox · exactly-once keys · dry-run · replay · metrics
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Start
|
|
15
|
+
|
|
16
|
+
The proxy is an agent: create one in the console (Agent Forge's starter) and download it. The download's `.env` names
|
|
17
|
+
the agent and its registry; its `.env.secret` holds the agent's credentials.
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
pip install "theprotocol-sdk[proxy]"
|
|
21
|
+
tp-proxy init --from ./my-agent # writes ./my-agent/proxy.yaml, then asks the registry about the agent
|
|
22
|
+
tp-proxy validate my-agent/proxy.yaml
|
|
23
|
+
tp-proxy run my-agent/proxy.yaml --dry-run # maps and prints what it would send; sends nothing
|
|
24
|
+
tp-proxy run my-agent/proxy.yaml
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
`init` reports what the registry says: whether the credentials work, the agent's card, its bond, and the permissions
|
|
28
|
+
the spec's actions need. The attestation action needs `reputation.signal`; the owner grants the `attestor` role, which
|
|
29
|
+
carries that and nothing else.
|
|
30
|
+
|
|
31
|
+
## The spec
|
|
32
|
+
|
|
33
|
+
One file per proxy (`proxy.yaml`; see `proxy.example.yaml`): its sources, mappings, actions, sinks and limits. A secret
|
|
34
|
+
is never written in it. Where the spec holds a credential it takes a reference: `env:NAME`, `file:/path` or
|
|
35
|
+
`file:/path#KEY` (one line of a dotenv file, such as the starter's `.env.secret`). A literal secret is refused at load,
|
|
36
|
+
with its path.
|
|
37
|
+
|
|
38
|
+
## What the core guarantees
|
|
39
|
+
|
|
40
|
+
- **Exactly once.** Each record's key is a hash of the source, the record's id, the mapping's name and its version. A
|
|
41
|
+
record read twice is kept once. A record is in the outbox (SQLite, WAL) before its source's cursor moves. Every call
|
|
42
|
+
carries the key as its `Idempotency-Key`, so a call whose answer was lost is sent again with the same key and the
|
|
43
|
+
registry answers it as a repeat.
|
|
44
|
+
- **Dead letters and replay.** A refusal (an answer a retry will not change) moves the record to the dead letters with
|
|
45
|
+
the registry's answer. `tp-proxy dead` lists them; `tp-proxy replay --all` (or `--mapping M`, `--key K`) sends them
|
|
46
|
+
again after a fix. A record its mapping cannot map is dead from the start, and a replay maps it with the fixed spec.
|
|
47
|
+
`tp-proxy run --replay SOURCE=POINT` makes a source read again from a point it understands.
|
|
48
|
+
- **A breaker per mapping.** Repeated refusals stop a mapping until `tp-proxy resume MAPPING`, and `tp-proxy status`
|
|
49
|
+
says why. Repeated transient failures (the registry down) cool it down, and it tries again by itself.
|
|
50
|
+
- **Limits.** Each action and sink has a calls-per-minute limit (`limits: {per_minute: N}`). `tp-proxy pause [MAPPING]`
|
|
51
|
+
stops sending while records are still taken in.
|
|
52
|
+
- **Run it like a service.** `/health` and `/metrics` (Prometheus) on `service.listen`, JSON logs with no secret in
|
|
53
|
+
them, and an optional IRONHAND mTLS identity (`identity.mtls.enabled`), renewed before it expires.
|
|
54
|
+
|
|
55
|
+
## In a container
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
docker compose up -d # compose.yaml: proxy.yaml, and the starter's .env and .env.secret beside it
|
|
59
|
+
docker compose exec proxy tp-proxy status
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The image is built for amd64 and arm64 from `theprotocol-sdk/`:
|
|
63
|
+
`docker buildx build --platform linux/amd64,linux/arm64 -f proxy/Dockerfile -t theprotocol-proxy:dev .`
|
|
64
|
+
|
|
65
|
+
## Connectors
|
|
66
|
+
|
|
67
|
+
Sources, actions and sinks are plugins (Python entry points in the groups `theprotocol.proxy.sources`,
|
|
68
|
+
`theprotocol.proxy.actions` and `theprotocol.proxy.sinks`). The interface and its rules are in
|
|
69
|
+
`theprotocol.proxy.plugins`, and every plugin passes the contract tests in `theprotocol.proxy.testing`. The built-ins:
|
|
70
|
+
|
|
71
|
+
| kind | type | what it does |
|
|
72
|
+
|---|---|---|
|
|
73
|
+
| source | `webhook` | an HTTP receiver for anything that can POST JSON (HMAC-signed; 202 once the record is kept) |
|
|
74
|
+
| source | `theprotocol_events` | the registry's webhooks: TheProtocol's events, each delivery's signature checked |
|
|
75
|
+
| action | `attestation` | one signed fact per record (needs `reputation.signal`: the `attestor` role) |
|
|
76
|
+
| action | `a2a_task` | a task to a named agent (A2A `message/send`), free agents only |
|
|
77
|
+
| action | `payment` | a payment authorization and its settle, only under a Cockpit mandate |
|
|
78
|
+
| action | `milestone_evidence` | a contract milestone delivered with the record as its evidence |
|
|
79
|
+
| action | `chat_message` | a message or a card into a chat thread or room |
|
|
80
|
+
| sink | `webhook` | each event POSTed to a system's API, the record's key as its `Idempotency-Key` |
|
|
81
|
+
| sink | `evidence` | hash-chained JSONL and a signed manifest (optionally mirrored to SFTP or S3) |
|
|
82
|
+
| sink | `journal` | accounting lines: a CSV journal, or an ISO 20022 camt.053 statement, per day |
|
|
83
|
+
| sink | `calendar` | an ICS calendar, one event per delivery |
|
|
84
|
+
| sink | `email_digest` | a digest mail of the events every interval |
|
|
85
|
+
|
|
86
|
+
## Paying, only under a mandate
|
|
87
|
+
|
|
88
|
+
A `payment` action names a Cockpit mandate (`mandate: lm_...`) and its own limits (`max_amount`, optionally
|
|
89
|
+
`per_day`). It does not start unless the registry answers that the mandate underwrites this agent and covers payments,
|
|
90
|
+
the action's `max_amount` is at or under the mandate's `max_per_tx`, and the agent has an IRONKEY spend cap that sits
|
|
91
|
+
at or under the mandate's limits (its owner sets one in the console). Every authorization names the mandate
|
|
92
|
+
(`X-Liability-Mandate`), so the registry checks that mandate for the call, its standing consents and step-ups
|
|
93
|
+
included, wherever it runs. Authorize and settle carry the record's key: a payment is made once.
|
|
94
|
+
|
|
95
|
+
## A quantum backend
|
|
96
|
+
|
|
97
|
+
`pip install "theprotocol-sdk[proxy-quantum]"`, then `proxy/proxy.quantum.example.yaml`. OpenQASM 3 arrives
|
|
98
|
+
as an event, the circuit runs, the shots are metered as they run, and each finished job is reported with its
|
|
99
|
+
counts.
|
|
100
|
+
|
|
101
|
+
It is **asynchronous**, and that is not a simplification. A real QPU queues — the quantum card extension
|
|
102
|
+
carries `queue.status` and `estimated_wait_seconds` — so there is no "circuit in, counts out" call: the
|
|
103
|
+
`quantum_submit` sink submits, the `quantum_results` source reads what finished, and the `quantum_report`
|
|
104
|
+
action reports it. A job id is the stable record id, so the core's exactly-once keys cover the whole path
|
|
105
|
+
and a replayed event never re-runs paid work.
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
tp-proxy quantum-card proxy.quantum.example.yaml \
|
|
109
|
+
--receipt-schema-version 1.0 --receipt-signing-algorithm Ed25519
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
generates the card's quantum workload extension **from the backend's own facts**, so a provider publishes a
|
|
113
|
+
card it did not type and cannot forget to update. It refuses rather than inventing: a stub cloud adapter
|
|
114
|
+
states no device facts, and a missing receipt block names the module those constants belong to.
|
|
115
|
+
|
|
116
|
+
**What the meter proves, and what it does not.** `accurateResourceUsagePolicy/v2.0.0` binds a reported shot
|
|
117
|
+
count to a committed meter log. Its own limits note says a verifier compares the commitment with one the
|
|
118
|
+
meter *published*, and the reason is worth knowing: a provider free to choose the logged units after seeing
|
|
119
|
+
its own report can always satisfy the tolerance rule. So the commitment is made when the work runs, and a
|
|
120
|
+
job that was never metered cannot be reported at all. The claim's `log_commitment` reads `NOT_COMPUTED`
|
|
121
|
+
until `nargo` and `bb` are installed — the pre-image is carried so a prover can compute it, and nothing is
|
|
122
|
+
written under the circuit's name that this recipe did not compute itself.
|
|
123
|
+
|
|
124
|
+
**Simulators, and your own hardware.** The built-in simulator is a small pure-python state-vector
|
|
125
|
+
simulator: it exists so the recipe runs with nothing installed, and it is not fast. There is deliberately
|
|
126
|
+
no accelerated-simulator extra, because an accelerated path that cannot be tested here is one we will not
|
|
127
|
+
claim; `kind` takes a `"module:Class"` path to your own `Backend` instead, and the `qpu` adapters are stubs
|
|
128
|
+
that refuse to run. The reader refuses a gate it does not implement by name, rather than running the
|
|
129
|
+
circuit approximately and returning counts that look like a result.
|
|
130
|
+
|
|
131
|
+
## Evidence, checked offline
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
tp-proxy keygen /run/secrets/evidence.pem # the export's signing key; prints its public key
|
|
135
|
+
tp-proxy verify /data/evidence --key <public key> --webhook-secret env:TP_WEBHOOK_SECRET
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Each event is one line whose hash covers its content and the line before, across the day files; `manifest.json`
|
|
139
|
+
names every file and the chain's head, embeds the registry's signed card when asked, and is signed by the proxy's
|
|
140
|
+
key. `verify` needs no network. It names a changed, removed or moved line, a file the manifest does not list, a
|
|
141
|
+
manifest signed by another key than the one you expect, and, with the webhook's secret, any delivery the registry
|
|
142
|
+
did not sign.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
# TheProtocol Proxy beside a legacy system. Next to this file: proxy.yaml (see proxy.example.yaml) and the Agent Forge
|
|
3
|
+
# starter's .env and .env.secret (the agent's DID and its credentials; compose reads them, the spec names them env:...).
|
|
4
|
+
# docker compose up -d then: docker compose exec proxy tp-proxy status
|
|
5
|
+
services:
|
|
6
|
+
proxy:
|
|
7
|
+
build:
|
|
8
|
+
context: ..
|
|
9
|
+
dockerfile: proxy/Dockerfile
|
|
10
|
+
image: theprotocol-proxy:dev
|
|
11
|
+
restart: unless-stopped
|
|
12
|
+
env_file: [.env, .env.secret]
|
|
13
|
+
volumes:
|
|
14
|
+
- ./proxy.yaml:/config/proxy.yaml:ro
|
|
15
|
+
- proxy-state:/data
|
|
16
|
+
ports:
|
|
17
|
+
# only for a webhook source the legacy system posts to (the proxy dials out for everything else)
|
|
18
|
+
- "8711:8711"
|
|
19
|
+
read_only: true
|
|
20
|
+
tmpfs: [/tmp]
|
|
21
|
+
cap_drop: [ALL]
|
|
22
|
+
security_opt: ["no-new-privileges:true"]
|
|
23
|
+
|
|
24
|
+
volumes:
|
|
25
|
+
proxy-state: {}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# TheProtocol Proxy, an example: a terminal operating system's gate-out events become attestations on TheProtocol.
|
|
2
|
+
# In the container (compose.yaml) the credentials come from the starter's .env and .env.secret as environment
|
|
3
|
+
# variables; on a host, name the file instead: client_secret: file:.env.secret#CLIENT_SECRET.
|
|
4
|
+
version: 1
|
|
5
|
+
name: gate-scanner
|
|
6
|
+
registry: https://api.theprotocol.cloud
|
|
7
|
+
identity:
|
|
8
|
+
agent_did: env:AGENT_DID
|
|
9
|
+
client_id: env:CLIENT_ID
|
|
10
|
+
client_secret: env:CLIENT_SECRET
|
|
11
|
+
mtls: {enabled: false, dir: /data/certs}
|
|
12
|
+
state: /data/proxy-state.db
|
|
13
|
+
sources:
|
|
14
|
+
gate:
|
|
15
|
+
type: webhook
|
|
16
|
+
# the TOS posts each gate event here, signed with GATE_HMAC (X-Signature-256: sha256=<hex of the body>)
|
|
17
|
+
config: {listen: "0.0.0.0:8711", path: /in/gate, id_field: event_id, secret: env:GATE_HMAC}
|
|
18
|
+
actions:
|
|
19
|
+
attest:
|
|
20
|
+
type: attestation
|
|
21
|
+
config: {attestation_type: tos.gate_out}
|
|
22
|
+
limits: {per_minute: 120}
|
|
23
|
+
sinks: {}
|
|
24
|
+
mappings:
|
|
25
|
+
- name: gate-out
|
|
26
|
+
version: 1 # part of every record's key: a new version sends the records it maps again
|
|
27
|
+
from: gate
|
|
28
|
+
to: attest
|
|
29
|
+
when: {path: $.payload.status, equals: OUT}
|
|
30
|
+
fields:
|
|
31
|
+
container: $.payload.container_id
|
|
32
|
+
at: $.payload.timestamp
|
|
33
|
+
seal: {path: $.payload.seal, default: null}
|
|
34
|
+
terminal: HAM-CTA
|
|
35
|
+
retry: {first_s: 2, max_s: 300, attempts: 8}
|
|
36
|
+
breaker: {refusals: 5, failures: 10, cooldown_s: 30}
|
|
37
|
+
service: {listen: "127.0.0.1:9108"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# TheProtocol Proxy, an example of the outbound direction: TheProtocol's events, as the registry's webhooks deliver
|
|
2
|
+
# them, into an evidence export anyone can check offline (tp-proxy verify) and into the bank-statement format an ERP
|
|
3
|
+
# ingests (ISO 20022 camt.053). The owner registers https://<this host>:8712/in/theprotocol as a webhook in the console
|
|
4
|
+
# (Developer, Webhooks) and keeps its secret in TP_WEBHOOK_SECRET; tp-proxy keygen writes the export's signing key.
|
|
5
|
+
version: 1
|
|
6
|
+
name: ledger-out
|
|
7
|
+
registry: https://api.theprotocol.cloud
|
|
8
|
+
identity:
|
|
9
|
+
agent_did: env:AGENT_DID
|
|
10
|
+
client_id: env:CLIENT_ID
|
|
11
|
+
client_secret: env:CLIENT_SECRET
|
|
12
|
+
state: /data/proxy-state.db
|
|
13
|
+
sources:
|
|
14
|
+
events:
|
|
15
|
+
type: theprotocol_events
|
|
16
|
+
config: {listen: "0.0.0.0:8712", path: /in/theprotocol, secret: env:TP_WEBHOOK_SECRET,
|
|
17
|
+
events: [payment.settled, contract.milestone_released]}
|
|
18
|
+
actions: {}
|
|
19
|
+
sinks:
|
|
20
|
+
evidence:
|
|
21
|
+
type: evidence
|
|
22
|
+
config: {dir: /data/evidence, signing_key: file:/run/secrets/evidence.pem, registry_card: true}
|
|
23
|
+
bank:
|
|
24
|
+
type: journal
|
|
25
|
+
config: {dir: /data/statements, format: camt053, account: {id: "did:theprotocol:ledger-out", currency: ECU}}
|
|
26
|
+
mappings:
|
|
27
|
+
- name: evidence
|
|
28
|
+
version: 1
|
|
29
|
+
from: events
|
|
30
|
+
to: evidence
|
|
31
|
+
fields: {amount: {path: $.payload.amount, default: null}, counterparty: {path: $.payload.payee, default: null}}
|
|
32
|
+
- name: statement
|
|
33
|
+
version: 1
|
|
34
|
+
from: events
|
|
35
|
+
to: bank
|
|
36
|
+
when: {path: $.meta.event_type, equals: payment.settled}
|
|
37
|
+
fields:
|
|
38
|
+
amount: $.payload.amount
|
|
39
|
+
direction: credit
|
|
40
|
+
counterparty: {path: $.payload.payer, default: ""}
|
|
41
|
+
text: {path: $.payload.memo, default: settlement}
|
|
42
|
+
service: {listen: "127.0.0.1:9108"}
|