@agent-score/commerce 2.7.4 → 2.7.6

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/dist/challenge/index.d.mts +3 -3
  2. package/dist/challenge/index.d.ts +3 -3
  3. package/dist/{checkout-DKq9gV3G.d.mts → checkout-B0jIzAEo.d.mts} +5 -5
  4. package/dist/{checkout-DW7GgRrl.d.ts → checkout-BRdpPSnc.d.ts} +5 -5
  5. package/dist/core.js +1 -1
  6. package/dist/core.mjs +1 -1
  7. package/dist/discovery/index.d.mts +6 -6
  8. package/dist/discovery/index.d.ts +6 -6
  9. package/dist/{gate-GCXy4FHI.d.mts → gate-BMUMi-P0.d.mts} +2 -2
  10. package/dist/{gate-D2RP6bZg.d.ts → gate-Bhbi5zvG.d.ts} +2 -2
  11. package/dist/identity/express.d.mts +2 -2
  12. package/dist/identity/express.d.ts +2 -2
  13. package/dist/identity/express.js +1 -1
  14. package/dist/identity/express.mjs +1 -1
  15. package/dist/identity/fastify.d.mts +2 -2
  16. package/dist/identity/fastify.d.ts +2 -2
  17. package/dist/identity/fastify.js +1 -1
  18. package/dist/identity/fastify.mjs +1 -1
  19. package/dist/identity/hono.d.mts +2 -2
  20. package/dist/identity/hono.d.ts +2 -2
  21. package/dist/identity/hono.js +1 -1
  22. package/dist/identity/hono.mjs +1 -1
  23. package/dist/identity/nextjs.d.mts +2 -2
  24. package/dist/identity/nextjs.d.ts +2 -2
  25. package/dist/identity/nextjs.js +1 -1
  26. package/dist/identity/nextjs.mjs +1 -1
  27. package/dist/identity/web.d.mts +2 -2
  28. package/dist/identity/web.d.ts +2 -2
  29. package/dist/identity/web.js +1 -1
  30. package/dist/identity/web.mjs +1 -1
  31. package/dist/index.d.mts +11 -11
  32. package/dist/index.d.ts +11 -11
  33. package/dist/index.js +14 -18
  34. package/dist/index.js.map +1 -1
  35. package/dist/index.mjs +14 -18
  36. package/dist/index.mjs.map +1 -1
  37. package/dist/{network_kind-toxNABqw.d.ts → network_kind-C3NA2wX2.d.ts} +2 -2
  38. package/dist/{network_kind-CLdLbqU5.d.mts → network_kind-DmHbQbOb.d.mts} +2 -2
  39. package/dist/payment/index.d.mts +27 -27
  40. package/dist/payment/index.d.ts +27 -27
  41. package/dist/payment/index.js +13 -17
  42. package/dist/payment/index.js.map +1 -1
  43. package/dist/payment/index.mjs +12 -16
  44. package/dist/payment/index.mjs.map +1 -1
  45. package/dist/{pricing-Dx3F1VAv.d.ts → pricing-DUYE2hIy.d.ts} +1 -1
  46. package/dist/{pricing-sfv3CPiY.d.mts → pricing-Wqbq6xIR.d.mts} +1 -1
  47. package/dist/{rail_spec-DGdb4Gnd.d.mts → rail_spec-C-jTQ7g6.d.mts} +1 -1
  48. package/dist/{rail_spec-DGdb4Gnd.d.ts → rail_spec-C-jTQ7g6.d.ts} +1 -1
  49. package/dist/stripe-multichain/index.js +2 -2
  50. package/dist/stripe-multichain/index.js.map +1 -1
  51. package/dist/stripe-multichain/index.mjs +2 -2
  52. package/dist/stripe-multichain/index.mjs.map +1 -1
  53. package/dist/{types-D1slMt0H.d.mts → types-1Mr5ZDas.d.mts} +1 -1
  54. package/dist/{types-D1slMt0H.d.ts → types-1Mr5ZDas.d.ts} +1 -1
  55. package/dist/{x402_server-Ciz2mls2.d.mts → x402_server-hgQzWQwB.d.mts} +1 -1
  56. package/dist/{x402_server-Ciz2mls2.d.ts → x402_server-hgQzWQwB.d.ts} +1 -1
  57. package/package.json +8 -8
package/dist/index.mjs CHANGED
@@ -1633,7 +1633,7 @@ var init_sha256 = __esm({
1633
1633
  }
1634
1634
  });
