@devlab.group/agent-commerce 2.0.0 → 2.2.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 (105) hide show
  1. package/README.md +137 -56
  2. package/dist/ap2.d.ts +2 -2
  3. package/dist/ap2.js +4 -3
  4. package/dist/ap2.js.map +1 -1
  5. package/dist/{authorization-BpbWGGrf.d.ts → authorization-CMkIuAkO.d.ts} +1 -1
  6. package/dist/chunk-2CJNA7MS.js +8 -0
  7. package/dist/chunk-2CJNA7MS.js.map +1 -0
  8. package/dist/{chunk-CKJRITWY.js → chunk-5ZYXBCDX.js} +3 -3
  9. package/dist/{chunk-CKJRITWY.js.map → chunk-5ZYXBCDX.js.map} +1 -1
  10. package/dist/{chunk-3LUJHVKX.js → chunk-6Z2H53CG.js} +5 -4
  11. package/dist/chunk-6Z2H53CG.js.map +1 -0
  12. package/dist/{chunk-53WXXIPR.js → chunk-7ZMMXZ4G.js} +6 -10
  13. package/dist/chunk-7ZMMXZ4G.js.map +1 -0
  14. package/dist/{chunk-HOZA3IWP.js → chunk-ES3V6ECS.js} +16 -6
  15. package/dist/chunk-ES3V6ECS.js.map +1 -0
  16. package/dist/chunk-HNRDZLSN.js +1398 -0
  17. package/dist/chunk-HNRDZLSN.js.map +1 -0
  18. package/dist/{chunk-SYEGCNJZ.js → chunk-IEW7NSP2.js} +23 -5
  19. package/dist/chunk-IEW7NSP2.js.map +1 -0
  20. package/dist/chunk-KA2AX5FH.js +44 -0
  21. package/dist/chunk-KA2AX5FH.js.map +1 -0
  22. package/dist/chunk-Y4RE3XYF.js +581 -0
  23. package/dist/chunk-Y4RE3XYF.js.map +1 -0
  24. package/dist/cli/ap2-MBMQHFX4.js +678 -0
  25. package/dist/cli/ap2-MBMQHFX4.js.map +1 -0
  26. package/dist/cli/chunk-2ZZOGI5I.js +1352 -0
  27. package/dist/cli/chunk-2ZZOGI5I.js.map +1 -0
  28. package/dist/cli/chunk-3EQBCFZY.js +53 -0
  29. package/dist/cli/chunk-3EQBCFZY.js.map +1 -0
  30. package/dist/cli/chunk-3M6U7ILB.js +8 -0
  31. package/dist/cli/chunk-3M6U7ILB.js.map +1 -0
  32. package/dist/cli/chunk-3MGAJ5FX.js +70 -0
  33. package/dist/cli/chunk-3MGAJ5FX.js.map +1 -0
  34. package/dist/cli/chunk-5K4XEAZV.js +113 -0
  35. package/dist/cli/chunk-5K4XEAZV.js.map +1 -0
  36. package/dist/cli/chunk-7JNYFUT3.js +256 -0
  37. package/dist/cli/chunk-7JNYFUT3.js.map +1 -0
  38. package/dist/cli/chunk-AA3FIEAR.js +27 -0
  39. package/dist/cli/chunk-AA3FIEAR.js.map +1 -0
  40. package/dist/cli/chunk-FHCFR2GS.js +17 -0
  41. package/dist/cli/chunk-FHCFR2GS.js.map +1 -0
  42. package/dist/cli/chunk-FRMLWGSS.js +8 -0
  43. package/dist/cli/chunk-FRMLWGSS.js.map +1 -0
  44. package/dist/cli/chunk-KLX2YZDG.js +1400 -0
  45. package/dist/cli/chunk-KLX2YZDG.js.map +1 -0
  46. package/dist/cli/chunk-NSPPEF5M.js +334 -0
  47. package/dist/cli/chunk-NSPPEF5M.js.map +1 -0
  48. package/dist/cli/chunk-OSTCU6ZK.js +44 -0
  49. package/dist/cli/chunk-OSTCU6ZK.js.map +1 -0
  50. package/dist/cli/chunk-QQ3WY5L3.js +271 -0
  51. package/dist/cli/chunk-QQ3WY5L3.js.map +1 -0
  52. package/dist/cli/chunk-RWVPYAKC.js +1742 -0
  53. package/dist/cli/chunk-RWVPYAKC.js.map +1 -0
  54. package/dist/cli/chunk-SPAYKVUP.js +118 -0
  55. package/dist/cli/chunk-SPAYKVUP.js.map +1 -0
  56. package/dist/cli/chunk-SS3QFF5N.js +614 -0
  57. package/dist/cli/chunk-SS3QFF5N.js.map +1 -0
  58. package/dist/cli/chunk-TPC4EJLT.js +11 -0
  59. package/dist/cli/chunk-TPC4EJLT.js.map +1 -0
  60. package/dist/cli/config-4IBGVFSP.js +11 -0
  61. package/dist/cli/config-4IBGVFSP.js.map +1 -0
  62. package/dist/cli/index.js +822 -3392
  63. package/dist/cli/index.js.map +1 -1
  64. package/dist/cli/mcp-CNWQ2MOE.js +559 -0
  65. package/dist/cli/mcp-CNWQ2MOE.js.map +1 -0
  66. package/dist/cli/near-5AY3HWYF.js +58 -0
  67. package/dist/cli/near-5AY3HWYF.js.map +1 -0
  68. package/dist/cli/provider-4BQDH56Y.js +396 -0
  69. package/dist/cli/provider-4BQDH56Y.js.map +1 -0
  70. package/dist/cli/run-5MB2D45X.js +7286 -0
  71. package/dist/cli/run-5MB2D45X.js.map +1 -0
  72. package/dist/cli/svm-3MMYFPC7.js +33 -0
  73. package/dist/cli/svm-3MMYFPC7.js.map +1 -0
  74. package/dist/cli/x402-NKR3WQDQ.js +96 -0
  75. package/dist/cli/x402-NKR3WQDQ.js.map +1 -0
  76. package/dist/{constants-BSBRlKRR.d.ts → constants-nackLItD.d.ts} +2 -1
  77. package/dist/index.d.ts +61 -40
  78. package/dist/index.js +2642 -2205
  79. package/dist/index.js.map +1 -1
  80. package/dist/mcp.d.ts +3 -3
  81. package/dist/mcp.js +15 -20
  82. package/dist/mcp.js.map +1 -1
  83. package/dist/mpp.d.ts +12 -5
  84. package/dist/mpp.js +69 -65
  85. package/dist/mpp.js.map +1 -1
  86. package/dist/near-D6C42VPE.js +58 -0
  87. package/dist/near-D6C42VPE.js.map +1 -0
  88. package/dist/networks-olfflCI_.d.ts +38 -0
  89. package/dist/{protocol-adapter-DonxfAwa.d.ts → protocol-adapter-CfxU8Z2T.d.ts} +2 -2
  90. package/dist/{runtime-CiYbgGpi.d.ts → runtime-7vLNYvmU.d.ts} +25 -3
  91. package/dist/svm-QEUAUNPQ.js +33 -0
  92. package/dist/svm-QEUAUNPQ.js.map +1 -0
  93. package/dist/x402.d.ts +76 -64
  94. package/dist/x402.js +13 -4
  95. package/dist/x402.js.map +1 -1
  96. package/package.json +22 -2
  97. package/dist/chunk-3LUJHVKX.js.map +0 -1
  98. package/dist/chunk-53WXXIPR.js.map +0 -1
  99. package/dist/chunk-HOZA3IWP.js.map +0 -1
  100. package/dist/chunk-RKBGCPCK.js +0 -733
  101. package/dist/chunk-RKBGCPCK.js.map +0 -1
  102. package/dist/chunk-SYEGCNJZ.js.map +0 -1
  103. package/dist/chunk-TWRUNWDR.js +0 -265
  104. package/dist/chunk-TWRUNWDR.js.map +0 -1
  105. package/dist/{payment-flow-DCS882tR.d.ts → guardrails-CX_jYXvZ.d.ts} +8 -8
