@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.
Files changed (59) hide show
  1. package/dist/challenge/index.d.mts +5 -1
  2. package/dist/challenge/index.d.ts +5 -1
  3. package/dist/challenge/index.js +11 -4
  4. package/dist/challenge/index.js.map +1 -1
  5. package/dist/challenge/index.mjs +11 -4
  6. package/dist/challenge/index.mjs.map +1 -1
  7. package/dist/{checkout-B-MIzYzW.d.ts → checkout-McfNpZJf.d.ts} +72 -1
  8. package/dist/{checkout-Bn7ZKIBD.d.mts → checkout-o17dIxHi.d.mts} +72 -1
  9. package/dist/core.d.mts +23 -1
  10. package/dist/core.d.ts +23 -1
  11. package/dist/core.js +25 -11
  12. package/dist/core.js.map +1 -1
  13. package/dist/core.mjs +25 -11
  14. package/dist/core.mjs.map +1 -1
  15. package/dist/discovery/index.d.mts +17 -2
  16. package/dist/discovery/index.d.ts +17 -2
  17. package/dist/discovery/index.js +14 -4
  18. package/dist/discovery/index.js.map +1 -1
  19. package/dist/discovery/index.mjs +14 -4
  20. package/dist/discovery/index.mjs.map +1 -1
  21. package/dist/gate-CWP10xPQ.d.mts +339 -0
  22. package/dist/gate-CWP10xPQ.d.ts +339 -0
  23. package/dist/identity/express.d.mts +26 -1
  24. package/dist/identity/express.d.ts +26 -1
  25. package/dist/identity/express.js +587 -13
  26. package/dist/identity/express.js.map +1 -1
  27. package/dist/identity/express.mjs +583 -12
  28. package/dist/identity/express.mjs.map +1 -1
  29. package/dist/identity/fastify.d.mts +12 -2
  30. package/dist/identity/fastify.d.ts +12 -2
  31. package/dist/identity/fastify.js +595 -13
  32. package/dist/identity/fastify.js.map +1 -1
  33. package/dist/identity/fastify.mjs +591 -12
  34. package/dist/identity/fastify.mjs.map +1 -1
  35. package/dist/identity/hono.d.mts +26 -1
  36. package/dist/identity/hono.d.ts +26 -1
  37. package/dist/identity/hono.js +576 -13
  38. package/dist/identity/hono.js.map +1 -1
  39. package/dist/identity/hono.mjs +572 -12
  40. package/dist/identity/hono.mjs.map +1 -1
  41. package/dist/identity/nextjs.d.mts +3 -0
  42. package/dist/identity/nextjs.d.ts +3 -0
  43. package/dist/identity/nextjs.js +581 -13
  44. package/dist/identity/nextjs.js.map +1 -1
  45. package/dist/identity/nextjs.mjs +577 -12
  46. package/dist/identity/nextjs.mjs.map +1 -1
  47. package/dist/identity/web.d.mts +24 -1
  48. package/dist/identity/web.d.ts +24 -1
  49. package/dist/identity/web.js +581 -13
  50. package/dist/identity/web.js.map +1 -1
  51. package/dist/identity/web.mjs +577 -12
  52. package/dist/identity/web.mjs.map +1 -1
  53. package/dist/index.d.mts +119 -3
  54. package/dist/index.d.ts +119 -3
  55. package/dist/index.js +893 -35
  56. package/dist/index.js.map +1 -1
  57. package/dist/index.mjs +873 -35
  58. package/dist/index.mjs.map +1 -1
  59. package/package.json +11 -11
