@astrasyncai/verification-gateway 4.0.0 → 4.1.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 (134) hide show
  1. package/README.md +106 -29
  2. package/dist/adapter-interface/interface.d.mts +2 -2
  3. package/dist/adapter-interface/interface.d.ts +2 -2
  4. package/dist/adapters/express.d.mts +2 -2
  5. package/dist/adapters/express.d.ts +2 -2
  6. package/dist/adapters/express.js +398 -15
  7. package/dist/adapters/express.js.map +1 -1
  8. package/dist/adapters/express.mjs +398 -15
  9. package/dist/adapters/express.mjs.map +1 -1
  10. package/dist/adapters/http-pdlss.d.mts +3 -3
  11. package/dist/adapters/http-pdlss.d.ts +3 -3
  12. package/dist/adapters/http-pdlss.js.map +1 -1
  13. package/dist/adapters/http-pdlss.mjs.map +1 -1
  14. package/dist/adapters/mcp.d.mts +56 -36
  15. package/dist/adapters/mcp.d.ts +56 -36
  16. package/dist/adapters/mcp.js +220 -3
  17. package/dist/adapters/mcp.js.map +1 -1
  18. package/dist/adapters/mcp.mjs +220 -3
  19. package/dist/adapters/mcp.mjs.map +1 -1
  20. package/dist/adapters/nextjs.d.mts +2 -2
  21. package/dist/adapters/nextjs.d.ts +2 -2
  22. package/dist/adapters/nextjs.js +433 -18
  23. package/dist/adapters/nextjs.js.map +1 -1
  24. package/dist/adapters/nextjs.mjs +433 -18
  25. package/dist/adapters/nextjs.mjs.map +1 -1
  26. package/dist/adapters/sdk.d.mts +2 -2
  27. package/dist/adapters/sdk.d.ts +2 -2
  28. package/dist/adapters/sdk.js +2 -2
  29. package/dist/adapters/sdk.js.map +1 -1
  30. package/dist/adapters/sdk.mjs +2 -2
  31. package/dist/adapters/sdk.mjs.map +1 -1
  32. package/dist/agent/index.d.mts +2 -2
  33. package/dist/agent/index.d.ts +2 -2
  34. package/dist/agent/index.js.map +1 -1
  35. package/dist/agent/index.mjs.map +1 -1
  36. package/dist/bin/astrasync-claude-hook.js +13 -13
  37. package/dist/bin/astrasync-codex-hook.js +13 -13
  38. package/dist/bin/astrasync-guard.js +13 -13
  39. package/dist/bin/astrasync.js +80 -26
  40. package/dist/browser/background.js +13 -13
  41. package/dist/browser/background.js.map +1 -1
  42. package/dist/browser/background.mjs +13 -13
  43. package/dist/browser/background.mjs.map +1 -1
  44. package/dist/browser/browser-adapter.d.mts +2 -2
  45. package/dist/browser/browser-adapter.d.ts +2 -2
  46. package/dist/claude-code/claude-code-adapter.d.mts +2 -2
  47. package/dist/claude-code/claude-code-adapter.d.ts +2 -2
  48. package/dist/cli/index.d.mts +2 -2
  49. package/dist/cli/index.d.ts +2 -2
  50. package/dist/codex/index.d.mts +3 -3
  51. package/dist/codex/index.d.ts +3 -3
  52. package/dist/codex/index.js +13 -13
  53. package/dist/codex/index.js.map +1 -1
  54. package/dist/codex/index.mjs +13 -13
  55. package/dist/codex/index.mjs.map +1 -1
  56. package/dist/cursor/cursor-adapter.d.mts +2 -2
  57. package/dist/cursor/cursor-adapter.d.ts +2 -2
  58. package/dist/cursor/extension.d.mts +2 -2
  59. package/dist/cursor/extension.d.ts +2 -2
  60. package/dist/cursor/extension.js +13 -13
  61. package/dist/cursor/extension.js.map +1 -1
  62. package/dist/cursor/extension.mjs +13 -13
  63. package/dist/cursor/extension.mjs.map +1 -1
  64. package/dist/edge-config.d.mts +22 -7
  65. package/dist/edge-config.d.ts +22 -7
  66. package/dist/edge-config.js.map +1 -1
  67. package/dist/edge-config.mjs.map +1 -1
  68. package/dist/edge-core/index.d.mts +425 -0
  69. package/dist/edge-core/index.d.ts +425 -0
  70. package/dist/edge-core/index.js +1482 -0
  71. package/dist/edge-core/index.js.map +1 -0
  72. package/dist/edge-core/index.mjs +1437 -0
  73. package/dist/edge-core/index.mjs.map +1 -0
  74. package/dist/{express-BZajRs4i.d.mts → express-BVd1_3FE.d.ts} +9 -7
  75. package/dist/{express-CjCUB1k7.d.ts → express-D_4hTn5Z.d.mts} +9 -7
  76. package/dist/gateway/gateway.d.mts +2 -2
  77. package/dist/gateway/gateway.d.ts +2 -2
  78. package/dist/gateway/gateway.js +13 -13
  79. package/dist/gateway/gateway.js.map +1 -1
  80. package/dist/gateway/gateway.mjs +13 -13
  81. package/dist/gateway/gateway.mjs.map +1 -1
  82. package/dist/git-trigger/git-hooks.d.mts +2 -2
  83. package/dist/git-trigger/git-hooks.d.ts +2 -2
  84. package/dist/{index-adgKhujR.d.ts → index-B0YHu_SP.d.ts} +30 -27
  85. package/dist/{index-B0cyMZDL.d.mts → index-BPEBlOsE.d.mts} +30 -27
  86. package/dist/{index-BRYteOqO.d.mts → index-DQb5-_1X.d.mts} +1 -1
  87. package/dist/{index-BZQdVqNw.d.ts → index-T1aBoUcc.d.ts} +1 -1
  88. package/dist/index.d.mts +11 -11
  89. package/dist/index.d.ts +11 -11
  90. package/dist/index.js +477 -265
  91. package/dist/index.js.map +1 -1
  92. package/dist/index.mjs +474 -265
  93. package/dist/index.mjs.map +1 -1
  94. package/dist/local-evaluator/evaluator.d.mts +2 -2
  95. package/dist/local-evaluator/evaluator.d.ts +2 -2
  96. package/dist/metadata-capture.d.mts +63 -4
  97. package/dist/metadata-capture.d.ts +63 -4
  98. package/dist/metadata-capture.js +67 -0
  99. package/dist/metadata-capture.js.map +1 -1
  100. package/dist/metadata-capture.mjs +64 -0
  101. package/dist/metadata-capture.mjs.map +1 -1
  102. package/dist/{nextjs-DeUTnOBd.d.mts → nextjs-WyeVr2Kp.d.mts} +3 -3
  103. package/dist/{nextjs-D_iFf5k-.d.ts → nextjs-w7RTbP1P.d.ts} +3 -3
  104. package/dist/platform-signatures.d.mts +5 -6
  105. package/dist/platform-signatures.d.ts +5 -6
  106. package/dist/platform-signatures.js.map +1 -1
  107. package/dist/platform-signatures.mjs.map +1 -1
  108. package/dist/registration/index.d.mts +10 -11
  109. package/dist/registration/index.d.ts +10 -11
  110. package/dist/registration/index.js.map +1 -1
  111. package/dist/registration/index.mjs.map +1 -1
  112. package/dist/{sdk-BM3mwEAq.d.ts → sdk-CbTNIkAa.d.mts} +4 -4
  113. package/dist/{sdk-_il1Q41f.d.mts → sdk-QeX0Z8Ho.d.ts} +4 -4
  114. package/dist/transport/index.d.mts +2 -2
  115. package/dist/transport/index.d.ts +2 -2
  116. package/dist/transport/index.js.map +1 -1
  117. package/dist/transport/index.mjs.map +1 -1
  118. package/dist/{types-CHKCgDFC.d.ts → types-BLUx92FJ.d.ts} +1 -1
  119. package/dist/{types-DfnP7JiM.d.mts → types-DqfPU5Bl.d.mts} +1 -1
  120. package/dist/{types-BcDf9Kk0.d.mts → types-r850cOt0.d.mts} +106 -88
  121. package/dist/{types-fTQD448H.d.ts → types-sMxBT-nM.d.ts} +106 -88
  122. package/dist/ui/index.d.mts +11 -7
  123. package/dist/ui/index.d.ts +11 -7
  124. package/dist/ui/index.js +13 -9
  125. package/dist/ui/index.js.map +1 -1
  126. package/dist/ui/index.mjs +10 -8
  127. package/dist/ui/index.mjs.map +1 -1
  128. package/dist/verify.d.mts +8 -7
  129. package/dist/verify.d.ts +8 -7
  130. package/dist/verify.js +1 -1
  131. package/dist/verify.js.map +1 -1
  132. package/dist/verify.mjs +1 -1
  133. package/dist/verify.mjs.map +1 -1
  134. package/package.json +8 -2
