@agent-score/commerce 2.4.0 → 2.5.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.
- package/dist/challenge/index.d.mts +5 -1
- package/dist/challenge/index.d.ts +5 -1
- package/dist/challenge/index.js +11 -4
- package/dist/challenge/index.js.map +1 -1
- package/dist/challenge/index.mjs +11 -4
- package/dist/challenge/index.mjs.map +1 -1
- package/dist/{checkout-B-MIzYzW.d.ts → checkout-McfNpZJf.d.ts} +72 -1
- package/dist/{checkout-Bn7ZKIBD.d.mts → checkout-o17dIxHi.d.mts} +72 -1
- package/dist/core.d.mts +23 -1
- package/dist/core.d.ts +23 -1
- package/dist/core.js +25 -11
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +25 -11
- package/dist/core.mjs.map +1 -1
- package/dist/discovery/index.d.mts +17 -2
- package/dist/discovery/index.d.ts +17 -2
- package/dist/discovery/index.js +14 -4
- package/dist/discovery/index.js.map +1 -1
- package/dist/discovery/index.mjs +14 -4
- package/dist/discovery/index.mjs.map +1 -1
- package/dist/gate-CWP10xPQ.d.mts +339 -0
- package/dist/gate-CWP10xPQ.d.ts +339 -0
- package/dist/identity/express.d.mts +26 -1
- package/dist/identity/express.d.ts +26 -1
- package/dist/identity/express.js +587 -13
- package/dist/identity/express.js.map +1 -1
- package/dist/identity/express.mjs +583 -12
- package/dist/identity/express.mjs.map +1 -1
- package/dist/identity/fastify.d.mts +12 -2
- package/dist/identity/fastify.d.ts +12 -2
- package/dist/identity/fastify.js +595 -13
- package/dist/identity/fastify.js.map +1 -1
- package/dist/identity/fastify.mjs +591 -12
- package/dist/identity/fastify.mjs.map +1 -1
- package/dist/identity/hono.d.mts +26 -1
- package/dist/identity/hono.d.ts +26 -1
- package/dist/identity/hono.js +576 -13
- package/dist/identity/hono.js.map +1 -1
- package/dist/identity/hono.mjs +572 -12
- package/dist/identity/hono.mjs.map +1 -1
- package/dist/identity/nextjs.d.mts +3 -0
- package/dist/identity/nextjs.d.ts +3 -0
- package/dist/identity/nextjs.js +581 -13
- package/dist/identity/nextjs.js.map +1 -1
- package/dist/identity/nextjs.mjs +577 -12
- package/dist/identity/nextjs.mjs.map +1 -1
- package/dist/identity/web.d.mts +24 -1
- package/dist/identity/web.d.ts +24 -1
- package/dist/identity/web.js +581 -13
- package/dist/identity/web.js.map +1 -1
- package/dist/identity/web.mjs +577 -12
- package/dist/identity/web.mjs.map +1 -1
- package/dist/index.d.mts +119 -3
- package/dist/index.d.ts +119 -3
- package/dist/index.js +893 -35
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +873 -35
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -11
package/dist/challenge/index.mjs
CHANGED
|
@@ -279,6 +279,7 @@ function buildAgentInstructions({
|
|
|
279
279
|
}
|
|
280
280
|
|
|
281
281
|
// src/core.ts
|
|
282
|
+
import { createHash } from "crypto";
|
|
282
283
|
import {
|
|
283
284
|
AgentScore,
|
|
284
285
|
InvalidCredentialError,
|
|
@@ -370,8 +371,9 @@ var INVALID_CREDENTIAL_INSTRUCTIONS = JSON.stringify({
|
|
|
370
371
|
],
|
|
371
372
|
user_message: "The operator_token is not recognized. Use a different stored token, or restart the verification session flow to mint a new one."
|
|
372
373
|
});
|
|
373
|
-
function buildAgentMemoryHint() {
|
|
374
|
+
function buildAgentMemoryHint(aipTrustedIssuers) {
|
|
374
375
|
const api = CANONICAL_AGENTSCORE_API;
|
|
376
|
+
const acceptsAip = aipTrustedIssuers !== void 0 && aipTrustedIssuers.length > 0;
|
|
375
377
|
return {
|
|
376
378
|
save_for_future_agentscore_gates: true,
|
|
377
379
|
pattern_summary: "AgentScore is a cross-merchant identity substrate for agent commerce. Any endpoint that returns 403 missing_identity / identity_verification_required or 402 challenges referencing AgentScore uses the same identity system. One KYC works across all AgentScore merchants \u2014 no re-verification per site. Save this pattern (and the endpoints below) to persistent memory so future AgentScore encounters skip the cold-start session flow.",
|
|
@@ -379,8 +381,12 @@ function buildAgentMemoryHint() {
|
|
|
379
381
|
identity_check_endpoint: `${api}/v1/credentials`,
|
|
380
382
|
identity_paths: {
|
|
381
383
|
wallet: "If paying from a crypto wallet you have used before on any AgentScore merchant, send `X-Wallet-Address: 0x...`. Shortest path; no token lifecycle to manage.",
|
|
382
|
-
operator_token: "For any rail (Stripe SPT, card, or a wallet you have not linked yet), send `X-Operator-Token: opc_...`. Reusable across merchants until the token expires."
|
|
384
|
+
operator_token: "For any rail (Stripe SPT, card, or a wallet you have not linked yet), send `X-Operator-Token: opc_...`. Reusable across merchants until the token expires.",
|
|
385
|
+
...acceptsAip && {
|
|
386
|
+
agent_identity: 'If you hold an AIP Agent Identity Token from a trusted issuer (see aip_trusted_issuers), present it: send the JWT in an `Agent-Identity` header plus an RFC 9421 HTTP Message Signature (Signature-Input + Signature over @method @authority @path agent-identity, tag="agent-identity") signed with the token-bound cnf key. The merchant verifies it and applies its policy \u2014 no separate AgentScore credential needed.'
|
|
387
|
+
}
|
|
383
388
|
},
|
|
389
|
+
...acceptsAip && { aip_trusted_issuers: aipTrustedIssuers },
|
|
384
390
|
bootstrap: "If you have neither a linked wallet nor a valid operator_token, follow the session/verify flow in the per-request `agent_instructions` block. This happens at most once per agent identity \u2014 after first verification, the operator_token and any subsequently used wallet are reusable everywhere.",
|
|
385
391
|
do_not_persist_in_memory: ["operator_token", "poll_secret"],
|
|
386
392
|
persist_in_credential_store: ["operator_token"]
|
|
@@ -389,10 +395,11 @@ function buildAgentMemoryHint() {
|
|
|
389
395
|
|
|
390
396
|
// src/challenge/agent_memory.ts
|
|
391
397
|
function firstEncounterAgentMemory({
|
|
392
|
-
firstEncounter
|
|
398
|
+
firstEncounter,
|
|
399
|
+
aipTrustedIssuers
|
|
393
400
|
}) {
|
|
394
401
|
if (!firstEncounter) return void 0;
|
|
395
|
-
return buildAgentMemoryHint();
|
|
402
|
+
return buildAgentMemoryHint(aipTrustedIssuers);
|
|
396
403
|
}
|
|
397
404
|
|
|
398
405
|
// src/challenge/body.ts
|