@402flow/sdk 0.1.0-alpha.21 → 0.1.0-alpha.22
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/README.md +31 -3
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -308,7 +308,10 @@ Receipt notes:
|
|
|
308
308
|
1. `receipt.status = 'confirmed'` means the control plane has chain-backed settlement attribution for the paid attempt
|
|
309
309
|
2. `receipt.status = 'provisional'` means the paid outcome was supportable by merchant-provided evidence, but final settlement attribution is still pending reconciliation
|
|
310
310
|
3. callers should treat provisional receipts as payment-attempt evidence, not as proof of final settlement
|
|
311
|
-
4.
|
|
311
|
+
4. `idempotencyKey` is optional for normal SDK use, which keeps low-value one-off integrations simple
|
|
312
|
+
5. if you safely retry the same logical paid request with the same `idempotencyKey`, the SDK returns the same durable paid outcome instead of creating a second paid attempt
|
|
313
|
+
6. if you omit `idempotencyKey`, the request still works, but you should not assume replay-safe duplicate suppression across retries
|
|
314
|
+
7. use `idempotencyKey` for retrying callers, automation loops, and higher-load integrations where duplicate suppression matters
|
|
312
315
|
|
|
313
316
|
## Receipt Lookup
|
|
314
317
|
|
|
@@ -370,10 +373,10 @@ export X402FLOW_AGENT="reporting-worker"
|
|
|
370
373
|
export X402FLOW_BOOTSTRAP_KEY="..."
|
|
371
374
|
|
|
372
375
|
npm run example:openai-tools-quickstart -- \
|
|
373
|
-
"Prepare and execute a paid POST request to
|
|
376
|
+
"Prepare and execute a paid POST request to http://127.0.0.1:4123/demo-merchant/research-brief/solana-devnet with JSON body {\"topic\":\"sdk integration rollout\",\"audience\":\"platform engineers\",\"format\":\"bullets\"}"
|
|
374
377
|
```
|
|
375
378
|
|
|
376
|
-
Use this when you want the shortest real host integration path.
|
|
379
|
+
Use this when you want the shortest real host integration path. For now, this quickstart defaults to the self-hosted first-party demo merchant in `agent-pay` so SDK adoption starts from the canonical proving ground. Switch the merchant URL to the public AWS demo-merchant host once that deployment is live.
|
|
377
380
|
|
|
378
381
|
## Optional `AgentHarness`
|
|
379
382
|
|
|
@@ -392,6 +395,31 @@ For harness usage, presets, transcripts, and scenario packs, see:
|
|
|
392
395
|
1. [docs/evaluation-harness.md](docs/evaluation-harness.md)
|
|
393
396
|
2. [docs/harness-scenarios.md](docs/harness-scenarios.md)
|
|
394
397
|
|
|
398
|
+
For the canonical cross-repo core proving sweep (first-party + mock), run:
|
|
399
|
+
|
|
400
|
+
```bash
|
|
401
|
+
pnpm scenario:core
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
`pnpm scenario:core` runs first-party + mock in a single pass and keeps one combined artifact set under `tmp/`.
|
|
405
|
+
|
|
406
|
+
Additional scenario commands:
|
|
407
|
+
|
|
408
|
+
1. `pnpm scenario:core`: core proving sweep (first-party + mock)
|
|
409
|
+
2. `pnpm scenario:first-party`: first-party self-hosted demo-merchant scenarios only
|
|
410
|
+
3. `pnpm scenario:third-party`: third-party merchant compatibility scenarios only
|
|
411
|
+
4. `pnpm scenario:mock`: fixture-only mock outcomes, no live merchant required
|
|
412
|
+
|
|
413
|
+
`pnpm scenario:all` now literally runs all scenarios (first-party + third-party + mock).
|
|
414
|
+
|
|
415
|
+
As the public AWS demo-merchant host comes online, keep these command boundaries and flip first-party scenario fixtures with one env variable:
|
|
416
|
+
|
|
417
|
+
```bash
|
|
418
|
+
export X402FLOW_FIRST_PARTY_MERCHANT_BASE_URL="https://demo-merchant.402flow.ai"
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
When unset, first-party fixtures default to the self-hosted demo merchant at `http://127.0.0.1:4123`.
|
|
422
|
+
|
|
395
423
|
## Publish
|
|
396
424
|
|
|
397
425
|
```bash
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@402flow/sdk",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.22",
|
|
4
4
|
"description": "Paid HTTP SDK for AI agents with an inspectable prepare/execute flow.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -49,7 +49,11 @@
|
|
|
49
49
|
"lint": "eslint src vitest.config.ts && npm run typecheck",
|
|
50
50
|
"pack:check": "npm run build && npm pack --dry-run",
|
|
51
51
|
"prepack": "npm run build",
|
|
52
|
-
"scenario:all": "npm run build && node scripts/run-scenarios.mjs",
|
|
52
|
+
"scenario:all": "npm run build && node scripts/run-scenarios.mjs --plan=all",
|
|
53
|
+
"scenario:core": "npm run build && node scripts/run-scenarios.mjs --plan=core",
|
|
54
|
+
"scenario:first-party": "npm run build && node scripts/run-scenarios.mjs --plan=first-party",
|
|
55
|
+
"scenario:mock": "npm run build && node scripts/run-scenarios.mjs --plan=mock",
|
|
56
|
+
"scenario:third-party": "npm run build && node scripts/run-scenarios.mjs --plan=third-party",
|
|
53
57
|
"test": "vitest run",
|
|
54
58
|
"test:coverage": "vitest run --coverage",
|
|
55
59
|
"typecheck": "tsc -p tsconfig.typecheck.json --noEmit"
|