package/README.md CHANGED
@@ -70,12 +70,24 @@ agent-commerce doctor
70
70
  ```
71
71
 
72
72
  Requires **Node >= 22**. The package includes the `agent-commerce` CLI
73
- (`init`, `validate`, `doctor`, `demo`, `import openapi`, `version`) and a library
74
- for embedding the gateway.
73
+ (`init`, `validate`, `start`, `doctor`, `demo`, `import openapi`, `version`) and
74
+ a library for embedding the gateway.
75
75
  The default install excludes optional protocol, payment and authorization
76
76
  peers. The OpenAPI parser is a regular dependency because import is part of the
77
77
  CLI.
78
78
 
79
+ ```bash
80
+ agent-commerce start --config config.yaml --env-file .env
81
+ ```
82
+
83
+ `start` runs the configured gateway in the foreground until SIGTERM or SIGINT.
84
+ Install the optional peers for the features you enable, listed below. Missing
85
+ startup imports stop the gateway with an error naming the package; missing
86
+ Solana, NEAR or CDP peers fail provider health checks or payment requests.
87
+ `start`, `validate` and `doctor` accept `--env-file <path>` to load environment
88
+ variables before reading the config. Variables already set in the environment
89
+ take precedence. To embed the gateway in your own process, use the library:
90
+
79
91
  ```ts
