@devlab.group/agent-commerce 1.6.1 → 2.1.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.
Files changed (57) hide show
  1. package/LICENSE +187 -2
  2. package/README.md +105 -54
  3. package/dist/ap2.d.ts +4 -4
  4. package/dist/ap2.js +95 -28
  5. package/dist/ap2.js.map +1 -1
  6. package/dist/{authorization-BpbWGGrf.d.ts → authorization-CMkIuAkO.d.ts} +1 -1
  7. package/dist/chunk-2CJNA7MS.js +8 -0
  8. package/dist/chunk-2CJNA7MS.js.map +1 -0
  9. package/dist/chunk-5ZYXBCDX.js +113 -0
  10. package/dist/chunk-5ZYXBCDX.js.map +1 -0
  11. package/dist/{chunk-V2V2E7HX.js → chunk-6Z2H53CG.js} +7 -6
  12. package/dist/chunk-6Z2H53CG.js.map +1 -0
  13. package/dist/chunk-ES3V6ECS.js +125 -0
  14. package/dist/chunk-ES3V6ECS.js.map +1 -0
  15. package/dist/chunk-IFGRCXME.js +581 -0
  16. package/dist/chunk-IFGRCXME.js.map +1 -0
  17. package/dist/chunk-KA2AX5FH.js +44 -0
  18. package/dist/chunk-KA2AX5FH.js.map +1 -0
  19. package/dist/{chunk-VKDXMXHL.js → chunk-LZS5BL3W.js} +3 -3
  20. package/dist/{chunk-VKDXMXHL.js.map → chunk-LZS5BL3W.js.map} +1 -1
  21. package/dist/{chunk-N5KRK7YA.js → chunk-SY6GUYSQ.js} +6 -10
  22. package/dist/chunk-SY6GUYSQ.js.map +1 -0
  23. package/dist/chunk-UHMYRV3J.js +1396 -0
  24. package/dist/chunk-UHMYRV3J.js.map +1 -0
  25. package/dist/cli/index.js +2980 -1964
  26. package/dist/cli/index.js.map +1 -1
  27. package/dist/{constants-Bkq04FRZ.d.ts → constants-nackLItD.d.ts} +4 -3
  28. package/dist/{guardrails-71XwtXlT.d.ts → guardrails-CX_jYXvZ.d.ts} +9 -1
  29. package/dist/index.d.ts +88 -49
  30. package/dist/index.js +3432 -2161
  31. package/dist/index.js.map +1 -1
  32. package/dist/mcp.d.ts +3 -3
  33. package/dist/mcp.js +252 -94
  34. package/dist/mcp.js.map +1 -1
  35. package/dist/mpp.d.ts +15 -4
  36. package/dist/mpp.js +115 -74
  37. package/dist/mpp.js.map +1 -1
  38. package/dist/near-D6C42VPE.js +58 -0
  39. package/dist/near-D6C42VPE.js.map +1 -0
  40. package/dist/networks-olfflCI_.d.ts +38 -0
  41. package/dist/{protocol-adapter-DTkrXTev.d.ts → protocol-adapter-CfxU8Z2T.d.ts} +4 -2
  42. package/dist/{runtime-CiYbgGpi.d.ts → runtime-7vLNYvmU.d.ts} +25 -3
  43. package/dist/svm-QEUAUNPQ.js +33 -0
  44. package/dist/svm-QEUAUNPQ.js.map +1 -0
  45. package/dist/{types-O6lg3Q5V.d.ts → types-CVw6Sf46.d.ts} +11 -0
  46. package/dist/x402.d.ts +78 -63
  47. package/dist/x402.js +13 -4
  48. package/dist/x402.js.map +1 -1
  49. package/package.json +36 -13
  50. package/dist/chunk-AFI2CEZS.js +0 -10
  51. package/dist/chunk-AFI2CEZS.js.map +0 -1
  52. package/dist/chunk-CBJIT7QP.js +0 -258
  53. package/dist/chunk-CBJIT7QP.js.map +0 -1
  54. package/dist/chunk-JKEKKXRJ.js +0 -680
  55. package/dist/chunk-JKEKKXRJ.js.map +0 -1
  56. package/dist/chunk-N5KRK7YA.js.map +0 -1
  57. package/dist/chunk-V2V2E7HX.js.map +0 -1
package/LICENSE CHANGED
@@ -1,7 +1,194 @@
1
+
1
2
  Apache License