@@ -16,14 +16,13 @@ type TrustLevel = 'BRONZE' | 'SILVER' | 'GOLD' | 'PLATINUM';
16
16
  * in `access.accessLevel`. SDK reads them verbatim (no client-side remap).
17
17
  *
18
18
  * For ANONYMOUS / unverified callers, the level is determined by the
19
- * endpoint's `unverifiedAgentPolicy` per the verify-access canonical flow
20
- * (see `docs/research/adapter-architecture-technical-requirements.md` §21):
21
- * - Branch A (deny): `none` — caller is denied + advised to register
22
- * - Branch B (allow_partial): `restricted` — reduced/browse-only access + advised
23
- * - Branch C (allow_full): `standard` — unrestricted + advised to register for next time
19
+ * endpoint's `unverifiedAgentPolicy` per the verify-access canonical flow:
20
+ * - deny: `none` — caller is denied + advised to register
21
+ * - allow_partial: `restricted` — reduced/browse-only access + advised
22
+ * - allow_full: `standard` — unrestricted + advised to register for next time
24
23
  * Every branch ALWAYS emits a verification event + queues a blockchain record.
25
24
  *
26
- * For VERIFIED callers (Branch D), the level is resolved server-side from the
25
+ * For VERIFIED callers, the level is resolved server-side from the
27
26
  * agent's live trust score plus the endpoint's `trust_score_requirement`:
28
27
  * - none: agent below endpoint gate (denied; access.allowed=false)
29
28
  * - restricted: 0–19 trust score (registration-prompt only, no real capability)
@@ -32,17 +31,14 @@ type TrustLevel = 'BRONZE' | 'SILVER' | 'GOLD' | 'PLATINUM';
32
31
  * - full: 70+ trust score (PDLSS-scoped, high-trust)
33
32
  * - internal: same-org membership, regardless of score
34
33
  *
