@astrasyncai/verification-gateway 5.18.1 → 5.20.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/CHANGELOG.md +232 -0
- package/README.md +217 -4
- package/dist/adapter-interface/interface.d.mts +2 -2
- package/dist/adapter-interface/interface.d.ts +2 -2
- package/dist/adapters/express.d.mts +9 -1
- package/dist/adapters/express.d.ts +9 -1
- package/dist/adapters/express.js +160 -52
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +160 -52
- package/dist/adapters/express.mjs.map +1 -1
- package/dist/adapters/http-pdlss.d.mts +7 -1
- package/dist/adapters/http-pdlss.d.ts +7 -1
- package/dist/adapters/http-pdlss.js +18 -2
- package/dist/adapters/http-pdlss.js.map +1 -1
- package/dist/adapters/http-pdlss.mjs +16 -1
- package/dist/adapters/http-pdlss.mjs.map +1 -1
- package/dist/adapters/kit-express.d.mts +93 -1
- package/dist/adapters/kit-express.d.ts +93 -1
- package/dist/adapters/kit-express.js +181 -2
- package/dist/adapters/kit-express.js.map +1 -1
- package/dist/adapters/kit-express.mjs +180 -2
- package/dist/adapters/kit-express.mjs.map +1 -1
- package/dist/adapters/mcp.d.mts +102 -9
- package/dist/adapters/mcp.d.ts +102 -9
- package/dist/adapters/mcp.js +242 -19
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +240 -19
- package/dist/adapters/mcp.mjs.map +1 -1
- package/dist/adapters/nextjs.d.mts +1 -1
- package/dist/adapters/nextjs.d.ts +1 -1
- package/dist/adapters/nextjs.js +97 -14
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +97 -14
- package/dist/adapters/nextjs.mjs.map +1 -1
- package/dist/adapters/sdk.d.mts +101 -2
- package/dist/adapters/sdk.d.ts +101 -2
- package/dist/adapters/sdk.js +199 -12
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +199 -12
- package/dist/adapters/sdk.mjs.map +1 -1
- package/dist/agent/index.d.mts +1 -1
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.js +1 -1
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/index.mjs +1 -1
- package/dist/agent/index.mjs.map +1 -1
- package/dist/bin/astrasync-claude-hook.js +94 -16
- package/dist/bin/astrasync-codex-hook.js +94 -16
- package/dist/bin/astrasync-guard.js +94 -16
- package/dist/bin/astrasync.js +127 -16
- package/dist/browser/background.js +94 -16
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +94 -16
- package/dist/browser/background.mjs.map +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/index.mjs +1 -1
- package/dist/cli/index.mjs.map +1 -1
- package/dist/codex/index.js +94 -16
- package/dist/codex/index.js.map +1 -1
- package/dist/codex/index.mjs +94 -16
- package/dist/codex/index.mjs.map +1 -1
- package/dist/cursor/extension.js +94 -16
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +94 -16
- package/dist/cursor/extension.mjs.map +1 -1
- package/dist/edge-config.d.mts +1 -1
- package/dist/edge-config.d.ts +1 -1
- package/dist/edge-config.js +1 -1
- package/dist/edge-config.js.map +1 -1
- package/dist/edge-config.mjs +1 -1
- package/dist/edge-config.mjs.map +1 -1
- package/dist/edge-core/index.d.mts +1 -1
- package/dist/edge-core/index.d.ts +1 -1
- package/dist/edge-core/index.js +69 -12
- package/dist/edge-core/index.js.map +1 -1
- package/dist/edge-core/index.mjs +69 -12
- package/dist/edge-core/index.mjs.map +1 -1
- package/dist/gateway/gateway.d.mts +2 -2
- package/dist/gateway/gateway.d.ts +2 -2
- package/dist/gateway/gateway.js +94 -16
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +94 -16
- package/dist/gateway/gateway.mjs.map +1 -1
- package/dist/git-trigger/git-hooks.d.mts +1 -1
- package/dist/git-trigger/git-hooks.d.ts +1 -1
- package/dist/index.d.mts +706 -34
- package/dist/index.d.ts +706 -34
- package/dist/index.js +1391 -205
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1374 -195
- 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/registration/index.d.mts +11 -2
- package/dist/registration/index.d.ts +11 -2
- package/dist/registration/index.js +1 -1
- package/dist/registration/index.js.map +1 -1
- package/dist/registration/index.mjs +1 -1
- package/dist/registration/index.mjs.map +1 -1
- package/dist/transport/index.d.mts +1 -1
- package/dist/transport/index.d.ts +1 -1
- package/dist/transport/index.js +3 -2
- package/dist/transport/index.js.map +1 -1
- package/dist/transport/index.mjs +3 -2
- package/dist/transport/index.mjs.map +1 -1
- package/dist/{types-BRz2U0Pn.d.ts → types-B_HLhZ9n.d.ts} +1 -1
- package/dist/{types-BfILnheI.d.mts → types-CU17R4Nr.d.mts} +11 -0
- package/dist/{types-BfILnheI.d.ts → types-CU17R4Nr.d.ts} +11 -0
- package/dist/{types-Cns4l8gX.d.mts → types-CxjqmPl-.d.mts} +115 -13
- package/dist/{types-Cns4l8gX.d.ts → types-CxjqmPl-.d.ts} +115 -13
- package/dist/{types-3ObBpsnf.d.mts → types-D37aSQ9c.d.mts} +106 -3
- package/dist/{types-CfBpm3w5.d.mts → types-Djpz-L0w.d.mts} +1 -1
- package/dist/{types-BoxZEYPS.d.ts → types-Dn8tXnei.d.ts} +106 -3
- package/dist/ui/index.d.mts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/verify.d.mts +50 -4
- package/dist/verify.d.ts +50 -4
- package/dist/verify.js +93 -14
- package/dist/verify.js.map +1 -1
- package/dist/verify.mjs +91 -14
- package/dist/verify.mjs.map +1 -1
- package/dist/webhooks.d.mts +16 -3
- package/dist/webhooks.d.ts +16 -3
- package/dist/webhooks.js +24 -13
- package/dist/webhooks.js.map +1 -1
- package/dist/webhooks.mjs +24 -13
- package/dist/webhooks.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -34,6 +34,17 @@ interface GatewayConfig {
|
|
|
34
34
|
debug?: boolean;
|
|
35
35
|
/** Custom headers to send with verification requests */
|
|
36
36
|
customHeaders?: Record<string, string>;
|
|
37
|
+
/**
|
|
38
|
+
* 5.20.0: proof that this caller may act as the agent, sent as
|
|
39
|
+
* `actingProof` in the verify-access body. Honoured only from a
|
|
40
|
+
* first-party AstraSync service caller (the bridge): the backend checks the
|
|
41
|
+
* connector's OAuth access token and records a `connector_owner` proof when
|
|
42
|
+
* its owner owns the agent. Ignored for any other key. A verify carrying it
|
|
43
|
+
* is never served from, or written to, the verdict cache.
|
|
44
|
+
*/
|
|
45
|
+
actingProof?: {
|
|
46
|
+
connectorToken: string;
|
|
47
|
+
};
|
|
37
48
|
/** This counterparty's URL (sent with verify-access requests for analytics) */
|
|
38
49
|
counterpartyUrl?: string;
|
|
39
50
|
/** This counterparty's type (sent with verify-access requests for analytics) */
|
|
@@ -34,6 +34,17 @@ interface GatewayConfig {
|
|
|
34
34
|
debug?: boolean;
|
|
35
35
|
/** Custom headers to send with verification requests */
|
|
36
36
|
customHeaders?: Record<string, string>;
|
|
37
|
+
/**
|
|
38
|
+
* 5.20.0: proof that this caller may act as the agent, sent as
|
|
39
|
+
* `actingProof` in the verify-access body. Honoured only from a
|
|
40
|
+
* first-party AstraSync service caller (the bridge): the backend checks the
|
|
41
|
+
* connector's OAuth access token and records a `connector_owner` proof when
|
|
42
|
+
* its owner owns the agent. Ignored for any other key. A verify carrying it
|
|
43
|
+
* is never served from, or written to, the verdict cache.
|
|
44
|
+
*/
|
|
45
|
+
actingProof?: {
|
|
46
|
+
connectorToken: string;
|
|
47
|
+
};
|
|
37
48
|
/** This counterparty's URL (sent with verify-access requests for analytics) */
|
|
38
49
|
counterpartyUrl?: string;
|
|
39
50
|
/** This counterparty's type (sent with verify-access requests for analytics) */
|
|
@@ -111,6 +111,17 @@ interface GatewayConfig {
|
|
|
111
111
|
debug?: boolean;
|
|
112
112
|
/** Custom headers to send with verification requests */
|
|
113
113
|
customHeaders?: Record<string, string>;
|
|
114
|
+
/**
|
|
115
|
+
* 5.20.0: proof that this caller may act as the agent, sent as
|
|
116
|
+
* `actingProof` in the verify-access body. Honoured only from a
|
|
117
|
+
* first-party AstraSync service caller (the bridge): the backend checks the
|
|
118
|
+
* connector's OAuth access token and records a `connector_owner` proof when
|
|
119
|
+
* its owner owns the agent. Ignored for any other key. A verify carrying it
|
|
120
|
+
* is never served from, or written to, the verdict cache.
|
|
121
|
+
*/
|
|
122
|
+
actingProof?: {
|
|
123
|
+
connectorToken: string;
|
|
124
|
+
};
|
|
114
125
|
/** This counterparty's URL (sent with verify-access requests for analytics) */
|
|
115
126
|
counterpartyUrl?: string;
|
|
116
127
|
/** This counterparty's type (sent with verify-access requests for analytics) */
|
|
@@ -219,9 +230,15 @@ interface VerifiedAgent {
|
|
|
219
230
|
astraId: string;
|
|
220
231
|
/** Agent display name */
|
|
221
232
|
name: string;
|
|
222
|
-
/**
|
|
233
|
+
/**
|
|
234
|
+
* Composite trust score (0-100). 5.19.0: verify-access returns it to an
|
|
235
|
+
* authenticated counterparty (your API key) — counterparties may see an
|
|
236
|
+
* agent's score; the agent itself never does, so never relay it to the
|
|
237
|
+
* agent. It is withheld (undefined at runtime) for a keyless caller and when
|
|
238
|
+
* the caller is the agent itself; a route `minTrustScore` then fails closed.
|
|
239
|
+
*/
|
|
223
240
|
trustScore: number;
|
|
224
|
-
/** Trust level tier */
|
|
241
|
+
/** Trust level tier (derived from `trustScore`) */
|
|
225
242
|
trustLevel: TrustLevel;
|
|
226
243
|
/** Whether the agent's identity record is anchored on-chain (5.9.0: was `blockchainVerified`) */
|
|
227
244
|
blockchainAnchored: boolean;
|
|
@@ -355,7 +372,9 @@ interface StepUpApprovalInfo {
|
|
|
355
372
|
* Lifecycle states of a step-up approval row (mirrors the backend's
|
|
356
373
|
* step_up_approval_status_check constraint).
|
|
357
374
|
*/
|
|
358
|
-
type StepUpApprovalStatus = 'pending' | 'approved' | 'denied' | 'expired' | 'consumed'
|
|
375
|
+
type StepUpApprovalStatus = 'pending' | 'approved' | 'denied' | 'expired' | 'consumed'
|
|
376
|
+
/** 5.20.0: approved but never redeemed inside the redemption window. */
|
|
377
|
+
| 'lapsed';
|
|
359
378
|
/**
|
|
360
379
|
* Terminal outcome of a hold-and-poll wait: any non-pending status, or
|
|
361
380
|
* 'timeout' when the hold budget ran out while the approval was still pending.
|
|
@@ -417,6 +436,20 @@ interface SettlementArtifact {
|
|
|
417
436
|
* - `counterparty.<allowlist|trust>`
|
|
418
437
|
* - `attestation.<type>` (e.g. `attestation.verified_human_party`)
|
|
419
438
|
* - `endpoint.<deactivated|trust|policy>`
|
|
439
|
+
* - `behaviour.<limit_probing|unattributed_limit_check>` (5.19.0) — the
|
|
440
|
+
* call is part of a sweep of unfinished attempts at rising values (quotes,
|
|
441
|
+
* held/denied confirms, orders that never settled) that maps the agent's
|
|
442
|
+
* spending limit. Completed purchases never count.
|
|
443
|
+
* - `behaviour.limit_probing`: the sweep is provably the agent's own
|
|
444
|
+
* (signed agent request, first-party bridge hop, runtime challenge or
|
|
445
|
+
* the agent's key). Denied with no new step-up approval; the agent's
|
|
446
|
+
* trust drops and its owner is alerted.
|
|
447
|
+
* - `behaviour.unattributed_limit_check`: the sweep can't be attributed
|
|
448
|
+
* to the agent (unsigned or direct merchant calls). Denied — it "needs
|
|
449
|
+
* a signed agent request" — with no agent trust penalty; owners are
|
|
450
|
+
* alerted with the evidence. A repeat of the merchant's own direct
|
|
451
|
+
* calls, or the same pattern across agents of two or more owners,
|
|
452
|
+
* reduces the endpoint owner's trust score.
|
|
420
453
|
*/
|
|
421
454
|
interface AccessFailure {
|
|
422
455
|
dimension: string;
|
|
@@ -533,6 +566,12 @@ interface VerificationResult {
|
|
|
533
566
|
* (steer the user to add one via onboarding).
|
|
534
567
|
*/
|
|
535
568
|
settlementOutcome?: SettlementOutcomeInfo;
|
|
569
|
+
/**
|
|
570
|
+
* 5.20.0 (round 29.1): non-fatal integration warnings for the caller —
|
|
571
|
+
* e.g. `events_url_missing` when a kit's held confirm is on an endpoint with
|
|
572
|
+
* no Events URL (the kit would never hear the owner's decision).
|
|
573
|
+
*/
|
|
574
|
+
warnings?: VerificationWarning[];
|
|
536
575
|
/**
|
|
537
576
|
* Card settlement token. Present on a card purchase at a first-party
|
|
538
577
|
* storefront (our Stripe tenant) — 5.14.1: always, there is no charge-here
|
|
@@ -696,6 +735,46 @@ interface CallerMetadata {
|
|
|
696
735
|
*/
|
|
697
736
|
observedMetadata?: ObservedMetadata;
|
|
698
737
|
}
|
|
738
|
+
/**
|
|
739
|
+
* 5.19.0 — the inbound agent request behind a kit confirm, forwarded so
|
|
740
|
+
* verify-access can tell whether the confirm is provably the agent's own
|
|
741
|
+
* (limit-probing attribution). The kits build it from `handle(req)`.
|
|
742
|
+
*
|
|
743
|
+
* - Signed (UCP, RFC 9421): the covered headers (`signature`,
|
|
744
|
+
* `signature-input`, `signature-agent`, `ucp-agent`, `content-digest` and
|
|
745
|
+
* every other header the signature covers — never `authorization` or
|
|
746
|
+
* `cookie`), the method, the PUBLIC request URL (your `publicOrigin` + the
|
|
747
|
+
* path and query, so `@target-uri` / `@authority` match what the agent
|
|
748
|
+
* signed behind a TLS-terminating proxy) and `contentDigest`, the
|
|
749
|
+
* `sha-256=:<base64>:` digest of the exact raw body.
|
|
750
|
+
* - `{ unsigned: true }`: the inbound request carried no signature, or it
|
|
751
|
+
* came over ACP (the ACP `Authorization` bearer is the platform's
|
|
752
|
+
* credential to you and is never forwarded, so ACP confirms are
|
|
753
|
+
* unattributable). Sent explicitly so the platform can tell a kit relay
|
|
754
|
+
* from a direct merchant call.
|
|
755
|
+
*/
|
|
756
|
+
type AgentArtifacts = {
|
|
757
|
+
unsigned: true;
|
|
758
|
+
protocol?: 'ucp' | 'acp';
|
|
759
|
+
} | {
|
|
760
|
+
unsigned?: false;
|
|
761
|
+
protocol: 'ucp' | 'acp';
|
|
762
|
+
method: string;
|
|
763
|
+
/** Absolute public URL of the inbound request. */
|
|
764
|
+
url: string;
|
|
765
|
+
/** Lower-cased covered headers. */
|
|
766
|
+
headers: Record<string, string>;
|
|
767
|
+
/** `sha-256=:<base64>:` over the raw request body (absent for an empty body). */
|
|
768
|
+
contentDigest?: string;
|
|
769
|
+
};
|
|
770
|
+
/** 5.19.0 — kit context on a confirm (carried onto the approval and its events). */
|
|
771
|
+
interface CheckoutMetadata {
|
|
772
|
+
/** The kit's own checkout session id (`chk_…` / `cs_…`). */
|
|
773
|
+
kitSessionId?: string;
|
|
774
|
+
protocol?: 'ucp' | 'acp';
|
|
775
|
+
}
|
|
776
|
+
/** 5.19.0 — see {@link VerificationRequest.purposeSource}. */
|
|
777
|
+
type PurposeSource = 'route_config' | 'header' | 'body' | 'default';
|
|
699
778
|
interface VerificationRequest {
|
|
700
779
|
/** Agent credentials */
|
|
701
780
|
credentials: AgentCredentials;
|
|
@@ -827,6 +906,25 @@ interface VerificationRequest {
|
|
|
827
906
|
* from the verify cache key.
|
|
828
907
|
*/
|
|
829
908
|
attemptId?: string;
|
|
909
|
+
/**
|
|
910
|
+
* 5.19.0 — where `purpose` came from: `'route_config'` (a dashboard route
|
|
911
|
+
* rule matched this request), `'header'` (the agent's X-Astra-Purpose /
|
|
912
|
+
* legacy header / query), `'body'` (request-derived by your own
|
|
913
|
+
* extractor), or `'default'` (derived from the action or the transport
|
|
914
|
+
* default). Set by the express and Next.js adapters. verify-access keeps a
|
|
915
|
+
* `'route_config'` purpose over a commerce-derived one (e.g. an MPP paid
|
|
916
|
+
* leg) only when a stored rule on the endpoint matches `requestMethod` +
|
|
917
|
+
* `requestPath` with the same purpose and action.
|
|
918
|
+
*/
|
|
919
|
+
purposeSource?: PurposeSource;
|
|
920
|
+
/** 5.19.0 — the inbound agent request behind a kit confirm (see {@link AgentArtifacts}). */
|
|
921
|
+
agentArtifacts?: AgentArtifacts;
|
|
922
|
+
/** 5.19.0 — kit session id + protocol, stored on any approval this confirm creates. */
|
|
923
|
+
metadata?: CheckoutMetadata;
|
|
924
|
+
/** 5.19.0 — the inbound request's HTTP method (for the route-rule check above). */
|
|
925
|
+
requestMethod?: string;
|
|
926
|
+
/** 5.19.0 — the inbound request's path, without the query (for the route-rule check above). */
|
|
927
|
+
requestPath?: string;
|
|
830
928
|
/**
|
|
831
929
|
* 3.12.0 — first-party observational data: the
|
|
832
930
|
* offers the agent evaluated at this checkpoint (catalog browse / intent
|
|
@@ -1025,17 +1123,16 @@ interface ExpressMiddlewareOptions extends GatewayConfig {
|
|
|
1025
1123
|
/**
|
|
1026
1124
|
* Posture when the middleware itself throws an internal error (header
|
|
1027
1125
|
* parsing failure, `fetchRoutes` network error, malformed proxy state,
|
|
1028
|
-
* etc.).
|
|
1029
|
-
* legitimate traffic continues to pass through during platform outages.
|
|
1126
|
+
* etc.).
|
|
1030
1127
|
*
|
|
1031
|
-
*
|
|
1032
|
-
*
|
|
1033
|
-
*
|
|
1034
|
-
*
|
|
1035
|
-
*
|
|
1128
|
+
* 5.19.0 (behaviour change): default `'closed'` — the request is refused
|
|
1129
|
+
* with 503 + Retry-After + `VERIFICATION_UNAVAILABLE` (the
|
|
1130
|
+
* `middleware.internal_error` dimension; never an identity-shaped 401) and
|
|
1131
|
+
* your handler is not called. Set `'open'` explicitly to pass the request
|
|
1132
|
+
* through unverified instead (e.g. small-value demo merchants).
|
|
1036
1133
|
*
|
|
1037
|
-
*
|
|
1038
|
-
*
|
|
1134
|
+
* The middleware always logs a `[SHADOW] would-have-denied` line on throws
|
|
1135
|
+
* including correlationId, whichever posture is set.
|
|
1039
1136
|
*/
|
|
1040
1137
|
failOnError?: 'open' | 'closed';
|
|
1041
1138
|
/**
|
|
@@ -1211,5 +1308,10 @@ interface AstraSyncAepEvidence {
|
|
|
1211
1308
|
platform_countersignature: string;
|
|
1212
1309
|
}>;
|
|
1213
1310
|
}
|
|
1311
|
+
/** 5.20.0: a non-fatal warning on a verify-access result (see `warnings`). */
|
|
1312
|
+
interface VerificationWarning {
|
|
1313
|
+
code: string;
|
|
1314
|
+
message: string;
|
|
1315
|
+
}
|
|
1214
1316
|
|
|
1215
|
-
export type {
|
|
1317
|
+
export type { AgentArtifacts as A, CheckoutMetadata as C, ExpressMiddlewareOptions as E, GatewayConfig as G, NextJsMiddlewareOptions as N, SDKOptions as S, TrustLevel as T, VerificationInterstitialProps as V, AgentCredentials as a, AstraSyncCredentials as b, GuidanceInfo as c, VerificationRequest as d, VerificationResult as e };
|
|
@@ -111,6 +111,17 @@ interface GatewayConfig {
|
|
|
111
111
|
debug?: boolean;
|
|
112
112
|
/** Custom headers to send with verification requests */
|
|
113
113
|
customHeaders?: Record<string, string>;
|
|
114
|
+
/**
|
|
115
|
+
* 5.20.0: proof that this caller may act as the agent, sent as
|
|
116
|
+
* `actingProof` in the verify-access body. Honoured only from a
|
|
117
|
+
* first-party AstraSync service caller (the bridge): the backend checks the
|
|
118
|
+
* connector's OAuth access token and records a `connector_owner` proof when
|
|
119
|
+
* its owner owns the agent. Ignored for any other key. A verify carrying it
|
|
120
|
+
* is never served from, or written to, the verdict cache.
|
|
121
|
+
*/
|
|
122
|
+
actingProof?: {
|
|
123
|
+
connectorToken: string;
|
|
124
|
+
};
|
|
114
125
|
/** This counterparty's URL (sent with verify-access requests for analytics) */
|
|
115
126
|
counterpartyUrl?: string;
|
|
116
127
|
/** This counterparty's type (sent with verify-access requests for analytics) */
|
|
@@ -219,9 +230,15 @@ interface VerifiedAgent {
|
|
|
219
230
|
astraId: string;
|
|
220
231
|
/** Agent display name */
|
|
221
232
|
name: string;
|
|
222
|
-
/**
|
|
233
|
+
/**
|
|
234
|
+
* Composite trust score (0-100). 5.19.0: verify-access returns it to an
|
|
235
|
+
* authenticated counterparty (your API key) — counterparties may see an
|
|
236
|
+
* agent's score; the agent itself never does, so never relay it to the
|
|
237
|
+
* agent. It is withheld (undefined at runtime) for a keyless caller and when
|
|
238
|
+
* the caller is the agent itself; a route `minTrustScore` then fails closed.
|
|
239
|
+
*/
|
|
223
240
|
trustScore: number;
|
|
224
|
-
/** Trust level tier */
|
|
241
|
+
/** Trust level tier (derived from `trustScore`) */
|
|
225
242
|
trustLevel: TrustLevel;
|
|
226
243
|
/** Whether the agent's identity record is anchored on-chain (5.9.0: was `blockchainVerified`) */
|
|
227
244
|
blockchainAnchored: boolean;
|
|
@@ -355,7 +372,9 @@ interface StepUpApprovalInfo {
|
|
|
355
372
|
* Lifecycle states of a step-up approval row (mirrors the backend's
|
|
356
373
|
* step_up_approval_status_check constraint).
|
|
357
374
|
*/
|
|
358
|
-
type StepUpApprovalStatus = 'pending' | 'approved' | 'denied' | 'expired' | 'consumed'
|
|
375
|
+
type StepUpApprovalStatus = 'pending' | 'approved' | 'denied' | 'expired' | 'consumed'
|
|
376
|
+
/** 5.20.0: approved but never redeemed inside the redemption window. */
|
|
377
|
+
| 'lapsed';
|
|
359
378
|
/**
|
|
360
379
|
* Terminal outcome of a hold-and-poll wait: any non-pending status, or
|
|
361
380
|
* 'timeout' when the hold budget ran out while the approval was still pending.
|
|
@@ -417,6 +436,20 @@ interface SettlementArtifact {
|
|
|
417
436
|
* - `counterparty.<allowlist|trust>`
|
|
418
437
|
* - `attestation.<type>` (e.g. `attestation.verified_human_party`)
|
|
419
438
|
* - `endpoint.<deactivated|trust|policy>`
|
|
439
|
+
* - `behaviour.<limit_probing|unattributed_limit_check>` (5.19.0) — the
|
|
440
|
+
* call is part of a sweep of unfinished attempts at rising values (quotes,
|
|
441
|
+
* held/denied confirms, orders that never settled) that maps the agent's
|
|
442
|
+
* spending limit. Completed purchases never count.
|
|
443
|
+
* - `behaviour.limit_probing`: the sweep is provably the agent's own
|
|
444
|
+
* (signed agent request, first-party bridge hop, runtime challenge or
|
|
445
|
+
* the agent's key). Denied with no new step-up approval; the agent's
|
|
446
|
+
* trust drops and its owner is alerted.
|
|
447
|
+
* - `behaviour.unattributed_limit_check`: the sweep can't be attributed
|
|
448
|
+
* to the agent (unsigned or direct merchant calls). Denied — it "needs
|
|
449
|
+
* a signed agent request" — with no agent trust penalty; owners are
|
|
450
|
+
* alerted with the evidence. A repeat of the merchant's own direct
|
|
451
|
+
* calls, or the same pattern across agents of two or more owners,
|
|
452
|
+
* reduces the endpoint owner's trust score.
|
|
420
453
|
*/
|
|
421
454
|
interface AccessFailure {
|
|
422
455
|
dimension: string;
|
|
@@ -533,6 +566,12 @@ interface VerificationResult {
|
|
|
533
566
|
* (steer the user to add one via onboarding).
|
|
534
567
|
*/
|
|
535
568
|
settlementOutcome?: SettlementOutcomeInfo;
|
|
569
|
+
/**
|
|
570
|
+
* 5.20.0 (round 29.1): non-fatal integration warnings for the caller —
|
|
571
|
+
* e.g. `events_url_missing` when a kit's held confirm is on an endpoint with
|
|
572
|
+
* no Events URL (the kit would never hear the owner's decision).
|
|
573
|
+
*/
|
|
574
|
+
warnings?: VerificationWarning[];
|
|
536
575
|
/**
|
|
537
576
|
* Card settlement token. Present on a card purchase at a first-party
|
|
538
577
|
* storefront (our Stripe tenant) — 5.14.1: always, there is no charge-here
|
|
@@ -696,6 +735,46 @@ interface CallerMetadata {
|
|
|
696
735
|
*/
|
|
697
736
|
observedMetadata?: ObservedMetadata;
|
|
698
737
|
}
|
|
738
|
+
/**
|
|
739
|
+
* 5.19.0 — the inbound agent request behind a kit confirm, forwarded so
|
|
740
|
+
* verify-access can tell whether the confirm is provably the agent's own
|
|
741
|
+
* (limit-probing attribution). The kits build it from `handle(req)`.
|
|
742
|
+
*
|
|
743
|
+
* - Signed (UCP, RFC 9421): the covered headers (`signature`,
|
|
744
|
+
* `signature-input`, `signature-agent`, `ucp-agent`, `content-digest` and
|
|
745
|
+
* every other header the signature covers — never `authorization` or
|
|
746
|
+
* `cookie`), the method, the PUBLIC request URL (your `publicOrigin` + the
|
|
747
|
+
* path and query, so `@target-uri` / `@authority` match what the agent
|
|
748
|
+
* signed behind a TLS-terminating proxy) and `contentDigest`, the
|
|
749
|
+
* `sha-256=:<base64>:` digest of the exact raw body.
|
|
750
|
+
* - `{ unsigned: true }`: the inbound request carried no signature, or it
|
|
751
|
+
* came over ACP (the ACP `Authorization` bearer is the platform's
|
|
752
|
+
* credential to you and is never forwarded, so ACP confirms are
|
|
753
|
+
* unattributable). Sent explicitly so the platform can tell a kit relay
|
|
754
|
+
* from a direct merchant call.
|
|
755
|
+
*/
|
|
756
|
+
type AgentArtifacts = {
|
|
757
|
+
unsigned: true;
|
|
758
|
+
protocol?: 'ucp' | 'acp';
|
|
759
|
+
} | {
|
|
760
|
+
unsigned?: false;
|
|
761
|
+
protocol: 'ucp' | 'acp';
|
|
762
|
+
method: string;
|
|
763
|
+
/** Absolute public URL of the inbound request. */
|
|
764
|
+
url: string;
|
|
765
|
+
/** Lower-cased covered headers. */
|
|
766
|
+
headers: Record<string, string>;
|
|
767
|
+
/** `sha-256=:<base64>:` over the raw request body (absent for an empty body). */
|
|
768
|
+
contentDigest?: string;
|
|
769
|
+
};
|
|
770
|
+
/** 5.19.0 — kit context on a confirm (carried onto the approval and its events). */
|
|
771
|
+
interface CheckoutMetadata {
|
|
772
|
+
/** The kit's own checkout session id (`chk_…` / `cs_…`). */
|
|
773
|
+
kitSessionId?: string;
|
|
774
|
+
protocol?: 'ucp' | 'acp';
|
|
775
|
+
}
|
|
776
|
+
/** 5.19.0 — see {@link VerificationRequest.purposeSource}. */
|
|
777
|
+
type PurposeSource = 'route_config' | 'header' | 'body' | 'default';
|
|
699
778
|
interface VerificationRequest {
|
|
700
779
|
/** Agent credentials */
|
|
701
780
|
credentials: AgentCredentials;
|
|
@@ -827,6 +906,25 @@ interface VerificationRequest {
|
|
|
827
906
|
* from the verify cache key.
|
|
828
907
|
*/
|
|
829
908
|
attemptId?: string;
|
|
909
|
+
/**
|
|
910
|
+
* 5.19.0 — where `purpose` came from: `'route_config'` (a dashboard route
|
|
911
|
+
* rule matched this request), `'header'` (the agent's X-Astra-Purpose /
|
|
912
|
+
* legacy header / query), `'body'` (request-derived by your own
|
|
913
|
+
* extractor), or `'default'` (derived from the action or the transport
|
|
914
|
+
* default). Set by the express and Next.js adapters. verify-access keeps a
|
|
915
|
+
* `'route_config'` purpose over a commerce-derived one (e.g. an MPP paid
|
|
916
|
+
* leg) only when a stored rule on the endpoint matches `requestMethod` +
|
|
917
|
+
* `requestPath` with the same purpose and action.
|
|
918
|
+
*/
|
|
919
|
+
purposeSource?: PurposeSource;
|
|
920
|
+
/** 5.19.0 — the inbound agent request behind a kit confirm (see {@link AgentArtifacts}). */
|
|
921
|
+
agentArtifacts?: AgentArtifacts;
|
|
922
|
+
/** 5.19.0 — kit session id + protocol, stored on any approval this confirm creates. */
|
|
923
|
+
metadata?: CheckoutMetadata;
|
|
924
|
+
/** 5.19.0 — the inbound request's HTTP method (for the route-rule check above). */
|
|
925
|
+
requestMethod?: string;
|
|
926
|
+
/** 5.19.0 — the inbound request's path, without the query (for the route-rule check above). */
|
|
927
|
+
requestPath?: string;
|
|
830
928
|
/**
|
|
831
929
|
* 3.12.0 — first-party observational data: the
|
|
832
930
|
* offers the agent evaluated at this checkpoint (catalog browse / intent
|
|
@@ -1025,17 +1123,16 @@ interface ExpressMiddlewareOptions extends GatewayConfig {
|
|
|
1025
1123
|
/**
|
|
1026
1124
|
* Posture when the middleware itself throws an internal error (header
|
|
1027
1125
|
* parsing failure, `fetchRoutes` network error, malformed proxy state,
|
|
1028
|
-
* etc.).
|
|
1029
|
-
* legitimate traffic continues to pass through during platform outages.
|
|
1126
|
+
* etc.).
|
|
1030
1127
|
*
|
|
1031
|
-
*
|
|
1032
|
-
*
|
|
1033
|
-
*
|
|
1034
|
-
*
|
|
1035
|
-
*
|
|
1128
|
+
* 5.19.0 (behaviour change): default `'closed'` — the request is refused
|
|
1129
|
+
* with 503 + Retry-After + `VERIFICATION_UNAVAILABLE` (the
|
|
1130
|
+
* `middleware.internal_error` dimension; never an identity-shaped 401) and
|
|
1131
|
+
* your handler is not called. Set `'open'` explicitly to pass the request
|
|
1132
|
+
* through unverified instead (e.g. small-value demo merchants).
|
|
1036
1133
|
*
|
|
1037
|
-
*
|
|
1038
|
-
*
|
|
1134
|
+
* The middleware always logs a `[SHADOW] would-have-denied` line on throws
|
|
1135
|
+
* including correlationId, whichever posture is set.
|
|
1039
1136
|
*/
|
|
1040
1137
|
failOnError?: 'open' | 'closed';
|
|
1041
1138
|
/**
|
|
@@ -1211,5 +1308,10 @@ interface AstraSyncAepEvidence {
|
|
|
1211
1308
|
platform_countersignature: string;
|
|
1212
1309
|
}>;
|
|
1213
1310
|
}
|
|
1311
|
+
/** 5.20.0: a non-fatal warning on a verify-access result (see `warnings`). */
|
|
1312
|
+
interface VerificationWarning {
|
|
1313
|
+
code: string;
|
|
1314
|
+
message: string;
|
|
1315
|
+
}
|
|
1214
1316
|
|
|
1215
|
-
export type {
|
|
1317
|
+
export type { AgentArtifacts as A, CheckoutMetadata as C, ExpressMiddlewareOptions as E, GatewayConfig as G, NextJsMiddlewareOptions as N, SDKOptions as S, TrustLevel as T, VerificationInterstitialProps as V, AgentCredentials as a, AstraSyncCredentials as b, GuidanceInfo as c, VerificationRequest as d, VerificationResult as e };
|
|
@@ -53,6 +53,17 @@ interface GatewayConfig {
|
|
|
53
53
|
debug?: boolean;
|
|
54
54
|
/** Custom headers to send with verification requests */
|
|
55
55
|
customHeaders?: Record<string, string>;
|
|
56
|
+
/**
|
|
57
|
+
* 5.20.0: proof that this caller may act as the agent, sent as
|
|
58
|
+
* `actingProof` in the verify-access body. Honoured only from a
|
|
59
|
+
* first-party AstraSync service caller (the bridge): the backend checks the
|
|
60
|
+
* connector's OAuth access token and records a `connector_owner` proof when
|
|
61
|
+
* its owner owns the agent. Ignored for any other key. A verify carrying it
|
|
62
|
+
* is never served from, or written to, the verdict cache.
|
|
63
|
+
*/
|
|
64
|
+
actingProof?: {
|
|
65
|
+
connectorToken: string;
|
|
66
|
+
};
|
|
56
67
|
/** This counterparty's URL (sent with verify-access requests for analytics) */
|
|
57
68
|
counterpartyUrl?: string;
|
|
58
69
|
/** This counterparty's type (sent with verify-access requests for analytics) */
|
|
@@ -161,9 +172,15 @@ interface VerifiedAgent {
|
|
|
161
172
|
astraId: string;
|
|
162
173
|
/** Agent display name */
|
|
163
174
|
name: string;
|
|
164
|
-
/**
|
|
175
|
+
/**
|
|
176
|
+
* Composite trust score (0-100). 5.19.0: verify-access returns it to an
|
|
177
|
+
* authenticated counterparty (your API key) — counterparties may see an
|
|
178
|
+
* agent's score; the agent itself never does, so never relay it to the
|
|
179
|
+
* agent. It is withheld (undefined at runtime) for a keyless caller and when
|
|
180
|
+
* the caller is the agent itself; a route `minTrustScore` then fails closed.
|
|
181
|
+
*/
|
|
165
182
|
trustScore: number;
|
|
166
|
-
/** Trust level tier */
|
|
183
|
+
/** Trust level tier (derived from `trustScore`) */
|
|
167
184
|
trustLevel: TrustLevel;
|
|
168
185
|
/** Whether the agent's identity record is anchored on-chain (5.9.0: was `blockchainVerified`) */
|
|
169
186
|
blockchainAnchored: boolean;
|
|
@@ -297,7 +314,9 @@ interface StepUpApprovalInfo {
|
|
|
297
314
|
* Lifecycle states of a step-up approval row (mirrors the backend's
|
|
298
315
|
* step_up_approval_status_check constraint).
|
|
299
316
|
*/
|
|
300
|
-
type StepUpApprovalStatus = 'pending' | 'approved' | 'denied' | 'expired' | 'consumed'
|
|
317
|
+
type StepUpApprovalStatus = 'pending' | 'approved' | 'denied' | 'expired' | 'consumed'
|
|
318
|
+
/** 5.20.0: approved but never redeemed inside the redemption window. */
|
|
319
|
+
| 'lapsed';
|
|
301
320
|
/**
|
|
302
321
|
* Terminal outcome of a hold-and-poll wait: any non-pending status, or
|
|
303
322
|
* 'timeout' when the hold budget ran out while the approval was still pending.
|
|
@@ -359,6 +378,20 @@ interface SettlementArtifact {
|
|
|
359
378
|
* - `counterparty.<allowlist|trust>`
|
|
360
379
|
* - `attestation.<type>` (e.g. `attestation.verified_human_party`)
|
|
361
380
|
* - `endpoint.<deactivated|trust|policy>`
|
|
381
|
+
* - `behaviour.<limit_probing|unattributed_limit_check>` (5.19.0) — the
|
|
382
|
+
* call is part of a sweep of unfinished attempts at rising values (quotes,
|
|
383
|
+
* held/denied confirms, orders that never settled) that maps the agent's
|
|
384
|
+
* spending limit. Completed purchases never count.
|
|
385
|
+
* - `behaviour.limit_probing`: the sweep is provably the agent's own
|
|
386
|
+
* (signed agent request, first-party bridge hop, runtime challenge or
|
|
387
|
+
* the agent's key). Denied with no new step-up approval; the agent's
|
|
388
|
+
* trust drops and its owner is alerted.
|
|
389
|
+
* - `behaviour.unattributed_limit_check`: the sweep can't be attributed
|
|
390
|
+
* to the agent (unsigned or direct merchant calls). Denied — it "needs
|
|
391
|
+
* a signed agent request" — with no agent trust penalty; owners are
|
|
392
|
+
* alerted with the evidence. A repeat of the merchant's own direct
|
|
393
|
+
* calls, or the same pattern across agents of two or more owners,
|
|
394
|
+
* reduces the endpoint owner's trust score.
|
|
362
395
|
*/
|
|
363
396
|
interface AccessFailure {
|
|
364
397
|
dimension: string;
|
|
@@ -475,6 +508,12 @@ interface VerificationResult {
|
|
|
475
508
|
* (steer the user to add one via onboarding).
|
|
476
509
|
*/
|
|
477
510
|
settlementOutcome?: SettlementOutcomeInfo;
|
|
511
|
+
/**
|
|
512
|
+
* 5.20.0 (round 29.1): non-fatal integration warnings for the caller —
|
|
513
|
+
* e.g. `events_url_missing` when a kit's held confirm is on an endpoint with
|
|
514
|
+
* no Events URL (the kit would never hear the owner's decision).
|
|
515
|
+
*/
|
|
516
|
+
warnings?: VerificationWarning[];
|
|
478
517
|
/**
|
|
479
518
|
* Card settlement token. Present on a card purchase at a first-party
|
|
480
519
|
* storefront (our Stripe tenant) — 5.14.1: always, there is no charge-here
|
|
@@ -638,6 +677,46 @@ interface CallerMetadata {
|
|
|
638
677
|
*/
|
|
639
678
|
observedMetadata?: ObservedMetadata;
|
|
640
679
|
}
|
|
680
|
+
/**
|
|
681
|
+
* 5.19.0 — the inbound agent request behind a kit confirm, forwarded so
|
|
682
|
+
* verify-access can tell whether the confirm is provably the agent's own
|
|
683
|
+
* (limit-probing attribution). The kits build it from `handle(req)`.
|
|
684
|
+
*
|
|
685
|
+
* - Signed (UCP, RFC 9421): the covered headers (`signature`,
|
|
686
|
+
* `signature-input`, `signature-agent`, `ucp-agent`, `content-digest` and
|
|
687
|
+
* every other header the signature covers — never `authorization` or
|
|
688
|
+
* `cookie`), the method, the PUBLIC request URL (your `publicOrigin` + the
|
|
689
|
+
* path and query, so `@target-uri` / `@authority` match what the agent
|
|
690
|
+
* signed behind a TLS-terminating proxy) and `contentDigest`, the
|
|
691
|
+
* `sha-256=:<base64>:` digest of the exact raw body.
|
|
692
|
+
* - `{ unsigned: true }`: the inbound request carried no signature, or it
|
|
693
|
+
* came over ACP (the ACP `Authorization` bearer is the platform's
|
|
694
|
+
* credential to you and is never forwarded, so ACP confirms are
|
|
695
|
+
* unattributable). Sent explicitly so the platform can tell a kit relay
|
|
696
|
+
* from a direct merchant call.
|
|
697
|
+
*/
|
|
698
|
+
type AgentArtifacts = {
|
|
699
|
+
unsigned: true;
|
|
700
|
+
protocol?: 'ucp' | 'acp';
|
|
701
|
+
} | {
|
|
702
|
+
unsigned?: false;
|
|
703
|
+
protocol: 'ucp' | 'acp';
|
|
704
|
+
method: string;
|
|
705
|
+
/** Absolute public URL of the inbound request. */
|
|
706
|
+
url: string;
|
|
707
|
+
/** Lower-cased covered headers. */
|
|
708
|
+
headers: Record<string, string>;
|
|
709
|
+
/** `sha-256=:<base64>:` over the raw request body (absent for an empty body). */
|
|
710
|
+
contentDigest?: string;
|
|
711
|
+
};
|
|
712
|
+
/** 5.19.0 — kit context on a confirm (carried onto the approval and its events). */
|
|
713
|
+
interface CheckoutMetadata {
|
|
714
|
+
/** The kit's own checkout session id (`chk_…` / `cs_…`). */
|
|
715
|
+
kitSessionId?: string;
|
|
716
|
+
protocol?: 'ucp' | 'acp';
|
|
717
|
+
}
|
|
718
|
+
/** 5.19.0 — see {@link VerificationRequest.purposeSource}. */
|
|
719
|
+
type PurposeSource = 'route_config' | 'header' | 'body' | 'default';
|
|
641
720
|
interface VerificationRequest {
|
|
642
721
|
/** Agent credentials */
|
|
643
722
|
credentials: AgentCredentials;
|
|
@@ -769,6 +848,25 @@ interface VerificationRequest {
|
|
|
769
848
|
* from the verify cache key.
|
|
770
849
|
*/
|
|
771
850
|
attemptId?: string;
|
|
851
|
+
/**
|
|
852
|
+
* 5.19.0 — where `purpose` came from: `'route_config'` (a dashboard route
|
|
853
|
+
* rule matched this request), `'header'` (the agent's X-Astra-Purpose /
|
|
854
|
+
* legacy header / query), `'body'` (request-derived by your own
|
|
855
|
+
* extractor), or `'default'` (derived from the action or the transport
|
|
856
|
+
* default). Set by the express and Next.js adapters. verify-access keeps a
|
|
857
|
+
* `'route_config'` purpose over a commerce-derived one (e.g. an MPP paid
|
|
858
|
+
* leg) only when a stored rule on the endpoint matches `requestMethod` +
|
|
859
|
+
* `requestPath` with the same purpose and action.
|
|
860
|
+
*/
|
|
861
|
+
purposeSource?: PurposeSource;
|
|
862
|
+
/** 5.19.0 — the inbound agent request behind a kit confirm (see {@link AgentArtifacts}). */
|
|
863
|
+
agentArtifacts?: AgentArtifacts;
|
|
864
|
+
/** 5.19.0 — kit session id + protocol, stored on any approval this confirm creates. */
|
|
865
|
+
metadata?: CheckoutMetadata;
|
|
866
|
+
/** 5.19.0 — the inbound request's HTTP method (for the route-rule check above). */
|
|
867
|
+
requestMethod?: string;
|
|
868
|
+
/** 5.19.0 — the inbound request's path, without the query (for the route-rule check above). */
|
|
869
|
+
requestPath?: string;
|
|
772
870
|
/**
|
|
773
871
|
* 3.12.0 — first-party observational data: the
|
|
774
872
|
* offers the agent evaluated at this checkpoint (catalog browse / intent
|
|
@@ -992,5 +1090,10 @@ interface AstraSyncAepEvidence {
|
|
|
992
1090
|
platform_countersignature: string;
|
|
993
1091
|
}>;
|
|
994
1092
|
}
|
|
1093
|
+
/** 5.20.0: a non-fatal warning on a verify-access result (see `warnings`). */
|
|
1094
|
+
interface VerificationWarning {
|
|
1095
|
+
code: string;
|
|
1096
|
+
message: string;
|
|
1097
|
+
}
|
|
995
1098
|
|
|
996
1099
|
export type { AgentCredentials as A, CommerceArtifactsPayload as C, GatewayConfig as G, TokenGuidance as T, VerificationRequest as V, AttemptReport as a, CounterpartyType as b, VerificationResult as c };
|