80
92
  import { createGateway, loadConfig, receipts } from '@devlab.group/agent-commerce';
81
93
 
@@ -98,17 +110,20 @@ const { url } = await gateway.listen();
98
110
  Components with extra dependencies use separate subpaths, so a gateway serving
99
111
  free HTTP resources does not install MCP, EVM, JOSE or SD-JWT packages.
100
112
 
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 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.
113
+ | You want | Install | Import |
114
+ | --------------------------------------- | ------------------------------------ | ------------------------------------------ |
115
+ | gateway, config, receipts, A2A/ACP, CLI | `@devlab.group/agent-commerce` | `from '@devlab.group/agent-commerce'` |
116
+ | expose resources as MCP tools | `+ @modelcontextprotocol/server` | `from '@devlab.group/agent-commerce/mcp'` |
117
+ | accept x402 payments | `+ @x402/core @x402/evm viem` | `from '@devlab.group/agent-commerce/x402'` |
118
+ | accept x402 on Solana | x402 peers `+ @x402/svm @solana/kit` | (no import - loaded for a Solana offer) |
119
+ | accept x402 on NEAR | x402 peers `+ @x402/near` | (no import - loaded for a NEAR offer) |
120
+ | accept MPP payments | `+ mppx viem @x402/core @x402/evm` | `from '@devlab.group/agent-commerce/mpp'` |
121
+ | verify AP2 mandates, sign checkout JWTs | `+ jose @sd-jwt/core canonicalize` | `from '@devlab.group/agent-commerce/ap2'` |
122
+ | authenticate to a CDP facilitator | `+ @coinbase/x402` | (no import - loaded on demand) |
123
+
124
+ The x402 entry needs `@x402/core`, `@x402/evm` and `viem` even when every
125
+ offer is on Solana or NEAR. MPP settles through an x402 facilitator, so its
126
+ entry also needs the x402 peers.
112
127
 
