@astrasyncai/verification-gateway 4.5.1 → 5.0.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 (140) hide show
  1. package/README.md +1 -1
  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 +11 -33
  7. package/dist/adapters/express.js.map +1 -1
  8. package/dist/adapters/express.mjs +11 -33
  9. package/dist/adapters/express.mjs.map +1 -1
  10. package/dist/adapters/mcp.d.mts +2 -2
  11. package/dist/adapters/mcp.d.ts +2 -2
  12. package/dist/adapters/mcp.js +28 -65
  13. package/dist/adapters/mcp.js.map +1 -1
  14. package/dist/adapters/mcp.mjs +27 -64
  15. package/dist/adapters/mcp.mjs.map +1 -1
  16. package/dist/adapters/nextjs.d.mts +2 -2
  17. package/dist/adapters/nextjs.d.ts +2 -2
  18. package/dist/adapters/nextjs.js +9 -30
  19. package/dist/adapters/nextjs.js.map +1 -1
  20. package/dist/adapters/nextjs.mjs +9 -30
  21. package/dist/adapters/nextjs.mjs.map +1 -1
  22. package/dist/adapters/sdk.d.mts +2 -2
  23. package/dist/adapters/sdk.d.ts +2 -2
  24. package/dist/adapters/sdk.js +8 -124
  25. package/dist/adapters/sdk.js.map +1 -1
  26. package/dist/adapters/sdk.mjs +8 -122
  27. package/dist/adapters/sdk.mjs.map +1 -1
  28. package/dist/agent/index.d.mts +2 -2
  29. package/dist/agent/index.d.ts +2 -2
  30. package/dist/agent/index.js +1 -1
  31. package/dist/agent/index.js.map +1 -1
  32. package/dist/agent/index.mjs +1 -1
  33. package/dist/agent/index.mjs.map +1 -1
  34. package/dist/bin/astrasync-claude-hook.js +63 -41
  35. package/dist/bin/astrasync-codex-hook.js +63 -41
  36. package/dist/bin/astrasync-guard.js +63 -41
  37. package/dist/bin/astrasync.js +75 -48
  38. package/dist/browser/background.js +63 -41
  39. package/dist/browser/background.js.map +1 -1
  40. package/dist/browser/background.mjs +63 -41
  41. package/dist/browser/background.mjs.map +1 -1
  42. package/dist/browser/browser-adapter.d.mts +2 -2
  43. package/dist/browser/browser-adapter.d.ts +2 -2
  44. package/dist/claude-code/claude-code-adapter.d.mts +2 -2
  45. package/dist/claude-code/claude-code-adapter.d.ts +2 -2
  46. package/dist/cli/index.d.mts +2 -2
  47. package/dist/cli/index.d.ts +2 -2
  48. package/dist/cli/index.js +33 -6
  49. package/dist/cli/index.js.map +1 -1
  50. package/dist/cli/index.mjs +33 -6
  51. package/dist/cli/index.mjs.map +1 -1
  52. package/dist/codex/index.d.mts +2 -2
  53. package/dist/codex/index.d.ts +2 -2
  54. package/dist/codex/index.js +63 -41
  55. package/dist/codex/index.js.map +1 -1
  56. package/dist/codex/index.mjs +63 -41
  57. package/dist/codex/index.mjs.map +1 -1
  58. package/dist/cursor/cursor-adapter.d.mts +2 -2
  59. package/dist/cursor/cursor-adapter.d.ts +2 -2
  60. package/dist/cursor/extension.d.mts +2 -2
  61. package/dist/cursor/extension.d.ts +2 -2
  62. package/dist/cursor/extension.js +63 -41
  63. package/dist/cursor/extension.js.map +1 -1
  64. package/dist/cursor/extension.mjs +63 -41
  65. package/dist/cursor/extension.mjs.map +1 -1
  66. package/dist/edge-config.d.mts +1 -1
  67. package/dist/edge-config.d.ts +1 -1
  68. package/dist/edge-config.js +1 -1
  69. package/dist/edge-config.js.map +1 -1
  70. package/dist/edge-config.mjs +1 -1
  71. package/dist/edge-config.mjs.map +1 -1
  72. package/dist/edge-core/index.d.mts +1 -3
  73. package/dist/edge-core/index.d.ts +1 -3
  74. package/dist/edge-core/index.js +11 -33
  75. package/dist/edge-core/index.js.map +1 -1
  76. package/dist/edge-core/index.mjs +11 -33
  77. package/dist/edge-core/index.mjs.map +1 -1
  78. package/dist/{express-DaqL11tx.d.ts → express-B5lWuemA.d.ts} +1 -1
  79. package/dist/{express-CR6F3njD.d.mts → express-Dm-snUuY.d.mts} +1 -1
  80. package/dist/gateway/gateway.d.mts +2 -2
  81. package/dist/gateway/gateway.d.ts +2 -2
  82. package/dist/gateway/gateway.js +63 -41
  83. package/dist/gateway/gateway.js.map +1 -1
  84. package/dist/gateway/gateway.mjs +63 -41
  85. package/dist/gateway/gateway.mjs.map +1 -1
  86. package/dist/git-trigger/git-hooks.d.mts +2 -2
  87. package/dist/git-trigger/git-hooks.d.ts +2 -2
  88. package/dist/{index-Cub7lK-T.d.mts → index-B5k_vUmK.d.mts} +1 -1
  89. package/dist/{index-BfIxCYIZ.d.ts → index-BOzM6xUq.d.mts} +1 -2
  90. package/dist/{index-CwAh7Tln.d.mts → index-dRfxUdFA.d.ts} +1 -2
  91. package/dist/{index-B5Ts1WtM.d.ts → index-y8xToocF.d.ts} +1 -1
  92. package/dist/index.d.mts +10 -10
  93. package/dist/index.d.ts +10 -10
  94. package/dist/index.js +30 -217
  95. package/dist/index.js.map +1 -1
  96. package/dist/index.mjs +30 -210
  97. package/dist/index.mjs.map +1 -1
  98. package/dist/local-evaluator/evaluator.d.mts +2 -2
  99. package/dist/local-evaluator/evaluator.d.ts +2 -2
  100. package/dist/local-evaluator/evaluator.js +22 -7
  101. package/dist/local-evaluator/evaluator.js.map +1 -1
  102. package/dist/local-evaluator/evaluator.mjs +22 -7
  103. package/dist/local-evaluator/evaluator.mjs.map +1 -1
  104. package/dist/{mcp-BgBJu4Jl.d.mts → mcp-DgsyQiQq.d.mts} +53 -52
  105. package/dist/{mcp--DgKOwfu.d.ts → mcp-OosmAcKf.d.ts} +53 -52
  106. package/dist/{nextjs-DlX6xwbU.d.mts → nextjs-B1sBdEav.d.mts} +1 -1
  107. package/dist/{nextjs-DL6uE1ye.d.ts → nextjs-DoRmhV_Z.d.ts} +1 -1
  108. package/dist/registration/index.d.mts +5 -1
  109. package/dist/registration/index.d.ts +5 -1
  110. package/dist/registration/index.js +1 -1
  111. package/dist/registration/index.js.map +1 -1
  112. package/dist/registration/index.mjs +1 -1
  113. package/dist/registration/index.mjs.map +1 -1
  114. package/dist/sdk-B83N3xKc.d.mts +142 -0
  115. package/dist/sdk-H_9BTNBS.d.ts +142 -0
  116. package/dist/transport/index.d.mts +2 -2
  117. package/dist/transport/index.d.ts +2 -2
  118. package/dist/transport/index.js +1 -1
  119. package/dist/transport/index.js.map +1 -1
  120. package/dist/transport/index.mjs +1 -1
  121. package/dist/transport/index.mjs.map +1 -1
  122. package/dist/{types-DwSfO7Sb.d.ts → types-BK2POWNc.d.ts} +23 -50
  123. package/dist/{types-C0zfSXMB.d.mts → types-CJjZvPr9.d.mts} +23 -50
  124. package/dist/{types-C7Rb-w0d.d.mts → types-CXf3q4kZ.d.ts} +14 -3
  125. package/dist/{types-nIh3HtuA.d.ts → types-DQmop7ZW.d.mts} +14 -3
  126. package/dist/ui/index.d.mts +2 -17
  127. package/dist/ui/index.d.ts +2 -17
  128. package/dist/ui/index.js +1 -43
  129. package/dist/ui/index.js.map +1 -1
  130. package/dist/ui/index.mjs +1 -42
  131. package/dist/ui/index.mjs.map +1 -1
  132. package/dist/verify.d.mts +3 -4
  133. package/dist/verify.d.ts +3 -4
  134. package/dist/verify.js +8 -28
  135. package/dist/verify.js.map +1 -1
  136. package/dist/verify.mjs +8 -28
  137. package/dist/verify.mjs.map +1 -1
  138. package/package.json +1 -1
  139. package/dist/sdk-Bbh9B_dw.d.mts +0 -215
  140. package/dist/sdk-C6SASmsh.d.ts +0 -215
