@astrasyncai/verification-gateway 4.0.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +106 -29
- package/dist/adapter-interface/interface.d.mts +2 -2
- package/dist/adapter-interface/interface.d.ts +2 -2
- package/dist/adapters/express.d.mts +2 -2
- package/dist/adapters/express.d.ts +2 -2
- package/dist/adapters/express.js +398 -15
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +398 -15
- package/dist/adapters/express.mjs.map +1 -1
- package/dist/adapters/http-pdlss.d.mts +3 -3
- package/dist/adapters/http-pdlss.d.ts +3 -3
- package/dist/adapters/http-pdlss.js.map +1 -1
- package/dist/adapters/http-pdlss.mjs.map +1 -1
- package/dist/adapters/mcp.d.mts +56 -36
- package/dist/adapters/mcp.d.ts +56 -36
- package/dist/adapters/mcp.js +220 -3
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +220 -3
- package/dist/adapters/mcp.mjs.map +1 -1
- package/dist/adapters/nextjs.d.mts +2 -2
- package/dist/adapters/nextjs.d.ts +2 -2
- package/dist/adapters/nextjs.js +433 -18
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +433 -18
- package/dist/adapters/nextjs.mjs.map +1 -1
- package/dist/adapters/sdk.d.mts +2 -2
- package/dist/adapters/sdk.d.ts +2 -2
- package/dist/adapters/sdk.js +2 -2
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +2 -2
- package/dist/adapters/sdk.mjs.map +1 -1
- package/dist/agent/index.d.mts +2 -2
- package/dist/agent/index.d.ts +2 -2
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/index.mjs.map +1 -1
- package/dist/bin/astrasync-claude-hook.js +13 -13
- package/dist/bin/astrasync-codex-hook.js +13 -13
- package/dist/bin/astrasync-guard.js +100 -13
- package/dist/bin/astrasync.js +168 -27
- package/dist/browser/background.js +13 -13
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +13 -13
- package/dist/browser/background.mjs.map +1 -1
- package/dist/browser/browser-adapter.d.mts +2 -2
- package/dist/browser/browser-adapter.d.ts +2 -2
- package/dist/claude-code/claude-code-adapter.d.mts +2 -2
- package/dist/claude-code/claude-code-adapter.d.ts +2 -2
- package/dist/cli/index.d.mts +2 -2
- package/dist/cli/index.d.ts +2 -2
- package/dist/codex/index.d.mts +3 -3
- package/dist/codex/index.d.ts +3 -3
- package/dist/codex/index.js +24 -13
- package/dist/codex/index.js.map +1 -1
- package/dist/codex/index.mjs +24 -13
- package/dist/codex/index.mjs.map +1 -1
- package/dist/cursor/cursor-adapter.d.mts +2 -2
- package/dist/cursor/cursor-adapter.d.ts +2 -2
- package/dist/cursor/extension.d.mts +2 -2
- package/dist/cursor/extension.d.ts +2 -2
- package/dist/cursor/extension.js +13 -13
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +13 -13
- package/dist/cursor/extension.mjs.map +1 -1
- package/dist/edge-config.d.mts +22 -7
- package/dist/edge-config.d.ts +22 -7
- package/dist/edge-config.js.map +1 -1
- package/dist/edge-config.mjs.map +1 -1
- package/dist/edge-core/index.d.mts +425 -0
- package/dist/edge-core/index.d.ts +425 -0
- package/dist/edge-core/index.js +1482 -0
- package/dist/edge-core/index.js.map +1 -0
- package/dist/edge-core/index.mjs +1437 -0
- package/dist/edge-core/index.mjs.map +1 -0
- package/dist/{express-BZajRs4i.d.mts → express-BVd1_3FE.d.ts} +9 -7
- package/dist/{express-CjCUB1k7.d.ts → express-D_4hTn5Z.d.mts} +9 -7
- package/dist/gateway/gateway.d.mts +2 -2
- package/dist/gateway/gateway.d.ts +2 -2
- package/dist/gateway/gateway.js +13 -13
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +13 -13
- package/dist/gateway/gateway.mjs.map +1 -1
- package/dist/git-trigger/git-hooks.d.mts +2 -2
- package/dist/git-trigger/git-hooks.d.ts +2 -2
- package/dist/{index-adgKhujR.d.ts → index-B0YHu_SP.d.ts} +30 -27
- package/dist/{index-B0cyMZDL.d.mts → index-BPEBlOsE.d.mts} +30 -27
- package/dist/{index-BRYteOqO.d.mts → index-DQb5-_1X.d.mts} +1 -1
- package/dist/{index-BZQdVqNw.d.ts → index-T1aBoUcc.d.ts} +1 -1
- package/dist/index.d.mts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +477 -265
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +474 -265
- package/dist/index.mjs.map +1 -1
- package/dist/local-evaluator/evaluator.d.mts +2 -2
- package/dist/local-evaluator/evaluator.d.ts +2 -2
- package/dist/metadata-capture.d.mts +63 -4
- package/dist/metadata-capture.d.ts +63 -4
- package/dist/metadata-capture.js +67 -0
- package/dist/metadata-capture.js.map +1 -1
- package/dist/metadata-capture.mjs +64 -0
- package/dist/metadata-capture.mjs.map +1 -1
- package/dist/{nextjs-DeUTnOBd.d.mts → nextjs-WyeVr2Kp.d.mts} +3 -3
- package/dist/{nextjs-D_iFf5k-.d.ts → nextjs-w7RTbP1P.d.ts} +3 -3
- package/dist/platform-signatures.d.mts +5 -6
- package/dist/platform-signatures.d.ts +5 -6
- package/dist/platform-signatures.js.map +1 -1
- package/dist/platform-signatures.mjs.map +1 -1
- package/dist/registration/index.d.mts +10 -11
- package/dist/registration/index.d.ts +10 -11
- package/dist/registration/index.js.map +1 -1
- package/dist/registration/index.mjs.map +1 -1
- package/dist/{sdk-BM3mwEAq.d.ts → sdk-CbTNIkAa.d.mts} +4 -4
- package/dist/{sdk-_il1Q41f.d.mts → sdk-QeX0Z8Ho.d.ts} +4 -4
- package/dist/transport/index.d.mts +2 -2
- package/dist/transport/index.d.ts +2 -2
- package/dist/transport/index.js.map +1 -1
- package/dist/transport/index.mjs.map +1 -1
- package/dist/{types-CHKCgDFC.d.ts → types-BLUx92FJ.d.ts} +1 -1
- package/dist/{types-DfnP7JiM.d.mts → types-DqfPU5Bl.d.mts} +1 -1
- package/dist/{types-BcDf9Kk0.d.mts → types-r850cOt0.d.mts} +106 -88
- package/dist/{types-fTQD448H.d.ts → types-sMxBT-nM.d.ts} +106 -88
- package/dist/ui/index.d.mts +11 -7
- package/dist/ui/index.d.ts +11 -7
- package/dist/ui/index.js +13 -9
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/index.mjs +10 -8
- package/dist/ui/index.mjs.map +1 -1
- package/dist/verify.d.mts +8 -7
- package/dist/verify.d.ts +8 -7
- package/dist/verify.js +1 -1
- package/dist/verify.js.map +1 -1
- package/dist/verify.mjs +1 -1
- package/dist/verify.mjs.map +1 -1
- package/package.json +8 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as AccessLevel, j as CounterpartyType, T as TokenGuidance } from './types-
|
|
1
|
+
import { a as AccessLevel, j as CounterpartyType, T as TokenGuidance } from './types-sMxBT-nM.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* AstraSync Gateway - Types for gateway modes, local evaluation, and adapter interface.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as AccessLevel, j as CounterpartyType, T as TokenGuidance } from './types-
|
|
1
|
+
import { a as AccessLevel, j as CounterpartyType, T as TokenGuidance } from './types-r850cOt0.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* AstraSync Gateway - Types for gateway modes, local evaluation, and adapter interface.
|
|
@@ -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
|
-
*
|
|
21
|
-
* -
|
|
22
|
-
* -
|
|
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
|
|
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
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
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
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
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
|
-
*
|
|
162
|
-
* `
|
|
163
|
-
*
|
|
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
|
|
172
|
-
* audit F-PROBE-01).
|
|
166
|
+
* subdomain referenced in older docs does not resolve).
|
|
173
167
|
*/
|
|
174
168
|
dashboardUrl?: string;
|
|
175
169
|
/**
|
|
176
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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
|
|
426
|
-
*
|
|
427
|
-
*
|
|
428
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
461
|
-
*
|
|
462
|
-
*
|
|
463
|
-
*
|
|
464
|
-
*
|
|
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
|
|
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 (
|
|
532
|
-
* `sanitizeHeaders` (genuine secrets
|
|
533
|
-
* safe format prefix). Forwarded so
|
|
534
|
-
* about the agent, not just IP/UA.
|
|
535
|
-
* verify cache key so per-request
|
|
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
|
-
*
|
|
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
|
|
602
|
-
* to verify-access, whose
|
|
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
|
-
* (
|
|
606
|
-
*
|
|
607
|
-
*
|
|
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
|
|
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
|
|
608
|
+
* from the verify cache key.
|
|
617
609
|
*/
|
|
618
610
|
attemptId?: string;
|
|
619
611
|
/**
|
|
620
|
-
* 3.12.0
|
|
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
|
|
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
|
|
650
|
-
*
|
|
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
|
|
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
|
|
688
|
-
*
|
|
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
|
|
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
|
|
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
|
|
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` (
|
|
831
|
-
*
|
|
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.
|
|
877
|
-
*
|
|
878
|
-
*
|
|
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
|
|
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
|
|
887
|
-
*
|
|
888
|
-
*
|
|
889
|
-
*
|
|
890
|
-
*
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
*
|
|
1041
|
+
* Verification interstitial UI props (the React overlay shown to unverified
|
|
1042
|
+
* agents; user-visible title stays "AstraSync Agent Verification").
|
|
1027
1043
|
*/
|
|
1028
|
-
interface
|
|
1029
|
-
/** Whether the
|
|
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,
|
|
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 };
|