2
3
  Version 2.0, January 2004
3
4
  http://www.apache.org/licenses/
4
5
 
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
5
192
  Licensed under the Apache License, Version 2.0 (the "License");
6
193
  you may not use this file except in compliance with the License.
7
194
  You may obtain a copy of the License at
@@ -13,5 +200,3 @@
13
200
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
201
  See the License for the specific language governing permissions and
15
202
  limitations under the License.
16
-
17
- Full text: https://www.apache.org/licenses/LICENSE-2.0.txt
package/README.md CHANGED
@@ -98,20 +98,23 @@ const { url } = await gateway.listen();
98
98
  Components with extra dependencies use separate subpaths, so a gateway serving
99
99
  free HTTP resources does not install MCP, EVM, JOSE or SD-JWT packages.
100
100
 
101
- | You want | Install | Import |
102
- | --------------------------------------- | ---------------------------------- | ------------------------------------------ |
103
- | gateway, config, receipts, A2A/ACP, CLI | `@devlab.group/agent-commerce` | `from '@devlab.group/agent-commerce'` |
104
- | expose resources as MCP tools | `+ @modelcontextprotocol/sdk` | `from '@devlab.group/agent-commerce/mcp'` |
105
- | accept x402 payments | `+ @x402/core @x402/evm viem` | `from '@devlab.group/agent-commerce/x402'` |
106
- | accept MPP payments | `+ mppx viem @x402/core @x402/evm` | `from '@devlab.group/agent-commerce/mpp'` |
107
- | verify AP2 mandates, sign checkout JWTs | `+ jose @sd-jwt/core canonicalize` | `from '@devlab.group/agent-commerce/ap2'` |
108
- | authenticate to a CDP facilitator | `+ @coinbase/x402` | (no import - loaded on demand) |
109
-
110
- MPP settles through an x402 facilitator, so its entry also needs the x402
111
- peers.
101
+ | You want | Install | Import |
102
+ | --------------------------------------- | ------------------------------------ | ------------------------------------------ |
103
+ | gateway, config, receipts, A2A/ACP, CLI | `@devlab.group/agent-commerce` | `from '@devlab.group/agent-commerce'` |
104
+ | expose resources as MCP tools | `+ @modelcontextprotocol/server` | `from '@devlab.group/agent-commerce/mcp'` |
105
+ | accept x402 payments | `+ @x402/core @x402/evm viem` | `from '@devlab.group/agent-commerce/x402'` |
106
+ | accept x402 on Solana | x402 peers `+ @x402/svm @solana/kit` | (no import - loaded for a Solana offer) |
107
+ | accept x402 on NEAR | x402 peers `+ @x402/near` | (no import - loaded for a NEAR offer) |
108
+ | accept MPP payments | `+ mppx viem @x402/core @x402/evm` | `from '@devlab.group/agent-commerce/mpp'` |
109
+ | verify AP2 mandates, sign checkout JWTs | `+ jose @sd-jwt/core canonicalize` | `from '@devlab.group/agent-commerce/ap2'` |
110
+ | authenticate to a CDP facilitator | `+ @coinbase/x402` | (no import - loaded on demand) |
111
+
112
+ The x402 entry needs `@x402/core`, `@x402/evm` and `viem` even when every
113
+ offer is on Solana or NEAR. MPP settles through an x402 facilitator, so its
114
+ entry also needs the x402 peers.
112
115
 
113
116
  ```bash
114
- npm install @devlab.group/agent-commerce @modelcontextprotocol/sdk @x402/core @x402/evm viem
117
+ npm install @devlab.group/agent-commerce @modelcontextprotocol/server @x402/core @x402/evm viem
115
118
  ```
116
119
 
117
120
  ```ts
@@ -160,6 +163,21 @@ gateway and a dashboard.
160
163
 
161
164
  To stop and wipe state: `docker compose down -v`.
162
165
 
166
+ ### `agent-commerce demo`
167
+
168
+ From a repository clone, one command starts the stack and runs the buyer agent:
169
+
170
+ ```bash
171
+ npm run agent-commerce -- demo
172
+ ```
173
+
174
+ It starts the stack with `docker compose up --build --detach --wait`, which
175
+ returns once every service with a health check is healthy, then runs
176
+ `npm run demo:agent`. A failing step stops the run with exit code 1, after
177
+ printing the end of its error output and the command to rerun it by hand.
178
+ `demo` does not run `doctor`. The Linux note above applies, and the stack
179
+ keeps running in the background until `docker compose down -v`.
180
+
163
181
  ## How it works
164
182
 
165
183
  ```text
