@agent-score/commerce 1.0.2 → 1.0.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/README.md CHANGED
@@ -26,7 +26,7 @@ npm install hono mppx @x402/core @x402/evm @x402/svm stripe # whatever your st
26
26
  | `/identity/{hono,express,fastify,nextjs,web}` | Trust gate middleware: KYC, sanctions, age, jurisdiction. `agentscoreGate(...)`, `getAgentScoreData(c)`, `captureWallet(...)`, `verifyWalletSignerMatch(...)`. Plus shared denial helpers: `denialReasonStatus`, `denialReasonToBody`, `buildSignerMismatchBody`, `buildContactSupportNextSteps`, `verificationAgentInstructions`, `isFixableDenial`, `FIXABLE_DENIAL_REASONS`. |
27
27
  | `/payment` | `networks`, `USDC`, `rails` registries; `paymentDirective`, `buildPaymentDirective`, `wwwAuthenticateHeader`, `paymentRequiredHeader`, `aliasAmountFields` (v1↔v2 amount field shim — emits both `amount` and `maxAmountRequired` so v1-only x402 parsers like Coinbase awal can read v2 bodies), `settlementOverrideHeader`, `dispatchSettlementByNetwork`, `extractPaymentSigner` (returns `{address, network}`); `createX402Server`, `createMppxServer`; drop-in x402 helpers: `validateX402NetworkConfig` (boot-time guard), `verifyX402Request` (parse + validate inbound X-Payment), `processX402Settle` (verify-then-settle with one call). |
28
28
  | `/discovery` | `isDiscoveryProbeRequest`, `buildDiscoveryProbeResponse` (with optional `x402Sample` for x402-aware crawlers — `awal x402 details` etc.), `sampleX402AcceptForNetwork` (USDC sample-accept builder for known CAIP-2 networks), `buildWellKnownMpp`, `buildLlmsTxt` + `llmsTxtIdentitySection` + `llmsTxtPaymentSection` (compact + verbose modes), `agentscoreOpenApiSnippets`, `createBazaarDiscovery`, `noindexNonDiscoveryPaths` (Hono middleware that emits `X-Robots-Tag: noindex` on every path except the agent-discovery surfaces — defaults cover `/openapi.json`, `/llms.txt`, `/.well-known/{mpp.json,agent-card.json,ucp}`, `/favicon.{png,ico}`; pure helpers `isDiscoveryPath` + `defaultDiscoveryPaths` for non-Hono frameworks). |