@@ -10,37 +10,6 @@ import { ObservedMetadata } from './metadata-capture.js';
10
10
  * Trust levels assigned to agents based on their composite trust score
11
11
  */
12
12
  type TrustLevel = 'BRONZE' | 'SILVER' | 'GOLD' | 'PLATINUM';
13
- /**
14
- * Access levels granted based on verification result. Server is the single
15
- * source of truth — these values are the resolved decision the server returns
16
- * in `access.accessLevel`. SDK reads them verbatim (no client-side remap).
17
- *
18
- * For ANONYMOUS / unverified callers, the level is determined by the
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
23
- * Every branch ALWAYS emits a verification event + queues a blockchain record.
24
- *
25
- * For VERIFIED callers, the level is resolved server-side from the
26
- * agent's live trust score plus the endpoint's `trust_score_requirement`:
27
- * - none: agent below endpoint gate (denied; access.allowed=false)
28
- * - restricted: 0–19 trust score (registration-prompt only, no real capability)
29
- * - read-only: 20–39 trust score (browse, no mutations)
30
- * - standard: 40–69 trust score (PDLSS-scoped operations)
31
- * - full: 70+ trust score (PDLSS-scoped, high-trust)
32
- * - internal: same-org membership, regardless of score
33
- *
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.
42
- */
43
- type AccessLevel = 'none' | 'restricted' | 'read-only' | 'standard' | 'full' | 'internal';
44
13
  /**
45
14
  * Types of counterparties that can integrate the gateway
46
15
  */