113
128
  ```bash
114
129
  npm install @devlab.group/agent-commerce @modelcontextprotocol/server @x402/core @x402/evm viem
@@ -132,6 +147,24 @@ missing package.
132
147
  `facilitator.auth.type: cdp` and brings the larger CDP dependency tree. A
133
148
  facilitator with a static token can use `auth.type: bearer` without it.
134
149
 
150
+ ## Integrate with an AI coding agent
151
+
152
+ The repository includes an experimental [Agent Skills](https://agentskills.io)
153
+ skill, [`skills/agent-commerce`](skills/agent-commerce/SKILL.md), for adding the
154
+ gateway to an existing API. It covers Base Sepolia configuration, startup and
155
+ checks through an unpaid 402 challenge. Its instructions keep secrets out of
156
+ chat and leave payment signing to the user. The skill has automated CLI and
157
+ config checks.
158
+
159
+ ```text
160
+ # Claude Code
161
+ /plugin marketplace add devlab-group/agent-commerce
162
+ /plugin install agent-commerce@agent-commerce
163
+
164
+ # Codex, Cursor and other agents (a third-party installer)
165
+ DISABLE_TELEMETRY=1 npx skills add devlab-group/agent-commerce --skill agent-commerce
166
+ ```
167
+
135
168
  ## Quickstart
136
169
 
137
170
  Requirements: **Node >= 22**, **npm 10**, **Docker**. Nothing else - no API
@@ -160,6 +193,21 @@ gateway and a dashboard.
160
193
 
161
194
  To stop and wipe state: `docker compose down -v`.
162
195
 
196
+ ### `agent-commerce demo`
197
+
198
+ From a repository clone, one command starts the stack and runs the buyer agent:
199
+
200
+ ```bash
201
+ npm run agent-commerce -- demo
202
+ ```
203
+
204
+ It starts the stack with `docker compose up --build --detach --wait`, which
205
+ returns once every service with a health check is healthy, then runs
206
+ `npm run demo:agent`. A failing step stops the run with exit code 1, after
207
+ printing the end of its error output and the command to rerun it by hand.
208
+ `demo` does not run `doctor`. The Linux note above applies, and the stack
209
+ keeps running in the background until `docker compose down -v`.
210
+
163
211
  ## How it works
164
212
 
165
213
  ```text
@@ -231,25 +279,25 @@ See [docs/configuration.md](docs/configuration.md).
231
279
 
232
280
  ## Protocol support
233
281
 
234
- | Protocol | Status | Pinned revision |
235
- | -------- | ------------ | ------------------------------------------------------------------------- |
236
- | **HTTP** | Supported | native routes |
237
- | **MCP** | Supported | `2026-07-28` and `2025-11-25`, `@modelcontextprotocol/server@2.3.0` |
238
- | **x402** | Supported | x402 v2 (`@x402/core`, `@x402/evm`), scheme `exact`, EVM |
239
- | **MPP** | Experimental | `mppx@0.13.1`, `charge` + `evm` + EIP-3009, USDC on Base Sepolia and Base |
240
- | **A2A** | Experimental | A2A v1.0.1, binding `JSONRPC`, method `SendMessage`, x402 extension |
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
282
+ | Protocol | Status | Pinned revision |
283
+ | -------- | ------------ | ------------------------------------------------------------------------------------------------------------ |
284
+ | **HTTP** | Supported | native routes |
285
+ | **MCP** | Supported | `2026-07-28` and `2025-11-25`, `@modelcontextprotocol/server@2.3.0` |
286
+ | **x402** | Supported | x402 v2 (`@x402/core`, `@x402/evm`, `@x402/svm`, `@x402/near`), scheme `exact`, EVM and Solana; NEAR partial |
287
+ | **MPP** | Experimental | `mppx@0.13.1`, `charge` + `evm` + EIP-3009, USDC on Base Sepolia and Base |
288
+ | **A2A** | Experimental | A2A v1.0.1, binding `JSONRPC`, method `SendMessage`, x402 extension |
289
+ | **ACP** | Experimental | ACP `2026-04-17`, REST checkout + discovery |
290
+ | **AP2** | Experimental | AP2 `v0.2.0`, Direct Checkout Mandate verification |
291
+ | UCP | Planned | no implementation |
292
+
293
+ [AP2](docs/protocols/ap2.md) is an authorization method, not a transport. It verifies a
246
294
  mandate before a paid resource settles; the gateway does not issue the mandate