35
- * v2.3.9 (defect #30): renamed `'guidance'` band → `'restricted'`. The old
36
- * name collided with the `guidance: {registrationUrl, ...}` help-payload
37
- * object on VerificationResult; in the !apiResponse.access?.allowed branch
38
- * of verify.ts, hardcoded `accessLevel: 'guidance'` plus colocated
39
- * `guidance: {...}` read as internally consistent on review while at
40
- * runtime `hasMinimumAccess('guidance', 'guidance') === true` let denied
41
- * requests pass any route gated at `'guidance'`. Banded vocabulary stays
42
- * capability-noun (none / restricted / read-only / standard / full /
43
- * internal); response-shape descriptors stay nouns (guidance, advisory).
44
- * Defensive `!result.identityVerified || !result.policyAllowed` short-circuit
45
- * also added in adapters as belt-and-braces (round-18 G4 split).
34
+ * v2.3.9 renamed the `'guidance'` band → `'restricted'`. The old name
35
+ * collided with the `guidance: {registrationUrl, ...}` help-payload object
36
+ * on VerificationResult, and the collision let denied requests pass any
37
+ * route gated at `'guidance'` (`hasMinimumAccess('guidance', 'guidance')
38
+ * === true`). Banded vocabulary stays capability-noun (none / restricted /
39
+ * read-only / standard / full / internal); response-shape descriptors stay
40
+ * nouns (guidance, advisory). Adapters additionally short-circuit on
41
+ * `!result.identityVerified || !result.policyAllowed` as belt-and-braces.
46
42
  */
47
43
  type AccessLevel = 'none' | 'restricted' | 'read-only' | 'standard' | 'full' | 'internal';
48
44
  /**
@@ -136,12 +132,11 @@ interface GatewayConfig {
136
132
  */
137
133
  disableInitChecks?: boolean;
138
134
  /**
139
- * Audit F-A6-33: when true, the init self-test runs synchronously on the
140
- * first verify() call and THROWS on misconfig (apiBaseUrl returning HTML,
141
- * unreachable, etc.) instead of warning + continuing. Recommended for
142
- * production deploys where you want a fast-fail startup signal rather
143
- * than silent verify-access call failures. Default false for backward
144
- * compatibility.
135
+ * When true, the init self-test runs synchronously on the first verify()
136
+ * call and THROWS on misconfig (apiBaseUrl returning HTML, unreachable,
137
+ * etc.) instead of warning + continuing. Recommended for production
138
+ * deploys where you want a fast-fail startup signal rather than silent
139
+ * verify-access call failures. Default false for backward compatibility.
145
140
  */
146
141
  strictInit?: boolean;
147
142
  /**
@@ -158,9 +153,9 @@ interface GatewayConfig {
158
153
  * tests assert "this endpoint should be gated; if it falls through, fail
159
154
  * loudly". Default off; opt-in.
160
155
  *
161
- * Round-10 (#49, O10): the header value was renamed from the ambiguous
162
- * `pass-through` to `unenforced` so it describes the GATE state only —
163
- * not whether the request succeeded end-to-end. The config FLAG name
156
+ * The header value was renamed from the ambiguous `pass-through` to
157
+ * `unenforced` so it describes the GATE state only — not whether the
158
+ * request succeeded end-to-end. The config FLAG name
164
159
  * (`setPassThroughHeader`) is unchanged for backwards compatibility.
165
160
  */
166
161
  setPassThroughHeader?: boolean;
@@ -168,13 +163,11 @@ interface GatewayConfig {
168
163
  * v2.3.8: dashboard origin used to construct configuration links in
169
164
  * boot-time warnings (e.g. when no per-route policy is configured).
170
165
  * Defaults to `https://astrasync.ai/dashboard` (the `app.astrasync.ai`
171
- * subdomain referenced in older docs does not currently resolve —
172
- * audit F-PROBE-01).
166
+ * subdomain referenced in older docs does not resolve).
173
167
  */
174
168
  dashboardUrl?: string;
175
169
  /**
176
- * Round-12 (F9, express) / round-13 (R13-5, mcp parity): when true, the
177
- * middleware calls verify-access for any request that presents
170
+ * When true, the middleware calls verify-access for any request that presents
178
171
  * AstraSync credentials, even on routes / MCP risk-tiers with
179
172
  * `minAccessLevel: 'none'`. Populates `req.agentVerification` and
180
173
  * records the verification event for the audit trail. Enforcement
@@ -399,7 +392,7 @@ interface SettlementArtifact {
399
392
  /**
400
393
  * Single failed gate on a verify-access denial. Aggregated into
401
394
  * `VerificationResult.failures[]` so partners can see every blocker in one
402
- * response. v2.9.8 (defect M1) — pre-fix the response was fail-fast on the
395
+ * response (v2.9.8+) — previously the response was fail-fast on the
403
396
  * first failed gate, forcing a fix-and-retry cascade through PDLSS
404
397
  * dimensions, counterparty allowlist, trust score, and attestations.
405
398
  *
@@ -417,19 +410,19 @@ interface AccessFailure {
417
410
  }
418
411
  interface VerificationResult {
419
412
  /**
420
- * Round-18 (G4): identity-verification status — was the caller successfully
413
+ * Identity-verification status — was the caller successfully
421
414
  * resolved to a registered agent (signature/credential check passed)?
422
415
  * Maps to backend `verificationContext.idVerified`. Drives HTTP 401 vs 403
423
416
  * mapping in default adapters: `!identityVerified` → 401 (re-authenticate);
424
417
  * `identityVerified && !policyAllowed` → 403 (re-auth won't help — update
425
- * PDLSS scope or step up). Replaces the round-17-and-earlier `verified`
426
- * field, which collapsed identity and policy into a single boolean and
427
- * forced merchants writing `verified ? 200 : 401` into the wrong HTTP-status
428
- * recovery path on PDLSS denials of authenticated agents.
418
+ * PDLSS scope or step up). Replaces the pre-4.x `verified` field, which
419
+ * collapsed identity and policy into a single boolean and forced merchants
420
+ * writing `verified ? 200 : 401` into the wrong HTTP-status recovery path
421
+ * on PDLSS denials of authenticated agents.
429
422
  */
430
423
  identityVerified: boolean;
431
424
  /**
432
- * Round-18 (G4): does the endpoint's PDLSS / access policy permit this
425
+ * Does the endpoint's PDLSS / access policy permit this
433
426
  * specific action? Maps to backend `access.allowed`. Distinct from
434
427
  * `identityVerified`: a verified agent can be policy-denied (403); an
435
428
  * unverified caller's policy field is `false` by definition.
@@ -457,17 +450,15 @@ interface VerificationResult {
457
450
  */
458
451
  failures?: AccessFailure[];
459
452
  /**
460
- * Round-10 (#47, O5): correlation handle for tying a partner-visible
461
- * denial to a server-side log line. Hoisted here from
462
- * `EnhancedVerificationResult` so adapter onDenied handlers can surface
463
- * it on the merchant's response body. Present on anonymous server
464
- * responses, on synthesised stubs for API-error fallbacks
465
- * (`createGuidanceResponse`), and on the new
466
- * `verify_access.internal_error` 200-shaped failure shape.
453
+ * Correlation handle for tying a partner-visible denial to a server-side
454
+ * log line, surfaced so adapter onDenied handlers can include it on the
455
+ * merchant's response body. Present on anonymous server responses, on
456
+ * synthesised stubs for API-error fallbacks (`createGuidanceResponse`),
457
+ * and on the `verify_access.internal_error` 200-shaped failure shape.
467
458
  */
468
459
  correlationId?: string;
469
460
  /**
470
- * 3.12.0 (Trust Record, §33.5 #3): attempt-chain handle, server-echoed on
461
+ * 3.12.0: attempt-chain handle, server-echoed on
471
462
  * every response branch (caller-supplied or server-minted). Disjoint from
472
463
  * `correlationId`/`sessionId` — those identify one verification EVENT; an
473
464
  * attempt CONTAINS events (the whole catalog → intent → settlement funnel
@@ -528,11 +519,12 @@ interface CallerMetadata {
528
519
  agentCardUrl?: string;
529
520
  /**
530
521
  * The full sanitised view of the agent's inbound request headers + connection
531
- * signals (Workstream D — maximal metadata capture). Produced by
532
- * `sanitizeHeaders` (genuine secrets removed, credential headers reduced to a
533
- * safe format prefix). Forwarded so the endpoint owner sees every wire signal
534
- * about the agent, not just IP/UA. Local string work only — kept OUT of the
535
- * verify cache key so per-request maps don't defeat verdict caching.
522
+ * signals (maximal metadata capture: every signal legitimately visible on
523
+ * the wire is captured). Produced by `sanitizeHeaders` (genuine secrets
524
+ * removed, credential headers reduced to a safe format prefix). Forwarded so
525
+ * the endpoint owner sees every wire signal about the agent, not just IP/UA.
526
+ * Local string work only — kept OUT of the verify cache key so per-request
527
+ * maps don't defeat verdict caching.
536
528
  */
537
529
  observedMetadata?: ObservedMetadata;
538
530
  }