@@ -231,25 +249,25 @@ See [docs/configuration.md](docs/configuration.md).
231
249
 
232
250
  ## Protocol support
233
251
 
234
- | Protocol | Status | Pinned revision |
235
- | -------- | ------------ | ------------------------------------------------------------------------- |
236
- | **HTTP** | Supported | native routes |
237
- | **MCP** | Supported | `@modelcontextprotocol/sdk@1.30.0` |
238
- | **x402** | Supported | x402 v2 (`@x402/core`, `@x402/evm`), scheme `exact`, EVM |
239
- | **MPP** | Experimental | `mppx@0.10.1`, `charge` + `evm` + EIP-3009, USDC on Base Sepolia and Base |
240
- | **A2A** | Experimental | A2A v1.0.0, binding `JSONRPC`, method `SendMessage` |
241
- | **ACP** | Experimental | ACP `2026-04-17`, REST checkout + discovery |
242
- | **AP2** | Experimental | AP2 `v0.2.0`, Direct Checkout Mandate verification |
243
- | UCP | Planned | no implementation |
244
-
245
- [AP2](docs/ap2.md) is an authorization method, not a transport. It verifies a
252
+ | Protocol | Status | Pinned revision |
253
+ | -------- | ------------ | ------------------------------------------------------------------------------------------------------------ |
254
+ | **HTTP** | Supported | native routes |
255
+ | **MCP** | Supported | `2026-07-28` and `2025-11-25`, `@modelcontextprotocol/server@2.3.0` |
256
+ | **x402** | Supported | x402 v2 (`@x402/core`, `@x402/evm`, `@x402/svm`, `@x402/near`), scheme `exact`, EVM and Solana; NEAR partial |
257
+ | **MPP** | Experimental | `mppx@0.13.1`, `charge` + `evm` + EIP-3009, USDC on Base Sepolia and Base |
258
+ | **A2A** | Experimental | A2A v1.0.1, binding `JSONRPC`, method `SendMessage`, x402 extension |
259
+ | **ACP** | Experimental | ACP `2026-04-17`, REST checkout + discovery |
260
+ | **AP2** | Experimental | AP2 `v0.2.0`, Direct Checkout Mandate verification |
261
+ | UCP | Planned | no implementation |
262
+
263
+ [AP2](docs/protocols/ap2.md) is an authorization method, not a transport. It verifies a
246
264
  mandate before a paid resource settles; the gateway does not issue the mandate
247
265
  or its Checkout Receipt.
248
266
 
249
267
  The experimental entries above ship off by default with documented subsets:
250
- [A2A](docs/protocols.md#a2a), [ACP](docs/protocols.md#acp),
251
- [AP2](docs/ap2.md#not-implemented) and [MPP](docs/protocols.md#mpp). Supported
252
- [MCP](docs/protocols.md#mcp) and [x402](docs/protocols.md#x402) are also scoped.
268
+ [A2A](docs/protocols/a2a.md), [ACP](docs/protocols/acp.md),
269
+ [AP2](docs/protocols/ap2.md#not-implemented) and [MPP](docs/protocols/mpp.md). Supported
270
+ [MCP](docs/protocols/mcp.md) and [x402](docs/protocols/x402.md) are also scoped.
253
271
  ACP exposes only its five checkout operations; merchant `payment_data` is never
254
272
  converted into a gateway payment proof.
255
273
 
@@ -257,6 +275,15 @@ converted into a gateway payment proof.
257
275
  `unsupported` for registered adapters and providers. `agent-commerce doctor`
258
276
  prints the `unsupported` lists for A2A, ACP and AP2 when they are enabled.
259
277
 
278
+ ### Versioning
279
+
280
+ Minor releases may break experimental configurations, integrations or types.
281
+ This applies to MPP, A2A, ACP, AP2 and `agent-commerce import openapi`.
282
+ Runtime adapters and providers report `status: experimental` in
283
+ `GET /.well-known/agent-commerce`. Pin an exact version and test upgrades
284
+ before deploying them. 2.1 also changes some supported x402 behavior and
285
+ types; see [Upgrading from 2.0](docs/migration-2.1.md).
286
+
260
287
  ## Payment model
261
288
 
262
289
  - **Non-custodial.** Buyer payments go directly to the merchant address in
@@ -264,9 +291,9 @@ prints the `unsupported` lists for A2A, ACP and AP2 when they are enabled.
264
291
  private keys. Local facilitator mode does hold a separate gas-paying signer.
265
292
  - **Fail closed.** Missing, malformed, expired, replayed, wrong-amount,
266
293
  wrong-recipient, wrong-network and wrong-asset payments are rejected.
267
- - **Replay-safe twice over.** EIP-3009 stops a double spend on-chain; the
268
- gateway additionally reserves a `replayKey` derived from the authorization
269
- before it settles anything.
294
+ - **Replay-safe twice over.** The EIP-3009 or Permit2 nonce stops a double
295
+ spend on-chain; the gateway additionally reserves a `replayKey` derived from
296
+ the authorization before it settles anything.
270
297
  - **On-chain settlement in CI.** The end-to-end test asserts the buyer's balance
271
298
  falls and the merchant's rises by exactly the price, with a real transaction
272
299
  hash in the receipt. A log line saying "payment successful" would not count.
@@ -288,21 +315,30 @@ Choose the network in config; Base mainnet also requires `allowMainnet: true`.
288
315
  These transactions each moved 0.01 USDC from a buyer to a merchant through a
289
316
  remote facilitator:
290
317
 
291
- | Rail | Network | Transaction |
292
- | ---- | ------------ | --------------------------------------------------------------------------------------------------------------------- |
293
- | x402 | Base Sepolia | [`0xea41b234c4…`](https://sepolia.basescan.org/tx/0xea41b234c4645a4d335589ec9753646aa7cccd1b97e9e15823b88bff7b54a247) |
294
- | x402 | Base | [`0x57ec81c2a3…`](https://basescan.org/tx/0x57ec81c2a360d14d59a43cf4e24be09a6bd75cbe6185016372895bda73e42763) |
295
- | MPP | Base Sepolia | [`0x5d9fcd111b…`](https://sepolia.basescan.org/tx/0x5d9fcd111b615bb8fc9e56d55096f119fc81c3c72c334f813cfaecee402d0ac3) |
296
- | MPP | Base | [`0xf4255bd7ec…`](https://basescan.org/tx/0xf4255bd7ec46ed06505dedfb5f9537924bd2633816e7952ec6f2b468395b1087) |
297
-
298
- The buyer signed each EIP-3009 authorization without ETH; the remote facilitator
299
- paid gas and broadcast it. The gateway path received no buyer or merchant key.
300
- The public-network smoke suites verify balance changes and fetch the transaction
301
- receipt from the chain instead of trusting the gateway's response.
318
+ | Rail | Network | Method | Transaction |
319
+ | ---- | ------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
320
+ | x402 | Base Sepolia | EIP-3009 | [`0xea41b234c4…`](https://sepolia.basescan.org/tx/0xea41b234c4645a4d335589ec9753646aa7cccd1b97e9e15823b88bff7b54a247) |
321
+ | x402 | Base Sepolia | Permit2 | [`0xa66f56cf39…`](https://sepolia.basescan.org/tx/0xa66f56cf39daeae958b5067c99383da4974c2ae6450786c0f9088700fa6439fe) |
322
+ | x402 | Base | EIP-3009 | [`0x57ec81c2a3…`](https://basescan.org/tx/0x57ec81c2a360d14d59a43cf4e24be09a6bd75cbe6185016372895bda73e42763) |
323
+ | x402 | Base | Permit2 | [`0x79d3da1145…`](https://basescan.org/tx/0x79d3da114522d4b056b29fad34d6492ce5662b92efd8ef2fd1ac21295ab71a42) |
324
+ | x402 | Solana Devnet | SPL transfer | [`5289xbeyHJ…`](https://explorer.solana.com/tx/5289xbeyHJPX1vX9DsLwGGJaGJJCH45qUtArhoTyxdgmWbXqZSjVPuJ3jyyLG4VrT9mFTCkLKhcoNfb1tuJ5qheb?cluster=devnet) |
325
+ | x402 | Solana | SPL transfer | [`E7gAuG8pMA…`](https://explorer.solana.com/tx/E7gAuG8pMArQjgRvGCwqm6S4qpt4xFNuhUTxeaZ5M1M1z1VA8eybyJJAXyo9paecCKnyrxYEuppoAemhntnnzTa) |
326
+ | x402 | NEAR Testnet | NEP-141 transfer | [`5tdtGLv4TB…`](https://testnet.nearblocks.io/txns/5tdtGLv4TBifK7c12hEdRuvxvNNrWjcWDH4e1ApUcE1W) |
327
+ | x402 | NEAR | NEP-141 transfer | [`7hU3imHepV…`](https://nearblocks.io/txns/7hU3imHepVZazGv53QfWYMGnWX5sVFxJAepemmwVSzt2) |
328
+ | MPP | Base Sepolia | EIP-3009 | [`0x5d9fcd111b…`](https://sepolia.basescan.org/tx/0x5d9fcd111b615bb8fc9e56d55096f119fc81c3c72c334f813cfaecee402d0ac3) |
329
+ | MPP | Base | EIP-3009 | [`0xf4255bd7ec…`](https://basescan.org/tx/0xf4255bd7ec46ed06505dedfb5f9537924bd2633816e7952ec6f2b468395b1087) |
330
+
331
+ Facilitators broadcast these payments and paid their ETH, SOL or NEAR fees.
332
+ Permit2 requires an initial, gas-paying token approval from the buyer. The
333
+ NEAR runs used the suite's SDK facilitator and relayer; support remains
334
+ partial pending hosted-facilitator settlement. Buyer and merchant keys stayed
335
+ outside the gateway. The smoke suites verified settlement on-chain.
302
336
 
303
337
  Reproduce with `npm run test:testnet`, which spends test USDC, or
304
338
  `npm run test:mainnet`, which spends real USDC. Both run only by hand; see
305
- [Base mainnet](#base-mainnet).
339
+ [Base mainnet](#base-mainnet) and [smoke tests](docs/smoke-tests.md). The
340
+ suites also cover NEAR testnet and mainnet (settled) and Arbitrum Sepolia (not
341
+ yet run).
306
342
 
307
343
  ### The facilitator model
308
344
 
@@ -348,10 +384,9 @@ from [faucet.circle.com](https://faucet.circle.com); the buyer needs no ETH.
348
384
  `npm run test:testnet` drives the whole flow and reads the result back off the
349
385
  chain.
350
386
 
351
- Chain id 84532 belongs to **both** Base Sepolia and this project's local dev
352
- chain, deliberately. Nothing infers "public network" from it - `local`,
353
- `testnet` and `mainnet` are derived from the network *and* the facilitator
354
- together, and reported by `doctor`, `health()` and `/.well-known`.
387
+ The local dev chain is `eip155:31337`, Anvil's default chain id, so the network
388
+ says whether a deployment is local, testnet or mainnet. `doctor`, `health()`
389
+ and `/.well-known` report it.
355
390
 
356
391
  ### Base mainnet
357
392
 
@@ -390,7 +425,7 @@ PASS Protocols http=on mcp=on (/mcp) a2a=off acp=off
390
425
  INFO A2A disabled
391
426
  INFO ACP disabled
392
427
  INFO AP2 disabled
393
- PASS Payments x402 v2 (scheme=exact) enabled - LOCAL dev chain (eip155:84532, chain id shared with Base Sepolia), destination=0x7099…79C8, facilitator=local (in-process)
428
+ PASS Payments x402 v2 (scheme=exact) enabled - LOCAL dev chain (eip155:31337), destination=0x7099…79C8, facilitator=local (in-process), paymentFlow=authorization
394
429
  INFO Payments (MPP) MPP not configured
395
430
  PASS Storage sqlite schema v2 writable; receipts=2
396
431
  PASS Protocol versions reported by gateway /.well-known/agent-commerce
@@ -398,11 +433,24 @@ PASS Protocol versions reported by gateway /.well-known/agent-commerce
398
433
  Score: 7/7 checks passed
399
434
  ```
400
435
 
401
- `doctor` cross-checks the gateway's live settlement configuration against the
402
- resolved local config and fails if they differ.
436
+ `doctor` compares live settlement terms with local config for each rail and
437
+ resource: offer order, network, token, payee and transfer method, plus decimals
438
+ and payment flows when published. Mismatches fail the check. It also names
439
+ failing offers when health is published; reasons appear in gateway debug logs.
403
440
 
404
441
  Exits non-zero if anything fails. `--json` for machines.
405
442
 
443
+ ### `agent-commerce version`
444
+
445
+ ```bash
446
+ npm run agent-commerce -- version
447
+ ```
448
+
449
+ Prints the CLI version and, for each protocol SDK and runtime library, the
450
+ version the package declares and the area that uses it. These are the pins in
451
+ `package.json`, optional peers included, not the versions installed in
452
+ `node_modules`. `agent-commerce --version` prints the CLI version alone.
453
+
406
454
  ## Exposure and access
407
455
 
408
456
  The demo binds everything to `127.0.0.1`. Before putting the gateway anywhere
@@ -434,10 +482,11 @@ See [CONTRIBUTING.md](CONTRIBUTING.md).
434
482
 
435
483
  ## Roadmap
436
484
 
437
- **Now** - MCP, x402 v2, settlement on the local chain, Base Sepolia and Base
438
- mainnet, receipts, doctor, deterministic demo, experimental A2A v1.0.0 and ACP
439
- `2026-04-17` checkout adapters, experimental AP2 v0.2.0 mandate verification,
440
- experimental MPP `charge` payments, and experimental OpenAPI import.
485
+ **Now** - MCP, x402 v2, settlement on the local chain, Base Sepolia, Base
486
+ mainnet, Solana devnet and Solana mainnet, receipts, doctor, deterministic
487
+ demo, experimental A2A v1.0.1 and ACP `2026-04-17` checkout adapters,
488
+ experimental AP2 v0.2.0 mandate verification, experimental MPP `charge`
489
+ payments, and experimental OpenAPI import.
441
490
 
442
491
  **Next** - a `doctor` GitHub Action · UCP ·
443
492
  autonomous-mode AP2 (open mandates, agent key binding, constraint evaluation) ·
@@ -454,8 +503,10 @@ they are added to a release.
454
503
  | [Architecture](docs/architecture.md) | how the pieces fit |
455
504
  | [Payment flow](docs/payment-flow.md) | the paid round trip and failure paths |
456
505
  | [Protocols](docs/protocols.md) | supported and unsupported protocol features |
457
- | [AP2](docs/ap2.md) | mandate verification and the trust model |
506
+ | [AP2](docs/protocols/ap2.md) | mandate verification and the trust model |
458
507
  | [Configuration](docs/configuration.md) | `config.yaml` reference |
508
+ | [Upgrading from 2.0](docs/migration-2.1.md) | changes that can break a 2.0 setup |
509
+ | [Smoke tests](docs/smoke-tests.md) | settling on public networks, by hand |
459
510
  | [OpenAPI import](docs/openapi-import.md) | generate resources from an existing API |
460
511
  | [Security model](docs/security.md) | trust boundaries, and what we do not defend |
461
512
  | [Contracts](docs/contracts.md) | the frozen cross-area contract |
package/dist/ap2.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { E as EnabledAp2Config } from './types-O6lg3Q5V.js';
2
- export { A as AP2_CHECKOUT_MANDATE_VCT, a as AP2_CHECKOUT_PROFILE, b as AP2_DEFAULT_CLOCK_SKEW_SECONDS, c as AP2_MAX_CLOCK_SKEW_SECONDS, d as AP2_SIGNING_ALGORITHM, e as AP2_SPEC_VERSION, f as Ap2AuthorizationConfig, g as Ap2Mode, h as Ap2TrustedIssuer, i as Ap2TrustedKey } from './types-O6lg3Q5V.js';
3
- import { A as AuthorizationProvider } from './authorization-BpbWGGrf.js';
4
- import { C as Clock, L as Logger } from './runtime-CiYbgGpi.js';
1
+ import { E as EnabledAp2Config } from './types-CVw6Sf46.js';
2
+ export { A as AP2_CHECKOUT_MANDATE_VCT, a as AP2_CHECKOUT_PROFILE, b as AP2_DEFAULT_CLOCK_SKEW_SECONDS, c as AP2_MAX_CLOCK_SKEW_SECONDS, d as AP2_SIGNING_ALGORITHM, e as AP2_SPEC_VERSION, f as Ap2AuthorizationConfig, g as Ap2Mode, h as Ap2TrustedIssuer, i as Ap2TrustedKey } from './types-CVw6Sf46.js';
3
+ import { A as AuthorizationProvider } from './authorization-CMkIuAkO.js';
4
+ import { C as Clock, L as Logger } from './runtime-7vLNYvmU.js';
5
5
 
6
6
  /**
7
7
  * A private ES256 key: either a private JWK (the pair of the public one in the