247
295
  or its Checkout Receipt.
248
296
 
249
297
  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.
298
+ [A2A](docs/protocols/a2a.md), [ACP](docs/protocols/acp.md),
299
+ [AP2](docs/protocols/ap2.md#not-implemented) and [MPP](docs/protocols/mpp.md). Supported
300
+ [MCP](docs/protocols/mcp.md) and [x402](docs/protocols/x402.md) are also scoped.
253
301
  ACP exposes only its five checkout operations; merchant `payment_data` is never
254
302
  converted into a gateway payment proof.
255
303
 
@@ -257,6 +305,15 @@ converted into a gateway payment proof.
257
305
  `unsupported` for registered adapters and providers. `agent-commerce doctor`
258
306
  prints the `unsupported` lists for A2A, ACP and AP2 when they are enabled.
259
307
 
308
+ ### Versioning
309
+
310
+ Minor releases may break experimental configurations, integrations or types.
311
+ This applies to MPP, A2A, ACP, AP2 and `agent-commerce import openapi`.
312
+ Runtime adapters and providers report `status: experimental` in
313
+ `GET /.well-known/agent-commerce`. Pin an exact version and test upgrades
314
+ before deploying them. Since 2.1, some supported x402 behavior and types
315
+ differ from 2.0; see [Upgrading from 2.0 to 2.x](docs/migration-2.1.md).
316
+
260
317
  ## Payment model
261
318
 
262
319
  - **Non-custodial.** Buyer payments go directly to the merchant address in
@@ -264,9 +321,9 @@ prints the `unsupported` lists for A2A, ACP and AP2 when they are enabled.
264
321
  private keys. Local facilitator mode does hold a separate gas-paying signer.
265
322
  - **Fail closed.** Missing, malformed, expired, replayed, wrong-amount,
266
323
  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.
324
+ - **Replay-safe twice over.** The EIP-3009 or Permit2 nonce stops a double
325
+ spend on-chain; the gateway additionally reserves a `replayKey` derived from
326
+ the authorization before it settles anything.
270
327
  - **On-chain settlement in CI.** The end-to-end test asserts the buyer's balance
271
328
  falls and the merchant's rises by exactly the price, with a real transaction
272
329
  hash in the receipt. A log line saying "payment successful" would not count.
@@ -288,21 +345,30 @@ Choose the network in config; Base mainnet also requires `allowMainnet: true`.
288
345
  These transactions each moved 0.01 USDC from a buyer to a merchant through a
289
346
  remote facilitator:
290
347
 
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.
348
+ | Rail | Network | Method | Transaction |
349
+ | ---- | ------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
350
+ | x402 | Base Sepolia | EIP-3009 | [`0xea41b234c4…`](https://sepolia.basescan.org/tx/0xea41b234c4645a4d335589ec9753646aa7cccd1b97e9e15823b88bff7b54a247) |
351
+ | x402 | Base Sepolia | Permit2 | [`0xa66f56cf39…`](https://sepolia.basescan.org/tx/0xa66f56cf39daeae958b5067c99383da4974c2ae6450786c0f9088700fa6439fe) |
352
+ | x402 | Base | EIP-3009 | [`0x57ec81c2a3…`](https://basescan.org/tx/0x57ec81c2a360d14d59a43cf4e24be09a6bd75cbe6185016372895bda73e42763) |
353
+ | x402 | Base | Permit2 | [`0x79d3da1145…`](https://basescan.org/tx/0x79d3da114522d4b056b29fad34d6492ce5662b92efd8ef2fd1ac21295ab71a42) |
354
+ | x402 | Solana Devnet | SPL transfer | [`5289xbeyHJ…`](https://explorer.solana.com/tx/5289xbeyHJPX1vX9DsLwGGJaGJJCH45qUtArhoTyxdgmWbXqZSjVPuJ3jyyLG4VrT9mFTCkLKhcoNfb1tuJ5qheb?cluster=devnet) |
355
+ | x402 | Solana | SPL transfer | [`E7gAuG8pMA…`](https://explorer.solana.com/tx/E7gAuG8pMArQjgRvGCwqm6S4qpt4xFNuhUTxeaZ5M1M1z1VA8eybyJJAXyo9paecCKnyrxYEuppoAemhntnnzTa) |
356
+ | x402 | NEAR Testnet | NEP-141 transfer | [`5tdtGLv4TB…`](https://testnet.nearblocks.io/txns/5tdtGLv4TBifK7c12hEdRuvxvNNrWjcWDH4e1ApUcE1W) |
357
+ | x402 | NEAR | NEP-141 transfer | [`7hU3imHepV…`](https://nearblocks.io/txns/7hU3imHepVZazGv53QfWYMGnWX5sVFxJAepemmwVSzt2) |
358
+ | MPP | Base Sepolia | EIP-3009 | [`0x5d9fcd111b…`](https://sepolia.basescan.org/tx/0x5d9fcd111b615bb8fc9e56d55096f119fc81c3c72c334f813cfaecee402d0ac3) |
359
+ | MPP | Base | EIP-3009 | [`0xf4255bd7ec…`](https://basescan.org/tx/0xf4255bd7ec46ed06505dedfb5f9537924bd2633816e7952ec6f2b468395b1087) |
360
+
361
+ Facilitators broadcast these payments and paid their ETH, SOL or NEAR fees.
362
+ Permit2 requires an initial, gas-paying token approval from the buyer. The
363
+ NEAR runs used the suite's SDK facilitator and relayer; support remains
364
+ partial pending hosted-facilitator settlement. Buyer and merchant keys stayed
365
+ outside the gateway. The smoke suites verified settlement on-chain.
302
366
 
303
367
  Reproduce with `npm run test:testnet`, which spends test USDC, or
304
368
  `npm run test:mainnet`, which spends real USDC. Both run only by hand; see
305
- [Base mainnet](#base-mainnet).
369
+ [Base mainnet](#base-mainnet) and [smoke tests](docs/smoke-tests.md). The
370
+ suites also cover NEAR testnet and mainnet (settled) and Arbitrum Sepolia (not
371
+ yet run).
306
372
 
307
373
  ### The facilitator model
308
374
 
@@ -348,10 +414,9 @@ from [faucet.circle.com](https://faucet.circle.com); the buyer needs no ETH.
348
414
  `npm run test:testnet` drives the whole flow and reads the result back off the
349
415
  chain.
350
416
 
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`.
417
+ The local dev chain is `eip155:31337`, Anvil's default chain id, so the network
418
+ says whether a deployment is local, testnet or mainnet. `doctor`, `health()`
419
+ and `/.well-known` report it.
355
420
 
356
421
  ### Base mainnet
357
422
 
@@ -390,19 +455,32 @@ PASS Protocols http=on mcp=on (/mcp) a2a=off acp=off
390
455
  INFO A2A disabled
391
456
  INFO ACP disabled
392
457
  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)
458
+ PASS Payments x402 v2 (scheme=exact) enabled - LOCAL dev chain (eip155:31337), destination=0x7099…79C8, facilitator=local (in-process), paymentFlow=authorization
394
459
  INFO Payments (MPP) MPP not configured
395
- PASS Storage sqlite schema v2 writable; receipts=2
460
+ PASS Storage sqlite schema v3 writable; receipts=2
396
461
  PASS Protocol versions reported by gateway /.well-known/agent-commerce
397
462
 
398
463
  Score: 7/7 checks passed
399
464
  ```
400
465
 
401
- `doctor` cross-checks the gateway's live settlement configuration against the
402
- resolved local config and fails if they differ.
466
+ `doctor` compares live settlement terms with local config for each rail and
467
+ resource: offer order, network, token, payee and transfer method, plus decimals
468
+ and payment flows when published. Mismatches fail the check. It also names
469
+ failing offers when health is published; reasons appear in gateway debug logs.
403
470
 
404
471
  Exits non-zero if anything fails. `--json` for machines.
405
472
 
473
+ ### `agent-commerce version`
474
+
475
+ ```bash
476
+ npm run agent-commerce -- version
477
+ ```
478
+
479
+ Prints the CLI version and, for each protocol SDK and runtime library, the
480
+ version the package declares and the area that uses it. These are the pins in
481
+ `package.json`, optional peers included, not the versions installed in
482
+ `node_modules`. `agent-commerce --version` prints the CLI version alone.
483
+
406
484
  ## Exposure and access
407
485
 
408
486
  The demo binds everything to `127.0.0.1`. Before putting the gateway anywhere
@@ -434,10 +512,11 @@ See [CONTRIBUTING.md](CONTRIBUTING.md).
434
512
 
435
513
  ## Roadmap
436
514
 
437
- **Now** - MCP, x402 v2, settlement on the local chain, Base Sepolia and Base
438
- mainnet, receipts, doctor, deterministic demo, experimental A2A v1.0.1 and ACP
439
- `2026-04-17` checkout adapters, experimental AP2 v0.2.0 mandate verification,
440
- experimental MPP `charge` payments, and experimental OpenAPI import.
515
+ **Now** - MCP, x402 v2, settlement on the local chain, Base Sepolia, Base
516
+ mainnet, Solana devnet and Solana mainnet, receipts, doctor, deterministic
517
+ demo, experimental A2A v1.0.1 and ACP `2026-04-17` checkout adapters,
518
+ experimental AP2 v0.2.0 mandate verification, experimental MPP `charge`
519
+ payments, and experimental OpenAPI import.
441
520
 
442
521
  **Next** - a `doctor` GitHub Action · UCP ·
443
522
  autonomous-mode AP2 (open mandates, agent key binding, constraint evaluation) ·
@@ -454,8 +533,10 @@ they are added to a release.
454
533
  | [Architecture](docs/architecture.md) | how the pieces fit |
455
534
  | [Payment flow](docs/payment-flow.md) | the paid round trip and failure paths |
456
535
  | [Protocols](docs/protocols.md) | supported and unsupported protocol features |
457
- | [AP2](docs/ap2.md) | mandate verification and the trust model |
536
+ | [AP2](docs/protocols/ap2.md) | mandate verification and the trust model |
458
537
  | [Configuration](docs/configuration.md) | `config.yaml` reference |
538
+ | [Upgrading from 2.0](docs/migration-2.1.md) | changes that can break a 2.0 setup |
539
+ | [Smoke tests](docs/smoke-tests.md) | settling on public networks, by hand |
459
540
  | [OpenAPI import](docs/openapi-import.md) | generate resources from an existing API |
460
541
  | [Security model](docs/security.md) | trust boundaries, and what we do not defend |
461
542
  | [Contracts](docs/contracts.md) | the frozen cross-area contract |
package/dist/ap2.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { E as EnabledAp2Config } from './types-CVw6Sf46.js';
2
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-BpbWGGrf.js';
4
- import { C as Clock, L as Logger } from './runtime-CiYbgGpi.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
package/dist/ap2.js CHANGED
@@ -1,6 +1,7 @@
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-SYEGCNJZ.js';
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-SYEGCNJZ.js';
3
- import { systemClock, NOOP_LOGGER, CommerceError, isRecord, PACKAGE_VERSION } from './chunk-53WXXIPR.js';
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-IEW7NSP2.js';
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-IEW7NSP2.js';
3
+ import { systemClock, NOOP_LOGGER, CommerceError, PACKAGE_VERSION } from './chunk-7ZMMXZ4G.js';
4
+ import { isRecord } from './chunk-2CJNA7MS.js';
4
5
  import { SignJWT, importPKCS8, importJWK, jwtVerify, decodeProtectedHeader, decodeJwt } from 'jose';
5
6
  import canonicalize from 'canonicalize';
6
7
  import { createHash } from 'crypto';