patchr 0.1.0__tar.gz → 0.1.2__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.
Files changed (186) hide show
  1. patchr-0.1.2/PKG-INFO +202 -0
  2. patchr-0.1.2/README.md +168 -0
  3. patchr-0.1.2/apps/__init__.py +2 -0
  4. patchr-0.1.2/apps/api/__init__.py +2 -0
  5. {patchr-0.1.0 → patchr-0.1.2}/apps/api/main.py +288 -77
  6. {patchr-0.1.0 → patchr-0.1.2}/apps/benchmarks/main.py +1 -1
  7. patchr-0.1.2/apps/sandbox/__init__.py +1 -0
  8. {patchr-0.1.0 → patchr-0.1.2}/apps/sandbox/main.py +1 -1
  9. patchr-0.1.2/apps/worker/__init__.py +2 -0
  10. {patchr-0.1.0 → patchr-0.1.2}/apps/worker/main.py +1 -1
  11. patchr-0.1.2/patchr.egg-info/PKG-INFO +202 -0
  12. {patchr-0.1.0 → patchr-0.1.2}/patchr.egg-info/SOURCES.txt +4 -0
  13. {patchr-0.1.0 → patchr-0.1.2}/patchr.egg-info/requires.txt +1 -0
  14. {patchr-0.1.0 → patchr-0.1.2}/pyproject.toml +10 -3
  15. patchr-0.1.2/src/patchr/sdk/__init__.py +50 -0
  16. {patchr-0.1.0 → patchr-0.1.2}/src/picux/api/service.py +688 -12
  17. {patchr-0.1.0 → patchr-0.1.2}/src/picux/config.py +22 -16
  18. {patchr-0.1.0 → patchr-0.1.2}/src/picux/contracts/integration.py +74 -19
  19. {patchr-0.1.0 → patchr-0.1.2}/src/picux/contracts/openapi.py +9 -6
  20. {patchr-0.1.0 → patchr-0.1.2}/src/picux/contracts/protocol_map.py +26 -44
  21. {patchr-0.1.0 → patchr-0.1.2}/src/picux/contracts/routes.py +22 -0
  22. patchr-0.1.2/src/picux/contracts/schemas.py +114 -0
  23. {patchr-0.1.0 → patchr-0.1.2}/src/picux/core/router.py +12 -0
  24. {patchr-0.1.0 → patchr-0.1.2}/src/picux/core/runtime.py +1 -1
  25. {patchr-0.1.0 → patchr-0.1.2}/src/picux/domains/bridge/engine.py +52 -0
  26. patchr-0.1.2/src/picux/domains/hunt/__init__.py +6 -0
  27. patchr-0.1.2/src/picux/domains/hunt/engine.py +669 -0
  28. patchr-0.1.2/src/picux/domains/hunt/models.py +259 -0
  29. {patchr-0.1.0 → patchr-0.1.2}/src/picux/orchestrator/engine.py +563 -176
  30. {patchr-0.1.0 → patchr-0.1.2}/src/picux/protocols/mcp/contract.py +1 -0
  31. {patchr-0.1.0 → patchr-0.1.2}/src/picux/protocols/mcp/server.py +1 -1
  32. {patchr-0.1.0 → patchr-0.1.2}/src/picux/sdk/client.py +116 -4
  33. {patchr-0.1.0 → patchr-0.1.2}/src/picux/security/auth.py +15 -1
  34. patchr-0.1.2/src/picux/security/ratelimit.py +91 -0
  35. {patchr-0.1.0 → patchr-0.1.2}/src/picux/storage/postgres.py +28 -7
  36. {patchr-0.1.0 → patchr-0.1.2}/src/picux/tools/__init__.py +2 -1
  37. {patchr-0.1.0 → patchr-0.1.2}/src/picux/tools/shared.py +609 -8
  38. patchr-0.1.2/src/picux/workflows/__init__.py +5 -0
  39. patchr-0.1.2/src/picux/workflows/templates.py +151 -0
  40. {patchr-0.1.0 → patchr-0.1.2}/tests/test_bridge_preflight.py +44 -0
  41. {patchr-0.1.0 → patchr-0.1.2}/tests/test_bridge_ready_connectors.py +15 -0
  42. {patchr-0.1.0 → patchr-0.1.2}/tests/test_case_channel_portal_workflows.py +26 -0
  43. {patchr-0.1.0 → patchr-0.1.2}/tests/test_fastapi_contract_parity.py +1 -1
  44. {patchr-0.1.0 → patchr-0.1.2}/tests/test_hosted_adapters.py +67 -0
  45. patchr-0.1.2/tests/test_hunt_domain.py +248 -0
  46. {patchr-0.1.0 → patchr-0.1.2}/tests/test_integration_manifest.py +4 -4
  47. {patchr-0.1.0 → patchr-0.1.2}/tests/test_mcp_endpoint.py +1 -1
  48. {patchr-0.1.0 → patchr-0.1.2}/tests/test_orchestrator_run.py +138 -20
  49. patchr-0.1.2/tests/test_orchestrator_stream_progress.py +52 -0
  50. {patchr-0.1.0 → patchr-0.1.2}/tests/test_protocol_contracts.py +4 -3
  51. {patchr-0.1.0 → patchr-0.1.2}/tests/test_scaffold.py +6 -0
  52. patchr-0.1.2/tests/test_sdk_client_scenarios.py +46 -0
  53. {patchr-0.1.0 → patchr-0.1.2}/tests/test_sdk_external_client.py +66 -2
  54. {patchr-0.1.0 → patchr-0.1.2}/tests/test_sdk_publish_artifacts.py +18 -0
  55. {patchr-0.1.0 → patchr-0.1.2}/tests/test_security_policy.py +33 -0
  56. {patchr-0.1.0 → patchr-0.1.2}/tests/test_shared_tools.py +144 -1
  57. patchr-0.1.2/tests/test_solana_escrow_ci.py +114 -0
  58. {patchr-0.1.0 → patchr-0.1.2}/tests/test_status_security.py +1 -1
  59. {patchr-0.1.0 → patchr-0.1.2}/tests/test_transport_auth.py +2 -2
  60. {patchr-0.1.0 → patchr-0.1.2}/tests/test_web_homepage.py +96 -22
  61. {patchr-0.1.0 → patchr-0.1.2}/tests/test_workflow_templates.py +81 -0
  62. patchr-0.1.0/PKG-INFO +0 -137
  63. patchr-0.1.0/README.md +0 -108
  64. patchr-0.1.0/apps/__init__.py +0 -2
  65. patchr-0.1.0/apps/api/__init__.py +0 -2
  66. patchr-0.1.0/apps/sandbox/__init__.py +0 -1
  67. patchr-0.1.0/apps/worker/__init__.py +0 -2
  68. patchr-0.1.0/patchr.egg-info/PKG-INFO +0 -137
  69. patchr-0.1.0/src/patchr/sdk/__init__.py +0 -20
  70. patchr-0.1.0/src/picux/domains/hunt/__init__.py +0 -6
  71. patchr-0.1.0/src/picux/domains/hunt/engine.py +0 -307
  72. patchr-0.1.0/src/picux/domains/hunt/models.py +0 -88
  73. patchr-0.1.0/src/picux/workflows/__init__.py +0 -5
  74. patchr-0.1.0/src/picux/workflows/templates.py +0 -74
  75. patchr-0.1.0/tests/test_hunt_domain.py +0 -109
  76. patchr-0.1.0/tests/test_solana_escrow_ci.py +0 -71
  77. {patchr-0.1.0 → patchr-0.1.2}/LICENSE +0 -0
  78. {patchr-0.1.0 → patchr-0.1.2}/apps/benchmarks/__init__.py +0 -0
  79. {patchr-0.1.0 → patchr-0.1.2}/apps/worker/verify.py +0 -0
  80. {patchr-0.1.0 → patchr-0.1.2}/patchr.egg-info/dependency_links.txt +0 -0
  81. {patchr-0.1.0 → patchr-0.1.2}/patchr.egg-info/entry_points.txt +0 -0
  82. {patchr-0.1.0 → patchr-0.1.2}/patchr.egg-info/top_level.txt +0 -0
  83. {patchr-0.1.0 → patchr-0.1.2}/setup.cfg +0 -0
  84. {patchr-0.1.0 → patchr-0.1.2}/src/patchr/__init__.py +0 -0
  85. {patchr-0.1.0 → patchr-0.1.2}/src/patchr/sdk/client.py +0 -0
  86. {patchr-0.1.0 → patchr-0.1.2}/src/picux/__init__.py +0 -0
  87. {patchr-0.1.0 → patchr-0.1.2}/src/picux/agents/__init__.py +0 -0
  88. {patchr-0.1.0 → patchr-0.1.2}/src/picux/agents/registry.py +0 -0
  89. {patchr-0.1.0 → patchr-0.1.2}/src/picux/api/__init__.py +0 -0
  90. {patchr-0.1.0 → patchr-0.1.2}/src/picux/audit/__init__.py +0 -0
  91. {patchr-0.1.0 → patchr-0.1.2}/src/picux/audit/activity.py +0 -0
  92. {patchr-0.1.0 → patchr-0.1.2}/src/picux/audit/observability.py +0 -0
  93. {patchr-0.1.0 → patchr-0.1.2}/src/picux/audit/verification/__init__.py +0 -0
  94. {patchr-0.1.0 → patchr-0.1.2}/src/picux/audit/verification/ledger.py +0 -0
  95. {patchr-0.1.0 → patchr-0.1.2}/src/picux/benchmarks/__init__.py +0 -0
  96. {patchr-0.1.0 → patchr-0.1.2}/src/picux/benchmarks/local.py +0 -0
  97. {patchr-0.1.0 → patchr-0.1.2}/src/picux/contracts/__init__.py +0 -0
  98. {patchr-0.1.0 → patchr-0.1.2}/src/picux/contracts/handshake.py +0 -0
  99. {patchr-0.1.0 → patchr-0.1.2}/src/picux/contracts/schema_catalog.py +0 -0
  100. {patchr-0.1.0 → patchr-0.1.2}/src/picux/core/__init__.py +0 -0
  101. {patchr-0.1.0 → patchr-0.1.2}/src/picux/core/models.py +0 -0
  102. {patchr-0.1.0 → patchr-0.1.2}/src/picux/core/state_machine.py +0 -0
  103. {patchr-0.1.0 → patchr-0.1.2}/src/picux/domains/__init__.py +0 -0
  104. {patchr-0.1.0 → patchr-0.1.2}/src/picux/domains/bridge/HostRun.py +0 -0
  105. {patchr-0.1.0 → patchr-0.1.2}/src/picux/domains/bridge/__init__.py +0 -0
  106. {patchr-0.1.0 → patchr-0.1.2}/src/picux/domains/pay/__init__.py +0 -0
  107. {patchr-0.1.0 → patchr-0.1.2}/src/picux/domains/pay/adapters.py +0 -0
  108. {patchr-0.1.0 → patchr-0.1.2}/src/picux/domains/pay/engine.py +0 -0
  109. {patchr-0.1.0 → patchr-0.1.2}/src/picux/domains/pay/models.py +0 -0
  110. {patchr-0.1.0 → patchr-0.1.2}/src/picux/domains/proxy/__init__.py +0 -0
  111. {patchr-0.1.0 → patchr-0.1.2}/src/picux/domains/proxy/engine.py +0 -0
  112. {patchr-0.1.0 → patchr-0.1.2}/src/picux/domains/resolve/__init__.py +0 -0
  113. {patchr-0.1.0 → patchr-0.1.2}/src/picux/domains/resolve/engine.py +0 -0
  114. {patchr-0.1.0 → patchr-0.1.2}/src/picux/orchestrator/__init__.py +0 -0
  115. {patchr-0.1.0 → patchr-0.1.2}/src/picux/portals/__init__.py +0 -0
  116. {patchr-0.1.0 → patchr-0.1.2}/src/picux/portals/templates.py +0 -0
  117. {patchr-0.1.0 → patchr-0.1.2}/src/picux/protocols/__init__.py +0 -0
  118. {patchr-0.1.0 → patchr-0.1.2}/src/picux/protocols/a2a/__init__.py +0 -0
  119. {patchr-0.1.0 → patchr-0.1.2}/src/picux/protocols/a2a/client.py +0 -0
  120. {patchr-0.1.0 → patchr-0.1.2}/src/picux/protocols/a2a/envelope.py +0 -0
  121. {patchr-0.1.0 → patchr-0.1.2}/src/picux/protocols/mcp/__init__.py +0 -0
  122. {patchr-0.1.0 → patchr-0.1.2}/src/picux/protocols/mcp/client.py +0 -0
  123. {patchr-0.1.0 → patchr-0.1.2}/src/picux/sandbox/__init__.py +0 -0
  124. {patchr-0.1.0 → patchr-0.1.2}/src/picux/sandbox/midnight_arbitrage.py +0 -0
  125. {patchr-0.1.0 → patchr-0.1.2}/src/picux/sandbox/models.py +0 -0
  126. {patchr-0.1.0 → patchr-0.1.2}/src/picux/sdk/__init__.py +0 -0
  127. {patchr-0.1.0 → patchr-0.1.2}/src/picux/sdk/external.py +0 -0
  128. {patchr-0.1.0 → patchr-0.1.2}/src/picux/security/__init__.py +0 -0
  129. {patchr-0.1.0 → patchr-0.1.2}/src/picux/security/config_validator.py +0 -0
  130. {patchr-0.1.0 → patchr-0.1.2}/src/picux/security/policy.py +0 -0
  131. {patchr-0.1.0 → patchr-0.1.2}/src/picux/security/secrets.py +0 -0
  132. {patchr-0.1.0 → patchr-0.1.2}/src/picux/signals/__init__.py +0 -0
  133. {patchr-0.1.0 → patchr-0.1.2}/src/picux/signals/community/__init__.py +0 -0
  134. {patchr-0.1.0 → patchr-0.1.2}/src/picux/signals/community/adapters/__init__.py +0 -0
  135. {patchr-0.1.0 → patchr-0.1.2}/src/picux/signals/community/adapters/reddit.py +0 -0
  136. {patchr-0.1.0 → patchr-0.1.2}/src/picux/signals/community/adapters/shopify.py +0 -0
  137. {patchr-0.1.0 → patchr-0.1.2}/src/picux/signals/community/adapters/web.py +0 -0
  138. {patchr-0.1.0 → patchr-0.1.2}/src/picux/signals/community/disambiguation.py +0 -0
  139. {patchr-0.1.0 → patchr-0.1.2}/src/picux/signals/community/intake.py +0 -0
  140. {patchr-0.1.0 → patchr-0.1.2}/src/picux/signals/community/models.py +0 -0
  141. {patchr-0.1.0 → patchr-0.1.2}/src/picux/signals/community/rules.py +0 -0
  142. {patchr-0.1.0 → patchr-0.1.2}/src/picux/signals/community/scoring.py +0 -0
  143. {patchr-0.1.0 → patchr-0.1.2}/src/picux/storage/__init__.py +0 -0
  144. {patchr-0.1.0 → patchr-0.1.2}/src/picux/storage/agents.py +0 -0
  145. {patchr-0.1.0 → patchr-0.1.2}/src/picux/storage/cases.py +0 -0
  146. {patchr-0.1.0 → patchr-0.1.2}/src/picux/storage/channels.py +0 -0
  147. {patchr-0.1.0 → patchr-0.1.2}/src/picux/storage/connectors.py +0 -0
  148. {patchr-0.1.0 → patchr-0.1.2}/src/picux/storage/envelopes.py +0 -0
  149. {patchr-0.1.0 → patchr-0.1.2}/src/picux/storage/escrows.py +0 -0
  150. {patchr-0.1.0 → patchr-0.1.2}/src/picux/storage/events.py +0 -0
  151. {patchr-0.1.0 → patchr-0.1.2}/src/picux/storage/keyspace.py +0 -0
  152. {patchr-0.1.0 → patchr-0.1.2}/src/picux/storage/mandates.py +0 -0
  153. {patchr-0.1.0 → patchr-0.1.2}/src/picux/storage/portals.py +0 -0
  154. {patchr-0.1.0 → patchr-0.1.2}/src/picux/storage/providers.py +0 -0
  155. {patchr-0.1.0 → patchr-0.1.2}/src/picux/storage/proxy.py +0 -0
  156. {patchr-0.1.0 → patchr-0.1.2}/src/picux/storage/receipts.py +0 -0
  157. {patchr-0.1.0 → patchr-0.1.2}/src/picux/storage/signals.py +0 -0
  158. {patchr-0.1.0 → patchr-0.1.2}/src/picux/storage/tasks.py +0 -0
  159. {patchr-0.1.0 → patchr-0.1.2}/src/picux/verification/__init__.py +0 -0
  160. {patchr-0.1.0 → patchr-0.1.2}/src/picux/verification/rollout.py +0 -0
  161. {patchr-0.1.0 → patchr-0.1.2}/tests/test_a2a_envelope_durability.py +0 -0
  162. {patchr-0.1.0 → patchr-0.1.2}/tests/test_a2a_protocol.py +0 -0
  163. {patchr-0.1.0 → patchr-0.1.2}/tests/test_agent_registry.py +0 -0
  164. {patchr-0.1.0 → patchr-0.1.2}/tests/test_audit_verification.py +0 -0
  165. {patchr-0.1.0 → patchr-0.1.2}/tests/test_benchmarks.py +0 -0
  166. {patchr-0.1.0 → patchr-0.1.2}/tests/test_bridge_connectors.py +0 -0
  167. {patchr-0.1.0 → patchr-0.1.2}/tests/test_brief_contract_parity.py +0 -0
  168. {patchr-0.1.0 → patchr-0.1.2}/tests/test_community_signal_harness.py +0 -0
  169. {patchr-0.1.0 → patchr-0.1.2}/tests/test_escrow_durability.py +0 -0
  170. {patchr-0.1.0 → patchr-0.1.2}/tests/test_integration_events.py +0 -0
  171. {patchr-0.1.0 → patchr-0.1.2}/tests/test_integration_handshake.py +0 -0
  172. {patchr-0.1.0 → patchr-0.1.2}/tests/test_mandate_durability.py +0 -0
  173. {patchr-0.1.0 → patchr-0.1.2}/tests/test_midnight_arbitrage_sandbox.py +0 -0
  174. {patchr-0.1.0 → patchr-0.1.2}/tests/test_pay_domain.py +0 -0
  175. {patchr-0.1.0 → patchr-0.1.2}/tests/test_pay_machine_contracts.py +0 -0
  176. {patchr-0.1.0 → patchr-0.1.2}/tests/test_phase8_verification.py +0 -0
  177. {patchr-0.1.0 → patchr-0.1.2}/tests/test_policy_enforcement_runtime.py +0 -0
  178. {patchr-0.1.0 → patchr-0.1.2}/tests/test_proxy_contract.py +0 -0
  179. {patchr-0.1.0 → patchr-0.1.2}/tests/test_receipt_export.py +0 -0
  180. {patchr-0.1.0 → patchr-0.1.2}/tests/test_resolve_attachment_contact_journey.py +0 -0
  181. {patchr-0.1.0 → patchr-0.1.2}/tests/test_resolve_bridge_domains.py +0 -0
  182. {patchr-0.1.0 → patchr-0.1.2}/tests/test_resolve_tv_journey.py +0 -0
  183. {patchr-0.1.0 → patchr-0.1.2}/tests/test_schema_catalog.py +0 -0
  184. {patchr-0.1.0 → patchr-0.1.2}/tests/test_secret_references.py +0 -0
  185. {patchr-0.1.0 → patchr-0.1.2}/tests/test_storage_audit.py +0 -0
  186. {patchr-0.1.0 → patchr-0.1.2}/tests/test_task_lifecycle.py +0 -0
