@patchr-core/sdk 0.1.2 → 0.1.5
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.
- package/CHANGELOG.md +50 -0
- package/README.md +184 -32
- package/dist/index.d.ts +57 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +103 -4
- package/dist/index.js.map +1 -1
- package/package.json +19 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Patchr Node.js SDK Changelog
|
|
2
|
+
|
|
3
|
+
Patchr - the infrastructure for autonomous agents that need contracts, evidence trails, and human-safe handoffs.
|
|
4
|
+
|
|
5
|
+
## 0.1.5 - 2026-05-26
|
|
6
|
+
|
|
7
|
+
### Breaking changes
|
|
8
|
+
- `createProfile(email, name, password)` → `createProfile(email, name)`. Password is no longer accepted or sent to the API. This aligns the SDK with the OAuth-only web signup and removes a confusing security anti-pattern (plaintext password in application code). Update any calls that passed a third argument.
|
|
9
|
+
|
|
10
|
+
### New
|
|
11
|
+
- `resumeOrchestrator(conversationId, itemId, action, payload?)` — resume a paused run after result selection or a Proxy handoff. Previously documented but not implemented.
|
|
12
|
+
- `mapTool(payload)` — geocode, resolve, or enrich location signals via `/v1/tools/map`. Previously documented but not implemented.
|
|
13
|
+
- `nlpTool(payload)` — classify, extract, or rewrite a text payload via `/v1/tools/nlp`. Previously documented but not implemented.
|
|
14
|
+
|
|
15
|
+
### Fixes
|
|
16
|
+
- `PatchrClient.fromEnv()` now throws a clear error with a signup URL (`https://www.patchr.co/signup`) when `PATCHR_API_TOKEN` is not set, instead of silently constructing a client with an empty token that produces a silent 401.
|
|
17
|
+
- `PatchrApiError` messages for `401` and `403` now include a direct link to the signup/dashboard page so the recovery path is obvious.
|
|
18
|
+
- Removed `PICUX_API_TOKEN` fallback from `fromEnv()` — internal codename was leaking into the public dist.
|
|
19
|
+
- `homepage` in `package.json` corrected to `https://www.patchr.co` (with www).
|
|
20
|
+
- npm `description` shortened to fit search result display without truncation.
|
|
21
|
+
- npm `keywords` expanded with `agentic`, `ai-agent`, `llm`, `langchain`, `openai-agents`, `autogen`, `proof-card`, `audit`, `human-in-the-loop`, `hitl`, `typescript`, `workflow-automation`.
|
|
22
|
+
|
|
23
|
+
### Developer experience
|
|
24
|
+
- README reordered: "Get your API token" and Quick Start are now first; SDK-first activation path moved to a dedicated later section.
|
|
25
|
+
- All documented methods now have implementations in source. No more `TypeError: patchr.X is not a function` on documented calls.
|
|
26
|
+
- Error handling section added to README with `PatchrApiError` catch example.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 0.1.4 - 2026-05-25
|
|
31
|
+
|
|
32
|
+
- Added `createProfile(email, name, password)` so developers can get a starter API token from the SDK.
|
|
33
|
+
- Added `activateToken(activationToken)` for local/debug activation and emailed activation-link flows.
|
|
34
|
+
- Documented the activation path as `createProfile` → `activateToken` → `runOrchestrator`, with unactivated starter tokens limited to 5 workflow requests.
|
|
35
|
+
- Removed the implicit iPhone starter-source injection from the web sandbox; deterministic Hunt smoke tests now require an explicit source URL.
|
|
36
|
+
- Hunt no-result runs now complete with source-attempt evidence; `NEEDS_INPUT` is reserved for source-backed result selection or later workflow inputs.
|
|
37
|
+
- Added `result`, `results`, and `resultCount` Hunt response fields for user-selectable results while preserving existing `selected`, `candidates`, and `candidateCount` fields for full-ranking compatibility.
|
|
38
|
+
- `allowNetwork` now defaults to live-enabled outside the web sandbox; the sandbox explicitly opts out unless the request overrides it.
|
|
39
|
+
|
|
40
|
+
## 0.1.3 - 2026-05-25
|
|
41
|
+
|
|
42
|
+
- Added a fast sandbox smoke-test path using `Buy me iPhone7 less than 500 dollar` with a source-backed starter listing.
|
|
43
|
+
- Documented deterministic Hunt testing with a supplied source URL before enabling live marketplace search.
|
|
44
|
+
- Updated examples so new developers can confirm a source-backed result selection quickly from the sandbox or SDK.
|
|
45
|
+
- Added release notes for package-store consumers.
|
|
46
|
+
|
|
47
|
+
## 0.1.2 - 2026-05-24
|
|
48
|
+
|
|
49
|
+
- Published developer-friendly Node.js SDK docs with quick start, streaming progress, handoff events, and common scenarios.
|
|
50
|
+
- Documented hosted API defaults and useful SDK methods.
|
package/README.md
CHANGED
|
@@ -2,24 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
Patchr - the infrastructure for autonomous agents that need contracts, evidence trails, and human-safe handoffs.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**Agentic workflow infrastructure** — contracts, proof cards, human handoffs, MCP/A2A surfaces.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
[](https://www.npmjs.com/package/@patchr-core/sdk)
|
|
8
|
+
[](LICENSE)
|
|
9
|
+
|
|
10
|
+
## Step 0: Get your API token
|
|
11
|
+
|
|
12
|
+
Sign up free at **[patchr.co/signup](https://www.patchr.co/signup)** — OAuth with Google, GitHub, or Microsoft. No credit card required. Your API token is on the dashboard immediately after signup.
|
|
8
13
|
|
|
9
14
|
```bash
|
|
10
|
-
|
|
15
|
+
export PATCHR_API_TOKEN="your_token_here"
|
|
16
|
+
export PATCHR_API_BASE_URL="https://api.patchr.co" # default — can omit
|
|
11
17
|
```
|
|
12
18
|
|
|
19
|
+
## Install
|
|
20
|
+
|
|
13
21
|
```bash
|
|
14
|
-
|
|
15
|
-
export PATCHR_API_TOKEN="your_patchr_api_token"
|
|
22
|
+
npm install @patchr-core/sdk
|
|
16
23
|
```
|
|
17
24
|
|
|
25
|
+
Requires Node.js 18+.
|
|
26
|
+
|
|
18
27
|
## Quick Start
|
|
19
28
|
|
|
20
29
|
```ts
|
|
21
30
|
import { PatchrClient } from "@patchr-core/sdk";
|
|
22
31
|
|
|
32
|
+
// Reads PATCHR_API_TOKEN from env — throws a clear error with a signup
|
|
33
|
+
// link if the variable is not set.
|
|
23
34
|
const patchr = PatchrClient.fromEnv();
|
|
24
35
|
|
|
25
36
|
const run = await patchr.runOrchestrator({
|
|
@@ -36,24 +47,48 @@ const run = await patchr.runOrchestrator({
|
|
|
36
47
|
],
|
|
37
48
|
});
|
|
38
49
|
|
|
39
|
-
console.log(run.status);
|
|
40
|
-
console.log(run.
|
|
50
|
+
console.log(run.status); // "ready" | "NEEDS_INPUT" | "proxyEscalated"
|
|
51
|
+
console.log(run.proofCard); // { title, evidenceStatus, confidence, ... }
|
|
41
52
|
```
|
|
42
53
|
|
|
43
|
-
|
|
54
|
+
> **No token yet?** `PatchrClient.fromEnv()` throws:
|
|
55
|
+
> ```
|
|
56
|
+
> Error: PATCHR_API_TOKEN is not set.
|
|
57
|
+
> Get a free API token at https://www.patchr.co/signup
|
|
58
|
+
> Then: export PATCHR_API_TOKEN=your_token
|
|
59
|
+
> ```
|
|
44
60
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
61
|
+
## Sandbox first (no API token needed)
|
|
62
|
+
|
|
63
|
+
Before writing code, try the hosted sandbox to see what a real run looks like:
|
|
64
|
+
|
|
65
|
+
**[patchr.co/sandbox](https://www.patchr.co/sandbox)**
|
|
66
|
+
|
|
67
|
+
Pick a scenario, send a request, and watch the orchestrator coordinate Hunt, Resolve, Proxy, and Pay in real time — no signup required.
|
|
68
|
+
|
|
69
|
+
## Fast Sandbox Smoke Test
|
|
70
|
+
|
|
71
|
+
For CI or local testing without hitting live marketplaces, supply a source URL so Hunt has a known result:
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
const smoke = await patchr.runOrchestrator({
|
|
75
|
+
clientId: "sandbox_smoke_test",
|
|
76
|
+
channel: "sdk",
|
|
77
|
+
conversationId: "conv_iphone7_smoke_001",
|
|
78
|
+
request: "Buy me iPhone7 less than 500 dollar",
|
|
79
|
+
urls: [
|
|
80
|
+
"data:text/html,<html><title>Used iPhone7 listing</title><body>Used iPhone7 listing available in stock. List 600 dollar, sale 189.99 dollar with receipt and fast shipping.</body></html>",
|
|
81
|
+
],
|
|
82
|
+
targetLimit: 1,
|
|
83
|
+
allowNetwork: false,
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
console.log(smoke.status); // "NEEDS_INPUT" — source-backed result ready to select
|
|
54
87
|
```
|
|
55
88
|
|
|
56
|
-
|
|
89
|
+
Remove `urls` and omit `allowNetwork` to enable live marketplace search.
|
|
90
|
+
|
|
91
|
+
## Streaming progress
|
|
57
92
|
|
|
58
93
|
```ts
|
|
59
94
|
for await (const event of patchr.streamOrchestrator({
|
|
@@ -73,37 +108,154 @@ for await (const event of patchr.streamOrchestrator({
|
|
|
73
108
|
}
|
|
74
109
|
```
|
|
75
110
|
|
|
76
|
-
|
|
111
|
+
Event types: `progress` (quiet-period heartbeat), `handoff` (agent starting human-facing work), `terminal` (trace line), `final` (complete result).
|
|
112
|
+
|
|
113
|
+
## Resuming a paused run
|
|
77
114
|
|
|
78
|
-
|
|
115
|
+
When a run returns `status: "NEEDS_INPUT"` (result selection) or `status: "proxyEscalated"` (human handoff required), resume it after the human step completes:
|
|
79
116
|
|
|
80
117
|
```ts
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
118
|
+
// First run — paused for result selection
|
|
119
|
+
const run = await patchr.runOrchestrator({ ... });
|
|
120
|
+
// run.status === "NEEDS_INPUT"
|
|
121
|
+
// run.decisionTree.paths has the ranked options
|
|
122
|
+
|
|
123
|
+
// Resume after the user selects a result
|
|
124
|
+
const resumed = await patchr.resumeOrchestrator(
|
|
125
|
+
run.conversationId, // from the original run
|
|
126
|
+
run.results.hunt.selected.candidateId,
|
|
127
|
+
"select",
|
|
128
|
+
);
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Common scenarios
|
|
88
132
|
|
|
133
|
+
```ts
|
|
134
|
+
// Disputed claim
|
|
89
135
|
await patchr.runOrchestrator({
|
|
90
136
|
clientId: "support_ops_demo",
|
|
91
137
|
channel: "sdk",
|
|
92
138
|
conversationId: "conv_ticket_dispute_001",
|
|
93
139
|
request: "Dispute ticket ZD-44291: airline charged me twice and closed the refund case.",
|
|
94
140
|
});
|
|
141
|
+
|
|
142
|
+
// Vendor due diligence workflow template
|
|
143
|
+
await patchr.runWorkflowTemplate("vendorDueDiligence", {
|
|
144
|
+
request: "Run due diligence on Acme Supply Co. for Q3 onboarding",
|
|
145
|
+
metadata: {
|
|
146
|
+
vendorName: "Acme Supply Co.",
|
|
147
|
+
website: "https://acme.example",
|
|
148
|
+
jurisdiction: "US",
|
|
149
|
+
policyRules: ["priceVarianceUnder5pct", "noSanctionedEntities"],
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
// Job offer verification
|
|
154
|
+
await patchr.runWorkflowTemplate("fakeJobVerification", {
|
|
155
|
+
request: "Verify this recruiter claiming to be from a Fortune 500",
|
|
156
|
+
metadata: { recruiterName: "Jane Smith", companyName: "Acme Corp", fees: true },
|
|
157
|
+
});
|
|
95
158
|
```
|
|
96
159
|
|
|
97
|
-
##
|
|
160
|
+
## Developer Activation
|
|
161
|
+
|
|
162
|
+
If you need to create a Patchr account programmatically (CI pipelines, onboarding flows), use `createProfile`. For interactive use, sign up at [patchr.co/signup](https://www.patchr.co/signup) instead — it's faster.
|
|
98
163
|
|
|
99
164
|
```ts
|
|
165
|
+
const patchr = new PatchrClient(); // no token yet
|
|
166
|
+
|
|
167
|
+
const profile = await patchr.createProfile("dev@example.com", "Dev Example") as {
|
|
168
|
+
token: string;
|
|
169
|
+
activation?: { message?: string; activationToken?: string };
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
// Patchr sends an activation email. Click it to lift the 5-request limit.
|
|
173
|
+
// In local/debug mode, the response includes activationToken for automated tests:
|
|
174
|
+
const activationToken = profile.activation?.activationToken;
|
|
175
|
+
if (activationToken) {
|
|
176
|
+
await patchr.activateToken(activationToken);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const activatedPatchr = new PatchrClient({ token: profile.token });
|
|
180
|
+
const run = await activatedPatchr.runOrchestrator({
|
|
181
|
+
clientId: "activation_smoke_test",
|
|
182
|
+
channel: "sdk",
|
|
183
|
+
request: "Buy me iPhone7 less than 500 dollar",
|
|
184
|
+
});
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
> **Activation limit:** Unactivated starter tokens are limited to 5 workflow requests. After the 5th request you will receive a `429` error. Click the activation link in your email, or visit [patchr.co/dashboard](https://www.patchr.co/dashboard) to manage your token.
|
|
188
|
+
|
|
189
|
+
## All methods
|
|
190
|
+
|
|
191
|
+
```ts
|
|
192
|
+
// Protocol discovery
|
|
100
193
|
await patchr.health();
|
|
194
|
+
await patchr.apiStatus();
|
|
101
195
|
await patchr.manifest();
|
|
102
196
|
await patchr.protocolMap();
|
|
197
|
+
await patchr.listSchemas();
|
|
198
|
+
await patchr.getSchema(schemaId);
|
|
199
|
+
|
|
200
|
+
// Workflow templates
|
|
201
|
+
await patchr.listWorkflowTemplates();
|
|
202
|
+
await patchr.getWorkflowTemplate(templateId);
|
|
203
|
+
await patchr.runWorkflowTemplate(templateId, payload);
|
|
204
|
+
|
|
205
|
+
// Orchestrator
|
|
103
206
|
await patchr.runOrchestrator(payload);
|
|
104
|
-
await patchr.resumeOrchestrator(conversationId, itemId, action, payload);
|
|
105
|
-
await patchr.
|
|
106
|
-
|
|
207
|
+
await patchr.resumeOrchestrator(conversationId, itemId, action, payload?);
|
|
208
|
+
for await (const event of patchr.streamOrchestrator(payload)) { ... }
|
|
209
|
+
|
|
210
|
+
// Tools
|
|
211
|
+
await patchr.mapTool(payload); // geocode / location enrichment
|
|
212
|
+
await patchr.nlpTool(payload); // classify / extract / rewrite
|
|
213
|
+
|
|
214
|
+
// A2A / Tasks / Proof
|
|
215
|
+
await patchr.createA2AEnvelope(payload);
|
|
216
|
+
await patchr.createTask(payload);
|
|
217
|
+
await patchr.createProofPack(payload);
|
|
218
|
+
|
|
219
|
+
// Developer activation
|
|
220
|
+
await patchr.createProfile(email, name);
|
|
221
|
+
await patchr.activateToken(activationToken);
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Default API base URL: `https://api.patchr.co`
|
|
225
|
+
|
|
226
|
+
## Error handling
|
|
227
|
+
|
|
228
|
+
```ts
|
|
229
|
+
import { PatchrApiError } from "@patchr-core/sdk";
|
|
230
|
+
|
|
231
|
+
try {
|
|
232
|
+
const run = await patchr.runOrchestrator({ request: "..." });
|
|
233
|
+
} catch (err) {
|
|
234
|
+
if (err instanceof PatchrApiError) {
|
|
235
|
+
console.error(err.status); // 401, 429, 500, etc.
|
|
236
|
+
console.error(err.message); // includes signup/upgrade link for 401/403
|
|
237
|
+
console.error(err.payload); // raw API error response
|
|
238
|
+
}
|
|
239
|
+
}
|
|
107
240
|
```
|
|
108
241
|
|
|
109
|
-
|
|
242
|
+
Error messages for `401` and `403` include a direct link to [patchr.co/signup](https://www.patchr.co/signup) so the path forward is always clear.
|
|
243
|
+
|
|
244
|
+
## Links
|
|
245
|
+
|
|
246
|
+
- **Signup** — [patchr.co/signup](https://www.patchr.co/signup)
|
|
247
|
+
- **Dashboard** — [patchr.co/dashboard](https://www.patchr.co/dashboard)
|
|
248
|
+
- **API reference** — [patchr.co/api](https://www.patchr.co/api)
|
|
249
|
+
- **Sandbox** — [patchr.co/sandbox](https://patchr.co/sandbox)
|
|
250
|
+
- **Changelog** — [CHANGELOG.md](CHANGELOG.md)
|
|
251
|
+
- **Issues** — [github.com/orepos/Patchr/issues](https://github.com/orepos/Patchr/issues)
|
|
252
|
+
|
|
253
|
+
## Changelog
|
|
254
|
+
|
|
255
|
+
`0.1.5` — removes password from `createProfile` (email + name only, consistent with OAuth web signup); adds `resumeOrchestrator`, `mapTool`, `nlpTool` implementations; `fromEnv()` throws a clear error with signup URL when `PATCHR_API_TOKEN` is not set; 401/403 errors include a signup link; removes internal `PICUX_API_TOKEN` fallback; expands npm keywords; fixes homepage URL.
|
|
256
|
+
|
|
257
|
+
`0.1.4` — adds `createProfile` and `activateToken` for SDK-first developer activation; 5-request unactivated token limit.
|
|
258
|
+
|
|
259
|
+
`0.1.3` — deterministic Hunt smoke test with supplied source URL.
|
|
260
|
+
|
|
261
|
+
See [CHANGELOG.md](CHANGELOG.md) for full release notes.
|
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,17 @@ export declare class PatchrClient {
|
|
|
18
18
|
readonly token: string;
|
|
19
19
|
private readonly fetchImpl;
|
|
20
20
|
constructor(options?: PatchrClientOptions);
|
|
21
|
+
/**
|
|
22
|
+
* Build a PatchrClient from environment variables.
|
|
23
|
+
*
|
|
24
|
+
* Reads PATCHR_API_BASE_URL (optional) and PATCHR_API_TOKEN (required).
|
|
25
|
+
* Throws a clear error with a signup link when the token is absent so
|
|
26
|
+
* developers know exactly what to do rather than hitting a silent 401.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* // Set PATCHR_API_TOKEN=your_token in your shell or .env, then:
|
|
30
|
+
* const patchr = PatchrClient.fromEnv();
|
|
31
|
+
*/
|
|
21
32
|
static fromEnv(env?: Record<string, string | undefined>): PatchrClient;
|
|
22
33
|
request<T = JsonValue>(method: string, path: string, payload?: JsonObject | null): Promise<T>;
|
|
23
34
|
get<T = JsonValue>(path: string, query?: JsonObject): Promise<T>;
|
|
@@ -31,8 +42,54 @@ export declare class PatchrClient {
|
|
|
31
42
|
listWorkflowTemplates(): Promise<JsonValue>;
|
|
32
43
|
getWorkflowTemplate(templateId: string): Promise<JsonValue>;
|
|
33
44
|
runWorkflowTemplate(templateId: string, payload: JsonObject): Promise<JsonValue>;
|
|
45
|
+
/**
|
|
46
|
+
* Create a Patchr developer profile from the SDK.
|
|
47
|
+
*
|
|
48
|
+
* Returns a starter API token immediately. Patchr sends an activation link
|
|
49
|
+
* to the email address — click it to lift the 5-request limit on the starter
|
|
50
|
+
* token. In local/debug mode the response may include an `activationToken`
|
|
51
|
+
* for automated testing without email delivery.
|
|
52
|
+
*
|
|
53
|
+
* Prefer signing up at https://www.patchr.co/signup (OAuth, no email
|
|
54
|
+
* required) when you are working interactively. Use `createProfile` when you
|
|
55
|
+
* need programmatic account creation in a CI or onboarding flow.
|
|
56
|
+
*/
|
|
57
|
+
createProfile(email: string, name: string): Promise<JsonValue>;
|
|
58
|
+
/**
|
|
59
|
+
* Activate a starter token using the token from the emailed link, or the
|
|
60
|
+
* `activationToken` returned in local/debug responses.
|
|
61
|
+
*/
|
|
62
|
+
activateToken(activationToken: string): Promise<JsonValue>;
|
|
63
|
+
/**
|
|
64
|
+
* Run a workflow through the Patchr orchestrator.
|
|
65
|
+
*
|
|
66
|
+
* The orchestrator routes the request through Hunt, Resolve, Bridge, Proxy,
|
|
67
|
+
* and Pay domains as needed and returns a proof card at the end of the run.
|
|
68
|
+
*/
|
|
34
69
|
runOrchestrator(payload: JsonObject): Promise<JsonValue>;
|
|
70
|
+
/**
|
|
71
|
+
* Resume a paused orchestrator run — e.g. after a result selection or a
|
|
72
|
+
* Proxy handoff has been completed.
|
|
73
|
+
*
|
|
74
|
+
* @param conversationId The conversationId from the original run response.
|
|
75
|
+
* @param itemId The itemId or resultId to resume from.
|
|
76
|
+
* @param action The resume action: "select", "confirm", "reject", or "handoffComplete".
|
|
77
|
+
* @param payload Additional context for the resume step.
|
|
78
|
+
*/
|
|
79
|
+
resumeOrchestrator(conversationId: string, itemId: string, action: string, payload?: JsonObject): Promise<JsonValue>;
|
|
80
|
+
/**
|
|
81
|
+
* Stream a workflow run as NDJSON events.
|
|
82
|
+
* Emits `progress`, `handoff`, `terminal`, and `final` event types.
|
|
83
|
+
*/
|
|
35
84
|
streamOrchestrator(payload: JsonObject): AsyncGenerator<JsonObject>;
|
|
85
|
+
/**
|
|
86
|
+
* Run the Map tool — geocode, resolve, or enrich location signals.
|
|
87
|
+
*/
|
|
88
|
+
mapTool(payload: JsonObject): Promise<JsonValue>;
|
|
89
|
+
/**
|
|
90
|
+
* Run the NLP tool — classify, extract, or rewrite a text payload.
|
|
91
|
+
*/
|
|
92
|
+
nlpTool(payload: JsonObject): Promise<JsonValue>;
|
|
36
93
|
createA2AEnvelope(payload: JsonObject): Promise<JsonValue>;
|
|
37
94
|
createTask(payload: JsonObject): Promise<JsonValue>;
|
|
38
95
|
createProofPack(payload: JsonObject): Promise<JsonValue>;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAC7D,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,UAAU,GAAG,SAAS,EAAE,CAAC;AACjE,MAAM,MAAM,UAAU,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAA;CAAE,CAAC;AAElE,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;CACtB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAC7D,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,UAAU,GAAG,SAAS,EAAE,CAAC;AACjE,MAAM,MAAM,UAAU,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAA;CAAE,CAAC;AAElE,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;CACtB,CAAC;AAKF,qBAAa,cAAe,SAAQ,KAAK;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,CA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B,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;IAMhF;;;;;;;;;;;OAWG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAI9D;;;OAGG;IACH,aAAa,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAM1D;;;;;OAKG;IACH,eAAe,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;IAIxD;;;;;;;;OAQG;IACH,kBAAkB,CAChB,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,UAAU,GACnB,OAAO,CAAC,SAAS,CAAC;IASrB;;;OAGG;IACI,kBAAkB,CAAC,OAAO,EAAE,UAAU,GAAG,cAAc,CAAC,UAAU,CAAC;IAgD1E;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;IAIhD;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;IAMhD,iBAAiB,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;IAI1D,UAAU,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;IAInD,eAAe,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;CAGzD"}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,22 @@
|
|
|
1
|
+
const SIGNUP_URL = "https://www.patchr.co/signup";
|
|
2
|
+
const DEFAULT_BASE_URL = "https://api.patchr.co";
|
|
1
3
|
export class PatchrApiError extends Error {
|
|
2
4
|
status;
|
|
3
5
|
payload;
|
|
4
6
|
constructor(status, payload) {
|
|
5
|
-
|
|
7
|
+
const apiMessage = typeof payload === "object" && payload !== null && "error" in payload
|
|
8
|
+
? String(payload.error)
|
|
9
|
+
: undefined;
|
|
10
|
+
// Surface actionable guidance for auth failures so developers know
|
|
11
|
+
// exactly what to do instead of hitting a silent 401.
|
|
12
|
+
const hint = status === 401
|
|
13
|
+
? `\nNo valid API token. Get a free token at ${SIGNUP_URL}`
|
|
14
|
+
: status === 403
|
|
15
|
+
? `\nThis token does not have permission for that resource. Check your plan at ${SIGNUP_URL}`
|
|
16
|
+
: status === 429
|
|
17
|
+
? "\nRate limit reached. Upgrade your plan or wait for the next billing cycle."
|
|
18
|
+
: "";
|
|
19
|
+
super(`${apiMessage ?? `patchr_api_${status}`}${hint}`);
|
|
6
20
|
this.name = "PatchrApiError";
|
|
7
21
|
this.status = status;
|
|
8
22
|
this.payload = payload;
|
|
@@ -13,19 +27,36 @@ export class PatchrClient {
|
|
|
13
27
|
token;
|
|
14
28
|
fetchImpl;
|
|
15
29
|
constructor(options = {}) {
|
|
16
|
-
this.baseUrl = options.baseUrl ??
|
|
30
|
+
this.baseUrl = options.baseUrl ?? DEFAULT_BASE_URL;
|
|
17
31
|
this.token = options.token ?? "";
|
|
18
32
|
this.fetchImpl = options.fetch ?? globalThis.fetch;
|
|
19
33
|
if (!this.fetchImpl) {
|
|
20
34
|
throw new Error("PatchrClient requires a fetch implementation. Use Node.js 18+ or pass options.fetch.");
|
|
21
35
|
}
|
|
22
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Build a PatchrClient from environment variables.
|
|
39
|
+
*
|
|
40
|
+
* Reads PATCHR_API_BASE_URL (optional) and PATCHR_API_TOKEN (required).
|
|
41
|
+
* Throws a clear error with a signup link when the token is absent so
|
|
42
|
+
* developers know exactly what to do rather than hitting a silent 401.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* // Set PATCHR_API_TOKEN=your_token in your shell or .env, then:
|
|
46
|
+
* const patchr = PatchrClient.fromEnv();
|
|
47
|
+
*/
|
|
23
48
|
static fromEnv(env) {
|
|
24
49
|
const processEnv = globalThis.process?.env ?? {};
|
|
25
50
|
const source = env ?? processEnv;
|
|
51
|
+
const token = source["PATCHR_API_TOKEN"];
|
|
52
|
+
if (!token) {
|
|
53
|
+
throw new Error("PATCHR_API_TOKEN is not set.\n" +
|
|
54
|
+
`Get a free API token at ${SIGNUP_URL}\n` +
|
|
55
|
+
"Then: export PATCHR_API_TOKEN=your_token");
|
|
56
|
+
}
|
|
26
57
|
return new PatchrClient({
|
|
27
|
-
baseUrl: source
|
|
28
|
-
token
|
|
58
|
+
baseUrl: source["PATCHR_API_BASE_URL"] || DEFAULT_BASE_URL,
|
|
59
|
+
token,
|
|
29
60
|
});
|
|
30
61
|
}
|
|
31
62
|
async request(method, path, payload) {
|
|
@@ -59,6 +90,7 @@ export class PatchrClient {
|
|
|
59
90
|
post(path, payload) {
|
|
60
91
|
return this.request("POST", path, payload ?? {});
|
|
61
92
|
}
|
|
93
|
+
// ─── Protocol discovery ────────────────────────────────────────────────────
|
|
62
94
|
health() {
|
|
63
95
|
return this.get("/healthz");
|
|
64
96
|
}
|
|
@@ -77,6 +109,7 @@ export class PatchrClient {
|
|
|
77
109
|
getSchema(schemaId) {
|
|
78
110
|
return this.get(`/v1/schemas/${encodeURIComponent(schemaId)}`);
|
|
79
111
|
}
|
|
112
|
+
// ─── Workflow templates ────────────────────────────────────────────────────
|
|
80
113
|
listWorkflowTemplates() {
|
|
81
114
|
return this.get("/v1/workflows/templates");
|
|
82
115
|
}
|
|
@@ -86,9 +119,60 @@ export class PatchrClient {
|
|
|
86
119
|
runWorkflowTemplate(templateId, payload) {
|
|
87
120
|
return this.post(`/v1/workflows/templates/${encodeURIComponent(templateId)}/run`, payload);
|
|
88
121
|
}
|
|
122
|
+
// ─── Developer activation ─────────────────────────────────────────────────
|
|
123
|
+
/**
|
|
124
|
+
* Create a Patchr developer profile from the SDK.
|
|
125
|
+
*
|
|
126
|
+
* Returns a starter API token immediately. Patchr sends an activation link
|
|
127
|
+
* to the email address — click it to lift the 5-request limit on the starter
|
|
128
|
+
* token. In local/debug mode the response may include an `activationToken`
|
|
129
|
+
* for automated testing without email delivery.
|
|
130
|
+
*
|
|
131
|
+
* Prefer signing up at https://www.patchr.co/signup (OAuth, no email
|
|
132
|
+
* required) when you are working interactively. Use `createProfile` when you
|
|
133
|
+
* need programmatic account creation in a CI or onboarding flow.
|
|
134
|
+
*/
|
|
135
|
+
createProfile(email, name) {
|
|
136
|
+
return this.post("/v1/profiles", { email, name });
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Activate a starter token using the token from the emailed link, or the
|
|
140
|
+
* `activationToken` returned in local/debug responses.
|
|
141
|
+
*/
|
|
142
|
+
activateToken(activationToken) {
|
|
143
|
+
return this.post("/v1/profiles/activate", { activationToken });
|
|
144
|
+
}
|
|
145
|
+
// ─── Orchestrator ─────────────────────────────────────────────────────────
|
|
146
|
+
/**
|
|
147
|
+
* Run a workflow through the Patchr orchestrator.
|
|
148
|
+
*
|
|
149
|
+
* The orchestrator routes the request through Hunt, Resolve, Bridge, Proxy,
|
|
150
|
+
* and Pay domains as needed and returns a proof card at the end of the run.
|
|
151
|
+
*/
|
|
89
152
|
runOrchestrator(payload) {
|
|
90
153
|
return this.post("/v1/orchestrator/run", payload);
|
|
91
154
|
}
|
|
155
|
+
/**
|
|
156
|
+
* Resume a paused orchestrator run — e.g. after a result selection or a
|
|
157
|
+
* Proxy handoff has been completed.
|
|
158
|
+
*
|
|
159
|
+
* @param conversationId The conversationId from the original run response.
|
|
160
|
+
* @param itemId The itemId or resultId to resume from.
|
|
161
|
+
* @param action The resume action: "select", "confirm", "reject", or "handoffComplete".
|
|
162
|
+
* @param payload Additional context for the resume step.
|
|
163
|
+
*/
|
|
164
|
+
resumeOrchestrator(conversationId, itemId, action, payload) {
|
|
165
|
+
return this.post("/v1/orchestrator/resume", {
|
|
166
|
+
conversationId,
|
|
167
|
+
itemId,
|
|
168
|
+
action,
|
|
169
|
+
...(payload ?? {}),
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Stream a workflow run as NDJSON events.
|
|
174
|
+
* Emits `progress`, `handoff`, `terminal`, and `final` event types.
|
|
175
|
+
*/
|
|
92
176
|
async *streamOrchestrator(payload) {
|
|
93
177
|
const headers = new Headers({ Accept: "application/x-ndjson", "Content-Type": "application/json" });
|
|
94
178
|
if (this.token) {
|
|
@@ -132,6 +216,20 @@ export class PatchrClient {
|
|
|
132
216
|
yield finalEvent;
|
|
133
217
|
}
|
|
134
218
|
}
|
|
219
|
+
// ─── Tools ────────────────────────────────────────────────────────────────
|
|
220
|
+
/**
|
|
221
|
+
* Run the Map tool — geocode, resolve, or enrich location signals.
|
|
222
|
+
*/
|
|
223
|
+
mapTool(payload) {
|
|
224
|
+
return this.post("/v1/tools/map", payload);
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Run the NLP tool — classify, extract, or rewrite a text payload.
|
|
228
|
+
*/
|
|
229
|
+
nlpTool(payload) {
|
|
230
|
+
return this.post("/v1/tools/nlp", payload);
|
|
231
|
+
}
|
|
232
|
+
// ─── A2A / Tasks / Proof ──────────────────────────────────────────────────
|
|
135
233
|
createA2AEnvelope(payload) {
|
|
136
234
|
return this.post("/v1/a2a/envelopes", payload);
|
|
137
235
|
}
|
|
@@ -142,6 +240,7 @@ export class PatchrClient {
|
|
|
142
240
|
return this.post("/v1/audit/proofPacks", payload);
|
|
143
241
|
}
|
|
144
242
|
}
|
|
243
|
+
// ─── Helpers ──────────────────────────────────────────────────────────────────
|
|
145
244
|
function joinUrl(baseUrl, path) {
|
|
146
245
|
return `${baseUrl.replace(/\/+$/, "")}/${path.replace(/^\/+/, "")}`;
|
|
147
246
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,MAAM,OAAO,cAAe,SAAQ,KAAK;IAC9B,MAAM,C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,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAC1D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IACzB,CAAC;AACH,CAAC;AAED,SAAS,YAAY,CAAC,KAAgB;IACpC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patchr-core/sdk",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.5",
|
|
4
|
+
"description": "Agentic workflow SDK — proof cards, contracts, human handoffs, MCP/A2A",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
|
-
"homepage": "https://patchr.co",
|
|
7
|
+
"homepage": "https://www.patchr.co",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "git+https://github.com/orepos/Patchr.git",
|
|
@@ -16,10 +16,24 @@
|
|
|
16
16
|
"keywords": [
|
|
17
17
|
"patchr",
|
|
18
18
|
"sdk",
|
|
19
|
+
"agentic",
|
|
20
|
+
"agentic-workflow",
|
|
21
|
+
"ai-agent",
|
|
22
|
+
"llm",
|
|
23
|
+
"orchestrator",
|
|
19
24
|
"mcp",
|
|
20
25
|
"a2a",
|
|
26
|
+
"langchain",
|
|
27
|
+
"openai-agents",
|
|
28
|
+
"autogen",
|
|
29
|
+
"proof-card",
|
|
30
|
+
"audit",
|
|
31
|
+
"human-in-the-loop",
|
|
32
|
+
"hitl",
|
|
21
33
|
"agents",
|
|
22
|
-
"workflows"
|
|
34
|
+
"workflows",
|
|
35
|
+
"typescript",
|
|
36
|
+
"workflow-automation"
|
|
23
37
|
],
|
|
24
38
|
"main": "./dist/index.js",
|
|
25
39
|
"types": "./dist/index.d.ts",
|
|
@@ -31,6 +45,7 @@
|
|
|
31
45
|
},
|
|
32
46
|
"files": [
|
|
33
47
|
"dist",
|
|
48
|
+
"CHANGELOG.md",
|
|
34
49
|
"README.md",
|
|
35
50
|
"package.json"
|
|
36
51
|
],
|