@@ -590,7 +582,7 @@ interface VerificationRequest {
590
582
  timeoutOverride?: number;
591
583
  };
592
584
  /**
593
- * Round-12 (F19): transport protocol marker. Set by the MCP middleware
585
+ * Transport protocol marker. Set by the MCP middleware
594
586
  * to `'mcp'`; non-MCP callers leave it unset (server treats as `'rest'`).
595
587
  * Separates "how did the call arrive" from "what does the agent want"
596
588
  * (`purpose`). Stored on platform_events.eventData for activity-feed
@@ -598,26 +590,26 @@ interface VerificationRequest {
598
590
  */
599
591
  invocationProtocol?: 'rest' | 'mcp' | 'a2a' | 'acp' | 'ap2' | 'mpp' | 'ucp';
600
592
  /**
601
- * 3.9.0 (§33.5 #1) — raw commerce-protocol artifacts forwarded verbatim
602
- * to verify-access, whose Step 0.5 commerce pipeline runs the full
593
+ * 3.9.0 — raw commerce-protocol artifacts forwarded verbatim
594
+ * to verify-access, whose commerce pipeline runs the full
603
595
  * cryptographic verification SERVER-side and persists commerce_context on
604
596
  * the session. Adapters forward artifacts, they never verify them locally
605
- * (bridge-is-transport: verify-access is the sole verification sink, so
606
- * every decision is recorded once, with events). Shape mirrors the
607
- * backend's `commerceArtifacts` schema 1:1.
597
+ * (verify-access is the sole verification sink, so every decision is
598
+ * recorded once, with events). Shape mirrors the backend's
599
+ * `commerceArtifacts` schema 1:1.
608
600
  */
609
601
  commerceArtifacts?: CommerceArtifactsPayload;
610
602
  /**
611
- * 3.12.0 (Trust Record, §33.5 #3) — attempt-chain handle correlating the
603
+ * 3.12.0 — attempt-chain handle correlating the
612
604
  * multi-call commerce funnel (catalog → intent → settlement) into ONE
613
605
  * attempt. Format `att_` + 32 lowercase hex. Optional: the server mints one
614
606
  * when absent and echoes it top-level on every response branch either way.
615
607
  * Observational pass-through — never affects the verdict, so it's excluded
616
- * from the verify cache key (see `getCacheKey`).
608
+ * from the verify cache key.
617
609
  */
618
610
  attemptId?: string;
