@agent-score/commerce 2.3.0 → 2.5.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 (80) hide show
  1. package/README.md +6 -6
  2. package/dist/challenge/index.d.mts +9 -5
  3. package/dist/challenge/index.d.ts +9 -5
  4. package/dist/challenge/index.js +11 -4
  5. package/dist/challenge/index.js.map +1 -1
  6. package/dist/challenge/index.mjs +11 -4
  7. package/dist/challenge/index.mjs.map +1 -1
  8. package/dist/{checkout-ChyOi7aU.d.ts → checkout-McfNpZJf.d.ts} +80 -12
  9. package/dist/{checkout-Ceo1_rVJ.d.mts → checkout-o17dIxHi.d.mts} +80 -12
  10. package/dist/core.d.mts +27 -7
  11. package/dist/core.d.ts +27 -7
  12. package/dist/core.js +25 -11
  13. package/dist/core.js.map +1 -1
  14. package/dist/core.mjs +25 -11
  15. package/dist/core.mjs.map +1 -1
  16. package/dist/discovery/index.d.mts +26 -10
  17. package/dist/discovery/index.d.ts +26 -10
  18. package/dist/discovery/index.js +58 -10
  19. package/dist/discovery/index.js.map +1 -1
  20. package/dist/discovery/index.mjs +58 -10
  21. package/dist/discovery/index.mjs.map +1 -1
  22. package/dist/gate-CWP10xPQ.d.mts +339 -0
  23. package/dist/gate-CWP10xPQ.d.ts +339 -0
  24. package/dist/identity/express.d.mts +26 -1
  25. package/dist/identity/express.d.ts +26 -1
  26. package/dist/identity/express.js +599 -25
  27. package/dist/identity/express.js.map +1 -1
  28. package/dist/identity/express.mjs +595 -24
  29. package/dist/identity/express.mjs.map +1 -1
  30. package/dist/identity/fastify.d.mts +12 -2
  31. package/dist/identity/fastify.d.ts +12 -2
  32. package/dist/identity/fastify.js +607 -25
  33. package/dist/identity/fastify.js.map +1 -1
  34. package/dist/identity/fastify.mjs +603 -24
  35. package/dist/identity/fastify.mjs.map +1 -1
  36. package/dist/identity/hono.d.mts +26 -1
  37. package/dist/identity/hono.d.ts +26 -1
  38. package/dist/identity/hono.js +588 -25
  39. package/dist/identity/hono.js.map +1 -1
  40. package/dist/identity/hono.mjs +584 -24
  41. package/dist/identity/hono.mjs.map +1 -1
  42. package/dist/identity/nextjs.d.mts +3 -0
  43. package/dist/identity/nextjs.d.ts +3 -0
  44. package/dist/identity/nextjs.js +593 -25
  45. package/dist/identity/nextjs.js.map +1 -1
  46. package/dist/identity/nextjs.mjs +589 -24
  47. package/dist/identity/nextjs.mjs.map +1 -1
  48. package/dist/identity/policy.js.map +1 -1
  49. package/dist/identity/policy.mjs.map +1 -1
  50. package/dist/identity/web.d.mts +24 -1
  51. package/dist/identity/web.d.ts +24 -1
  52. package/dist/identity/web.js +593 -25
  53. package/dist/identity/web.js.map +1 -1
  54. package/dist/identity/web.mjs +589 -24
  55. package/dist/identity/web.mjs.map +1 -1
  56. package/dist/index.d.mts +129 -14
  57. package/dist/index.d.ts +129 -14
  58. package/dist/index.js +978 -99
  59. package/dist/index.js.map +1 -1
  60. package/dist/index.mjs +956 -99
  61. package/dist/index.mjs.map +1 -1
  62. package/dist/{default_rails-DtR_E9N9.d.ts → network_kind-BIJM2peR.d.ts} +22 -8
  63. package/dist/{default_rails-K25PtWrL.d.mts → network_kind-C0EMkdzz.d.mts} +22 -8
  64. package/dist/payment/index.d.mts +16 -26
  65. package/dist/payment/index.d.ts +16 -26
  66. package/dist/payment/index.js +62 -57
  67. package/dist/payment/index.js.map +1 -1
  68. package/dist/payment/index.mjs +62 -57
  69. package/dist/payment/index.mjs.map +1 -1
  70. package/dist/{pricing-B3-aKxSz.d.ts → pricing-CytRwhC2.d.ts} +1 -1
  71. package/dist/{pricing-BReyZiqN.d.mts → pricing-KHDqMLd7.d.mts} +1 -1
  72. package/dist/{rail_spec-B1239jPp.d.mts → rail_spec-BFZmW9RN.d.mts} +3 -4
  73. package/dist/{rail_spec-B1239jPp.d.ts → rail_spec-BFZmW9RN.d.ts} +3 -4
  74. package/dist/stripe-multichain/index.d.mts +2 -9
  75. package/dist/stripe-multichain/index.d.ts +2 -9
  76. package/dist/stripe-multichain/index.js.map +1 -1
  77. package/dist/stripe-multichain/index.mjs.map +1 -1
  78. package/dist/{wwwauthenticate-D_FMnPgU.d.mts → wwwauthenticate-CVaGUMjU.d.mts} +8 -6
  79. package/dist/{wwwauthenticate-D_FMnPgU.d.ts → wwwauthenticate-CVaGUMjU.d.ts} +8 -6
  80. package/package.json +14 -13
@@ -4,12 +4,14 @@
4
4
  */
5
5
  declare function wwwAuthenticateHeader(directives: string[]): string;