@@ -363,11 +363,13 @@ function buildWellKnownX402(input) {
363
363
  // src/discovery/llms_txt.ts
364
364
  function llmsTxtIdentitySection({
365
365
  agentscore,
366
- compliance
366
+ compliance,
367
+ aip
367
368
  } = {}) {
368
369
  if (!agentscore) {
369
370
  return "";
370
371
  }
372
+ const aipBullet = aip ? "\n- **`Agent-Identity: <JWT>` + RFC 9421 signature** \u2014 present an Agent Identity Token (AIP) from a trusted issuer (AgentScore is always trusted). Short-lived and bound to your key; sign the request (`Signature-Input` + `Signature` over `@method @authority @path agent-identity`, tag `agent-identity`) to prove possession. No long-lived token on the wire. Mint one with `agentscore-pay identity-mint` or let `agentscore-pay pay --identity aip` attach it automatically." : "";
371
373
  const complianceNote = compliance ? `
372
374
 
373
375
  Compliance: ${[
@@ -381,7 +383,7 @@ Compliance: ${[
381
383
  AgentScore identity is reusable across every AgentScore-gated merchant \u2014 one KYC, no re-verification per site. Pick a header:
382
384
 
383
385
  - **\`X-Wallet-Address: 0x...\` or base58** \u2014 works on signing rails (Tempo, x402, Solana MPP). The wallet you claim must sign the payment.
384
- - **\`X-Operator-Token: opc_...\`** \u2014 works on every rail, including Stripe SPT. Reusable across AgentScore merchants until expiry.
386
+ - **\`X-Operator-Token: opc_...\`** \u2014 works on every rail, including Stripe SPT. Reusable across AgentScore merchants until expiry.${aipBullet}
385
387
  - **Neither** \u2014 you get a 403 with \`verify_url\`. Complete the session flow once and reuse the resulting \`opc_...\` everywhere.${complianceNote}`;
386
388
  }
387
389
  function llmsTxtPaymentSection(input) {
@@ -522,6 +524,12 @@ function agentscoreSecuritySchemes() {
522
524
  name: "X-Wallet-Address",
523
525
  description: "Wallet-path identity (0x... or base58). Only works on rails that carry a wallet signature (Tempo MPP, x402 EIP-3009, x402 SPL Token). The wallet you claim MUST sign the payment."
524
526
  },
527
+ AgentIdentity: {
528
+ type: "apiKey",
529
+ in: "header",
530
+ name: "Agent-Identity",
531
+ description: "AIP Agent Identity Token path (a JWT from a trusted issuer; AgentScore is always trusted). Opt-in. The token is bound to the agent key via `cnf`; the request MUST also carry an RFC 9421 HTTP Message Signature (`Signature-Input` + `Signature` over `@method @authority @path agent-identity`, tag `agent-identity`) proving possession. A verified AIT is the sole identity and is evaluated against the merchant policy via its attested claims."
532
+ },
525
533
  siwx: siwxSecurityScheme()
526
534
  };
527
535
  }
@@ -885,14 +893,16 @@ function identitySection(input) {
885
893
  if (id.minAge) reqs.push(`age ${id.minAge}+`);
886
894
  if (id.allowedJurisdictions?.length) reqs.push(`${id.allowedJurisdictions.join("/")} only`);
887
895
  if (id.sanctionsClear) reqs.push("sanctions clear");
888
- if (reqs.length === 0) return "";
896
+ if (reqs.length === 0 && !id.aip) return "";
889
897
  const bootstrap = input.identityBootstrapUrl ? `
890
898
 
891
899
  If you don't have a Passport, fetch \`${input.identityBootstrapUrl}\` and follow the onboarding there first. Bring back the \`opc_...\` operator token in \`X-Operator-Token\` on every gated request.` : "";
900
+ const reqLine = reqs.length ? `This merchant uses AgentScore identity. Required: ${reqs.join(", ")}.${bootstrap}` : `This merchant uses AgentScore identity.${bootstrap}`;
901
+ const aipNote = id.aip ? "\n\nThis merchant accepts AIP Agent Identity Tokens. If you hold an AIT from a trusted issuer (AgentScore is always trusted), present 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 \u2014 it satisfies identity in one round trip, no separate AgentScore credential needed. `agentscore-pay pay --identity aip` does this automatically." : "";
892
902
  return [
893
903
  "## Identity Prerequisite",
894
904
  "",
895
- `This merchant uses AgentScore identity. Required: ${reqs.join(", ")}.${bootstrap}`,
905
+ `${reqLine}${aipNote}`,
896
906
  "",
897
907
  "Denial bodies carry an `agent_instructions` block describing the recovery action \u2014 read the `action` field and follow it. See the identity-bootstrap skill for the canonical denial-code \u2192 action table."
898
908
  ].join("\n");