619
611
  /**
620
- * 3.12.0 (Trust Record, §33.5 #3) — first-party observational data: the
612
+ * 3.12.0 — first-party observational data: the
621
613
  * offers the agent evaluated at this checkpoint (catalog browse / intent
622
614
  * selection). Forwarded verbatim to verify-access; never affects the
623
615
  * verdict (also excluded from the cache key).
@@ -625,7 +617,7 @@ interface VerificationRequest {
625
617
  considerationSet?: ConsiderationSet;
626
618
  }
627
619
  /**
628
- * One offer the agent evaluated (Trust Record, §33.5 #3). Mirrors the
620
+ * One offer the agent evaluated. Mirrors the
629
621
  * backend's `considerationItemSchema` 1:1 — first-party observational data
630
622
  * reported by the transport (bridge / adapters), never verified locally.
631
623
  */
@@ -646,8 +638,8 @@ interface ConsiderationItem {
646
638
  notChosenReason?: 'price' | 'policy' | 'trust_threshold' | 'stock' | 'other';
647
639
  }
648
640
  /**
649
- * The set of offers evaluated at one funnel checkpoint (Trust Record,
650
- * §33.5 #3). Mirrors the backend's `considerationSetSchema` 1:1.
641
+ * The set of offers evaluated at one funnel checkpoint.
642
+ * Mirrors the backend's `considerationSetSchema` 1:1.
651
643
  *
652
644
  * `items` is capped at 50 server-side — reporters MUST order chosen items
653
645
  * FIRST so purchased counts survive truncation; `totalEvaluated` carries the
@@ -665,8 +657,7 @@ interface ConsiderationSet {
665
657
  }
666
658
  /**
667
659
  * Terminal (or notable) outcome of an attempt chain, reported post-hoc via
668
- * `reportAttempt` (Trust Record, §33.5 #3). Mirrors the backend's
669
- * `attemptReportSchema.outcome` 1:1.
660
+ * `reportAttempt`. Mirrors the backend's `attemptReportSchema.outcome` 1:1.
670
661
  */
