@agent-score/commerce 2.6.2 → 2.6.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 +23 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -22574,7 +22574,7 @@ function createAgentScoreCore(options) {
|
|
|
22574
22574
|
} = options;
|
|
22575
22575
|
const baseUrl = stripTrailingSlashes(rawBaseUrl);
|
|
22576
22576
|
const agentMemoryHint = buildAgentMemoryHint(aipTrustedIssuers);
|
|
22577
|
-
const defaultUa = `@agent-score/commerce@${"2.6.
|
|
22577
|
+
const defaultUa = `@agent-score/commerce@${"2.6.3"}`;
|
|
22578
22578
|
const userAgentHeader = userAgent ? `${userAgent} (${defaultUa})` : defaultUa;
|
|
22579
22579
|
const sdk = new AgentScore({ apiKey, baseUrl, userAgent: userAgentHeader });
|
|
22580
22580
|
const sessionSdkCache = /* @__PURE__ */ new Map();
|
|
@@ -25980,21 +25980,33 @@ var Checkout = class {
|
|
|
25980
25980
|
if (ctx.pricing.amountUsd !== 0) return null;
|
|
25981
25981
|
const headers = normalizeHeadersToLowercase(ctx.request.headers);
|
|
25982
25982
|
let zero;
|
|
25983
|
+
let railKey;
|
|
25983
25984
|
if (rail === "x402-base") {
|
|
25984
|
-
const
|
|
25985
|
-
|
|
25986
|
-
|
|
25987
|
-
|
|
25988
|
-
|
|
25989
|
-
|
|
25990
|
-
|
|
25991
|
-
|
|
25985
|
+
const fakeRequest = new Request(ctx.request.url, {
|
|
25986
|
+
method: ctx.request.method,
|
|
25987
|
+
headers: ctx.request.headers
|
|
25988
|
+
});
|
|
25989
|
+
const verified = await verifyX402Request({
|
|
25990
|
+
request: fakeRequest,
|
|
25991
|
+
isCachedAddress: (addr) => this.asyncIsCachedAddress(addr, ctx),
|
|
25992
|
+
acceptedNetwork: this.x402BaseNetwork ?? ""
|
|
25993
|
+
});
|
|
25994
|
+
if (!verified.ok) {
|
|
25995
|
+
return {
|
|
25996
|
+
status: verified.status,
|
|
25997
|
+
body: verified.body,
|
|
25998
|
+
headers: {},
|
|
25999
|
+
referenceId: ctx.referenceId,
|
|
26000
|
+
settled: false,
|
|
26001
|
+
settlePhase: "verify_failed"
|
|
26002
|
+
};
|
|
25992
26003
|
}
|
|
25993
|
-
zero = zeroAmountCarveOut({ rail, payload });
|
|
26004
|
+
zero = zeroAmountCarveOut({ rail, payload: verified.payload });
|
|
26005
|
+
railKey = this.x402RailKey();
|
|
25994
26006
|
} else {
|
|
25995
26007
|
zero = zeroAmountCarveOut({ rail, authorizationHeader: headers["authorization"] });
|
|
26008
|
+
railKey = (zero.signerNetwork !== null ? this.railsKeyForMppxMethod(zero.signerNetwork === "solana" ? "solana" : "tempo") : void 0) ?? this.mppRailKey();
|
|
25996
26009
|
}
|
|
25997
|
-
const railKey = rail === "x402-base" ? this.x402RailKey() : this.mppRailKey();
|
|
25998
26010
|
const outcome = {
|
|
25999
26011
|
rail: rail === "x402-base" ? "x402" : "mpp",
|
|
26000
26012
|
paymentResponseHeader: null,
|