6
6
  /**
7
- * Add the v1↔v2 amount-field alias to each accepts entry. Idempotent. Used by both
8
- * `paymentRequiredHeader` (header emit) and `build402Body` (body emit) so every
9
- * x402 entry on the wire carries BOTH `amount` (v2 spec) AND `maxAmountRequired`
10
- * (v1 spec) strict v1-only parsers (e.g. Coinbase awal at `payments-mcp.coinbase.com`,
11
- * which is hardcoded to read `maxAmountRequired`) work alongside strict v2 parsers,
12
- * which ignore the alias.
7
+ * Add the v1↔v2 amount-field alias to each accepts entry. Idempotent.
8
+ *
9
+ * Opt-in helper: the 402 emitters (`paymentRequiredHeader` / `build402Body`) do NOT
10
+ * call this. Strict x402 v2 settlement matches the agent's echoed requirement against
11
+ * the server's rebuilt one by exact comparison, so an extra `maxAmountRequired` the
12
+ * rebuild lacks silently fails settle — keep emitted `accepts` as `buildPaymentRequirements`
13
+ * produced them. Call this only for a client hardcoded to read `maxAmountRequired`
14
+ * regardless of `x402Version`.
13
15
  */
14
16
  declare function aliasAmountFields(accepts: unknown[]): unknown[];
15
17
  /**
@@ -4,12 +4,14 @@
4
4
  */
5
5
  declare function wwwAuthenticateHeader(directives: string[]): string;
6
6
  /**
7
- * Add the v1↔v2 amount-field alias to each accepts entry. Idempotent. Used by both
8
- * `paymentRequiredHeader` (header emit) and `build402Body` (body emit) so every
9
- * x402 entry on the wire carries BOTH `amount` (v2 spec) AND `maxAmountRequired`
10
- * (v1 spec) strict v1-only parsers (e.g. Coinbase awal at `payments-mcp.coinbase.com`,
11
- * which is hardcoded to read `maxAmountRequired`) work alongside strict v2 parsers,
12
- * which ignore the alias.
7
+ * Add the v1↔v2 amount-field alias to each accepts entry. Idempotent.
8
+ *
9
+ * Opt-in helper: the 402 emitters (`paymentRequiredHeader` / `build402Body`) do NOT
10
+ * call this. Strict x402 v2 settlement matches the agent's echoed requirement against
11
+ * the server's rebuilt one by exact comparison, so an extra `maxAmountRequired` the
12
+ * rebuild lacks silently fails settle — keep emitted `accepts` as `buildPaymentRequirements`
13
+ * produced them. Call this only for a client hardcoded to read `maxAmountRequired`
14
+ * regardless of `x402Version`.
13
15
  */
14
16
  declare function aliasAmountFields(accepts: unknown[]): unknown[];
15
17
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-score/commerce",
3
- "version": "2.3.0",
3
+ "version": "2.5.0",
4
4
  "description": "Agent commerce SDK — identity middleware (Hono, Express, Fastify, Next.js, Web Fetch) + payment helpers + 402 builders + discovery + Stripe multichain. The full merchant-side toolkit for AgentScore-powered agent commerce.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -106,7 +106,8 @@
106
106
  "lint:fix": "eslint . --fix",
107
107
  "knip": "knip",
108
108
  "test": "vitest run --coverage",
109
- "typecheck": "tsc --noEmit",
109
+ "typecheck": "tsc --noEmit && tsc --noEmit -p examples/tsconfig.json",
110
+ "typecheck:examples": "tsc --noEmit -p examples/tsconfig.json",
110
111
  "prepare": "lefthook install",
111
112
  "prepublishOnly": "bun run build"
112
113
  },
@@ -143,11 +144,11 @@
143
144
  "url": "https://github.com/agentscore/node-commerce/issues"
144
145
  },
145
146
  "engines": {
146
- "node": ">=22",
147
- "bun": ">=1.3.0"
147
+ "node": ">=22 <25",
148
+ "bun": ">=1.3.0 <2"
148
149
  },
149
150
  "dependencies": {
150
- "@agent-score/sdk": "^2.3.4"
151
+ "@agent-score/sdk": "^2.5.0"
151
152
  },
152
153
  "overrides": {
153
154
  "axios": "^1.15.0",
@@ -205,24 +206,24 @@
205
206
  "@types/express": "^5.0.6",
206
207
  "@types/node": "^25.9.1",
207
208
  "@vitest/coverage-v8": "^4.1.7",
208
- "@x402/core": "^2.12.0",
209
- "@x402/evm": "^2.12.0",
210
- "@x402/extensions": "^2.12.0",
209
+ "@x402/core": "^2.14.0",
210
+ "@x402/evm": "^2.14.0",
211
+ "@x402/extensions": "^2.14.0",
211
212
  "dotenv": "^17.4.2",
212
213
  "eslint": "^9.39.4",
213
214
  "eslint-plugin-import": "^2.32.0",
214
215
  "eslint-plugin-unused-imports": "^4.4.1",
215
216
  "express": "^5.2.1",
216
217
  "fastify": "^5.8.5",
217
- "hono": "^4.12.21",
218
- "ioredis": "^5.10.1",
218
+ "hono": "^4.12.23",
219
+ "ioredis": "^5.11.0",
219
220
  "jose": "^6.2.3",
220
- "knip": "^6.14.1",
221
- "lefthook": "^2.1.8",
221
+ "knip": "^6.15.0",
222
+ "lefthook": "^2.1.9",
222
223
  "mppx": "0.6.26",
223
224
  "tsup": "^8.5.1",
224
225
  "typescript": "^6.0.3",
225
- "typescript-eslint": "^8.59.4",
226
+ "typescript-eslint": "^8.60.0",
226
227
  "vitest": "^4.1.7"
227
228
  },
228
229
  "packageManager": "bun@1.3.13"