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