@paybond/kit 0.11.10 → 0.12.0
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 +2 -2
- package/completion-presets/catalog.json +374 -3
- package/completion-presets/catalog.sha256 +1 -1
- package/dist/agent/facade.js +13 -0
- package/dist/agent/guarded-agent.d.ts +1 -1
- package/dist/agent/guarded-agent.js +19 -0
- package/dist/agent/index.d.ts +2 -1
- package/dist/agent/index.js +1 -0
- package/dist/agent/instrument.d.ts +6 -0
- package/dist/agent/instrument.js +6 -0
- package/dist/agent/interceptor.d.ts +9 -0
- package/dist/agent/interceptor.js +177 -1
- package/dist/agent/receipt-client.d.ts +49 -0
- package/dist/agent/receipt-client.js +45 -0
- package/dist/agent/registry.js +1 -0
- package/dist/agent/run.d.ts +2 -0
- package/dist/agent/run.js +52 -0
- package/dist/agent/types.d.ts +70 -0
- package/dist/agent-receipt-external-attestations.d.ts +29 -0
- package/dist/agent-receipt-external-attestations.js +124 -0
- package/dist/agent-receipt.d.ts +134 -0
- package/dist/agent-receipt.js +580 -0
- package/dist/agent-recognition.d.ts +25 -0
- package/dist/agent-recognition.js +36 -0
- package/dist/audit/exports.d.ts +72 -0
- package/dist/audit/exports.js +185 -0
- package/dist/audit/index.d.ts +3 -0
- package/dist/audit/index.js +3 -0
- package/dist/audit/verify.d.ts +8 -0
- package/dist/audit/verify.js +113 -0
- package/dist/audit/wire.d.ts +54 -0
- package/dist/audit/wire.js +80 -0
- package/dist/cli/agent/demo-loaders.d.ts +2 -0
- package/dist/cli/agent/demo-loaders.js +24 -0
- package/dist/cli/agent/production-evidence.d.ts +11 -0
- package/dist/cli/agent/production-evidence.js +17 -0
- package/dist/cli/audit-export.d.ts +2 -7
- package/dist/cli/audit-export.js +2 -120
- package/dist/cli/command-spec.js +43 -10
- package/dist/cli/commands/agent.d.ts +3 -0
- package/dist/cli/commands/agent.js +143 -1
- package/dist/cli/commands/discovery.js +39 -36
- package/dist/cli/commands/workflows.js +116 -18
- package/dist/cli/help.d.ts +1 -1
- package/dist/cli/help.js +12 -8
- package/dist/cli/intents-harbor-mutation.d.ts +18 -0
- package/dist/cli/intents-harbor-mutation.js +33 -0
- package/dist/cli/paybond.d.ts +9 -0
- package/dist/cli/paybond.js +23 -0
- package/dist/cli/redact.js +3 -0
- package/dist/cloudflare-agents/config.d.ts +24 -0
- package/dist/cloudflare-agents/config.js +23 -0
- package/dist/cloudflare-agents/index.d.ts +3 -0
- package/dist/cloudflare-agents/index.js +3 -0
- package/dist/cloudflare-agents/peer.d.ts +9 -0
- package/dist/cloudflare-agents/peer.js +20 -0
- package/dist/cloudflare-agents/sandbox-demo.d.ts +36 -0
- package/dist/cloudflare-agents/sandbox-demo.js +89 -0
- package/dist/completion-catalog-digest.d.ts +1 -1
- package/dist/completion-catalog-digest.js +1 -1
- package/dist/completion-init.js +8 -3
- package/dist/dev/offline-gateway.d.ts +2 -1
- package/dist/dev/offline-gateway.js +34 -3
- package/dist/dev/x402-fund-mock.d.ts +28 -0
- package/dist/dev/x402-fund-mock.js +124 -0
- package/dist/index.d.ts +125 -9
- package/dist/index.js +264 -17
- package/dist/init.js +113 -2
- package/dist/mastra/config.d.ts +30 -0
- package/dist/mastra/config.js +58 -0
- package/dist/mastra/index.d.ts +2 -0
- package/dist/mastra/index.js +2 -0
- package/dist/mastra/peer.d.ts +11 -0
- package/dist/mastra/peer.js +24 -0
- package/dist/mastra/sandbox-demo.d.ts +36 -0
- package/dist/mastra/sandbox-demo.js +87 -0
- package/dist/mcp/index.d.ts +1 -0
- package/dist/mcp/index.js +1 -0
- package/dist/mcp/sandbox-demo.d.ts +38 -0
- package/dist/mcp/sandbox-demo.js +112 -0
- package/dist/mcp-receipt-resource.d.ts +10 -0
- package/dist/mcp-receipt-resource.js +32 -0
- package/dist/mcp-server.d.ts +6 -0
- package/dist/mcp-server.js +124 -1
- package/dist/mpp-commercial.d.ts +19 -0
- package/dist/mpp-commercial.js +34 -0
- package/dist/mpp-funding.d.ts +71 -0
- package/dist/mpp-funding.js +192 -0
- package/dist/payment-transport.d.ts +30 -0
- package/dist/payment-transport.js +56 -0
- package/dist/policy/init.js +2 -0
- package/dist/policy/intent-spec.js +2 -0
- package/dist/principal-intent.d.ts +1 -1
- package/dist/principal-intent.js +4 -1
- package/dist/project-init.js +8 -0
- package/dist/template-init.d.ts +2 -2
- package/dist/template-init.js +6 -2
- package/dist/x402-funding.d.ts +52 -0
- package/dist/x402-funding.js +124 -0
- package/package.json +20 -2
- package/templates/manifest.json +28 -9
- package/templates/openai-shopping-agent/package-lock.json +16 -8
- package/templates/openai-shopping-agent/package.json +1 -1
- package/templates/paybond-aws-operator/package-lock.json +13 -5
- package/templates/paybond-aws-operator/package.json +1 -1
- package/templates/paybond-claude-agents-demo/package-lock.json +16 -8
- package/templates/paybond-claude-agents-demo/package.json +1 -1
- package/templates/paybond-invoice-agent/requirements.txt +1 -1
- package/templates/paybond-mastra-travel-agent/.env.example +3 -0
- package/templates/paybond-mastra-travel-agent/.github/workflows/smoke.yml +20 -0
- package/templates/paybond-mastra-travel-agent/LICENSE +201 -0
- package/templates/paybond-mastra-travel-agent/README.md +29 -0
- package/templates/paybond-mastra-travel-agent/package-lock.json +3377 -0
- package/templates/paybond-mastra-travel-agent/package.json +22 -0
- package/templates/paybond-mastra-travel-agent/paybond.policy.yaml +22 -0
- package/templates/paybond-mastra-travel-agent/src/index.ts +22 -0
- package/templates/paybond-mastra-travel-agent/src/paybond.config.ts +51 -0
- package/templates/paybond-mastra-travel-agent/tsconfig.json +13 -0
- package/templates/paybond-mcp-coding-agent/package-lock.json +13 -5
- package/templates/paybond-mcp-coding-agent/package.json +1 -1
- package/templates/paybond-openai-agents-demo/package-lock.json +16 -8
- package/templates/paybond-openai-agents-demo/package.json +1 -1
- package/templates/paybond-procurement-agent/package-lock.json +13 -5
- package/templates/paybond-procurement-agent/package.json +1 -1
- package/templates/paybond-travel-agent/package-lock.json +16 -8
- package/templates/paybond-travel-agent/package.json +1 -1
- package/templates/paybond-vercel-shopping-agent/package-lock.json +13 -5
- package/templates/paybond-vercel-shopping-agent/package.json +1 -1
package/README.md
CHANGED
|
@@ -70,7 +70,7 @@ npx -p @paybond/kit paybond agent sandbox smoke \
|
|
|
70
70
|
--format json
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
With `--policy-file`, Kit sends `completion_preset` from the tool's `evidence_preset` and omits `evidence_schema` and `template_id` (Gateway rejects conflicting bootstrap fields). Requires `@paybond/kit` 0.11.
|
|
73
|
+
With `--policy-file`, Kit sends `completion_preset` from the tool's `evidence_preset` and omits `evidence_schema` and `template_id` (Gateway rejects conflicting bootstrap fields). Requires `@paybond/kit` 0.11.11+.
|
|
74
74
|
|
|
75
75
|
`agent sandbox smoke` only requires `@paybond/kit`. Framework demo commands (`agent demo vercel-ai smoke`, etc.) load their optional peers on demand.
|
|
76
76
|
|
|
@@ -170,7 +170,7 @@ Core SDK:
|
|
|
170
170
|
- `Paybond.open(...)` for API-key-only, tenant-derived hosted sessions
|
|
171
171
|
- `HarborClient` for capability verification, intent creation, x402 funding, evidence submission, and ledger reads
|
|
172
172
|
- `paybond.signal` and `paybond.fraud` on `Paybond` sessions opened from one service-account API key
|
|
173
|
-
- `PaybondIntents` helpers for principal-signed intent creation, x402 funding,
|
|
173
|
+
- `PaybondIntents` helpers for principal-signed intent creation, x402 funding, payee-signed evidence submission, and settlement confirmation
|
|
174
174
|
- `PaybondSpendGuard`, `authorizeSpend`, and `guardTool` for spend-named wrappers around capability verification
|
|
175
175
|
- Runtime-neutral and framework aliases: `paybondAgentToolSpendGuard`, `paybondRuntimeNeutralToolSpendGuard`, `paybondLangGraphToolSpendGuard`, and `paybondMCPToolSpendGuard`
|
|
176
176
|
- `paybondRuntimeToolCallAdapter` for agent SDKs and custom runtimes that expose a tool-call object plus an application-owned executor
|
|
@@ -950,7 +950,8 @@
|
|
|
950
950
|
},
|
|
951
951
|
"scope": "tool_completion",
|
|
952
952
|
"rail_hints": [
|
|
953
|
-
"x402_usdc_base"
|
|
953
|
+
"x402_usdc_base",
|
|
954
|
+
"stripe_mpp"
|
|
954
955
|
],
|
|
955
956
|
"forbidden_evidence_fields": [
|
|
956
957
|
"payment_session_id",
|
|
@@ -1063,7 +1064,8 @@
|
|
|
1063
1064
|
},
|
|
1064
1065
|
"scope": "tool_completion",
|
|
1065
1066
|
"rail_hints": [
|
|
1066
|
-
"x402_usdc_base"
|
|
1067
|
+
"x402_usdc_base",
|
|
1068
|
+
"stripe_mpp"
|
|
1067
1069
|
],
|
|
1068
1070
|
"forbidden_evidence_fields": [
|
|
1069
1071
|
"payment_session_id",
|
|
@@ -1158,7 +1160,8 @@
|
|
|
1158
1160
|
},
|
|
1159
1161
|
"scope": "tool_completion",
|
|
1160
1162
|
"rail_hints": [
|
|
1161
|
-
"x402_usdc_base"
|
|
1163
|
+
"x402_usdc_base",
|
|
1164
|
+
"stripe_mpp"
|
|
1162
1165
|
],
|
|
1163
1166
|
"forbidden_evidence_fields": [
|
|
1164
1167
|
"payment_session_id",
|
|
@@ -1182,6 +1185,374 @@
|
|
|
1182
1185
|
"schema_digest_hex": "30a152fec1fa2965578938f26b82c805263f15e324db1be345453dc65598cc9c",
|
|
1183
1186
|
"canonical_schema_digest_hex": "30a152fec1fa2965578938f26b82c805263f15e324db1be345453dc65598cc9c"
|
|
1184
1187
|
}
|
|
1188
|
+
},
|
|
1189
|
+
{
|
|
1190
|
+
"preset_id": "x402_saas_api_purchase",
|
|
1191
|
+
"kind": "vendor_pack",
|
|
1192
|
+
"archetype_preset_id": "api_response_ok",
|
|
1193
|
+
"title": "x402 SaaS API purchase",
|
|
1194
|
+
"description": "SaaS seat or API subscription purchase behind an x402-funded intent. Maps subscription_id to vendor_ref_id with seat_count metadata.",
|
|
1195
|
+
"harbor_template_id": "api_response_v1",
|
|
1196
|
+
"parameters": {
|
|
1197
|
+
"http_status_path": [
|
|
1198
|
+
"http_status"
|
|
1199
|
+
],
|
|
1200
|
+
"expected_http_status": 200
|
|
1201
|
+
},
|
|
1202
|
+
"evidence_field_map": {
|
|
1203
|
+
"subscription_id": "vendor_ref_id",
|
|
1204
|
+
"http_status": "http_status",
|
|
1205
|
+
"response_digest": "response_digest"
|
|
1206
|
+
},
|
|
1207
|
+
"vendor_evidence_schema": {
|
|
1208
|
+
"type": "object",
|
|
1209
|
+
"properties": {
|
|
1210
|
+
"subscription_id": {
|
|
1211
|
+
"type": "string",
|
|
1212
|
+
"description": "SaaS subscription or seat purchase reference"
|
|
1213
|
+
},
|
|
1214
|
+
"seat_count": {
|
|
1215
|
+
"type": "integer",
|
|
1216
|
+
"description": "Number of seats or API units purchased"
|
|
1217
|
+
},
|
|
1218
|
+
"http_status": {
|
|
1219
|
+
"type": "integer"
|
|
1220
|
+
},
|
|
1221
|
+
"response_digest": {
|
|
1222
|
+
"type": "string"
|
|
1223
|
+
}
|
|
1224
|
+
},
|
|
1225
|
+
"required": [
|
|
1226
|
+
"subscription_id",
|
|
1227
|
+
"seat_count",
|
|
1228
|
+
"http_status",
|
|
1229
|
+
"response_digest"
|
|
1230
|
+
]
|
|
1231
|
+
},
|
|
1232
|
+
"evidence_schema": {
|
|
1233
|
+
"type": "object",
|
|
1234
|
+
"properties": {
|
|
1235
|
+
"http_status": {
|
|
1236
|
+
"type": "integer"
|
|
1237
|
+
},
|
|
1238
|
+
"vendor_ref_id": {
|
|
1239
|
+
"type": "string"
|
|
1240
|
+
},
|
|
1241
|
+
"response_digest": {
|
|
1242
|
+
"type": "string"
|
|
1243
|
+
}
|
|
1244
|
+
},
|
|
1245
|
+
"required": [
|
|
1246
|
+
"http_status",
|
|
1247
|
+
"vendor_ref_id",
|
|
1248
|
+
"response_digest"
|
|
1249
|
+
]
|
|
1250
|
+
},
|
|
1251
|
+
"vendor_sample_evidence": {
|
|
1252
|
+
"subscription_id": "sub_9kExample",
|
|
1253
|
+
"seat_count": 5,
|
|
1254
|
+
"http_status": 200,
|
|
1255
|
+
"response_digest": "blake3:7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069"
|
|
1256
|
+
},
|
|
1257
|
+
"sample_evidence": {
|
|
1258
|
+
"http_status": 200,
|
|
1259
|
+
"vendor_ref_id": "sub_9kExample",
|
|
1260
|
+
"response_digest": "blake3:7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069"
|
|
1261
|
+
},
|
|
1262
|
+
"sample_failing_evidence": {
|
|
1263
|
+
"http_status": 402,
|
|
1264
|
+
"vendor_ref_id": "sub_9kExample",
|
|
1265
|
+
"response_digest": "blake3:7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069"
|
|
1266
|
+
},
|
|
1267
|
+
"human_summary": "Release when HTTP status is 200 with subscription_id mapped to vendor_ref_id, seat_count present, and response_digest bound to the API body.",
|
|
1268
|
+
"recommended_amount_cents": 2500,
|
|
1269
|
+
"spend_hints": {
|
|
1270
|
+
"approval_threshold_cents": 5000,
|
|
1271
|
+
"per_tool_max_cents": 25000
|
|
1272
|
+
},
|
|
1273
|
+
"scope": "tool_completion",
|
|
1274
|
+
"rail_hints": [
|
|
1275
|
+
"x402_usdc_base",
|
|
1276
|
+
"stripe_mpp"
|
|
1277
|
+
],
|
|
1278
|
+
"forbidden_evidence_fields": [
|
|
1279
|
+
"payment_session_id",
|
|
1280
|
+
"authorization_id",
|
|
1281
|
+
"capture_id",
|
|
1282
|
+
"void_id",
|
|
1283
|
+
"x402_payment_session_id",
|
|
1284
|
+
"onchain_transaction_hashes"
|
|
1285
|
+
],
|
|
1286
|
+
"anti_patterns": [
|
|
1287
|
+
"Do not submit Coinbase payment-session or authorization payloads as tool-completion evidence.",
|
|
1288
|
+
"Do not use Stripe PaymentIntent ids as SaaS purchase proof — bind subscription_id from the vendor API response."
|
|
1289
|
+
],
|
|
1290
|
+
"vendor_contract": {
|
|
1291
|
+
"provider": "x402",
|
|
1292
|
+
"api_version": "x402_saas_api_v1",
|
|
1293
|
+
"contract_kind": "json_schema",
|
|
1294
|
+
"quality_fields": [
|
|
1295
|
+
"subscription_id",
|
|
1296
|
+
"seat_count",
|
|
1297
|
+
"response_digest"
|
|
1298
|
+
],
|
|
1299
|
+
"schema_digest_hex": "7b1f5efa6aa2ffa4aa6029ea7dc025107f7bdbe96d20b9d834fb197ff85f842e",
|
|
1300
|
+
"canonical_schema_digest_hex": "95a6b806adf78cab5fbb4f7bb871d1114268620c0d12cf61cfa8405558ea2577"
|
|
1301
|
+
}
|
|
1302
|
+
},
|
|
1303
|
+
{
|
|
1304
|
+
"preset_id": "x402_travel_booking",
|
|
1305
|
+
"kind": "vendor_pack",
|
|
1306
|
+
"archetype_preset_id": "cost_and_completion",
|
|
1307
|
+
"title": "x402 travel booking",
|
|
1308
|
+
"description": "Travel booking completion on the x402_usdc_base rail with confirmation_number, total_cents budget cap, and fare_class metadata.",
|
|
1309
|
+
"harbor_template_id": "completion_budget_v1",
|
|
1310
|
+
"parameters": {
|
|
1311
|
+
"status_path": [
|
|
1312
|
+
"status"
|
|
1313
|
+
],
|
|
1314
|
+
"expected_status": "completed",
|
|
1315
|
+
"cost_path": [
|
|
1316
|
+
"total_cents"
|
|
1317
|
+
]
|
|
1318
|
+
},
|
|
1319
|
+
"evidence_field_map": {
|
|
1320
|
+
"confirmation_number": "confirmation_number",
|
|
1321
|
+
"total_cents": "total_cents",
|
|
1322
|
+
"fare_class": "fare_class",
|
|
1323
|
+
"status": "status"
|
|
1324
|
+
},
|
|
1325
|
+
"vendor_evidence_schema": {
|
|
1326
|
+
"type": "object",
|
|
1327
|
+
"properties": {
|
|
1328
|
+
"confirmation_number": {
|
|
1329
|
+
"type": "string"
|
|
1330
|
+
},
|
|
1331
|
+
"total_cents": {
|
|
1332
|
+
"type": "integer"
|
|
1333
|
+
},
|
|
1334
|
+
"fare_class": {
|
|
1335
|
+
"type": "string"
|
|
1336
|
+
},
|
|
1337
|
+
"status": {
|
|
1338
|
+
"type": "string"
|
|
1339
|
+
}
|
|
1340
|
+
},
|
|
1341
|
+
"required": [
|
|
1342
|
+
"confirmation_number",
|
|
1343
|
+
"total_cents",
|
|
1344
|
+
"fare_class",
|
|
1345
|
+
"status"
|
|
1346
|
+
]
|
|
1347
|
+
},
|
|
1348
|
+
"evidence_schema": {
|
|
1349
|
+
"type": "object",
|
|
1350
|
+
"properties": {
|
|
1351
|
+
"confirmation_number": {
|
|
1352
|
+
"type": "string"
|
|
1353
|
+
},
|
|
1354
|
+
"total_cents": {
|
|
1355
|
+
"type": "integer"
|
|
1356
|
+
},
|
|
1357
|
+
"fare_class": {
|
|
1358
|
+
"type": "string"
|
|
1359
|
+
},
|
|
1360
|
+
"status": {
|
|
1361
|
+
"type": "string"
|
|
1362
|
+
}
|
|
1363
|
+
},
|
|
1364
|
+
"required": [
|
|
1365
|
+
"confirmation_number",
|
|
1366
|
+
"total_cents",
|
|
1367
|
+
"fare_class",
|
|
1368
|
+
"status"
|
|
1369
|
+
]
|
|
1370
|
+
},
|
|
1371
|
+
"vendor_sample_evidence": {
|
|
1372
|
+
"confirmation_number": "AA-8JZ3QK",
|
|
1373
|
+
"total_cents": 19750,
|
|
1374
|
+
"fare_class": "economy",
|
|
1375
|
+
"status": "completed"
|
|
1376
|
+
},
|
|
1377
|
+
"sample_evidence": {
|
|
1378
|
+
"confirmation_number": "AA-8JZ3QK",
|
|
1379
|
+
"total_cents": 19750,
|
|
1380
|
+
"fare_class": "economy",
|
|
1381
|
+
"status": "completed"
|
|
1382
|
+
},
|
|
1383
|
+
"sample_failing_evidence": {
|
|
1384
|
+
"confirmation_number": "AA-8JZ3QK",
|
|
1385
|
+
"total_cents": 19750,
|
|
1386
|
+
"fare_class": "business",
|
|
1387
|
+
"status": "failed"
|
|
1388
|
+
},
|
|
1389
|
+
"human_summary": "Release when status is completed and total_cents is within the intent budget. confirmation_number and fare_class are schema-validated metadata.",
|
|
1390
|
+
"recommended_amount_cents": 20000,
|
|
1391
|
+
"spend_hints": {
|
|
1392
|
+
"approval_threshold_cents": 10000,
|
|
1393
|
+
"per_tool_max_cents": 50000
|
|
1394
|
+
},
|
|
1395
|
+
"scope": "tool_completion",
|
|
1396
|
+
"rail_hints": [
|
|
1397
|
+
"x402_usdc_base",
|
|
1398
|
+
"stripe_mpp"
|
|
1399
|
+
],
|
|
1400
|
+
"forbidden_evidence_fields": [
|
|
1401
|
+
"payment_session_id",
|
|
1402
|
+
"authorization_id",
|
|
1403
|
+
"capture_id",
|
|
1404
|
+
"void_id",
|
|
1405
|
+
"x402_payment_session_id",
|
|
1406
|
+
"onchain_transaction_hashes"
|
|
1407
|
+
],
|
|
1408
|
+
"anti_patterns": [
|
|
1409
|
+
"Do not submit Coinbase authorization or payment-session payloads as tool-completion evidence."
|
|
1410
|
+
],
|
|
1411
|
+
"vendor_contract": {
|
|
1412
|
+
"provider": "x402",
|
|
1413
|
+
"api_version": "x402_travel_booking_v1",
|
|
1414
|
+
"contract_kind": "json_schema",
|
|
1415
|
+
"quality_fields": [
|
|
1416
|
+
"confirmation_number",
|
|
1417
|
+
"fare_class",
|
|
1418
|
+
"total_cents"
|
|
1419
|
+
],
|
|
1420
|
+
"schema_digest_hex": "2fb55ee27008a7d59d2df78f80dc144121e54056c71f53c62c90c5f00200dd91",
|
|
1421
|
+
"canonical_schema_digest_hex": "2fb55ee27008a7d59d2df78f80dc144121e54056c71f53c62c90c5f00200dd91"
|
|
1422
|
+
}
|
|
1423
|
+
},
|
|
1424
|
+
{
|
|
1425
|
+
"preset_id": "invoice_payment_confirmed",
|
|
1426
|
+
"kind": "vendor_pack",
|
|
1427
|
+
"archetype_preset_id": "webhook_confirmed",
|
|
1428
|
+
"title": "Invoice payment confirmed",
|
|
1429
|
+
"description": "Accounts-payable invoice payment confirmed via vendor webhook with invoice_number and payment_reference fields. Rail-agnostic — not payment-rail funding webhooks.",
|
|
1430
|
+
"harbor_template_id": "webhook_confirmation_v1",
|
|
1431
|
+
"parameters": {
|
|
1432
|
+
"event_type_path": [
|
|
1433
|
+
"event_type"
|
|
1434
|
+
],
|
|
1435
|
+
"expected_event_type": "invoice.paid"
|
|
1436
|
+
},
|
|
1437
|
+
"evidence_field_map": {
|
|
1438
|
+
"invoice_number": "invoice_number",
|
|
1439
|
+
"payment_reference": "payment_reference",
|
|
1440
|
+
"webhook_event_id": "webhook_event_id",
|
|
1441
|
+
"event_type": "event_type",
|
|
1442
|
+
"payload_digest": "payload_digest"
|
|
1443
|
+
},
|
|
1444
|
+
"vendor_evidence_schema": {
|
|
1445
|
+
"type": "object",
|
|
1446
|
+
"properties": {
|
|
1447
|
+
"invoice_number": {
|
|
1448
|
+
"type": "string",
|
|
1449
|
+
"description": "Vendor invoice number (e.g. INV-2026-0042)"
|
|
1450
|
+
},
|
|
1451
|
+
"payment_reference": {
|
|
1452
|
+
"type": "string",
|
|
1453
|
+
"description": "Vendor payment or remittance reference id"
|
|
1454
|
+
},
|
|
1455
|
+
"webhook_event_id": {
|
|
1456
|
+
"type": "string"
|
|
1457
|
+
},
|
|
1458
|
+
"event_type": {
|
|
1459
|
+
"type": "string"
|
|
1460
|
+
},
|
|
1461
|
+
"payload_digest": {
|
|
1462
|
+
"type": "string"
|
|
1463
|
+
}
|
|
1464
|
+
},
|
|
1465
|
+
"required": [
|
|
1466
|
+
"invoice_number",
|
|
1467
|
+
"payment_reference",
|
|
1468
|
+
"webhook_event_id",
|
|
1469
|
+
"event_type",
|
|
1470
|
+
"payload_digest"
|
|
1471
|
+
]
|
|
1472
|
+
},
|
|
1473
|
+
"evidence_schema": {
|
|
1474
|
+
"type": "object",
|
|
1475
|
+
"properties": {
|
|
1476
|
+
"invoice_number": {
|
|
1477
|
+
"type": "string"
|
|
1478
|
+
},
|
|
1479
|
+
"payment_reference": {
|
|
1480
|
+
"type": "string"
|
|
1481
|
+
},
|
|
1482
|
+
"webhook_event_id": {
|
|
1483
|
+
"type": "string"
|
|
1484
|
+
},
|
|
1485
|
+
"event_type": {
|
|
1486
|
+
"type": "string"
|
|
1487
|
+
},
|
|
1488
|
+
"payload_digest": {
|
|
1489
|
+
"type": "string"
|
|
1490
|
+
}
|
|
1491
|
+
},
|
|
1492
|
+
"required": [
|
|
1493
|
+
"invoice_number",
|
|
1494
|
+
"payment_reference",
|
|
1495
|
+
"webhook_event_id",
|
|
1496
|
+
"event_type",
|
|
1497
|
+
"payload_digest"
|
|
1498
|
+
]
|
|
1499
|
+
},
|
|
1500
|
+
"vendor_sample_evidence": {
|
|
1501
|
+
"invoice_number": "INV-2026-0042",
|
|
1502
|
+
"payment_reference": "pay_ref_8JZ3QK",
|
|
1503
|
+
"webhook_event_id": "wh_inv_9kExample",
|
|
1504
|
+
"event_type": "invoice.paid",
|
|
1505
|
+
"payload_digest": "blake3:2c26b46b68ffc68ff99b453c1d3041340e45ee0e6daef0f4c932b8d4b8e8bb2e"
|
|
1506
|
+
},
|
|
1507
|
+
"sample_evidence": {
|
|
1508
|
+
"invoice_number": "INV-2026-0042",
|
|
1509
|
+
"payment_reference": "pay_ref_8JZ3QK",
|
|
1510
|
+
"webhook_event_id": "wh_inv_9kExample",
|
|
1511
|
+
"event_type": "invoice.paid",
|
|
1512
|
+
"payload_digest": "blake3:2c26b46b68ffc68ff99b453c1d3041340e45ee0e6daef0f4c932b8d4b8e8bb2e"
|
|
1513
|
+
},
|
|
1514
|
+
"sample_failing_evidence": {
|
|
1515
|
+
"invoice_number": "INV-2026-0042",
|
|
1516
|
+
"payment_reference": "pay_ref_8JZ3QK",
|
|
1517
|
+
"webhook_event_id": "wh_inv_9kExample",
|
|
1518
|
+
"event_type": "invoice.voided",
|
|
1519
|
+
"payload_digest": "blake3:2c26b46b68ffc68ff99b453c1d3041340e45ee0e6daef0f4c932b8d4b8e8bb2e"
|
|
1520
|
+
},
|
|
1521
|
+
"human_summary": "Release when event_type is invoice.paid with invoice_number, payment_reference, webhook_event_id, and payload_digest present.",
|
|
1522
|
+
"recommended_amount_cents": 50000,
|
|
1523
|
+
"spend_hints": {
|
|
1524
|
+
"approval_threshold_cents": 25000,
|
|
1525
|
+
"per_tool_max_cents": 250000
|
|
1526
|
+
},
|
|
1527
|
+
"scope": "tool_completion",
|
|
1528
|
+
"forbidden_evidence_fields": [
|
|
1529
|
+
"payment_intent_id",
|
|
1530
|
+
"mandate_id",
|
|
1531
|
+
"latest_charge_id",
|
|
1532
|
+
"transfer_id",
|
|
1533
|
+
"refund_id",
|
|
1534
|
+
"stripe_event_id",
|
|
1535
|
+
"payment_session_id",
|
|
1536
|
+
"authorization_id",
|
|
1537
|
+
"x402_payment_session_id",
|
|
1538
|
+
"onchain_transaction_hashes"
|
|
1539
|
+
],
|
|
1540
|
+
"anti_patterns": [
|
|
1541
|
+
"Do not use Stripe payment_intent.succeeded or Coinbase authorization webhooks as tool-completion evidence.",
|
|
1542
|
+
"Do not submit x402 payment-session ids as invoice payment proof."
|
|
1543
|
+
],
|
|
1544
|
+
"vendor_contract": {
|
|
1545
|
+
"provider": "generic",
|
|
1546
|
+
"api_version": "invoice_payment_v1",
|
|
1547
|
+
"contract_kind": "json_schema",
|
|
1548
|
+
"quality_fields": [
|
|
1549
|
+
"invoice_number",
|
|
1550
|
+
"payment_reference",
|
|
1551
|
+
"payload_digest"
|
|
1552
|
+
],
|
|
1553
|
+
"schema_digest_hex": "c185be62f1add3fb051604db007f3649137b8141e43efb5c82811db3dcd7678c",
|
|
1554
|
+
"canonical_schema_digest_hex": "9bc60cfc5ed0a4233d4c6041120ad5af56ace2fb454779563c1e0b01f966ad18"
|
|
1555
|
+
}
|
|
1185
1556
|
}
|
|
1186
1557
|
]
|
|
1187
1558
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
a738febc9ee8b5b66f05991c4582ba24e6857cdc574196b0aeefc5c77e192ea9
|
package/dist/agent/facade.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { createPaybondClaudeAgentsConfig } from "../claude-agents/config.js";
|
|
2
2
|
import { createPaybondOpenAIAgentsConfig } from "../openai-agents/index.js";
|
|
3
3
|
import { isKnownPolicyPresetId, resolvePolicyPresetPath } from "../policy/presets.js";
|
|
4
|
+
import { createPaybondCloudflareAgentsConfig } from "../cloudflare-agents/config.js";
|
|
5
|
+
import { createPaybondMastraConfig } from "../mastra/config.js";
|
|
4
6
|
import { createPaybondVercelAgentConfig } from "../vercel-ai/config.js";
|
|
5
7
|
import { createPaybondGenericAgentConfig, createPaybondGenericInputGuard, } from "./generic-runner.js";
|
|
6
8
|
import { instrumentPaybondAgent, PaybondInstrumentRuntime, } from "./instrument.js";
|
|
@@ -58,6 +60,13 @@ export function toPaybondAgentResult(result) {
|
|
|
58
60
|
hooks.allowedTools = result.claudeAgentsConfig.allowedTools;
|
|
59
61
|
}
|
|
60
62
|
break;
|
|
63
|
+
case "mastra":
|
|
64
|
+
break;
|
|
65
|
+
case "cloudflare-agents":
|
|
66
|
+
if (result.toolApproval) {
|
|
67
|
+
hooks.toolApproval = result.toolApproval;
|
|
68
|
+
}
|
|
69
|
+
break;
|
|
61
70
|
default: {
|
|
62
71
|
const exhaustive = result.framework;
|
|
63
72
|
throw new Error(`unsupported guarded agent framework: ${String(exhaustive)}`);
|
|
@@ -102,6 +111,10 @@ export function wrapPaybondTools(run, tools, options) {
|
|
|
102
111
|
return createPaybondOpenAIAgentsConfig(run, tools).tools;
|
|
103
112
|
case "claude-agents":
|
|
104
113
|
return createPaybondClaudeAgentsConfig(run, tools).agentTools;
|
|
114
|
+
case "mastra":
|
|
115
|
+
return createPaybondMastraConfig(run, tools).tools;
|
|
116
|
+
case "cloudflare-agents":
|
|
117
|
+
return createPaybondCloudflareAgentsConfig(run, tools).tools;
|
|
105
118
|
case "langgraph":
|
|
106
119
|
throw new Error('framework "langgraph" does not wrap tools in place; use instrument() or createPaybondLangGraphHooks(run)');
|
|
107
120
|
default: {
|
|
@@ -11,7 +11,7 @@ import type { PaybondToolRegistry } from "./registry.js";
|
|
|
11
11
|
import type { PaybondAgentRunHost } from "./run.js";
|
|
12
12
|
import { PaybondAgentRun } from "./run.js";
|
|
13
13
|
import type { PaybondRunBindingAttachInput } from "./types.js";
|
|
14
|
-
export type GuardedAgentFramework = "generic" | "openai-agents" | "vercel-ai" | "langgraph" | "claude-agents";
|
|
14
|
+
export type GuardedAgentFramework = "generic" | "openai-agents" | "vercel-ai" | "langgraph" | "claude-agents" | "mastra" | "cloudflare-agents";
|
|
15
15
|
export type CreateGuardedAgentInput<TTools = unknown> = {
|
|
16
16
|
policy: PaybondPolicyLoadSource | PaybondPolicy;
|
|
17
17
|
/** Agent-agnostic wrapping when omitted. Pass a framework only when SDK-specific hooks are required. */
|
|
@@ -3,6 +3,8 @@ import { PaybondPolicy } from "../policy/load.js";
|
|
|
3
3
|
import { createPaybondVercelAgentConfig } from "../vercel-ai/config.js";
|
|
4
4
|
import { createPaybondLangGraphHooks } from "../langgraph/config.js";
|
|
5
5
|
import { createPaybondClaudeAgentsConfig, } from "../claude-agents/config.js";
|
|
6
|
+
import { createPaybondCloudflareAgentsConfig, } from "../cloudflare-agents/config.js";
|
|
7
|
+
import { createPaybondMastraConfig, } from "../mastra/config.js";
|
|
6
8
|
import { createPaybondGenericAgentConfig, } from "./generic-runner.js";
|
|
7
9
|
import { PaybondAgentRun } from "./run.js";
|
|
8
10
|
async function resolvePolicy(source) {
|
|
@@ -90,6 +92,23 @@ export async function createGuardedAgent(paybond, input) {
|
|
|
90
92
|
claudeAgentsConfig,
|
|
91
93
|
};
|
|
92
94
|
}
|
|
95
|
+
case "mastra": {
|
|
96
|
+
const config = createPaybondMastraConfig(run, input.tools);
|
|
97
|
+
return {
|
|
98
|
+
...base,
|
|
99
|
+
framework: "mastra",
|
|
100
|
+
agentTools: config.tools,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
case "cloudflare-agents": {
|
|
104
|
+
const config = createPaybondCloudflareAgentsConfig(run, input.tools);
|
|
105
|
+
return {
|
|
106
|
+
...base,
|
|
107
|
+
framework: "cloudflare-agents",
|
|
108
|
+
agentTools: config.tools,
|
|
109
|
+
toolApproval: config.toolApproval,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
93
112
|
default: {
|
|
94
113
|
const exhaustive = framework;
|
|
95
114
|
throw new Error(`unsupported guarded agent framework: ${String(exhaustive)}`);
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { PaybondAgentFacade, createPaybondAgentCallable, type GetAgentReceiptInput, type PaybondAgentCallable, } from "./receipt-client.js";
|
|
1
2
|
export { createGuardedAgent, createGuardedAgentRunner, type CreateGuardedAgentInput, type CreateGuardedAgentResult, type CreateGuardedAgentResultBase, type GuardedAgentFramework, } from "./guarded-agent.js";
|
|
2
3
|
export { createPaybondAgent, resolveAgentPolicySource, toPaybondAgentResult, wrapPaybondTools, type PaybondAgentHooks, type PaybondAgentInput, type PaybondAgentResult, type PaybondInstrumentInput, type PaybondWrapToolsOptions, } from "./facade.js";
|
|
3
4
|
export { PaybondInstrumentBuilder, PaybondInstrumented, PaybondInstrumentRuntime, PaybondLazyContextError, PaybondUnboundContextError, discoverPolicyFromAgent, discoverToolNames, discoverToolsFromAgent, inlinePolicyToDocument, instrumentPaybondAgent, instrumentPaybondClaudeAgents, instrumentPaybondLangGraph, instrumentPaybondMCP, instrumentPaybondOpenAI, instrumentPaybondVercel, isInlinePolicy, isInstrumentableAgentObject, readPaybondAgentInstrumentation, type PaybondAgentInstrumentation, type PaybondInlinePolicy, type PaybondInstrumentAgentOptions, type PaybondInstrumentAttachInput, type PaybondInstrumentBinding, type PaybondInstrumentContext, type PaybondInstrumentContextInput, type PaybondInstrumentContextProvider, } from "./instrument.js";
|
|
@@ -10,4 +11,4 @@ export { PaybondToolInterceptor } from "./interceptor.js";
|
|
|
10
11
|
export { PaybondToolRegistry, createPaybondToolRegistry, } from "./registry.js";
|
|
11
12
|
export { PaybondAgentRun, PaybondAgentRunFacade, type PaybondAgentRunHost, } from "./run.js";
|
|
12
13
|
export { agentRegistryDocumentToConfig, buildSmokeRegistry, loadAgentRegistryFile, parseAgentRegistryText, validateAgentRegistryDocument, type AgentRegistryFileDocument, type AgentRegistryValidationResult, } from "./registry-file.js";
|
|
13
|
-
export { PaybondAgentRunBindError, PaybondAutoEvidenceError, PaybondAutoEvidenceSubmitError, PaybondEvidenceSubmitError, PaybondToolRegistryValidationError, PaybondUnregisteredSideEffectingToolError, type PaybondAgentRunBindInput, type PaybondAuthorizeToolCallInput, type PaybondEvidenceMapper, type PaybondInterceptEvidenceResult, type PaybondInterceptWrapExecuteInput, type PaybondInterceptWrapExecuteResult, type PaybondRunBinding, type PaybondRunBindingAttachInput, type PaybondRunBindingSandboxBootstrapInput, type PaybondRunProductionEvidenceCredentials, type PaybondRunGuard, type PaybondSideEffectingToolEntry, type PaybondSideEffectingToolPolicy, type PaybondSpendResolver, type PaybondToolCallContext, type PaybondToolInputGuardAllowDecision, type PaybondToolInputGuardApprovalRequiredDecision, type PaybondToolInputGuardDecision, type PaybondToolInputGuardDenyDecision, type PaybondToolRegistryConfig, type PaybondToolResolution, type PaybondTraceEvent, type PaybondTraceSink, } from "./types.js";
|
|
14
|
+
export { PaybondAgentRunBindError, PaybondAutoEvidenceError, PaybondAutoEvidenceSubmitError, PaybondEvidenceSubmitError, PaybondToolRegistryValidationError, PaybondUnregisteredSideEffectingToolError, type PaybondAgentRunBindInput, type PaybondAuthorizeToolCallInput, type PaybondEvidenceMapper, type PaybondExternalAttestationMapper, type PaybondInterceptEvidenceResult, type PaybondInterceptWrapExecuteInput, type PaybondInterceptWrapExecuteResult, type PaybondRunBinding, type PaybondRunBindingAttachInput, type PaybondRunBindingSandboxBootstrapInput, type PaybondRunProductionEvidenceCredentials, type PaybondRunGuard, type PaybondSideEffectingToolEntry, type PaybondSideEffectingToolPolicy, type PaybondSpendResolver, type PaybondToolCallContext, type PaybondToolInputGuardAllowDecision, type PaybondToolInputGuardApprovalRequiredDecision, type PaybondToolInputGuardDecision, type PaybondToolInputGuardDenyDecision, type PaybondToolRegistryConfig, type PaybondToolResolution, type PaybondTraceEvent, type PaybondTraceSink, } from "./types.js";
|
package/dist/agent/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { PaybondAgentFacade, createPaybondAgentCallable, } from "./receipt-client.js";
|
|
1
2
|
export { createGuardedAgent, createGuardedAgentRunner, } from "./guarded-agent.js";
|
|
2
3
|
export { createPaybondAgent, resolveAgentPolicySource, toPaybondAgentResult, wrapPaybondTools, } from "./facade.js";
|
|
3
4
|
export { PaybondInstrumentBuilder, PaybondInstrumented, PaybondInstrumentRuntime, PaybondLazyContextError, PaybondUnboundContextError, discoverPolicyFromAgent, discoverToolNames, discoverToolsFromAgent, inlinePolicyToDocument, instrumentPaybondAgent, instrumentPaybondClaudeAgents, instrumentPaybondLangGraph, instrumentPaybondMCP, instrumentPaybondOpenAI, instrumentPaybondVercel, isInlinePolicy, isInstrumentableAgentObject, readPaybondAgentInstrumentation, } from "./instrument.js";
|
|
@@ -154,3 +154,9 @@ export declare function instrumentPaybondClaudeAgents<TTools>(paybond: PaybondAg
|
|
|
154
154
|
export declare function instrumentPaybondMCP<TTools>(paybond: PaybondAgentRunHost, input: Omit<PaybondInstrumentBaseInput<TTools>, "framework"> & {
|
|
155
155
|
tools: TTools;
|
|
156
156
|
}): Promise<PaybondInstrumented<TTools> | PaybondInstrumentRuntime<TTools>>;
|
|
157
|
+
export declare function instrumentPaybondMastra<TTools>(paybond: PaybondAgentRunHost, input: Omit<PaybondInstrumentBaseInput<TTools>, "framework"> & {
|
|
158
|
+
tools: TTools;
|
|
159
|
+
}): Promise<PaybondInstrumented<TTools> | PaybondInstrumentRuntime<TTools>>;
|
|
160
|
+
export declare function instrumentPaybondCloudflareAgents<TTools>(paybond: PaybondAgentRunHost, input: Omit<PaybondInstrumentBaseInput<TTools>, "framework"> & {
|
|
161
|
+
tools: TTools;
|
|
162
|
+
}): Promise<PaybondInstrumented<TTools> | PaybondInstrumentRuntime<TTools>>;
|
package/dist/agent/instrument.js
CHANGED
|
@@ -440,3 +440,9 @@ export function instrumentPaybondClaudeAgents(paybond, input) {
|
|
|
440
440
|
export function instrumentPaybondMCP(paybond, input) {
|
|
441
441
|
return frameworkInstrument(paybond, "generic", input);
|
|
442
442
|
}
|
|
443
|
+
export function instrumentPaybondMastra(paybond, input) {
|
|
444
|
+
return frameworkInstrument(paybond, "mastra", input);
|
|
445
|
+
}
|
|
446
|
+
export function instrumentPaybondCloudflareAgents(paybond, input) {
|
|
447
|
+
return frameworkInstrument(paybond, "cloudflare-agents", input);
|
|
448
|
+
}
|
|
@@ -21,4 +21,13 @@ export declare class PaybondToolInterceptor {
|
|
|
21
21
|
wrapExecute<TResult>(input: PaybondInterceptWrapExecuteInput<TResult>): Promise<PaybondInterceptWrapExecuteResult<TResult>>;
|
|
22
22
|
private resolveSideEffectingCall;
|
|
23
23
|
private submitAutoEvidence;
|
|
24
|
+
/**
|
|
25
|
+
* Composes an unsigned Agent Receipt Standard draft (Phase 1) after a successful
|
|
26
|
+
* authorize → execute → evidence cycle. Never signed or persisted here; Phase 2 covers
|
|
27
|
+
* compose/sign/persist. Best-effort: returns `undefined` instead of throwing whenever
|
|
28
|
+
* required receipt fields (agent context, principal/operator DID, policy template, pinned
|
|
29
|
+
* policy digest, or a Harbor decision id) are unavailable on this binding or call.
|
|
30
|
+
*/
|
|
31
|
+
private buildReceiptDraft;
|
|
32
|
+
private resolveToolExternalAttestations;
|
|
24
33
|
}
|