1635
1635
 
1636
- // node_modules/@noble/curves/esm/abstract/utils.js
1636
+ // node_modules/ox/node_modules/@noble/curves/esm/abstract/utils.js
1637
1637
  function equalBytes(a, b) {
1638
1638
  if (a.length !== b.length)
1639
1639
  return false;
@@ -1644,7 +1644,7 @@ function equalBytes(a, b) {
1644
1644
  }
1645
1645
  var hasHexBuiltin;
1646
1646
  var init_utils2 = __esm({
1647
- "node_modules/@noble/curves/esm/abstract/utils.js"() {
1647
+ "node_modules/ox/node_modules/@noble/curves/esm/abstract/utils.js"() {
1648
1648
  "use strict";
1649
1649
  hasHexBuiltin = // @ts-ignore
1650
1650
  typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function";
@@ -22618,7 +22618,7 @@ function createAgentScoreCore(options) {
22618
22618
  } = options;
22619
22619
  const baseUrl = stripTrailingSlashes(rawBaseUrl);
22620
22620
  const agentMemoryHint = buildAgentMemoryHint(aipTrustedIssuers);
22621
- const defaultUa = `@agent-score/commerce@${"2.7.4"}`;
22621
+ const defaultUa = `@agent-score/commerce@${"2.7.6"}`;
22622
22622
  const userAgentHeader = userAgent ? `${userAgent} (${defaultUa})` : defaultUa;
22623
22623
  const sdk = new AgentScore({ apiKey, baseUrl, userAgent: userAgentHeader });
22624
22624
  const sessionSdkCache = /* @__PURE__ */ new Map();
@@ -25068,20 +25068,16 @@ function classifyX402SettleResult(result) {
25068
25068
  };
25069
25069
  }
25070
25070
  }
25071
- function toCanonicalX402PaymentPayload(payload) {
25071
+ function stripUnsignedX402PayloadFields(payload) {
25072
25072
  if (typeof payload !== "object" || payload === null) return payload;
25073
25073
  const p = payload;
25074
- const accepted = typeof p.accepted === "object" && p.accepted !== null ? p.accepted : void 0;
25075
- const scheme = p.scheme ?? accepted?.scheme;
25076
- const network = p.network ?? accepted?.network;
25077
- const inner = p.payload;
25078
- if (scheme === void 0 || network === void 0 || inner === void 0) return payload;
25079
- return {
25080
- x402Version: p.x402Version ?? 2,
25081
- scheme,
25082
- network,
25083
- payload: inner
25084
- };
25074
+ if (!("extensions" in p) && !("resource" in p)) return payload;
25075
+ const rest = {};
25076
+ for (const [k, v] of Object.entries(p)) {
25077
+ if (k === "extensions" || k === "resource") continue;
25078
+ rest[k] = v;
25079
+ }
25080
+ return rest;
25085
25081
  }
25086
25082
  async function processX402Settle({
25087
25083
  x402Server,
@@ -25103,7 +25099,7 @@ async function processX402Settle({
25103
25099
  if (!matchedRequirement) {
25104
25100
  return { success: false, phase: "no_requirements", reason: "x402Server.buildPaymentRequirements returned empty" };
25105
25101
  }
25106
- const canonicalPayload = toCanonicalX402PaymentPayload(payload);
25102
+ const facilitatorPayload = stripUnsignedX402PayloadFields(payload);
25107
25103
  const resolvedTransportContext = transportContext ?? (() => {
25108
25104
  const path = new URL(resourceMeta.url).pathname;
25109
25105
  return { method: "POST", adapter: { getPath: () => path }, routePattern: path };
@@ -25118,7 +25114,7 @@ async function processX402Settle({
25118
25114
  let verifyResult;
25119
25115
  try {
25120
25116
  verifyResult = await server.verifyPayment(
25121
- canonicalPayload,
25117
+ facilitatorPayload,
25122
25118
  matchedRequirement,
25123
25119
  enrichedExt,
25124
25120
  resolvedTransportContext
@@ -25133,7 +25129,7 @@ async function processX402Settle({
25133
25129
  }
25134
25130
  try {
25135
25131
  const settleResult = await server.settlePayment(
25136
- canonicalPayload,
25132
+ facilitatorPayload,
25137
25133
  matchedRequirement,
25138
25134
  enrichedExt,
25139
25135
  resolvedTransportContext