@agent-score/commerce 2.7.4 → 2.7.5
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.
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/identity/express.js +1 -1
- package/dist/identity/express.mjs +1 -1
- package/dist/identity/fastify.js +1 -1
- package/dist/identity/fastify.mjs +1 -1
- package/dist/identity/hono.js +1 -1
- package/dist/identity/hono.mjs +1 -1
- package/dist/identity/nextjs.js +1 -1
- package/dist/identity/nextjs.mjs +1 -1
- package/dist/identity/web.js +1 -1
- package/dist/identity/web.mjs +1 -1
- package/dist/index.js +12 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -16
- package/dist/index.mjs.map +1 -1
- package/dist/payment/index.d.mts +22 -22
- package/dist/payment/index.d.ts +22 -22
- package/dist/payment/index.js +13 -17
- package/dist/payment/index.js.map +1 -1
- package/dist/payment/index.mjs +12 -16
- package/dist/payment/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -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.
|
|
22621
|
+
const defaultUa = `@agent-score/commerce@${"2.7.5"}`;
|
|
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
|
|
25071
|
+
function stripUnsignedX402PayloadFields(payload) {
|
|
25072
25072
|
if (typeof payload !== "object" || payload === null) return payload;
|
|
25073
25073
|
const p = payload;
|
|
25074
|
-
|
|
25075
|
-
const
|
|
25076
|
-
const
|
|
25077
|
-
|
|
25078
|
-
|
|
25079
|
-
|
|
25080
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
25132
|
+
facilitatorPayload,
|
|
25137
25133
|
matchedRequirement,
|
|
25138
25134
|
enrichedExt,
|
|
25139
25135
|
resolvedTransportContext
|