@agent-score/commerce 2.7.2 → 2.7.3
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 +11 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -2
- package/dist/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.3"}`;
|
|
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();
|
|
@@ -25358,6 +25358,15 @@ function getIdentityStatus(ctx) {
|
|
|
25358
25358
|
if (decision === "allow") return "verified";
|
|
25359
25359
|
return "unverified";
|
|
25360
25360
|
}
|
|
25361
|
+
function stripPaymentHeadersFromRaw(raw) {
|
|
25362
|
+
if (typeof Request === "undefined" || !(raw instanceof Request)) return raw;
|
|
25363
|
+
const headers = new Headers(raw.headers);
|
|
25364
|
+
headers.delete("payment-signature");
|
|
25365
|
+
headers.delete("x-payment");
|
|
25366
|
+
const auth = headers.get("authorization");
|
|
25367
|
+
if (auth !== null && auth.startsWith("Payment ")) headers.delete("authorization");
|
|
25368
|
+
return new Request(raw.url, { method: raw.method, headers });
|
|
25369
|
+
}
|
|
25361
25370
|
function resolveIdentityMetadata(ctx) {
|
|
25362
25371
|
const h = normalizeHeadersToLowercase(ctx.request.headers);
|
|
25363
25372
|
const wallet = h["x-wallet-address"];
|
|
@@ -26307,7 +26316,7 @@ var Checkout = class {
|
|
|
26307
26316
|
if (lk === "authorization" && v.startsWith("Payment ")) continue;
|
|
26308
26317
|
headers[k] = v;
|
|
26309
26318
|
}
|
|
26310
|
-
return { ...request, headers };
|
|
26319
|
+
return { ...request, headers, raw: stripPaymentHeadersFromRaw(request.raw) };
|
|
26311
26320
|
}
|
|
26312
26321
|
async emit402(ctx, mppxHeaders = {}) {
|
|
26313
26322
|
if (ctx.pricing === null) {
|