@agent-score/commerce 2.2.0 → 2.4.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 (68) hide show
  1. package/README.md +7 -7
  2. package/dist/challenge/index.d.mts +4 -4
  3. package/dist/challenge/index.d.ts +4 -4
  4. package/dist/challenge/index.js.map +1 -1
  5. package/dist/challenge/index.mjs.map +1 -1
  6. package/dist/{checkout-CfgxgPZL.d.ts → checkout-B-MIzYzW.d.ts} +8 -11
  7. package/dist/{checkout-CKQE2QpJ.d.mts → checkout-Bn7ZKIBD.d.mts} +8 -11
  8. package/dist/core.d.mts +4 -6
  9. package/dist/core.d.ts +4 -6
  10. package/dist/core.js +1 -1
  11. package/dist/core.js.map +1 -1
  12. package/dist/core.mjs +1 -1
  13. package/dist/core.mjs.map +1 -1
  14. package/dist/discovery/index.d.mts +10 -9
  15. package/dist/discovery/index.d.ts +10 -9
  16. package/dist/discovery/index.js +44 -6
  17. package/dist/discovery/index.js.map +1 -1
  18. package/dist/discovery/index.mjs +44 -6
  19. package/dist/discovery/index.mjs.map +1 -1
  20. package/dist/identity/express.js +13 -13
  21. package/dist/identity/express.js.map +1 -1
  22. package/dist/identity/express.mjs +13 -13
  23. package/dist/identity/express.mjs.map +1 -1
  24. package/dist/identity/fastify.js +13 -13
  25. package/dist/identity/fastify.js.map +1 -1
  26. package/dist/identity/fastify.mjs +13 -13
  27. package/dist/identity/fastify.mjs.map +1 -1
  28. package/dist/identity/hono.js +13 -13
  29. package/dist/identity/hono.js.map +1 -1
  30. package/dist/identity/hono.mjs +13 -13
  31. package/dist/identity/hono.mjs.map +1 -1
  32. package/dist/identity/nextjs.js +13 -13
  33. package/dist/identity/nextjs.js.map +1 -1
  34. package/dist/identity/nextjs.mjs +13 -13
  35. package/dist/identity/nextjs.mjs.map +1 -1
  36. package/dist/identity/policy.js.map +1 -1
  37. package/dist/identity/policy.mjs.map +1 -1
  38. package/dist/identity/web.js +13 -13
  39. package/dist/identity/web.js.map +1 -1
  40. package/dist/identity/web.mjs +13 -13
  41. package/dist/identity/web.mjs.map +1 -1
  42. package/dist/index.d.mts +12 -13
  43. package/dist/index.d.ts +12 -13
  44. package/dist/index.js +88 -65
  45. package/dist/index.js.map +1 -1
  46. package/dist/index.mjs +86 -65
  47. package/dist/index.mjs.map +1 -1
  48. package/dist/{default_rails-C5gKZJMI.d.ts → network_kind-BIJM2peR.d.ts} +22 -8
  49. package/dist/{default_rails-XFCuRddA.d.mts → network_kind-C0EMkdzz.d.mts} +22 -8
  50. package/dist/payment/index.d.mts +16 -26
  51. package/dist/payment/index.d.ts +16 -26
  52. package/dist/payment/index.js +64 -57
  53. package/dist/payment/index.js.map +1 -1
  54. package/dist/payment/index.mjs +64 -57
  55. package/dist/payment/index.mjs.map +1 -1
  56. package/dist/{pricing-uFGRNoGl.d.ts → pricing-CytRwhC2.d.ts} +1 -1
  57. package/dist/{pricing-dSI3ePmE.d.mts → pricing-KHDqMLd7.d.mts} +1 -1
  58. package/dist/{rail_spec-D6qzh3J0.d.mts → rail_spec-BFZmW9RN.d.mts} +28 -4
  59. package/dist/{rail_spec-D6qzh3J0.d.ts → rail_spec-BFZmW9RN.d.ts} +28 -4
  60. package/dist/stripe-multichain/index.d.mts +61 -18
  61. package/dist/stripe-multichain/index.d.ts +61 -18
  62. package/dist/stripe-multichain/index.js +82 -42
  63. package/dist/stripe-multichain/index.js.map +1 -1
  64. package/dist/stripe-multichain/index.mjs +81 -42
  65. package/dist/stripe-multichain/index.mjs.map +1 -1
  66. package/dist/{wwwauthenticate-D_FMnPgU.d.mts → wwwauthenticate-CVaGUMjU.d.mts} +8 -6
  67. package/dist/{wwwauthenticate-D_FMnPgU.d.ts → wwwauthenticate-CVaGUMjU.d.ts} +8 -6
  68. package/package.json +12 -11
@@ -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.2.0",
3
+ "version": "2.4.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
  },
@@ -147,7 +148,7 @@
147
148
  "bun": ">=1.3.0"
148
149
  },
149
150
  "dependencies": {
150
- "@agent-score/sdk": "^2.3.3"
151
+ "@agent-score/sdk": "^2.4.3"
151
152
  },
152
153
  "overrides": {
153
154
  "axios": "^1.15.0",
@@ -201,29 +202,29 @@
201
202
  "@coinbase/x402": "^2.1.0",
202
203
  "@eslint/js": "^9.39.4",
203
204
  "@solana/kit": "^6.9.0",
204
- "@solana/mpp": "^0.5.2",
205
+ "@solana/mpp": "^0.6.0",
205
206
  "@types/express": "^5.0.6",
206
207
  "@types/node": "^25.9.1",
207
- "@vitest/coverage-v8": "^4.1.6",
208
- "@x402/core": "^2.12.0",
209
- "@x402/evm": "^2.12.0",
210
- "@x402/extensions": "^2.12.0",
208
+ "@vitest/coverage-v8": "^4.1.7",
209
+ "@x402/core": "^2.13.0",
210
+ "@x402/evm": "^2.13.0",
211
+ "@x402/extensions": "^2.13.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
+ "hono": "^4.12.23",
218
219
  "ioredis": "^5.10.1",
219
220
  "jose": "^6.2.3",
220
- "knip": "^6.14.1",
221
+ "knip": "^6.14.2",
221
222
  "lefthook": "^2.1.8",
222
223
  "mppx": "0.6.26",
223
224
  "tsup": "^8.5.1",
224
225
  "typescript": "^6.0.3",
225
226
  "typescript-eslint": "^8.59.4",
226
- "vitest": "^4.1.6"
227
+ "vitest": "^4.1.7"
227
228
  },
228
229
  "packageManager": "bun@1.3.13"
229
230
  }