@@ -66,14 +35,12 @@ interface GatewayConfig {
66
35
  apiBaseUrl: string;
67
36
  /** API key for authenticating with AstraSync. */
68
37
  apiKey?: string;
69
- /** Default access level for unverified requests */
70
- defaultAccessLevel?: AccessLevel;
71
38
  /**
72
39
  * @deprecated Removed in v2.3.0 — server is the single source of truth for
73
- * access-level decisions. Setting this no longer affects access decisions
74
- * (the SDK reads `access.accessLevel` from the verify-access response).
75
- * If you need a higher gate for an endpoint, configure it server-side via
76
- * the endpoint's `trust_score_requirement`.
40
+ * access decisions (verified ID + runtime challenge + PDLSS + trust score).
41
+ * Setting this no longer affects access decisions. If you need a higher gate
42
+ * for an endpoint, configure it server-side via the endpoint's
43
+ * `trust_score_requirement`.
77
44
  */
78
45
  minTrustScore?: number;
79
46
  /**
@@ -168,12 +135,11 @@ interface GatewayConfig {
168
135
  dashboardUrl?: string;
169
136
  /**
170
137
  * When true, the middleware calls verify-access for any request that presents
171
- * AstraSync credentials, even on routes / MCP risk-tiers with
172
- * `minAccessLevel: 'none'`. Populates `req.agentVerification` and
173
- * records the verification event for the audit trail. Enforcement
174
- * still respects route / tier policy — a `none` floor still grants
175
- * regardless of access level. Default false to preserve existing
176
- * behaviour.
138
+ * AstraSync credentials, even on `observe`-marked routes / tools that would
139
+ * otherwise pass through unevaluated. Populates `req.agentVerification` and
140
+ * records the verification event for the audit trail. Enforcement still
141
+ * respects the gate — an `observe` marker still passes through regardless of
142
+ * the server decision. Default false to preserve existing behaviour.
177
143
  *
178
144
  * Use this when a single endpoint serves both anonymous and verified
179
145
  * traffic with different response shapes (e.g. anonymous catalog vs
@@ -428,8 +394,6 @@ interface VerificationResult {
428
394
  * unverified caller's policy field is `false` by definition.
429
395
  */
430
396
  policyAllowed: boolean;
431
- /** Access level granted */
432
- accessLevel: AccessLevel;
433
397
  /** Verified agent info (if verified) */
434
398
  agent?: VerifiedAgent;
435
399
  /** Developer info (if available) */
@@ -475,6 +439,14 @@ interface VerificationResult {
475
439
  * `MERCHANT_VERIFICATION_MISCONFIGURED` instead of a misleading 401.
476
440
  */
477
441
  misconfigured?: boolean;
442
+ /**
443
+ * 4.6.0: a TRANSIENT infrastructure failure (`verify_access.api_error` — a
444
+ * 5xx / timeout / CSRF-403 reaching the verify-access backend), NOT a policy
445
+ * deny and NOT a deterministic misconfig. Consumers should surface it as an
446
+ * error-and-retry (recommendation `'error'`), never as a policy denial. Unset
447
+ * on misconfig (deterministic — retrying will not help) and on real denials.
448
+ */
449
+ retryable?: boolean;
478
450
  /** Whether step-up authentication is required */
479
451
  requiresStepUp?: boolean;
480
452
  /** Whether approval is required */
@@ -765,10 +737,12 @@ interface RouteAccessConfig {
765
737
  /** HTTP method (or * for all) */
766
738
  method: string | '*';
767
739
  /**
768
- * @deprecated 3.2.0 — the access-level band no longer gates.
769
- * Optional/ignored; retained for back-compat. Use `minTrustScore` to tighten.
740
+ * Pass this route through unenforced (observe). The middleware skips gating
741
+ * on the server decision; with `evaluateAlwaysIfCredentialed` set it still
742
+ * calls verify-access for the audit trail and populates `req.agentVerification`.
743
+ * Replaces the old `minAccessLevel: 'none'` sentinel (SDK 5.0.0).
770
744
  */
771
- minAccessLevel?: AccessLevel;
745
+ observe?: boolean;
772
746
  /** Minimum trust score required (optional) */
773
747
  minTrustScore?: number;
774
748
  /** Required purposes (optional, agent must declare one of these) */
@@ -944,7 +918,6 @@ interface NextJsMiddlewareOptions extends GatewayConfig {
944
918
  title?: string;
945
919
  message?: string;
946
920
  allowGuestAccess?: boolean;
947
- guestAccessLevel?: AccessLevel;
948
921
  };
949
922
  /** Enable runtime challenge for all verify-access calls (default: true) */
950
923
  enableRuntimeChallenge?: boolean;
@@ -1086,4 +1059,4 @@ interface VerificationInterstitialProps {
1086
1059
  /** @deprecated Renamed VerificationInterstitialProps in 4.1.0; alias removed next major. */
1087
1060
  type CommerceShieldProps = VerificationInterstitialProps;
1088
1061
 
1089
- 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 };
1062
+ 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, VerificationInterstitialProps as V, AgentCredentials as a, AstraSyncCredentials as b, AttemptOutcome as c, AttemptReport as d, CommerceArtifactsPayload as e, CommerceShieldProps as f, ConsiderationItem as g, ConsiderationSet as h, CounterpartyType as i, ExpressMiddlewareOptions as j, GuidanceInfo as k, ProtocolTransport as l, RuntimeChallengeResult as m, SettlementArtifact as n, SettlementArtifactBinding as o, SettlementArtifactBindingBase as p, StablecoinSettlementBinding as q, StepUpApprovalInfo as r, StepUpApprovalStatus as s, StepUpOutcome as t, TrustLevel as u, VerificationRequest as v, VerificationResult as w, VerifiedAgent as x, VerifiedDeveloper as y, VerifiedOrganization as z };
@@ -10,37 +10,6 @@ import { ObservedMetadata } from './metadata-capture.mjs';
10
10
  * Trust levels assigned to agents based on their composite trust score
11
11
  */
12
12
  type TrustLevel = 'BRONZE' | 'SILVER' | 'GOLD' | 'PLATINUM';
13
- /**
14
- * Access levels granted based on verification result. Server is the single
15
- * source of truth — these values are the resolved decision the server returns
16
- * in `access.accessLevel`. SDK reads them verbatim (no client-side remap).
17
- *
18
- * For ANONYMOUS / unverified callers, the level is determined by the
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
23
- * Every branch ALWAYS emits a verification event + queues a blockchain record.
24
- *
25
- * For VERIFIED callers, the level is resolved server-side from the
26
- * agent's live trust score plus the endpoint's `trust_score_requirement`:
27
- * - none: agent below endpoint gate (denied; access.allowed=false)
28
- * - restricted: 0–19 trust score (registration-prompt only, no real capability)
29
- * - read-only: 20–39 trust score (browse, no mutations)
30
- * - standard: 40–69 trust score (PDLSS-scoped operations)
31
- * - full: 70+ trust score (PDLSS-scoped, high-trust)
32
- * - internal: same-org membership, regardless of score
33
- *
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.
42
- */
43
- type AccessLevel = 'none' | 'restricted' | 'read-only' | 'standard' | 'full' | 'internal';
44
13
  /**
45
14
  * Types of counterparties that can integrate the gateway
46
15
  */
@@ -66,14 +35,12 @@ interface GatewayConfig {
66
35
  apiBaseUrl: string;
67
36
  /** API key for authenticating with AstraSync. */
68
37
  apiKey?: string;
69
- /** Default access level for unverified requests */
70
- defaultAccessLevel?: AccessLevel;
71
38
  /**
72
39
  * @deprecated Removed in v2.3.0 — server is the single source of truth for
73
- * access-level decisions. Setting this no longer affects access decisions
74
- * (the SDK reads `access.accessLevel` from the verify-access response).
75
- * If you need a higher gate for an endpoint, configure it server-side via
76
- * the endpoint's `trust_score_requirement`.
40
+ * access decisions (verified ID + runtime challenge + PDLSS + trust score).
41
+ * Setting this no longer affects access decisions. If you need a higher gate
42
+ * for an endpoint, configure it server-side via the endpoint's
43
+ * `trust_score_requirement`.
77
44
  */
78
45
  minTrustScore?: number;
79
46
  /**
@@ -168,12 +135,11 @@ interface GatewayConfig {
168
135
  dashboardUrl?: string;
169
136
  /**
170
137
  * When true, the middleware calls verify-access for any request that presents
171
- * AstraSync credentials, even on routes / MCP risk-tiers with
172
- * `minAccessLevel: 'none'`. Populates `req.agentVerification` and
173
- * records the verification event for the audit trail. Enforcement
174
- * still respects route / tier policy — a `none` floor still grants
175
- * regardless of access level. Default false to preserve existing
176
- * behaviour.
138
+ * AstraSync credentials, even on `observe`-marked routes / tools that would
139
+ * otherwise pass through unevaluated. Populates `req.agentVerification` and
140
+ * records the verification event for the audit trail. Enforcement still
141
+ * respects the gate — an `observe` marker still passes through regardless of
142
+ * the server decision. Default false to preserve existing behaviour.
177
143
  *
178
144
  * Use this when a single endpoint serves both anonymous and verified
179
145
  * traffic with different response shapes (e.g. anonymous catalog vs
@@ -428,8 +394,6 @@ interface VerificationResult {
428
394
  * unverified caller's policy field is `false` by definition.
429
395
  */
430
396
  policyAllowed: boolean;
431
- /** Access level granted */
432
- accessLevel: AccessLevel;
433
397
  /** Verified agent info (if verified) */
434
398
  agent?: VerifiedAgent;
435
399
  /** Developer info (if available) */
@@ -475,6 +439,14 @@ interface VerificationResult {
475
439
  * `MERCHANT_VERIFICATION_MISCONFIGURED` instead of a misleading 401.
476
440
  */
477
441
  misconfigured?: boolean;
442
+ /**
443
+ * 4.6.0: a TRANSIENT infrastructure failure (`verify_access.api_error` — a
444
+ * 5xx / timeout / CSRF-403 reaching the verify-access backend), NOT a policy
445
+ * deny and NOT a deterministic misconfig. Consumers should surface it as an
446
+ * error-and-retry (recommendation `'error'`), never as a policy denial. Unset
447
+ * on misconfig (deterministic — retrying will not help) and on real denials.
448
+ */
449
+ retryable?: boolean;
478
450
  /** Whether step-up authentication is required */
479
451
  requiresStepUp?: boolean;
480
452
  /** Whether approval is required */
@@ -765,10 +737,12 @@ interface RouteAccessConfig {
765
737
  /** HTTP method (or * for all) */
766
738
  method: string | '*';
767
739
  /**
768
- * @deprecated 3.2.0 — the access-level band no longer gates.
769
- * Optional/ignored; retained for back-compat. Use `minTrustScore` to tighten.
740
+ * Pass this route through unenforced (observe). The middleware skips gating
741
+ * on the server decision; with `evaluateAlwaysIfCredentialed` set it still
742
+ * calls verify-access for the audit trail and populates `req.agentVerification`.
743
+ * Replaces the old `minAccessLevel: 'none'` sentinel (SDK 5.0.0).
770
744
  */
771
- minAccessLevel?: AccessLevel;
745
+ observe?: boolean;
772
746
  /** Minimum trust score required (optional) */
773
747
  minTrustScore?: number;
774
748
  /** Required purposes (optional, agent must declare one of these) */
@@ -944,7 +918,6 @@ interface NextJsMiddlewareOptions extends GatewayConfig {
944
918
  title?: string;
945
919
  message?: string;
946
920
  allowGuestAccess?: boolean;
947
- guestAccessLevel?: AccessLevel;
948
921
  };
949
922
  /** Enable runtime challenge for all verify-access calls (default: true) */
950
923
  enableRuntimeChallenge?: boolean;
@@ -1086,4 +1059,4 @@ interface VerificationInterstitialProps {
1086
1059
  /** @deprecated Renamed VerificationInterstitialProps in 4.1.0; alias removed next major. */
1087
1060
  type CommerceShieldProps = VerificationInterstitialProps;
1088
1061
 
1089
- 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 };
1062
+ 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, VerificationInterstitialProps as V, AgentCredentials as a, AstraSyncCredentials as b, AttemptOutcome as c, AttemptReport as d, CommerceArtifactsPayload as e, CommerceShieldProps as f, ConsiderationItem as g, ConsiderationSet as h, CounterpartyType as i, ExpressMiddlewareOptions as j, GuidanceInfo as k, ProtocolTransport as l, RuntimeChallengeResult as m, SettlementArtifact as n, SettlementArtifactBinding as o, SettlementArtifactBindingBase as p, StablecoinSettlementBinding as q, StepUpApprovalInfo as r, StepUpApprovalStatus as s, StepUpOutcome as t, TrustLevel as u, VerificationRequest as v, VerificationResult as w, VerifiedAgent as x, VerifiedDeveloper as y, VerifiedOrganization as z };
@@ -1,4 +1,4 @@
1
- import { a as AccessLevel, j as CounterpartyType, T as TokenGuidance } from './types-C0zfSXMB.mjs';
1
+ import { i as CounterpartyType, T as TokenGuidance } from './types-BK2POWNc.js';
2
2
 
3
3
  /**
4
4
  * AstraSync Gateway - Types for gateway modes, local evaluation, and adapter interface.
@@ -38,8 +38,6 @@ interface AstraSyncGatewayConfig {
38
38
  traceEnabled?: boolean;
39
39
  /** Trace log directory (default: .astrasync/traces/) */
40
40
  tracePath?: string;
41
- /** Default access level for unverified requests */
42
- defaultAccessLevel?: AccessLevel;
43
41
  /** Minimum trust score for standard access (online/hybrid) */
44
42
  minTrustScore?: number;
45
43
  /** Minimum trust score for full access (online/hybrid) */
@@ -120,6 +118,19 @@ interface LocalScope {
120
118
  blockedResources?: string[];
121
119
  }
122
120
  interface LocalLimits {
121
+ /**
122
+ * Autonomous Limit — a transaction value at or below this is granted without
123
+ * escalation. A value in the band `[autonomousThreshold, maxTransactionAmount)`
124
+ * requires human approval (step-up → MANUAL_REVIEW), mirroring the backend
125
+ * `checkWithinLimits` ladder. When omitted there is no autonomous band: every
126
+ * positive value below the Hard Limit is granted (legacy flat-cap behaviour).
127
+ */
128
+ autonomousThreshold?: number;
129
+ /**
130
+ * Hard Limit — a transaction value at or above this is denied outright. (Named
131
+ * `maxTransactionAmount` for backward compatibility with existing local policy
132
+ * files; it is the SDK equivalent of the backend `approvalThreshold`.)
133
+ */
123
134
  maxTransactionAmount?: number;
124
135
  maxRequestsPerHour?: number;
125
136
  currency?: string;
@@ -1,4 +1,4 @@
1
- import { a as AccessLevel, j as CounterpartyType, T as TokenGuidance } from './types-DwSfO7Sb.js';
1
+ import { i as CounterpartyType, T as TokenGuidance } from './types-CJjZvPr9.mjs';
2
2
 
3
3
  /**
4
4
  * AstraSync Gateway - Types for gateway modes, local evaluation, and adapter interface.
@@ -38,8 +38,6 @@ interface AstraSyncGatewayConfig {
38
38
  traceEnabled?: boolean;
39
39
  /** Trace log directory (default: .astrasync/traces/) */
40
40
  tracePath?: string;
41
- /** Default access level for unverified requests */
42
- defaultAccessLevel?: AccessLevel;
43
41
  /** Minimum trust score for standard access (online/hybrid) */
44
42
  minTrustScore?: number;
45
43
  /** Minimum trust score for full access (online/hybrid) */
@@ -120,6 +118,19 @@ interface LocalScope {
120
118
  blockedResources?: string[];
121
119
  }
122
120
  interface LocalLimits {
121
+ /**
122
+ * Autonomous Limit — a transaction value at or below this is granted without
123
+ * escalation. A value in the band `[autonomousThreshold, maxTransactionAmount)`
124
+ * requires human approval (step-up → MANUAL_REVIEW), mirroring the backend
125
+ * `checkWithinLimits` ladder. When omitted there is no autonomous band: every
126
+ * positive value below the Hard Limit is granted (legacy flat-cap behaviour).
127
+ */
128
+ autonomousThreshold?: number;
129
+ /**
130
+ * Hard Limit — a transaction value at or above this is denied outright. (Named
131
+ * `maxTransactionAmount` for backward compatibility with existing local policy
132
+ * files; it is the SDK equivalent of the backend `approvalThreshold`.)
133
+ */
123
134
  maxTransactionAmount?: number;
124
135
  maxRequestsPerHour?: number;
125
136
  currency?: string;
@@ -1,4 +1,4 @@
1
- import { V as VerificationInterstitialProps, x as VerificationResult, b as AgentCredentials, l as GuidanceInfo, v as TrustLevel } from '../types-C0zfSXMB.mjs';
1
+ import { V as VerificationInterstitialProps, w as VerificationResult, a as AgentCredentials, k as GuidanceInfo, u as TrustLevel } from '../types-CJjZvPr9.mjs';
2
2
  import '../metadata-capture.mjs';
3
3
 
4
4
  /**
@@ -110,17 +110,6 @@ interface TrustLevelBadgeProps {
110
110
  /** Custom class name */
111
111
  className?: string;
112
112
  }
113
- /**
114
- * Access level indicator props
115
- */
116
- interface AccessLevelIndicatorProps {
117
- /** Current access level */
118
- accessLevel: string;
119
- /** Required access level */
120
- requiredLevel?: string;
121
- /** Custom class name */
122
- className?: string;
123
- }
124
113
  /**
125
114
  * Guidance card component
126
115
  */
@@ -129,10 +118,6 @@ declare function GuidanceCard({ guidance, title, compact, className, }: Guidance
129
118
  * Trust level badge component
130
119
  */
131
120
  declare function TrustLevelBadge({ level, score, size, className, }: TrustLevelBadgeProps): JSX.Element;
132
- /**
133
- * Access level indicator component
134
- */
135
- declare function AccessLevelIndicator({ accessLevel, requiredLevel, className, }: AccessLevelIndicatorProps): JSX.Element;
136
121
  /**
137
122
  * Denial reasons list component
138
123
  */
@@ -142,4 +127,4 @@ interface DenialReasonsProps {
142
127
  }
143
128
  declare function DenialReasons({ reasons, className }: DenialReasonsProps): JSX.Element;
144
129
 
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 };
130
+ export { 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,4 +1,4 @@
1
- import { V as VerificationInterstitialProps, x as VerificationResult, b as AgentCredentials, l as GuidanceInfo, v as TrustLevel } from '../types-DwSfO7Sb.js';
1
+ import { V as VerificationInterstitialProps, w as VerificationResult, a as AgentCredentials, k as GuidanceInfo, u as TrustLevel } from '../types-BK2POWNc.js';
2
2
  import '../metadata-capture.js';
3
3
 
4
4
  /**
@@ -110,17 +110,6 @@ interface TrustLevelBadgeProps {
110
110
  /** Custom class name */
111
111
  className?: string;
112
112
  }
113
- /**
114
- * Access level indicator props
115
- */
116
- interface AccessLevelIndicatorProps {
117
- /** Current access level */
118
- accessLevel: string;
119
- /** Required access level */
120
- requiredLevel?: string;
121
- /** Custom class name */
122
- className?: string;
123
- }
124
113
  /**
125
114
  * Guidance card component
126
115
  */
@@ -129,10 +118,6 @@ declare function GuidanceCard({ guidance, title, compact, className, }: Guidance
129
118
  * Trust level badge component
130
119
  */
131
120
  declare function TrustLevelBadge({ level, score, size, className, }: TrustLevelBadgeProps): JSX.Element;
132
- /**
133
- * Access level indicator component
134
- */
135
- declare function AccessLevelIndicator({ accessLevel, requiredLevel, className, }: AccessLevelIndicatorProps): JSX.Element;
136
121
  /**
137
122
  * Denial reasons list component
138
123
  */
@@ -142,4 +127,4 @@ interface DenialReasonsProps {
142
127
  }
143
128
  declare function DenialReasons({ reasons, className }: DenialReasonsProps): JSX.Element;
144
129
 
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 };
130
+ export { 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
@@ -30,7 +30,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/ui/index.ts
31
31
  var ui_exports = {};
32
32
  __export(ui_exports, {
33
- AccessLevelIndicator: () => AccessLevelIndicator,
34
33
  CommerceShield: () => VerificationInterstitial,
35
34
  CredentialPrompt: () => CredentialPrompt,
36
35
  DenialReasons: () => DenialReasons,
@@ -233,7 +232,7 @@ function useVerificationInterstitial(verificationResult) {
233
232
  const [dismissed, setDismissed] = import_react.default.useState(false);
234
233
  import_react.default.useEffect(() => {
235
234
  if (verificationResult && !dismissed) {
236
- const shouldShow = !verificationResult.identityVerified || !verificationResult.policyAllowed || verificationResult.accessLevel === "none" || verificationResult.accessLevel === "restricted";
235
+ const shouldShow = !verificationResult.identityVerified || !verificationResult.policyAllowed;
237
236
  setVisible(shouldShow);
238
237
  }
239
238
  }, [verificationResult, dismissed]);
@@ -725,46 +724,6 @@ function TrustLevelBadge({
725
724
  }
726
725
  );
727
726
  }
728
- function AccessLevelIndicator({
729
- accessLevel,
730
- requiredLevel,
731
- className
732
- }) {
733
- const getStatus = () => {
734
- if (accessLevel === "none" || accessLevel === "restricted") {
735
- return "denied";
736
- }
737
- if (requiredLevel) {
738
- const levels = ["none", "restricted", "read-only", "standard", "full", "internal"];
739
- const currentIndex = levels.indexOf(accessLevel);
740
- const requiredIndex = levels.indexOf(requiredLevel);
741
- if (currentIndex < requiredIndex) {
742
- return "limited";
743
- }
744
- }
745
- return "allowed";
746
- };
747
- const status = getStatus();
748
- const statusColors = {
749
- allowed: styles.indicatorAllowed,
750
- denied: styles.indicatorDenied,
751
- limited: styles.indicatorLimited
752
- };
753
- const statusLabels = {
754
- allowed: "Access Granted",
755
- denied: "Access Denied",
756
- limited: "Limited Access"
757
- };
758
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { style: styles.indicator, className, children: [
759
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: { ...styles.indicatorDot, ...statusColors[status] } }),
760
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: statusLabels[status] }),
761
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { style: { color: "#94a3b8" }, children: [
762
- "(",
763
- accessLevel,
764
- ")"
765
- ] })
766
- ] });
767
- }
768
727
  function DenialReasons({ reasons, className }) {
769
728
  if (reasons.length === 0) {
770
729
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, {});
@@ -816,7 +775,6 @@ function DenialReasons({ reasons, className }) {
816
775
  }
817
776
  // Annotate the CommonJS export names for ESM import in node:
818
777
  0 && (module.exports = {
819
- AccessLevelIndicator,
820
778
  CommerceShield,
821
779
  CredentialPrompt,
822
780
  DenialReasons,