@devlab.group/agent-commerce 2.8.0 → 2.9.1
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 +28 -21
- package/dist/ap2.js +2 -2
- package/dist/{chunk-WDD2ZUR3.js → chunk-46Y5M7BA.js} +3 -2
- package/dist/chunk-46Y5M7BA.js.map +1 -0
- package/dist/{chunk-ENK63GKR.js → chunk-J3K7E4CA.js} +3 -3
- package/dist/{chunk-ENK63GKR.js.map → chunk-J3K7E4CA.js.map} +1 -1
- package/dist/{cli/chunk-APC5BTQM.js → chunk-RF3DFVXH.js} +2 -2
- package/dist/{chunk-IWXVQYG5.js.map → chunk-RF3DFVXH.js.map} +1 -1
- package/dist/{chunk-QZW5YL3G.js → chunk-TEI6GTUG.js} +7 -3
- package/dist/chunk-TEI6GTUG.js.map +1 -0
- package/dist/cli/{ap2-GYKFGE66.js → ap2-MUNB4HHC.js} +5 -5
- package/dist/cli/{ap2-GYKFGE66.js.map → ap2-MUNB4HHC.js.map} +1 -1
- package/dist/cli/{chunk-DKWO6LLX.js → chunk-4WPHZLVO.js} +3 -2
- package/dist/cli/chunk-4WPHZLVO.js.map +1 -0
- package/dist/cli/chunk-JP5NQ5II.js +8 -0
- package/dist/cli/{chunk-SAAT2XFX.js.map → chunk-JP5NQ5II.js.map} +1 -1
- package/dist/cli/chunk-KLKNFJTT.js +540 -0
- package/dist/cli/chunk-KLKNFJTT.js.map +1 -0
- package/dist/cli/{chunk-WFIR374D.js → chunk-L264N3ZV.js} +41 -5
- package/dist/cli/chunk-L264N3ZV.js.map +1 -0
- package/dist/cli/{chunk-VWQMSWDF.js → chunk-RAWPZIG6.js} +7 -3
- package/dist/cli/chunk-RAWPZIG6.js.map +1 -0
- package/dist/cli/{chunk-SYXLQ5BS.js → chunk-SEDRU2KV.js} +5 -5
- package/dist/cli/{chunk-SYXLQ5BS.js.map → chunk-SEDRU2KV.js.map} +1 -1
- package/dist/cli/{chunk-3PGFOEVJ.js → chunk-SHIA2B6G.js} +32 -6
- package/dist/cli/chunk-SHIA2B6G.js.map +1 -0
- package/dist/{chunk-IWXVQYG5.js → cli/chunk-UV23DWUY.js} +2 -2
- package/dist/cli/{chunk-APC5BTQM.js.map → chunk-UV23DWUY.js.map} +1 -1
- package/dist/cli/{chunk-YXXPZFWC.js → chunk-UX7GRVL4.js} +126 -18
- package/dist/cli/chunk-UX7GRVL4.js.map +1 -0
- package/dist/cli/{config-JWMHWVRT.js → config-IBG46HTQ.js} +6 -6
- package/dist/cli/{config-JWMHWVRT.js.map → config-IBG46HTQ.js.map} +1 -1
- package/dist/cli/index.js +34 -14
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/{mcp-OW5GY7TT.js → mcp-55FLXKCC.js} +3 -3
- package/dist/cli/{mcp-OW5GY7TT.js.map → mcp-55FLXKCC.js.map} +1 -1
- package/dist/cli/payment-providers-4OC2TONC.js +6 -0
- package/dist/cli/{payment-providers-QL2BJYMD.js.map → payment-providers-4OC2TONC.js.map} +1 -1
- package/dist/cli/{provider-3A2LVEQS.js → provider-H57SJDEJ.js} +4 -4
- package/dist/cli/{provider-3A2LVEQS.js.map → provider-H57SJDEJ.js.map} +1 -1
- package/dist/cli/receipts-SMX4MFO5.js +9 -0
- package/dist/cli/{receipts-FQUFGEQD.js.map → receipts-SMX4MFO5.js.map} +1 -1
- package/dist/cli/{run-KF5OQYPL.js → run-BS7323JH.js} +830 -184
- package/dist/cli/run-BS7323JH.js.map +1 -0
- package/dist/cli/{x402-5A7CVCIJ.js → x402-RNV3VHJT.js} +5 -5
- package/dist/cli/{x402-5A7CVCIJ.js.map → x402-RNV3VHJT.js.map} +1 -1
- package/dist/index.d.ts +74 -31
- package/dist/index.js +1410 -270
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +1 -1
- package/dist/mpp.js +2 -2
- package/dist/{store-BzgwHOPu.d.ts → store-04pazhFP.d.ts} +52 -1
- package/dist/testing.js +468 -273
- package/dist/testing.js.map +1 -1
- package/dist/x402.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-QZW5YL3G.js.map +0 -1
- package/dist/chunk-WDD2ZUR3.js.map +0 -1
- package/dist/cli/chunk-3PGFOEVJ.js.map +0 -1
- package/dist/cli/chunk-6BWEHQPJ.js +0 -215
- package/dist/cli/chunk-6BWEHQPJ.js.map +0 -1
- package/dist/cli/chunk-DKWO6LLX.js.map +0 -1
- package/dist/cli/chunk-SAAT2XFX.js +0 -8
- package/dist/cli/chunk-VWQMSWDF.js.map +0 -1
- package/dist/cli/chunk-WFIR374D.js.map +0 -1
- package/dist/cli/chunk-YXXPZFWC.js.map +0 -1
- package/dist/cli/payment-providers-QL2BJYMD.js +0 -6
- package/dist/cli/receipts-FQUFGEQD.js +0 -9
- package/dist/cli/run-KF5OQYPL.js.map +0 -1
package/README.md
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
<!-- support-record:begin badges -->
|
|
12
12
|
<img alt="MCP" src="https://img.shields.io/badge/MCP-supported-6b4fbb">
|
|
13
13
|
<img alt="x402" src="https://img.shields.io/badge/x402-supported-0052ff">
|
|
14
|
+
<img alt="A2A" src="https://img.shields.io/badge/A2A-supported-2ea44f">
|
|
14
15
|
<img alt="MPP" src="https://img.shields.io/badge/MPP-experimental-f0a30a">
|
|
15
|
-
<img alt="A2A" src="https://img.shields.io/badge/A2A-experimental-f0a30a">
|
|
16
16
|
<img alt="ACP" src="https://img.shields.io/badge/ACP-experimental-f0a30a">
|
|
17
17
|
<img alt="AP2" src="https://img.shields.io/badge/AP2-experimental-f0a30a">
|
|
18
18
|
<!-- support-record:end -->
|
|
@@ -25,7 +25,7 @@ call and pay for it without adding those protocols to your backend.
|
|
|
25
25
|
|
|
26
26
|
Run the gateway in your infrastructure and describe each endpoint in YAML, or
|
|
27
27
|
generate draft resource definitions from OpenAPI. Resources can be exposed over
|
|
28
|
-
HTTP, MCP or
|
|
28
|
+
HTTP, MCP or A2A; dedicated resources can implement experimental
|
|
29
29
|
ACP checkout operations. Paid resources use x402 or experimental MPP and can
|
|
30
30
|
also require an AP2 mandate proving that the buyer approved the purchase. Funds
|
|
31
31
|
go directly to the merchant wallet, and the gateway needs neither the buyer's
|
|
@@ -308,16 +308,17 @@ See [docs/configuration.md](docs/configuration.md).
|
|
|
308
308
|
|
|
309
309
|
<!-- support-record:begin matrix -->
|
|
310
310
|
|
|
311
|
-
| Protocol
|
|
312
|
-
|
|
|
313
|
-
| **HTTP**
|
|
314
|
-
| **MCP**
|
|
315
|
-
| **x402**
|
|
316
|
-
| **MPP**
|
|
317
|
-
| **A2A**
|
|
318
|
-
| **ACP**
|
|
319
|
-
| **AP2**
|
|
320
|
-
| **ERC-8409**
|
|
311
|
+
| Protocol | Status | Pinned revision | Implemented subset |
|
|
312
|
+
| ---------------------- | ------------ | ----------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
313
|
+
| **HTTP** | Supported | native | resource routes and rail-specific payment headers |
|
|
314
|
+
| **MCP** | Supported | MCP `2026-07-28` and `2025-11-25`; `@modelcontextprotocol/server@2.3.0` | tool discovery, invocation, payment-required and error mapping |
|
|
315
|
+
| **x402** | Supported | x402 v2; `@x402/core@2.30.0`, `@x402/evm@2.30.0`, `@x402/svm@2.30.0`, `@x402/near@2.30.0` | `exact` on EVM through EIP-3009 or Permit2, on Solana, and on NEAR (partial): challenge, verification, settlement and replay binding |
|
|
316
|
+
| **MPP** | Experimental | drafts at `tempoxyz/mpp-specs@806fdb8`; `mppx@0.13.1` | `charge`/`evm`/EIP-3009 with USDC on Base Sepolia and Base, over HTTP, MCP and A2A |
|
|
317
|
+
| **A2A** | Supported | v1.0.1; negotiation `1.0`; `JSONRPC` binding | Agent Card, `SendMessage` with `returnImmediately`, `GetTask`, `ListTasks`, `CancelTask` and the paid flow |
|
|
318
|
+
| **ACP** | Experimental | stable snapshot `2026-04-17`; REST binding | discovery and the five checkout operations |
|
|
319
|
+
| **AP2** | Experimental | v0.2.0, tag 2026-04-28, commit `b4587ac`; Direct mode; `jose@6.2.12`, `@sd-jwt/core@0.20.1`, `canonicalize@5.0.0` | closed Checkout Mandate verification before settlement |
|
|
320
|
+
| **ERC-8409** | Experimental | draft `SergeevDmitry/ERCs@0ee33230` | signed quotes on x402 EVM offers; issuer published in `/.well-known/agent-commerce` |
|
|
321
|
+
| **A2A x402 extension** | Experimental | v0.1.0, commit `a5590226` | `TASK_STATE_INPUT_REQUIRED` with x402 v2 requirements, payment by a follow-up message on the task, receipts in the final status; A2A 1.0 wire forms, x402 only |
|
|
321
322
|
|
|
322
323
|
<!-- support-record:end -->
|
|
323
324
|
|
|
@@ -327,9 +328,11 @@ UCP is planned and has no implementation.
|
|
|
327
328
|
mandate before a paid resource settles; the gateway does not issue the mandate
|
|
328
329
|
or its Checkout Receipt.
|
|
329
330
|
|
|
330
|
-
The experimental entries above
|
|
331
|
-
|
|
332
|
-
[
|
|
331
|
+
The experimental entries above are disabled by default and cover documented
|
|
332
|
+
subsets:
|
|
333
|
+
[ACP](docs/protocols/acp.md), [AP2](docs/protocols/ap2.md#not-implemented),
|
|
334
|
+
[MPP](docs/protocols/mpp.md), the
|
|
335
|
+
[a2a-x402 extension](docs/protocols/a2a.md#x402-extension) and
|
|
333
336
|
[ERC-8409 quotes](docs/protocols/x402.md#erc-8409-signed-quotes). Supported
|
|
334
337
|
[MCP](docs/protocols/mcp.md) and [x402](docs/protocols/x402.md) are also scoped.
|
|
335
338
|
ACP exposes only its five checkout operations; merchant `payment_data` is never
|
|
@@ -342,7 +345,8 @@ prints the `unsupported` lists for A2A, ACP and AP2 when they are enabled.
|
|
|
342
345
|
### Versioning
|
|
343
346
|
|
|
344
347
|
Minor releases may break experimental configurations, integrations or types.
|
|
345
|
-
This includes MPP,
|
|
348
|
+
This includes MPP, ACP, AP2, the
|
|
349
|
+
[a2a-x402 extension](docs/protocols/a2a.md#x402-extension), ERC-8409 quotes, the
|
|
346
350
|
[public resource URL](docs/configuration.md#public-resource-url) and
|
|
347
351
|
[Bazaar metadata](docs/configuration.md#bazaar-metadata) in payment
|
|
348
352
|
challenges, and these interfaces:
|
|
@@ -356,6 +360,7 @@ challenges, and these interfaces:
|
|
|
356
360
|
in 2.7.0.
|
|
357
361
|
- `PaymentContext.protocol` and `AdapterHealthComponent.undetermined` (added
|
|
358
362
|
in 2.8.0), and the `./testing` entry.
|
|
363
|
+
- `TaskRecord` and the task storage methods on `ReceiptStore`, added in 2.9.0.
|
|
359
364
|
|
|
360
365
|
A profile moves from experimental to supported only when it meets the
|
|
361
366
|
[promotion criteria](docs/protocols.md#promotion-criteria).
|
|
@@ -525,7 +530,7 @@ INFO AP2 disabled
|
|
|
525
530
|
PASS Payments x402 v2 (scheme=exact) enabled - LOCAL dev chain (eip155:31337), destination=0x7099…79C8, facilitator=local (in-process), paymentFlow=authorization
|
|
526
531
|
PASS Payments (offers) 1 offer(s) pass their health checks
|
|
527
532
|
INFO Payments (MPP) MPP not configured
|
|
528
|
-
PASS Storage sqlite schema
|
|
533
|
+
PASS Storage sqlite schema v6 writable; receipts=2
|
|
529
534
|
PASS Transactions none unresolved
|
|
530
535
|
PASS Protocol versions reported by gateway /.well-known/agent-commerce
|
|
531
536
|
|
|
@@ -535,7 +540,9 @@ Score: 10/10 checks passed
|
|
|
535
540
|
`doctor` compares live settlement terms with local config for each rail and
|
|
536
541
|
resource: offer order, network, token, payee and transfer method, plus decimals
|
|
537
542
|
and payment flows when published. Mismatches fail the check. It also names
|
|
538
|
-
failing offers when health is published
|
|
543
|
+
failing and degraded offers when health is published. The gateway logs
|
|
544
|
+
reported rail health details at warn when a rail starts failing, and at
|
|
545
|
+
debug otherwise.
|
|
539
546
|
|
|
540
547
|
`Secrets` lists each config placeholder (`${VAR}`) as missing, set or
|
|
541
548
|
defaulted. Config loading stops at the first missing variable; this check
|
|
@@ -595,8 +602,8 @@ follows.
|
|
|
595
602
|
It exits 0 after a completed run, even if attempts remain unresolved, and 1 if
|
|
596
603
|
the run fails to complete. If a store error stops a hold scan, the command
|
|
597
604
|
prints the report, preserving any saved resolutions, and exits 1.
|
|
598
|
-
`reconcile` and `resolve`
|
|
599
|
-
migrating them. Back up the database, then start the gateway once before
|
|
605
|
+
`reconcile` and `resolve` reject receipt databases with an older schema
|
|
606
|
+
without migrating them. Back up the database, then start the gateway once before
|
|
600
607
|
retrying either command.
|
|
601
608
|
|
|
602
609
|
Each family needs its own evidence:
|
|
@@ -719,7 +726,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
|
719
726
|
|
|
720
727
|
**Now** - MCP, x402 v2, settlement on the local chain, Base Sepolia, Base
|
|
721
728
|
mainnet, Solana devnet and Solana mainnet, receipts, doctor, deterministic
|
|
722
|
-
demo,
|
|
729
|
+
demo, the A2A v1.0.1 adapter, the experimental ACP `2026-04-17` checkout adapter,
|
|
723
730
|
experimental AP2 v0.2.0 mandate verification, experimental MPP `charge`
|
|
724
731
|
payments, experimental OpenAPI import, experimental retries after a lost
|
|
725
732
|
response, and experimental discovery metadata for x402 Bazaar and MCP Registry
|
package/dist/ap2.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AP2_CHECKOUT_MANDATE_VCT, AP2_SIGNING_ALGORITHM, AP2_DIGEST_ALGORITHM, AP2_CHECKOUT_PROFILE, AP2_SPEC_VERSION, AP2_KEY_TYPE, AP2_JWK_CURVE, openSqliteDatabase } from './chunk-RXYGC7A3.js';
|
|
2
2
|
export { AP2_CHECKOUT_MANDATE_VCT, AP2_CHECKOUT_PROFILE, AP2_DEFAULT_CLOCK_SKEW_SECONDS, AP2_MAX_CLOCK_SKEW_SECONDS, AP2_SIGNING_ALGORITHM, AP2_SPEC_VERSION } from './chunk-RXYGC7A3.js';
|
|
3
|
-
import { exclusionNames, descriptorStatus, PACKAGE_VERSION } from './chunk-
|
|
4
|
-
import { hasMethodGroup } from './chunk-
|
|
3
|
+
import { exclusionNames, descriptorStatus, PACKAGE_VERSION } from './chunk-J3K7E4CA.js';
|
|
4
|
+
import { hasMethodGroup } from './chunk-46Y5M7BA.js';
|
|
5
5
|
import { systemClock, NOOP_LOGGER, CommerceError } from './chunk-MDOGXTZD.js';
|
|
6
6
|
import { isRecord } from './chunk-2CJNA7MS.js';
|
|
7
7
|
import { SignJWT, importPKCS8, importJWK, jwtVerify, decodeProtectedHeader, decodeJwt } from 'jose';
|
|
@@ -8,6 +8,7 @@ var STORE_METHOD_GROUPS = {
|
|
|
8
8
|
"listOrphanAuthorizationHolds"
|
|
9
9
|
],
|
|
10
10
|
pending_tasks: ["putPendingTask", "getPendingTask", "takePendingTask"],
|
|
11
|
+
task_records: ["putTaskRecord", "getTaskRecord", "listTaskRecords"],
|
|
11
12
|
// Separate from `idempotency_claims`: a store can support claims without redelivery
|
|
12
13
|
response_redelivery: ["getIdempotencyKey"]
|
|
13
14
|
};
|
|
@@ -16,5 +17,5 @@ function hasMethodGroup(store, group) {
|
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
export { STORE_METHOD_GROUPS, hasMethodGroup };
|
|
19
|
-
//# sourceMappingURL=chunk-
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
20
|
+
//# sourceMappingURL=chunk-46Y5M7BA.js.map
|
|
21
|
+
//# sourceMappingURL=chunk-46Y5M7BA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/store-method-groups.ts"],"names":[],"mappings":";AAKO,IAAM,mBAAA,GAAsB;AAAA,EACjC,kBAAA,EAAoB,CAAC,qBAAA,EAAuB,sBAAA,EAAwB,wBAAwB,CAAA;AAAA,EAC5F,mBAAA,EAAqB;AAAA,IACnB,0BAAA;AAAA,IACA,6BAAA;AAAA,IACA,2BAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA,aAAA,EAAe,CAAC,gBAAA,EAAkB,gBAAA,EAAkB,iBAAiB,CAAA;AAAA,EACrE,YAAA,EAAc,CAAC,eAAA,EAAiB,eAAA,EAAiB,iBAAiB,CAAA;AAAA;AAAA,EAElE,mBAAA,EAAqB,CAAC,mBAAmB;AAC3C;AASO,SAAS,cAAA,CACd,OACA,KAAA,EAC8C;AAC9C,EAAA,OACE,KAAA,KAAU,MAAA,IACV,mBAAA,CAAoB,KAAK,CAAA,CAAE,KAAA,CAAM,CAAC,MAAA,KAAW,OAAO,KAAA,CAAM,MAAM,CAAA,KAAM,UAAU,CAAA;AAEpF","file":"chunk-46Y5M7BA.js","sourcesContent":["// Optional ReceiptStore method groups. Adapters use a store for a group only\n// when all its methods are present; conformance checks that each group is\n// implemented in full or omitted.\nimport type { ReceiptStore } from './interfaces/store';\n\nexport const STORE_METHOD_GROUPS = {\n idempotency_claims: ['claimIdempotencyKey', 'updateIdempotencyKey', 'recoverIdempotencyKeys'],\n authorization_holds: [\n 'reserveAuthorizationHold',\n 'transitionAuthorizationHold',\n 'getAuthorizationHoldState',\n 'listOrphanAuthorizationHolds',\n ],\n pending_tasks: ['putPendingTask', 'getPendingTask', 'takePendingTask'],\n task_records: ['putTaskRecord', 'getTaskRecord', 'listTaskRecords'],\n // Separate from `idempotency_claims`: a store can support claims without redelivery\n response_redelivery: ['getIdempotencyKey'],\n} as const satisfies Record<string, readonly (keyof ReceiptStore)[]>;\n\nexport type StoreMethodGroup = keyof typeof STORE_METHOD_GROUPS;\n\n/** The required store methods for one group */\nexport type StoreGroupMethods<G extends StoreMethodGroup> = Required<\n Pick<ReceiptStore, (typeof STORE_METHOD_GROUPS)[G][number]>\n>;\n\nexport function hasMethodGroup<G extends StoreMethodGroup>(\n store: ReceiptStore | undefined,\n group: G,\n): store is ReceiptStore & StoreGroupMethods<G> {\n return (\n store !== undefined &&\n STORE_METHOD_GROUPS[group].every((method) => typeof store[method] === 'function')\n );\n}\n"]}
|
|
@@ -15,8 +15,8 @@ function featureStatus(record, name) {
|
|
|
15
15
|
}
|
|
16
16
|
return feature.status;
|
|
17
17
|
}
|
|
18
|
-
var PACKAGE_VERSION = "2.
|
|
18
|
+
var PACKAGE_VERSION = "2.9.1" ;
|
|
19
19
|
|
|
20
20
|
export { PACKAGE_VERSION, descriptorStatus, exclusionNames, featureStatus };
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
22
|
-
//# sourceMappingURL=chunk-
|
|
21
|
+
//# sourceMappingURL=chunk-J3K7E4CA.js.map
|
|
22
|
+
//# sourceMappingURL=chunk-J3K7E4CA.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/support/claims.ts","../src/version.ts"],"names":[],"mappings":";;;;AAkBO,SAAS,iBAAiB,MAAA,EAAkD;AACjF,EAAA,OAAO,MAAA,CAAO,MAAA,KAAW,WAAA,GAAc,QAAA,GAAW,cAAA;AACpD;AAGO,SAAS,eAAe,MAAA,EAA0C;AACvE,EAAA,OAAO,OAAO,UAAA,CAAW,GAAA,CAAI,CAAC,SAAA,KAAc,UAAU,IAAI,CAAA;AAC5D;AAEO,SAAS,aAAA,CAAc,QAAuB,IAAA,EAA6B;AAChF,EAAA,MAAM,OAAA,GAAU,OAAO,QAAA,CAAS,IAAA,CAAK,CAAC,SAAA,KAAc,SAAA,CAAU,SAAS,IAAI,CAAA;AAC3E,EAAA,IAAI,YAAY,MAAA,EAAW;AACzB,IAAA,MAAM,IAAI,aAAA,CAAc,gBAAA,EAAkB,CAAA,+BAAA,EAAkC,IAAI,CAAA,CAAA,CAAG,CAAA;AAAA,EACrF;AACA,EAAA,OAAO,OAAA,CAAQ,MAAA;AACjB;ACXO,IAAM,eAAA,GACmC,OAAA","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/support/claims.ts","../src/version.ts"],"names":[],"mappings":";;;;AAkBO,SAAS,iBAAiB,MAAA,EAAkD;AACjF,EAAA,OAAO,MAAA,CAAO,MAAA,KAAW,WAAA,GAAc,QAAA,GAAW,cAAA;AACpD;AAGO,SAAS,eAAe,MAAA,EAA0C;AACvE,EAAA,OAAO,OAAO,UAAA,CAAW,GAAA,CAAI,CAAC,SAAA,KAAc,UAAU,IAAI,CAAA;AAC5D;AAEO,SAAS,aAAA,CAAc,QAAuB,IAAA,EAA6B;AAChF,EAAA,MAAM,OAAA,GAAU,OAAO,QAAA,CAAS,IAAA,CAAK,CAAC,SAAA,KAAc,SAAA,CAAU,SAAS,IAAI,CAAA;AAC3E,EAAA,IAAI,YAAY,MAAA,EAAW;AACzB,IAAA,MAAM,IAAI,aAAA,CAAc,gBAAA,EAAkB,CAAA,+BAAA,EAAkC,IAAI,CAAA,CAAA,CAAG,CAAA;AAAA,EACrF;AACA,EAAA,OAAO,OAAA,CAAQ,MAAA;AACjB;ACXO,IAAM,eAAA,GACmC,OAAA","file":"chunk-J3K7E4CA.js","sourcesContent":["/**\n * Read support status, feature status and exclusion names for descriptors,\n * discovery and `doctor`, without loading external packages.\n * `scripts/support-record.ts` validates records in tests and tooling; runtime\n * readers trust them.\n */\nimport { CommerceError } from '../core/errors';\n\n/** The fields of a support record that runtime code reads */\nexport interface SupportClaims {\n readonly status: string;\n readonly features: readonly { readonly name: string; readonly status: string }[];\n readonly exclusions: readonly { readonly name: string }[];\n}\n\nexport type FeatureStatus = 'supported' | 'experimental' | 'partial';\n\n/** Maps `supported` to `stable` without changing the descriptor's status union */\nexport function descriptorStatus(record: SupportClaims): 'stable' | 'experimental' {\n return record.status === 'supported' ? 'stable' : 'experimental';\n}\n\n/** The strings a descriptor publishes in `unsupported` */\nexport function exclusionNames(record: SupportClaims): readonly string[] {\n return record.exclusions.map((exclusion) => exclusion.name);\n}\n\nexport function featureStatus(record: SupportClaims, name: string): FeatureStatus {\n const feature = record.features.find((candidate) => candidate.name === name);\n if (feature === undefined) {\n throw new CommerceError('INTERNAL_ERROR', `support record has no feature \"${name}\"`);\n }\n return feature.status as FeatureStatus;\n}\n","/**\n * The package version, resolved once for the whole package.\n *\n * The build injects `__OAC_PACKAGE_VERSION__` (tsup.config.ts), because a\n * relative manifest path resolves from the wrong depth once `src/**` is\n * bundled. From source, the root manifest is read instead. `typeof` on an\n * undeclared identifier is safe, so the source path runs without the constant.\n */\nimport { createRequire } from 'node:module';\n\ndeclare const __OAC_PACKAGE_VERSION__: string | undefined;\n\nfunction readFromManifest(): string {\n try {\n const require = createRequire(import.meta.url);\n // src/version.ts -> repository root\n return (require('../package.json') as { version?: string }).version ?? '0.0.0-unknown';\n } catch {\n return '0.0.0-unknown';\n }\n}\n\nexport const PACKAGE_VERSION: string =\n typeof __OAC_PACKAGE_VERSION__ === 'string' ? __OAC_PACKAGE_VERSION__ : readFromManifest();\n"]}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
var PAYMENT_KEY_ENDPOINT_PREFIX = "payment:";
|
|
3
3
|
|
|
4
4
|
export { PAYMENT_KEY_ENDPOINT_PREFIX };
|
|
5
|
-
//# sourceMappingURL=chunk-
|
|
6
|
-
//# sourceMappingURL=chunk-
|
|
5
|
+
//# sourceMappingURL=chunk-RF3DFVXH.js.map
|
|
6
|
+
//# sourceMappingURL=chunk-RF3DFVXH.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/domain/store-records.ts"],"names":[],"mappings":";AAqBO,IAAM,2BAAA,GAA8B","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/core/domain/store-records.ts"],"names":[],"mappings":";AAqBO,IAAM,2BAAA,GAA8B","file":"chunk-RF3DFVXH.js","sourcesContent":["/**\n * Protocol-neutral records for the receipt store's optional methods:\n * idempotency claims, authorization holds and pending tasks. Adapters and\n * authorization providers map their own data to these types at their boundaries.\n */\nimport type { AuthorizationMethodName, IsoTimestamp, ProtocolName } from './common';\nimport type { AuthorizationHoldState } from './transaction';\n\n/** Experimental: may change in a minor release */\nexport interface IdempotencyScope {\n /** The gateway's public base URL, which survives a credential rotation */\n readonly deployment: string;\n /** The concrete endpoint path, so a client may reuse one key across operations */\n readonly endpoint: string;\n readonly key: string;\n}\n\n/**\n * Prefix reserved for paid retry claim endpoints, followed by the resource ID.\n * ACP endpoints begin with `/`, keeping the claim namespaces distinct.\n */\nexport const PAYMENT_KEY_ENDPOINT_PREFIX = 'payment:';\n\n/**\n * Result of claiming an idempotency key. `owner` is the tag the claim was\n * created with, if any. Experimental: may change in a minor release.\n */\nexport type IdempotencyClaim =\n /** The caller owns the key and must perform the operation */\n | { readonly kind: 'reserved' }\n /** Same fingerprint; an earlier claim is still in flight */\n | { readonly kind: 'in-flight'; readonly owner?: string }\n /** Same fingerprint; an earlier attempt's outcome is unknown */\n | { readonly kind: 'unresolved'; readonly owner?: string }\n /** A different fingerprint, regardless of the claim's state */\n | { readonly kind: 'conflict' }\n /** Same fingerprint; replay the stored response */\n | { readonly kind: 'replay'; readonly status: number; readonly body: unknown };\n\n/**\n * An idempotency claim's outcome. `body` must be JSON-serializable.\n * Experimental: may change in a minor release.\n */\nexport type IdempotencyUpdate =\n /** Store the response for later claims with the same fingerprint to replay */\n | { readonly kind: 'completed'; readonly status: number; readonly body: unknown }\n /** Keep the claim without a response and refuse retries: the operation may have run */\n | { readonly kind: 'unresolved' }\n /** Delete only if no backend call ran or the backend deduplicates by this key */\n | { readonly kind: 'released' };\n\n/** Experimental: may change in a minor release */\nexport interface AuthorizationHoldReservation {\n readonly method: AuthorizationMethodName;\n /** Identifies one authorization, unique across the store. AP2: the issuer-signed token's digest */\n readonly reference: string;\n /** Identifies a binding with at most one unreleased hold. AP2: the checkout JWT's `jti` */\n readonly bindingReference: string;\n readonly resourceId: string;\n readonly requestId: string;\n /** Non-secret operator identifiers, such as issuers; never presentations or signatures */\n readonly metadata?: Readonly<Record<string, string>>;\n}\n\n/** Experimental: may change in a minor release */\nexport type AuthorizationHoldResult =\n | { readonly kind: 'reserved' }\n /** The reference or its binding is already held; refuse the authorization */\n | { readonly kind: 'replayed'; readonly state: AuthorizationHoldState };\n\n/** Experimental: may change in a minor release */\nexport interface AuthorizationHold extends AuthorizationHoldReservation {\n readonly state: AuthorizationHoldState;\n readonly createdAt: IsoTimestamp;\n readonly updatedAt: IsoTimestamp;\n}\n\n/**\n * A purchase awaiting its payment message. Experimental: may change in a\n * minor release.\n */\nexport interface PendingTask {\n /** Unique across the store */\n readonly id: string;\n readonly protocol: ProtocolName;\n readonly resourceId: string;\n /**\n * JSON-serializable purchase input with reserved fields removed. Must not\n * contain payment proofs or authorization presentations.\n */\n readonly input: Readonly<Record<string, unknown>>;\n /** JSON-serializable data that only the adapter interprets */\n readonly adapterData?: Readonly<Record<string, unknown>>;\n /** Set and bounded by the caller */\n readonly expiresAt: IsoTimestamp;\n}\n\n/**\n * A task response last returned by its protocol adapter, saved for later reads.\n * This record does not make the task payable. Experimental: may change in a\n * minor release.\n */\nexport interface TaskRecord {\n /** Unique across the store */\n readonly id: string;\n readonly protocol: ProtocolName;\n /** Groups related tasks for listing */\n readonly groupId: string;\n /** State name defined by the adapter */\n readonly state: string;\n /** Time of the last state change; used to sort listed records */\n readonly updatedAt: IsoTimestamp;\n /**\n * JSON-serializable task response. Must not contain payment proofs or\n * authorization presentations.\n */\n readonly document: Readonly<Record<string, unknown>>;\n /** Set and bounded by the caller */\n readonly expiresAt: IsoTimestamp;\n /**\n * Mark an uncharged response for eviction at capacity. Omit this flag or\n * set it to false to protect the record from capacity eviction.\n */\n readonly evictable?: boolean;\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { x402_default, isWellKnownDevKey, findX402Network, normalizeAddress, assertPayToIsNotDevAddress, resolveX402Deployment, assertDevKeyIsLocalOnly, describeRpc, canonicalJson, X402_DEFAULT_PAYMENT_FLOW, REUSE_REJECTED_AUTHORIZATION_METADATA_KEY, SETTLE_AFTER_BACKEND_METADATA_KEY, sameAddress, LOCAL_CHAIN_ID, BAZAAR_EXTENSION_KEY, isTransactionReference, x402OfferName, CDP_FACILITATOR_URL, isEvmAddress, describeDeploymentMode } from './chunk-VHS6MGXJ.js';
|
|
2
|
-
import { exclusionNames, descriptorStatus, PACKAGE_VERSION } from './chunk-
|
|
2
|
+
import { exclusionNames, descriptorStatus, PACKAGE_VERSION } from './chunk-J3K7E4CA.js';
|
|
3
3
|
import { CommerceError, systemClock, NOOP_LOGGER, redactedErrorText, RECONCILIATION_METADATA_KEY, isCommerceError } from './chunk-MDOGXTZD.js';
|
|
4
4
|
import { LOCATOR_VERSION, eip3009Locator, computeReplayKey, permit2Locator, computePermit2ReplayKey, isoFromSeconds } from './chunk-GA3O2A7R.js';
|
|
5
5
|
import { isRecord } from './chunk-2CJNA7MS.js';
|
|
@@ -2035,6 +2035,10 @@ function createSettle(ctx, bazaar) {
|
|
|
2035
2035
|
);
|
|
2036
2036
|
}
|
|
2037
2037
|
if (sdkResult.errorReason === SETTLEMENT_PENDING_REASON || sdkResult.errorMessage?.startsWith(SETTLEMENT_PENDING_REASON) === true || UNKNOWN_OUTCOME_REASONS.has(sdkResult.errorReason ?? "") || NO_VERDICT_REASONS.has(sdkResult.errorReason ?? "") || scope.transportFailed()) {
|
|
2038
|
+
logger.warn(
|
|
2039
|
+
{ reportedReason: redactedErrorText(sdkResult.errorReason ?? "") },
|
|
2040
|
+
"x402 settle(): settlement was broadcast but could not be confirmed; outcome unknown"
|
|
2041
|
+
);
|
|
2038
2042
|
throw new CommerceError(
|
|
2039
2043
|
"PAYMENT_PROVIDER_UNAVAILABLE",
|
|
2040
2044
|
"x402 provider: settlement was broadcast but could not be confirmed",
|
|
@@ -2417,5 +2421,5 @@ function loadOptionalModule(load, missing) {
|
|
|
2417
2421
|
}
|
|
2418
2422
|
|
|
2419
2423
|
export { DEFAULT_IDS, chainIdFromCaip2, createX402PaymentProvider, parseCanonicalAmount };
|
|
2420
|
-
//# sourceMappingURL=chunk-
|
|
2421
|
-
//# sourceMappingURL=chunk-
|
|
2424
|
+
//# sourceMappingURL=chunk-TEI6GTUG.js.map
|
|
2425
|
+
//# sourceMappingURL=chunk-TEI6GTUG.js.map
|