29
- | `/challenge` | `build402Body`, `buildAcceptedMethods`, `buildIdentityMetadata`, `buildHowToPay`, `buildAgentInstructions`, `buildPricingBlock`, `firstEncounterAgentMemory`, `OrderReceipt`; `respond402` — drop-in 402 emit that preserves mppx's `WWW-Authenticate` and layers x402's `PAYMENT-REQUIRED`. `buildValidationError` — structured 4xx body builder (`{error: {code, message}, required_fields?, example_body?, next_steps?, ...extra}`) so vendors compose body shapes by name instead of inlining at every validation site. |
29
+ | `/challenge` | `build402Body`, `buildAcceptedMethods`, `buildIdentityMetadata`, `buildHowToPay`, `buildAgentInstructions` (auto-emits per-rail `compatible_clients` — smoke-verified CLIs the agent should use; vendor override supported), `buildPricingBlock`, `firstEncounterAgentMemory`, `OrderReceipt`; `respond402` — drop-in 402 emit that preserves mppx's `WWW-Authenticate` and layers x402's `PAYMENT-REQUIRED`. `buildValidationError` — structured 4xx body builder (`{error: {code, message}, required_fields?, example_body?, next_steps?, ...extra}`) so vendors compose body shapes by name instead of inlining at every validation site. |
30
30
  | `/stripe-multichain` | `createMultichainPaymentIntent`, `getDepositAddress`, `simulateCryptoDeposit`, `createMppxStripe`; `createPiCache` (TTL'd PI / deposit-address cache, Redis-backed when `redisUrl` set, in-memory otherwise), `simulateDepositIfTestMode` (gates on `sk_test_` and looks up the PI for you), `STRIPE_TEST_TX_HASH_SUCCESS` / `STRIPE_TEST_TX_HASH_FAILED` constants. Peer dep on `stripe`. |
31
31
  | `/api` | Everything from `@agent-score/sdk` re-exported in one place: `AgentScore` + `AgentScoreError`, `AGENTSCORE_TEST_ADDRESSES` + `isAgentScoreTestAddress`. **Don't add `@agent-score/sdk` as a separate dep** — the two can drift versions and cause subtle type mismatches. |
32
32
 
@@ -280,7 +280,7 @@ app.post("/purchase", async (c) => {
280
280
 
281
281
  ## Examples
282
282
 
283
- The [examples/](./examples) directory has 6 runnable single-file Hono apps covering common merchant scenarios — copy-paste templates, not frameworks. See [examples/README.md](./examples/README.md) for the full table.
283
+ The [examples/](./examples) directory has 7 runnable single-file Hono apps covering common merchant scenarios — copy-paste templates, not frameworks. See [examples/README.md](./examples/README.md) for the full table.
284
284
 
285
285
  ## Vendor profile examples
286
286
 
package/dist/core.js CHANGED
@@ -164,7 +164,7 @@ function createAgentScoreCore(options) {
164
164
  } = options;
165
165
  const baseUrl = stripTrailingSlashes(rawBaseUrl);
166
166
  const agentMemoryHint = buildAgentMemoryHint();
167
- const defaultUa = `@agent-score/commerce@${"1.0.2"}`;
167
+ const defaultUa = `@agent-score/commerce@${"1.0.3"}`;
168
168
  const userAgentHeader = userAgent ? `${userAgent} (${defaultUa})` : defaultUa;
169
169
  const API_TIMEOUT_MS = 1e4;
170
170
  const cache = new TTLCache(cacheSeconds * 1e3);
package/dist/core.mjs CHANGED
@@ -137,7 +137,7 @@ function createAgentScoreCore(options) {
137
137
  } = options;
138
138
  const baseUrl = stripTrailingSlashes(rawBaseUrl);
139
139
  const agentMemoryHint = buildAgentMemoryHint();
140
- const defaultUa = `@agent-score/commerce@${"1.0.2"}`;
140
+ const defaultUa = `@agent-score/commerce@${"1.0.3"}`;
141
141
  const userAgentHeader = userAgent ? `${userAgent} (${defaultUa})` : defaultUa;
142
142
  const API_TIMEOUT_MS = 1e4;
143
143
  const cache = new TTLCache(cacheSeconds * 1e3);
@@ -344,7 +344,7 @@ function createAgentScoreCore(options) {
344
344
  } = options;
345
345
  const baseUrl = stripTrailingSlashes(rawBaseUrl);
346
346
  const agentMemoryHint = buildAgentMemoryHint();
347
- const defaultUa = `@agent-score/commerce@${"1.0.2"}`;
347
+ const defaultUa = `@agent-score/commerce@${"1.0.3"}`;
348
348
  const userAgentHeader = userAgent ? `${userAgent} (${defaultUa})` : defaultUa;
349
349
  const API_TIMEOUT_MS = 1e4;
350
350
  const cache = new TTLCache(cacheSeconds * 1e3);
@@ -306,7 +306,7 @@ function createAgentScoreCore(options) {
306
306
  } = options;
307
307
  const baseUrl = stripTrailingSlashes(rawBaseUrl);
308
308
  const agentMemoryHint = buildAgentMemoryHint();
309
- const defaultUa = `@agent-score/commerce@${"1.0.2"}`;
309
+ const defaultUa = `@agent-score/commerce@${"1.0.3"}`;
310
310
  const userAgentHeader = userAgent ? `${userAgent} (${defaultUa})` : defaultUa;
311
311
  const API_TIMEOUT_MS = 1e4;
312
312
  const cache = new TTLCache(cacheSeconds * 1e3);
@@ -345,7 +345,7 @@ function createAgentScoreCore(options) {
345
345
  } = options;
346
346
  const baseUrl = stripTrailingSlashes(rawBaseUrl);
347
347
  const agentMemoryHint = buildAgentMemoryHint();
348
- const defaultUa = `@agent-score/commerce@${"1.0.2"}`;
348
+ const defaultUa = `@agent-score/commerce@${"1.0.3"}`;
349
349
  const userAgentHeader = userAgent ? `${userAgent} (${defaultUa})` : defaultUa;
350
350
  const API_TIMEOUT_MS = 1e4;
351
351
  const cache = new TTLCache(cacheSeconds * 1e3);
@@ -306,7 +306,7 @@ function createAgentScoreCore(options) {
306
306
  } = options;
307
307
  const baseUrl = stripTrailingSlashes(rawBaseUrl);
308
308
  const agentMemoryHint = buildAgentMemoryHint();
309
- const defaultUa = `@agent-score/commerce@${"1.0.2"}`;
309
+ const defaultUa = `@agent-score/commerce@${"1.0.3"}`;
310
310
  const userAgentHeader = userAgent ? `${userAgent} (${defaultUa})` : defaultUa;
311
311
  const API_TIMEOUT_MS = 1e4;
312
312
  const cache = new TTLCache(cacheSeconds * 1e3);
@@ -344,7 +344,7 @@ function createAgentScoreCore(options) {
344
344
  } = options;
345
345
  const baseUrl = stripTrailingSlashes(rawBaseUrl);
346
346
  const agentMemoryHint = buildAgentMemoryHint();
347
- const defaultUa = `@agent-score/commerce@${"1.0.2"}`;
347
+ const defaultUa = `@agent-score/commerce@${"1.0.3"}`;
348
348
  const userAgentHeader = userAgent ? `${userAgent} (${defaultUa})` : defaultUa;
349
349
  const API_TIMEOUT_MS = 1e4;
350
350
  const cache = new TTLCache(cacheSeconds * 1e3);
@@ -306,7 +306,7 @@ function createAgentScoreCore(options) {
306
306
  } = options;
307
307
  const baseUrl = stripTrailingSlashes(rawBaseUrl);
308
308
  const agentMemoryHint = buildAgentMemoryHint();
309
- const defaultUa = `@agent-score/commerce@${"1.0.2"}`;
309
+ const defaultUa = `@agent-score/commerce@${"1.0.3"}`;
310
310
  const userAgentHeader = userAgent ? `${userAgent} (${defaultUa})` : defaultUa;
311
311
  const API_TIMEOUT_MS = 1e4;
312
312
  const cache = new TTLCache(cacheSeconds * 1e3);
@@ -342,7 +342,7 @@ function createAgentScoreCore(options) {
342
342
  } = options;
343
343
  const baseUrl = stripTrailingSlashes(rawBaseUrl);
344
344
  const agentMemoryHint = buildAgentMemoryHint();
345
- const defaultUa = `@agent-score/commerce@${"1.0.2"}`;
345
+ const defaultUa = `@agent-score/commerce@${"1.0.3"}`;
346
346
  const userAgentHeader = userAgent ? `${userAgent} (${defaultUa})` : defaultUa;
347
347
  const API_TIMEOUT_MS = 1e4;
348
348
  const cache = new TTLCache(cacheSeconds * 1e3);
@@ -306,7 +306,7 @@ function createAgentScoreCore(options) {
306
306
  } = options;
307
307
  const baseUrl = stripTrailingSlashes(rawBaseUrl);
308
308
  const agentMemoryHint = buildAgentMemoryHint();
309
- const defaultUa = `@agent-score/commerce@${"1.0.2"}`;
309
+ const defaultUa = `@agent-score/commerce@${"1.0.3"}`;
310
310
  const userAgentHeader = userAgent ? `${userAgent} (${defaultUa})` : defaultUa;
311
311
  const API_TIMEOUT_MS = 1e4;
312
312
  const cache = new TTLCache(cacheSeconds * 1e3);
@@ -342,7 +342,7 @@ function createAgentScoreCore(options) {
342
342
  } = options;
343
343
  const baseUrl = stripTrailingSlashes(rawBaseUrl);
344
344
  const agentMemoryHint = buildAgentMemoryHint();
345
- const defaultUa = `@agent-score/commerce@${"1.0.2"}`;
345
+ const defaultUa = `@agent-score/commerce@${"1.0.3"}`;
346
346
  const userAgentHeader = userAgent ? `${userAgent} (${defaultUa})` : defaultUa;
347
347
  const API_TIMEOUT_MS = 1e4;
348
348
  const cache = new TTLCache(cacheSeconds * 1e3);
@@ -306,7 +306,7 @@ function createAgentScoreCore(options) {
306
306
  } = options;
307
307
  const baseUrl = stripTrailingSlashes(rawBaseUrl);
308
308
  const agentMemoryHint = buildAgentMemoryHint();
309
- const defaultUa = `@agent-score/commerce@${"1.0.2"}`;
309
+ const defaultUa = `@agent-score/commerce@${"1.0.3"}`;
310
310
  const userAgentHeader = userAgent ? `${userAgent} (${defaultUa})` : defaultUa;
311
311
  const API_TIMEOUT_MS = 1e4;
312
312
  const cache = new TTLCache(cacheSeconds * 1e3);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-score/commerce",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Agent commerce SDK — identity middleware (Hono, Express, Fastify, Next.js, Web Fetch) + payment helpers + 402 builders + discovery + Stripe multichain. The full merchant-side toolkit for AgentScore-powered agent commerce.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",