671
662
  interface AttemptOutcome {
672
663
  kind: 'settled' | 'blocked_step_up' | 'failed' | 'high_value_action';
@@ -684,8 +675,8 @@ interface AttemptOutcome {
684
675
  rail?: string;
685
676
  }
686
677
  /**
687
- * Body for `POST /agents/verify-access/attempt-report` (Trust Record,
688
- * §33.5 #3): post-hoc consideration/outcome data for an attempt chain that a
678
+ * Body for `POST /agents/verify-access/attempt-report`:
679
+ * post-hoc consideration/outcome data for an attempt chain that a
689
680
  * verify-access call couldn't carry (e.g. the catalog was served from a local
690
681
  * cache, or the deny happened transport-side). Must carry `considerationSet`
691
682
  * and/or `outcome`.
@@ -774,7 +765,7 @@ interface RouteAccessConfig {
774
765
  /** HTTP method (or * for all) */
775
766
  method: string | '*';
776
767
  /**
777
- * @deprecated 3.2.0 — the access-level band no longer gates (post-3.1.0 #1).
768
+ * @deprecated 3.2.0 — the access-level band no longer gates.
778
769
  * Optional/ignored; retained for back-compat. Use `minTrustScore` to tighten.
779
770
  */
780
771
  minAccessLevel?: AccessLevel;
@@ -792,13 +783,13 @@ interface RouteAccessConfig {
792
783
  /** Maximum transaction value for this route */
793
784
  maxTransactionValue?: number;
794
785
  /**
795
- * Backend-evaluator strict mode (audit F-A1-09): when true AND
786
+ * Backend-evaluator strict mode: when true AND
796
787
  * `allowedPurposes` is non-empty, verify-access denies requests arriving
797
788
  * WITHOUT a purpose. Configured in the dashboard; passed through here.
798
789
  */
799
790
  requirePurpose?: boolean;
800
791
  /**
801
- * SEND-mapping (Bug 14, §4.6) — not an allow-list: the PDLSS tokens the
792
+ * SEND-mapping — not an allow-list: the PDLSS tokens the
802
793
  * middleware STAMPS on verify-access calls matching this route, replacing
803
794
  * the generic `data`/`data.*` method-table fallback. `purpose` = bare
804
795
  * category noun (`shopping`, `trading`); `action` = dotted verb
@@ -827,8 +818,8 @@ interface ExpressMiddlewareOptions extends GatewayConfig {
827
818
  extractPurpose?: (req: unknown) => string | undefined;
828
819
  /**
829
820
  * Function to extract the PDLSS action from a request — symmetric with
830
- * `extractPurpose` (Bug 14, §4.6: the action axis previously had NO
831
- * override and hardwired the HTTP verb). When configured it masks the
821
+ * `extractPurpose` (previously the action axis had no override and
822
+ * hardwired the HTTP verb). When configured it masks the
832
823
  * `X-Astra-Action` header step; returning undefined falls through to the
833
824
  * pinned method→action table (GET→data.read, POST/PUT/PATCH→data.write,
834
825
  * DELETE→data.delete). Dashboard route mapping still outranks it.
@@ -873,28 +864,39 @@ interface ExpressMiddlewareOptions extends GatewayConfig {
873
864
  *
874
865
  * In shadow mode (default), the middleware ALWAYS logs a
875
866
  * `[SHADOW] would-have-denied` line on throws including correlationId so
876
- * merchants can grep their own logs for impact analysis. SDK 2.4.x reads
877
- * the shadow logs across the 1-week observation window; the default
878
- * flips to `'closed'` in a follow-up release once <0.1% of throws appear
879
- * to be legitimate-traffic regressions.
867
+ * merchants can grep their own logs for impact analysis. The default
868
+ * flips to `'closed'` in a follow-up release once the shadow logs confirm
869
+ * legitimate traffic is unaffected.
880
870
  *
881
871
  * Small-value demo merchants can keep `'open'` indefinitely after the
882
- * default flip by setting this explicitly (audit F-A1-06).
872
+ * default flip by setting this explicitly.
883
873
  */
884
874
  failOnError?: 'open' | 'closed';
885
875
  /**
886
- * When true, route-pattern matching is case-insensitive (audit F-A6-31,
887
- * round-18.6.5 Finding #1 from astrasync.shop). Default false in SDK
888
- * 2.4.13 for backward compatibility; shadow logs record divergences so
889
- * merchants can preview impact before flipping. Follow-up release makes
890
- * case-insensitive the default after 1-week observation confirms <5
891
- * merchants with divergence-events.
876
+ * When true, route-pattern matching is case-insensitive. Default false in
877
+ * SDK 2.4.13 for backward compatibility; shadow logs record divergences so
878
+ * merchants can preview impact before flipping. A follow-up release makes
879
+ * case-insensitive the default once observation confirms merchants are
880
+ * unaffected.
892
881
  *
893
882
  * Recommended: set to true if your Express install uses the default
894
883
  * (case-insensitive) routing AND your policy entries don't deliberately
895
884
  * use case distinctions.
896
885
  */
897
886
  caseInsensitiveRouteMatch?: boolean;
887
+ /**
888
+ * Emit a fire-and-forget beacon for bot- and agent-shaped traffic that
889
+ * passes through UNGATED (no dashboard route matches the path, or the
890
+ * matching route is gated at `none`), so the endpoint's dashboard sees
891
+ * anonymous agent traffic the gate never evaluates. Human traffic and
892
+ * static assets are never beaconed; platform-fingerprinted agents always
893
+ * beacon; other non-browser traffic is sampled at the dashboard-configured
894
+ * `sampling.anonymousBeaconRate` (set the rate to 0 in the dashboard to
895
+ * stop sampling). The beacon is never awaited on the request path and adds
896
+ * no latency. Requires `counterpartyId`. Default true; set false to
897
+ * disable the beacon and its config fetch entirely.
898
+ */
899
+ anonymousBeacon?: boolean;
898
900
  }
899
901
  /**
900
902
  * Next.js middleware options.
@@ -907,9 +909,15 @@ interface NextJsMiddlewareOptions extends GatewayConfig {
907
909
  skipPaths?: string[];
908
910
  /** Refresh interval (ms) for the remote-fetched route policy. Default: 5 minutes. */
909
911
  routesRefreshMs?: number;
910
- /** Whether to show Commerce Shield overlay for unverified */
912
+ /**
913
+ * Whether to show the verification interstitial (the HTML overlay served to
914
+ * unverified web-page traffic). Default true. Takes precedence over the
915
+ * deprecated `showCommerceShield` when both are set.
916
+ */
917
+ showInterstitial?: boolean;
918
+ /** @deprecated Renamed in 4.1.0 — use `showInterstitial`. Alias removed next major. */
911
919
  showCommerceShield?: boolean;
912
- /** Commerce Shield configuration */
920
+ /** Verification interstitial configuration */
913
921
  commerceShield?: {
914
922
  title?: string;
915
923
  message?: string;
@@ -918,6 +926,13 @@ interface NextJsMiddlewareOptions extends GatewayConfig {
918
926
  };
919
927
  /** Enable runtime challenge for all verify-access calls (default: true) */
920
928
  enableRuntimeChallenge?: boolean;
929
+ /**
930
+ * Emit a fire-and-forget beacon for bot- and agent-shaped traffic that
931
+ * passes through ungated — same semantics as the express option of the
932
+ * same name (see `ExpressMiddlewareOptions.anonymousBeacon`). Default
933
+ * true; set false to disable entirely.
934
+ */
935
+ anonymousBeacon?: boolean;
921
936
  }
922
937
  /**
923
938
  * SDK function options
@@ -1023,10 +1038,11 @@ interface AstraSyncCredentials {
1023
1038
  */
1024
1039
  type ProtocolTransport = 'http' | 'a2a' | 'mcp';
1025
1040
  /**
1026
- * Commerce Shield UI props
1041
+ * Verification interstitial UI props (the React overlay shown to unverified
1042
+ * agents; user-visible title stays "AstraSync Agent Verification").
1027
1043
  */
1028
- interface CommerceShieldProps {
1029
- /** Whether the shield is visible */
1044
+ interface VerificationInterstitialProps {
1045
+ /** Whether the interstitial is visible */
1030
1046
  visible: boolean;
1031
1047
  /** Verification result (if any) */
1032
1048
  result?: VerificationResult;
@@ -1045,5 +1061,7 @@ interface CommerceShieldProps {
1045
1061
  /** Custom styles */
1046
1062
  className?: string;
1047
1063
  }
1064
+ /** @deprecated Renamed VerificationInterstitialProps in 4.1.0; alias removed next major. */
1065
+ type CommerceShieldProps = VerificationInterstitialProps;
1048
1066
 
1049
- export type { AccessFailure as A, CallerMetadata as C, EnhancedVerificationResult as E, FiatSettlementBinding as F, GatewayConfig as G, NextJsMiddlewareOptions as N, PDLSSInfo as P, RouteAccessConfig as R, SDKOptions as S, TokenGuidance as T, VerificationRequest as V, AccessLevel as a, AgentCredentials as b, AstraSyncCredentials as c, AttemptOutcome as d, AttemptReport as e, CommerceArtifactsPayload as f, CommerceShieldProps as g, ConsiderationItem as h, ConsiderationSet as i, CounterpartyType as j, ExpressMiddlewareOptions as k, GuidanceInfo as l, ProtocolTransport as m, RuntimeChallengeResult as n, SettlementArtifact as o, SettlementArtifactBinding as p, SettlementArtifactBindingBase as q, StablecoinSettlementBinding as r, StepUpApprovalInfo as s, StepUpApprovalStatus as t, StepUpOutcome as u, TrustLevel as v, VerificationResult as w, VerifiedAgent as x, VerifiedDeveloper as y, VerifiedOrganization as z };
1067
+ export type { AccessFailure as A, VerifiedOrganization as B, CallerMetadata as C, EnhancedVerificationResult as E, FiatSettlementBinding as F, GatewayConfig as G, NextJsMiddlewareOptions as N, PDLSSInfo as P, RouteAccessConfig as R, SDKOptions as S, TokenGuidance as T, VerificationInterstitialProps as V, AccessLevel as a, AgentCredentials as b, AstraSyncCredentials as c, AttemptOutcome as d, AttemptReport as e, CommerceArtifactsPayload as f, CommerceShieldProps as g, ConsiderationItem as h, ConsiderationSet as i, CounterpartyType as j, ExpressMiddlewareOptions as k, GuidanceInfo as l, ProtocolTransport as m, RuntimeChallengeResult as n, SettlementArtifact as o, SettlementArtifactBinding as p, SettlementArtifactBindingBase as q, StablecoinSettlementBinding as r, StepUpApprovalInfo as s, StepUpApprovalStatus as t, StepUpOutcome as u, TrustLevel as v, VerificationRequest as w, VerificationResult as x, VerifiedAgent as y, VerifiedDeveloper as z };
@@ -1,21 +1,25 @@
1
- import { g as CommerceShieldProps, w as VerificationResult, b as AgentCredentials, l as GuidanceInfo, v as TrustLevel } from '../types-BcDf9Kk0.mjs';
1
+ import { V as VerificationInterstitialProps, x as VerificationResult, b as AgentCredentials, l as GuidanceInfo, v as TrustLevel } from '../types-r850cOt0.mjs';
2
2
  import '../metadata-capture.mjs';
3
3
 
4
4
  /**
5
- * AstraSync Commerce Shield Component
5
+ * AstraSync Verification Interstitial Component
6
6
  *
7
7
  * A React component that displays a verification overlay for unverified agents.
8
8
  * Shows guidance on how to register and get verified access.
9
+ *
10
+ * Renamed from `CommerceShield` in 4.1.0; the old names are re-exported as
11
+ * deprecated aliases from `./index` until the next major.
9
12
  */
10
13
 
11
14
  /**
12
- * Commerce Shield overlay component
15
+ * Verification interstitial overlay component. Shown to unverified agents
16
+ * (the user-visible title remains "AstraSync Agent Verification").
13
17
  */
14
- declare function CommerceShield({ visible, result, onRegister, onGuestAccess, onDismiss, title, message, allowGuestAccess, className, }: CommerceShieldProps): JSX.Element | null;
18
+ declare function VerificationInterstitial({ visible, result, onRegister, onGuestAccess, onDismiss, title, message, allowGuestAccess, className, }: VerificationInterstitialProps): JSX.Element | null;
15
19
  /**
16
- * Hook to manage Commerce Shield visibility
20
+ * Hook to manage verification-interstitial visibility
17
21
  */
18
- declare function useCommerceShield(verificationResult: VerificationResult | null): {
22
+ declare function useVerificationInterstitial(verificationResult: VerificationResult | null): {
19
23
  visible: boolean;
20
24
  dismiss: () => void;
21
25
  reset: () => void;
@@ -138,4 +142,4 @@ interface DenialReasonsProps {
138
142
  }
139
143
  declare function DenialReasons({ reasons, className }: DenialReasonsProps): JSX.Element;
140
144
 
141
- export { AccessLevelIndicator, type AccessLevelIndicatorProps, CommerceShield, CredentialPrompt, type CredentialPromptProps, DenialReasons, type DenialReasonsProps, GuidanceCard, type GuidanceCardProps, TrustLevelBadge, type TrustLevelBadgeProps, useCommerceShield, useCredentialPrompt };
145
+ export { AccessLevelIndicator, type AccessLevelIndicatorProps, VerificationInterstitial as CommerceShield, VerificationInterstitialProps as CommerceShieldProps, CredentialPrompt, type CredentialPromptProps, DenialReasons, type DenialReasonsProps, GuidanceCard, type GuidanceCardProps, TrustLevelBadge, type TrustLevelBadgeProps, VerificationInterstitial, VerificationInterstitialProps, useVerificationInterstitial as useCommerceShield, useCredentialPrompt, useVerificationInterstitial };
@@ -1,21 +1,25 @@
1
- import { g as CommerceShieldProps, w as VerificationResult, b as AgentCredentials, l as GuidanceInfo, v as TrustLevel } from '../types-fTQD448H.js';
1
+ import { V as VerificationInterstitialProps, x as VerificationResult, b as AgentCredentials, l as GuidanceInfo, v as TrustLevel } from '../types-sMxBT-nM.js';
2
2
  import '../metadata-capture.js';
3
3
 
4
4
  /**
5
- * AstraSync Commerce Shield Component
5
+ * AstraSync Verification Interstitial Component
6
6
  *
7
7
  * A React component that displays a verification overlay for unverified agents.
8
8
  * Shows guidance on how to register and get verified access.
9
+ *
10
+ * Renamed from `CommerceShield` in 4.1.0; the old names are re-exported as
11
+ * deprecated aliases from `./index` until the next major.
9
12
  */
10
13
 
11
14
  /**
12
- * Commerce Shield overlay component
15
+ * Verification interstitial overlay component. Shown to unverified agents
16
+ * (the user-visible title remains "AstraSync Agent Verification").
13
17
  */
14
- declare function CommerceShield({ visible, result, onRegister, onGuestAccess, onDismiss, title, message, allowGuestAccess, className, }: CommerceShieldProps): JSX.Element | null;
18
+ declare function VerificationInterstitial({ visible, result, onRegister, onGuestAccess, onDismiss, title, message, allowGuestAccess, className, }: VerificationInterstitialProps): JSX.Element | null;
15
19
  /**
16
- * Hook to manage Commerce Shield visibility
20
+ * Hook to manage verification-interstitial visibility
17
21
  */
18
- declare function useCommerceShield(verificationResult: VerificationResult | null): {
22
+ declare function useVerificationInterstitial(verificationResult: VerificationResult | null): {
19
23
  visible: boolean;
20
24
  dismiss: () => void;
21
25
  reset: () => void;
@@ -138,4 +142,4 @@ interface DenialReasonsProps {
138
142
  }
139
143
  declare function DenialReasons({ reasons, className }: DenialReasonsProps): JSX.Element;
140
144
 
141
- export { AccessLevelIndicator, type AccessLevelIndicatorProps, CommerceShield, CredentialPrompt, type CredentialPromptProps, DenialReasons, type DenialReasonsProps, GuidanceCard, type GuidanceCardProps, TrustLevelBadge, type TrustLevelBadgeProps, useCommerceShield, useCredentialPrompt };
145
+ export { AccessLevelIndicator, type AccessLevelIndicatorProps, VerificationInterstitial as CommerceShield, VerificationInterstitialProps as CommerceShieldProps, CredentialPrompt, type CredentialPromptProps, DenialReasons, type DenialReasonsProps, GuidanceCard, type GuidanceCardProps, TrustLevelBadge, type TrustLevelBadgeProps, VerificationInterstitial, VerificationInterstitialProps, useVerificationInterstitial as useCommerceShield, useCredentialPrompt, useVerificationInterstitial };
package/dist/ui/index.js CHANGED
@@ -31,17 +31,19 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  var ui_exports = {};
32
32
  __export(ui_exports, {
33
33
  AccessLevelIndicator: () => AccessLevelIndicator,
34
- CommerceShield: () => CommerceShield,
34
+ CommerceShield: () => VerificationInterstitial,
35
35
  CredentialPrompt: () => CredentialPrompt,
36
36
  DenialReasons: () => DenialReasons,
37
37
  GuidanceCard: () => GuidanceCard,
38
38
  TrustLevelBadge: () => TrustLevelBadge,
39
- useCommerceShield: () => useCommerceShield,
40
- useCredentialPrompt: () => useCredentialPrompt
39
+ VerificationInterstitial: () => VerificationInterstitial,
40
+ useCommerceShield: () => useVerificationInterstitial,
41
+ useCredentialPrompt: () => useCredentialPrompt,
42
+ useVerificationInterstitial: () => useVerificationInterstitial
41
43
  });
42
44
  module.exports = __toCommonJS(ui_exports);
43
45
 
44
- // src/ui/commerce-shield.tsx
46
+ // src/ui/verification-interstitial.tsx
45
47
  var import_react = __toESM(require("react"));
46
48
  var import_jsx_runtime = require("react/jsx-runtime");
47
49
  var defaultStyles = {
@@ -137,7 +139,7 @@ var defaultStyles = {
137
139
  textDecoration: "none"
138
140
  }
139
141
  };
140
- function CommerceShield({
142
+ function VerificationInterstitial({
141
143
  visible,
142
144
  result,
143
145
  onRegister,
@@ -181,10 +183,10 @@ function CommerceShield({
181
183
  className,
182
184
  role: "dialog",
183
185
  "aria-modal": "true",
184
- "aria-labelledby": "commerce-shield-title",
186
+ "aria-labelledby": "verification-interstitial-title",
185
187
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: defaultStyles.container, children: [
186
188
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: defaultStyles.icon, "aria-hidden": "true", children: "\u{1F6E1}\uFE0F" }),
187
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { id: "commerce-shield-title", style: defaultStyles.title, children: title }),
189
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { id: "verification-interstitial-title", style: defaultStyles.title, children: title }),
188
190
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { style: defaultStyles.message, children: displayMessage }),
189
191
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: defaultStyles.stepsContainer, children: [
190
192
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { style: defaultStyles.stepsTitle, children: "To get verified access:" }),
@@ -226,7 +228,7 @@ function CommerceShield({
226
228
  }
227
229
  );
228
230
  }
229
- function useCommerceShield(verificationResult) {
231
+ function useVerificationInterstitial(verificationResult) {
230
232
  const [visible, setVisible] = import_react.default.useState(false);
231
233
  const [dismissed, setDismissed] = import_react.default.useState(false);
232
234
  import_react.default.useEffect(() => {
@@ -820,7 +822,9 @@ function DenialReasons({ reasons, className }) {
820
822
  DenialReasons,
821
823
  GuidanceCard,
822
824
  TrustLevelBadge,
825
+ VerificationInterstitial,
823
826
  useCommerceShield,
824
- useCredentialPrompt
827
+ useCredentialPrompt,
828
+ useVerificationInterstitial
825
829
  });
826
830
  //# sourceMappingURL=index.js.map