patchr-0.1.2/PKG-INFO ADDED
@@ -0,0 +1,202 @@
1
+ Metadata-Version: 2.4
2
+ Name: patchr
3
+ Version: 0.1.2
4
+ Summary: Patchr - the infrastructure for autonomous agents that need contracts, evidence trails, and human-safe handoffs.
5
+ Author: Patchr Core Team
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://patchr.co
8
+ Project-URL: Documentation, https://patchr.co/api-reference
9
+ Project-URL: Sandbox, https://patchr.co/sandbox
10
+ Project-URL: Source, https://github.com/orepos/Patchr
11
+ Keywords: patchr,sdk,mcp,a2a,workflow,agents
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
+ Requires-Python: >=3.11
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Provides-Extra: api
23
+ Requires-Dist: fastapi>=0.111; extra == "api"
24
+ Requires-Dist: uvicorn>=0.30; extra == "api"
25
+ Provides-Extra: worker
26
+ Requires-Dist: redis>=5.0; extra == "worker"
27
+ Requires-Dist: rq>=1.16; extra == "worker"
28
+ Provides-Extra: db
29
+ Requires-Dist: psycopg[binary]>=3.2; extra == "db"
30
+ Requires-Dist: psycopg_pool>=3.2; extra == "db"
31
+ Provides-Extra: dev
32
+ Requires-Dist: pytest>=8.0; extra == "dev"
33
+ Dynamic: license-file
34
+
35
+ # Patchr
36
+
37
+ Patchr - the infrastructure for autonomous agents that need contracts, evidence trails, and human-safe handoffs.
38
+
39
+ Patchr is an SDK and hosted API for running agent workflows that need source-bound search, claim preparation, customer-service handoff, human calls, and settlement coordination.
40
+
41
+ Use it when your app needs to turn a user request such as "find a mechanic in Lekki", "prepare a damage claim", or "dispute this ticket" into a routed workflow with auditable JSON results and streaming status messages.
42
+
43
+ ## Install
44
+
45
+ ```bash
46
+ pip install patchr
47
+ ```
48
+
49
+ ```bash
50
+ export PATCHR_API_BASE_URL="https://api.patchr.co"
51
+ export PATCHR_API_TOKEN="your_patchr_api_token"
52
+ ```
53
+
54
+ ## Quick Start
55
+
56
+ ```python
57
+ from patchr.sdk import PatchrClient
58
+
59
+ patchr = PatchrClient.fromEnv()
60
+
61
+ run = patchr.runOrchestrator({
62
+ "clientId": "support_ops_demo",
63
+ "channel": "sdk",
64
+ "conversationId": "conv_damage_claim_001",
65
+ "request": "My newly purchased TV was damaged in transit and the merchant has not followed up.",
66
+ "attachments": [
67
+ {
68
+ "name": "damaged-tv-photo.jpg",
69
+ "mime": "image/jpeg",
70
+ "text": "Cracked TV panel and damaged transport packaging."
71
+ }
72
+ ],
73
+ })
74
+
75
+ print(run["status"])
76
+ print(run["route"])
77
+ ```
78
+
79
+ Typical response shape:
80
+
81
+ ```json
82
+ {
83
+ "ok": true,
84
+ "status": "ready",
85
+ "route": ["resolve", "bridge"],
86
+ "results": {
87
+ "resolve": {
88
+ "claimDraft": {
89
+ "summary": "Damaged goods claim with attachment evidence"
90
+ }
91
+ },
92
+ "bridge": {
93
+ "contactPlan": {
94
+ "primary": { "type": "merchantSupport" }
95
+ }
96
+ }
97
+ }
98
+ }
99
+ ```
100
+
101
+ ## Streaming Status
102
+
103
+ Use streaming when the workflow may take more than a few seconds. Patchr sends human-readable `progress` events during quiet periods and `handoff` events when work moves into a human-facing step.
104
+
105
+ ```python
106
+ for event in patchr.streamOrchestrator({
107
+ "clientId": "local_services_demo",
108
+ "channel": "sdk",
109
+ "conversationId": "conv_lekki_mechanic_001",
110
+ "request": "Find me a mechanic in Lekki, Lagos",
111
+ "country": "NG",
112
+ "stream": True,
113
+ }):
114
+ if event.get("type") in {"progress", "handoff"}:
115
+ print(event["message"])
116
+ if event.get("type") == "final":
117
+ print(event["result"]["status"])
118
+ ```
119
+
120
+ Example stream events:
121
+
122
+ ```json
123
+ {"type":"progress","status":"running","elapsedSec":10.0,"message":"I am still checking source-bound options and marketplace or map evidence."}
124
+ {"type":"handoff","phase":"proxy","name":"mission.callAvailability","status":"calling","message":"Contacting the mechanic for availability."}
125
+ ```
126
+
127
+ ## Common Scenarios
128
+
129
+ Shopping:
130
+
131
+ ```python
132
+ patchr.runOrchestrator({
133
+ "clientId": "storefront_demo",
134
+ "channel": "sdk",
135
+ "conversationId": "conv_shopping_001",
136
+ "request": "Buy used iPhone 12 in Sweden under 350 dollar",
137
+ "country": "SE"
138
+ })
139
+ ```
140
+
141
+ Local service with proxy call handoff:
142
+
143
+ ```python
144
+ patchr.runOrchestrator({
145
+ "clientId": "local_services_demo",
146
+ "channel": "sdk",
147
+ "conversationId": "conv_mechanic_001",
148
+ "request": "Find me a mechanic in Lekki, Lagos",
149
+ "country": "NG"
150
+ })
151
+ ```
152
+
153
+ Ticket dispute:
154
+
155
+ ```python
156
+ patchr.runOrchestrator({
157
+ "clientId": "support_ops_demo",
158
+ "channel": "sdk",
159
+ "conversationId": "conv_ticket_dispute_001",
160
+ "request": "Dispute ticket ZD-44291: airline charged me twice after cancellation and closed the refund case."
161
+ })
162
+ ```
163
+
164
+ Property lead discovery:
165
+
166
+ ```python
167
+ patchr.runOrchestrator({
168
+ "clientId": "property_demo",
169
+ "channel": "sdk",
170
+ "conversationId": "conv_property_001",
171
+ "request": "Find abandoned properties to sell around Partille, Goteborg",
172
+ "country": "SE"
173
+ })
174
+ ```
175
+
176
+ ## Useful Methods
177
+
178
+ ```python
179
+ patchr.health()
180
+ patchr.manifest()
181
+ patchr.protocolMap()
182
+ patchr.runOrchestrator(payload)
183
+ patchr.streamOrchestrator(payload)
184
+ patchr.resumeOrchestrator(conversation_id, item_id, action, payload)
185
+ patchr.mapTool(payload)
186
+ patchr.nlpTool(payload)
187
+ ```
188
+
189
+ ## Runtime Notes
190
+
191
+ - Local-service searches such as mechanics, plumbers, clinics, and appointments route through map/place search and can trigger a PROXY handoff for availability calls.
192
+ - Long-running workflows emit user-facing progress text so your client does not appear stuck.
193
+ - Handoff events include plain messages such as "Contacting the mechanic for availability", "Calling the clinic to book your appointment", and "Preparing case documents".
194
+ - Set `PATCHR_API_TOKEN` for hosted API calls. Local test transports can run in-process without network I/O.
195
+
196
+ ## More
197
+
198
+ - Hosted API reference: https://patchr.co/api-reference
199
+ - Control plane: https://patchr.co/control-plane
200
+ - Developer sandbox: https://patchr.co/sandbox
201
+ - Python package: https://pypi.org/project/patchr/
202
+ - Node package: https://www.npmjs.com/package/@patchr-core/sdk
patchr-0.1.2/README.md ADDED
@@ -0,0 +1,168 @@
1
+ # Patchr
2
+
3
+ Patchr - the infrastructure for autonomous agents that need contracts, evidence trails, and human-safe handoffs.
4
+
5
+ Patchr is an SDK and hosted API for running agent workflows that need source-bound search, claim preparation, customer-service handoff, human calls, and settlement coordination.
6
+
7
+ Use it when your app needs to turn a user request such as "find a mechanic in Lekki", "prepare a damage claim", or "dispute this ticket" into a routed workflow with auditable JSON results and streaming status messages.
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ pip install patchr
13
+ ```
14
+
15
+ ```bash
16
+ export PATCHR_API_BASE_URL="https://api.patchr.co"
17
+ export PATCHR_API_TOKEN="your_patchr_api_token"
18
+ ```
19
+
20
+ ## Quick Start
21
+
22
+ ```python
23
+ from patchr.sdk import PatchrClient
24
+
25
+ patchr = PatchrClient.fromEnv()
26
+
27
+ run = patchr.runOrchestrator({
28
+ "clientId": "support_ops_demo",
29
+ "channel": "sdk",
30
+ "conversationId": "conv_damage_claim_001",
31
+ "request": "My newly purchased TV was damaged in transit and the merchant has not followed up.",
32
+ "attachments": [
33
+ {
34
+ "name": "damaged-tv-photo.jpg",
35
+ "mime": "image/jpeg",
36
+ "text": "Cracked TV panel and damaged transport packaging."
37
+ }
38
+ ],
39
+ })
40
+
41
+ print(run["status"])
42
+ print(run["route"])
43
+ ```
44
+
45
+ Typical response shape:
46
+
47
+ ```json
48
+ {
49
+ "ok": true,
50
+ "status": "ready",
51
+ "route": ["resolve", "bridge"],
52
+ "results": {
53
+ "resolve": {
54
+ "claimDraft": {
55
+ "summary": "Damaged goods claim with attachment evidence"
56
+ }
57
+ },
58
+ "bridge": {
59
+ "contactPlan": {
60
+ "primary": { "type": "merchantSupport" }
61
+ }
62
+ }
63
+ }
64
+ }
65
+ ```
66
+
67
+ ## Streaming Status
68
+
69
+ Use streaming when the workflow may take more than a few seconds. Patchr sends human-readable `progress` events during quiet periods and `handoff` events when work moves into a human-facing step.
70
+
71
+ ```python
72
+ for event in patchr.streamOrchestrator({
73
+ "clientId": "local_services_demo",
74
+ "channel": "sdk",
75
+ "conversationId": "conv_lekki_mechanic_001",
76
+ "request": "Find me a mechanic in Lekki, Lagos",
77
+ "country": "NG",
78
+ "stream": True,
79
+ }):
80
+ if event.get("type") in {"progress", "handoff"}:
81
+ print(event["message"])
82
+ if event.get("type") == "final":
83
+ print(event["result"]["status"])
84
+ ```
85
+
86
+ Example stream events:
87
+
88
+ ```json
89
+ {"type":"progress","status":"running","elapsedSec":10.0,"message":"I am still checking source-bound options and marketplace or map evidence."}
90
+ {"type":"handoff","phase":"proxy","name":"mission.callAvailability","status":"calling","message":"Contacting the mechanic for availability."}
91
+ ```
92
+
93
+ ## Common Scenarios
94
+
95
+ Shopping:
96
+
97
+ ```python
98
+ patchr.runOrchestrator({
99
+ "clientId": "storefront_demo",
100
+ "channel": "sdk",
101
+ "conversationId": "conv_shopping_001",
102
+ "request": "Buy used iPhone 12 in Sweden under 350 dollar",
103
+ "country": "SE"
104
+ })
105
+ ```
106
+
107
+ Local service with proxy call handoff:
108
+
109
+ ```python
110
+ patchr.runOrchestrator({
111
+ "clientId": "local_services_demo",
112
+ "channel": "sdk",
113
+ "conversationId": "conv_mechanic_001",
114
+ "request": "Find me a mechanic in Lekki, Lagos",
115
+ "country": "NG"
116
+ })
117
+ ```
118
+
119
+ Ticket dispute:
120
+
121
+ ```python
122
+ patchr.runOrchestrator({
123
+ "clientId": "support_ops_demo",
124
+ "channel": "sdk",
125
+ "conversationId": "conv_ticket_dispute_001",
126
+ "request": "Dispute ticket ZD-44291: airline charged me twice after cancellation and closed the refund case."
127
+ })
128
+ ```
129
+
130
+ Property lead discovery:
131
+
132
+ ```python
133
+ patchr.runOrchestrator({
134
+ "clientId": "property_demo",
135
+ "channel": "sdk",
136
+ "conversationId": "conv_property_001",
137
+ "request": "Find abandoned properties to sell around Partille, Goteborg",
138
+ "country": "SE"
139
+ })
140
+ ```
141
+
142
+ ## Useful Methods
143
+
144
+ ```python
145
+ patchr.health()
146
+ patchr.manifest()
147
+ patchr.protocolMap()
148
+ patchr.runOrchestrator(payload)
149
+ patchr.streamOrchestrator(payload)
150
+ patchr.resumeOrchestrator(conversation_id, item_id, action, payload)
151
+ patchr.mapTool(payload)
152
+ patchr.nlpTool(payload)
153
+ ```
154
+
155
+ ## Runtime Notes
156
+
157
+ - Local-service searches such as mechanics, plumbers, clinics, and appointments route through map/place search and can trigger a PROXY handoff for availability calls.
158
+ - Long-running workflows emit user-facing progress text so your client does not appear stuck.
159
+ - Handoff events include plain messages such as "Contacting the mechanic for availability", "Calling the clinic to book your appointment", and "Preparing case documents".
160
+ - Set `PATCHR_API_TOKEN` for hosted API calls. Local test transports can run in-process without network I/O.
161
+
162
+ ## More
163
+
164
+ - Hosted API reference: https://patchr.co/api-reference
165
+ - Control plane: https://patchr.co/control-plane
166
+ - Developer sandbox: https://patchr.co/sandbox
167
+ - Python package: https://pypi.org/project/patchr/
168
+ - Node package: https://www.npmjs.com/package/@patchr-core/sdk
@@ -0,0 +1,2 @@
1
+ """Patchr application entrypoints."""
2
+
@@ -0,0 +1,2 @@
1
+ """Patchr API application."""
2
+