@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
package/dist/index.d.ts
CHANGED
|
@@ -243,6 +243,17 @@ interface GatewayConfig {
|
|
|
243
243
|
debug?: boolean;
|
|
244
244
|
/** Custom headers to send with verification requests */
|
|
245
245
|
customHeaders?: Record<string, string>;
|
|
246
|
+
/**
|
|
247
|
+
* 5.20.0: proof that this caller may act as the agent, sent as
|
|
248
|
+
* `actingProof` in the verify-access body. Honoured only from a
|
|
249
|
+
* first-party AstraSync service caller (the bridge): the backend checks the
|
|
250
|
+
* connector's OAuth access token and records a `connector_owner` proof when
|
|
251
|
+
* its owner owns the agent. Ignored for any other key. A verify carrying it
|
|
252
|
+
* is never served from, or written to, the verdict cache.
|
|
253
|
+
*/
|
|
254
|
+
actingProof?: {
|
|
255
|
+
connectorToken: string;
|
|
256
|
+
};
|
|
246
257
|
/** This counterparty's URL (sent with verify-access requests for analytics) */
|
|
247
258
|
counterpartyUrl?: string;
|
|
248
259
|
/** This counterparty's type (sent with verify-access requests for analytics) */
|
|
@@ -351,9 +362,15 @@ interface VerifiedAgent {
|
|
|
351
362
|
astraId: string;
|
|
352
363
|
/** Agent display name */
|
|
353
364
|
name: string;
|
|
354
|
-
/**
|
|
365
|
+
/**
|
|
366
|
+
* Composite trust score (0-100). 5.19.0: verify-access returns it to an
|
|
367
|
+
* authenticated counterparty (your API key) — counterparties may see an
|
|
368
|
+
* agent's score; the agent itself never does, so never relay it to the
|
|
369
|
+
* agent. It is withheld (undefined at runtime) for a keyless caller and when
|
|
370
|
+
* the caller is the agent itself; a route `minTrustScore` then fails closed.
|
|
371
|
+
*/
|
|
355
372
|
trustScore: number;
|
|
356
|
-
/** Trust level tier */
|
|
373
|
+
/** Trust level tier (derived from `trustScore`) */
|
|
357
374
|
trustLevel: TrustLevel;
|
|
358
375
|
/** Whether the agent's identity record is anchored on-chain (5.9.0: was `blockchainVerified`) */
|
|
359
376
|
blockchainAnchored: boolean;
|
|
@@ -543,7 +560,9 @@ interface StepUpApprovalInfo {
|
|
|
543
560
|
* Lifecycle states of a step-up approval row (mirrors the backend's
|
|
544
561
|
* step_up_approval_status_check constraint).
|
|
545
562
|
*/
|
|
546
|
-
type StepUpApprovalStatus = 'pending' | 'approved' | 'denied' | 'expired' | 'consumed'
|
|
563
|
+
type StepUpApprovalStatus = 'pending' | 'approved' | 'denied' | 'expired' | 'consumed'
|
|
564
|
+
/** 5.20.0: approved but never redeemed inside the redemption window. */
|
|
565
|
+
| 'lapsed';
|
|
547
566
|
/**
|
|
548
567
|
* Terminal outcome of a hold-and-poll wait: any non-pending status, or
|
|
549
568
|
* 'timeout' when the hold budget ran out while the approval was still pending.
|
|
@@ -605,6 +624,20 @@ interface SettlementArtifact {
|
|
|
605
624
|
* - `counterparty.<allowlist|trust>`
|
|
606
625
|
* - `attestation.<type>` (e.g. `attestation.verified_human_party`)
|
|
607
626
|
* - `endpoint.<deactivated|trust|policy>`
|
|
627
|
+
* - `behaviour.<limit_probing|unattributed_limit_check>` (5.19.0) — the
|
|
628
|
+
* call is part of a sweep of unfinished attempts at rising values (quotes,
|
|
629
|
+
* held/denied confirms, orders that never settled) that maps the agent's
|
|
630
|
+
* spending limit. Completed purchases never count.
|
|
631
|
+
* - `behaviour.limit_probing`: the sweep is provably the agent's own
|
|
632
|
+
* (signed agent request, first-party bridge hop, runtime challenge or
|
|
633
|
+
* the agent's key). Denied with no new step-up approval; the agent's
|
|
634
|
+
* trust drops and its owner is alerted.
|
|
635
|
+
* - `behaviour.unattributed_limit_check`: the sweep can't be attributed
|
|
636
|
+
* to the agent (unsigned or direct merchant calls). Denied — it "needs
|
|
637
|
+
* a signed agent request" — with no agent trust penalty; owners are
|
|
638
|
+
* alerted with the evidence. A repeat of the merchant's own direct
|
|
639
|
+
* calls, or the same pattern across agents of two or more owners,
|
|
640
|
+
* reduces the endpoint owner's trust score.
|
|
608
641
|
*/
|
|
609
642
|
interface AccessFailure {
|
|
610
643
|
dimension: string;
|
|
@@ -721,6 +754,12 @@ interface VerificationResult {
|
|
|
721
754
|
* (steer the user to add one via onboarding).
|
|
722
755
|
*/
|
|
723
756
|
settlementOutcome?: SettlementOutcomeInfo;
|
|
757
|
+
/**
|
|
758
|
+
* 5.20.0 (round 29.1): non-fatal integration warnings for the caller —
|
|
759
|
+
* e.g. `events_url_missing` when a kit's held confirm is on an endpoint with
|
|
760
|
+
* no Events URL (the kit would never hear the owner's decision).
|
|
761
|
+
*/
|
|
762
|
+
warnings?: VerificationWarning[];
|
|
724
763
|
/**
|
|
725
764
|
* Card settlement token. Present on a card purchase at a first-party
|
|
726
765
|
* storefront (our Stripe tenant) — 5.14.1: always, there is no charge-here
|
|
@@ -884,6 +923,46 @@ interface CallerMetadata {
|
|
|
884
923
|
*/
|
|
885
924
|
observedMetadata?: ObservedMetadata;
|
|
886
925
|
}
|
|
926
|
+
/**
|
|
927
|
+
* 5.19.0 — the inbound agent request behind a kit confirm, forwarded so
|
|
928
|
+
* verify-access can tell whether the confirm is provably the agent's own
|
|
929
|
+
* (limit-probing attribution). The kits build it from `handle(req)`.
|
|
930
|
+
*
|
|
931
|
+
* - Signed (UCP, RFC 9421): the covered headers (`signature`,
|
|
932
|
+
* `signature-input`, `signature-agent`, `ucp-agent`, `content-digest` and
|
|
933
|
+
* every other header the signature covers — never `authorization` or
|
|
934
|
+
* `cookie`), the method, the PUBLIC request URL (your `publicOrigin` + the
|
|
935
|
+
* path and query, so `@target-uri` / `@authority` match what the agent
|
|
936
|
+
* signed behind a TLS-terminating proxy) and `contentDigest`, the
|
|
937
|
+
* `sha-256=:<base64>:` digest of the exact raw body.
|
|
938
|
+
* - `{ unsigned: true }`: the inbound request carried no signature, or it
|
|
939
|
+
* came over ACP (the ACP `Authorization` bearer is the platform's
|
|
940
|
+
* credential to you and is never forwarded, so ACP confirms are
|
|
941
|
+
* unattributable). Sent explicitly so the platform can tell a kit relay
|
|
942
|
+
* from a direct merchant call.
|
|
943
|
+
*/
|
|
944
|
+
type AgentArtifacts = {
|
|
945
|
+
unsigned: true;
|
|
946
|
+
protocol?: 'ucp' | 'acp';
|
|
947
|
+
} | {
|
|
948
|
+
unsigned?: false;
|
|
949
|
+
protocol: 'ucp' | 'acp';
|
|
950
|
+
method: string;
|
|
951
|
+
/** Absolute public URL of the inbound request. */
|
|
952
|
+
url: string;
|
|
953
|
+
/** Lower-cased covered headers. */
|
|
954
|
+
headers: Record<string, string>;
|
|
955
|
+
/** `sha-256=:<base64>:` over the raw request body (absent for an empty body). */
|
|
956
|
+
contentDigest?: string;
|
|
957
|
+
};
|
|
958
|
+
/** 5.19.0 — kit context on a confirm (carried onto the approval and its events). */
|
|
959
|
+
interface CheckoutMetadata {
|
|
960
|
+
/** The kit's own checkout session id (`chk_…` / `cs_…`). */
|
|
961
|
+
kitSessionId?: string;
|
|
962
|
+
protocol?: 'ucp' | 'acp';
|
|
963
|
+
}
|
|
964
|
+
/** 5.19.0 — see {@link VerificationRequest.purposeSource}. */
|
|
965
|
+
type PurposeSource = 'route_config' | 'header' | 'body' | 'default';
|
|
887
966
|
interface VerificationRequest {
|
|
888
967
|
/** Agent credentials */
|
|
889
968
|
credentials: AgentCredentials;
|
|
@@ -1015,6 +1094,25 @@ interface VerificationRequest {
|
|
|
1015
1094
|
* from the verify cache key.
|
|
1016
1095
|
*/
|
|
1017
1096
|
attemptId?: string;
|
|
1097
|
+
/**
|
|
1098
|
+
* 5.19.0 — where `purpose` came from: `'route_config'` (a dashboard route
|
|
1099
|
+
* rule matched this request), `'header'` (the agent's X-Astra-Purpose /
|
|
1100
|
+
* legacy header / query), `'body'` (request-derived by your own
|
|
1101
|
+
* extractor), or `'default'` (derived from the action or the transport
|
|
1102
|
+
* default). Set by the express and Next.js adapters. verify-access keeps a
|
|
1103
|
+
* `'route_config'` purpose over a commerce-derived one (e.g. an MPP paid
|
|
1104
|
+
* leg) only when a stored rule on the endpoint matches `requestMethod` +
|
|
1105
|
+
* `requestPath` with the same purpose and action.
|
|
1106
|
+
*/
|
|
1107
|
+
purposeSource?: PurposeSource;
|
|
1108
|
+
/** 5.19.0 — the inbound agent request behind a kit confirm (see {@link AgentArtifacts}). */
|
|
1109
|
+
agentArtifacts?: AgentArtifacts;
|
|
1110
|
+
/** 5.19.0 — kit session id + protocol, stored on any approval this confirm creates. */
|
|
1111
|
+
metadata?: CheckoutMetadata;
|
|
1112
|
+
/** 5.19.0 — the inbound request's HTTP method (for the route-rule check above). */
|
|
1113
|
+
requestMethod?: string;
|
|
1114
|
+
/** 5.19.0 — the inbound request's path, without the query (for the route-rule check above). */
|
|
1115
|
+
requestPath?: string;
|
|
1018
1116
|
/**
|
|
1019
1117
|
* 3.12.0 — first-party observational data: the
|
|
1020
1118
|
* offers the agent evaluated at this checkpoint (catalog browse / intent
|
|
@@ -1321,17 +1419,16 @@ interface ExpressMiddlewareOptions extends GatewayConfig {
|
|
|
1321
1419
|
/**
|
|
1322
1420
|
* Posture when the middleware itself throws an internal error (header
|
|
1323
1421
|
* parsing failure, `fetchRoutes` network error, malformed proxy state,
|
|
1324
|
-
* etc.).
|
|
1325
|
-
* legitimate traffic continues to pass through during platform outages.
|
|
1422
|
+
* etc.).
|
|
1326
1423
|
*
|
|
1327
|
-
*
|
|
1328
|
-
*
|
|
1329
|
-
*
|
|
1330
|
-
*
|
|
1331
|
-
*
|
|
1424
|
+
* 5.19.0 (behaviour change): default `'closed'` — the request is refused
|
|
1425
|
+
* with 503 + Retry-After + `VERIFICATION_UNAVAILABLE` (the
|
|
1426
|
+
* `middleware.internal_error` dimension; never an identity-shaped 401) and
|
|
1427
|
+
* your handler is not called. Set `'open'` explicitly to pass the request
|
|
1428
|
+
* through unverified instead (e.g. small-value demo merchants).
|
|
1332
1429
|
*
|
|
1333
|
-
*
|
|
1334
|
-
*
|
|
1430
|
+
* The middleware always logs a `[SHADOW] would-have-denied` line on throws
|
|
1431
|
+
* including correlationId, whichever posture is set.
|
|
1335
1432
|
*/
|
|
1336
1433
|
failOnError?: 'open' | 'closed';
|
|
1337
1434
|
/**
|
|
@@ -1580,6 +1677,11 @@ interface AstraSyncAepEvidence {
|
|
|
1580
1677
|
platform_countersignature: string;
|
|
1581
1678
|
}>;
|
|
1582
1679
|
}
|
|
1680
|
+
/** 5.20.0: a non-fatal warning on a verify-access result (see `warnings`). */
|
|
1681
|
+
interface VerificationWarning {
|
|
1682
|
+
code: string;
|
|
1683
|
+
message: string;
|
|
1684
|
+
}
|
|
1583
1685
|
|
|
1584
1686
|
/**
|
|
1585
1687
|
* AstraSync Universal Verification Gateway — Trust Level helpers.
|
|
@@ -1611,7 +1713,8 @@ declare function getTrustLevel(score: number): TrustLevel;
|
|
|
1611
1713
|
*/
|
|
1612
1714
|
|
|
1613
1715
|
/**
|
|
1614
|
-
* Clear the verification cache
|
|
1716
|
+
* Clear the verification cache, and (5.20.0) forget in-flight single-flight
|
|
1717
|
+
* calls so a later identical request reaches the backend on its own.
|
|
1615
1718
|
*/
|
|
1616
1719
|
declare function clearCache(): void;
|
|
1617
1720
|
/**
|
|
@@ -1639,6 +1742,24 @@ interface VerifyOptions {
|
|
|
1639
1742
|
* Main verification function
|
|
1640
1743
|
*/
|
|
1641
1744
|
declare function verify(config: GatewayConfig, request: VerificationRequest, options?: VerifyOptions): Promise<VerificationResult>;
|
|
1745
|
+
/**
|
|
1746
|
+
* Whether `result` was served from the verdict cache or shared from a
|
|
1747
|
+
* concurrent identical call (5.20.0). The adapters skip the decision POST for
|
|
1748
|
+
* these: the session already has its decision from the call that created it.
|
|
1749
|
+
*/
|
|
1750
|
+
declare function isSharedVerdict(result: VerificationResult): boolean;
|
|
1751
|
+
type VerificationListener = (result: VerificationResult, request: VerificationRequest) => void;
|
|
1752
|
+
/**
|
|
1753
|
+
* 5.20.0: observe every verdict this process fetched from verify-access
|
|
1754
|
+
* (cache hits and single-flight followers are not repeated). Listeners run
|
|
1755
|
+
* synchronously after the result is built and must not throw (a throw is
|
|
1756
|
+
* swallowed). Returns an unsubscribe function.
|
|
1757
|
+
*
|
|
1758
|
+
* The MCP bridge uses it to size its per-agent rate limit from the trust
|
|
1759
|
+
* score its tools' own verifies return, instead of paying for a second
|
|
1760
|
+
* verify-access call in the gate.
|
|
1761
|
+
*/
|
|
1762
|
+
declare function onVerificationResult(listener: VerificationListener): () => void;
|
|
1642
1763
|
/**
|
|
1643
1764
|
* Report post-hoc consideration/outcome data for an attempt chain (Trust
|
|
1644
1765
|
* Record). Use when the signal never reached verify-access: a
|
|
@@ -1665,15 +1786,42 @@ interface ReportAttemptOptions {
|
|
|
1665
1786
|
retried: boolean;
|
|
1666
1787
|
}) => void;
|
|
1667
1788
|
}
|
|
1668
|
-
declare function fetchRoutes(config: GatewayConfig, counterpartyId: string
|
|
1789
|
+
declare function fetchRoutes(config: GatewayConfig, counterpartyId: string, options?: {
|
|
1790
|
+
/**
|
|
1791
|
+
* 5.19.0: tool names the MCP middleware gates in code, sent as
|
|
1792
|
+
* `?codeGates=a,b` so the dashboard can mark them "gated in code — a rule
|
|
1793
|
+
* here can only add checks".
|
|
1794
|
+
*/
|
|
1795
|
+
codeGates?: string[];
|
|
1796
|
+
/**
|
|
1797
|
+
* 5.20.0: called with the endpoint's `counterpartyType` when the routes
|
|
1798
|
+
* response carries it (backend round 29.1+). The MCP middleware uses it
|
|
1799
|
+
* to warn when it is pointed at a non-`mcp_server` endpoint.
|
|
1800
|
+
*/
|
|
1801
|
+
onEndpointType?: (counterpartyType: string) => void;
|
|
1802
|
+
}): Promise<RouteAccessConfigShape[] | null>;
|
|
1669
1803
|
/**
|
|
1670
1804
|
* Minimal shape of an EndpointRoute as the SDK consumes it. Mirrors the
|
|
1671
1805
|
* server's `EndpointRoute` type and the SDK's `RouteAccessConfig` — same
|
|
1672
1806
|
* JSON moves between server and SDK unchanged.
|
|
1673
1807
|
*/
|
|
1674
1808
|
interface RouteAccessConfigShape {
|
|
1809
|
+
/** Path pattern (path rules). Absent on an MCP tool rule. */
|
|
1675
1810
|
pattern: string;
|
|
1676
1811
|
method: string;
|
|
1812
|
+
/**
|
|
1813
|
+
* 5.19.0: MCP tool rule — the `tools/call` tool name this rule governs
|
|
1814
|
+
* (`mcp_server` endpoints store only tool rules: `{tool, purpose, action,
|
|
1815
|
+
* resource?, observe?}`). Path-rule matchers skip rules carrying it.
|
|
1816
|
+
*/
|
|
1817
|
+
tool?: string;
|
|
1818
|
+
/** 5.19.0: a tool rule's resource override. */
|
|
1819
|
+
resource?: string;
|
|
1820
|
+
/**
|
|
1821
|
+
* 5.19.0: a path rule stored on an `mcp_server` endpoint before tool rules
|
|
1822
|
+
* existed. The MCP middleware ignores it (replace it with tool rules).
|
|
1823
|
+
*/
|
|
1824
|
+
legacy?: boolean;
|
|
1677
1825
|
/** Pass through unenforced (observe). Replaces `minAccessLevel: 'none'`. */
|
|
1678
1826
|
observe?: boolean;
|
|
1679
1827
|
minTrustScore?: number;
|
|
@@ -1929,6 +2077,14 @@ declare global {
|
|
|
1929
2077
|
namespace Express {
|
|
1930
2078
|
interface Request {
|
|
1931
2079
|
agentVerification?: VerificationResult;
|
|
2080
|
+
/**
|
|
2081
|
+
* 5.19.0 (documented): the exact request bytes, when your JSON parser
|
|
2082
|
+
* keeps them — `express.json({ verify: (req, _res, buf) => { req.rawBody = buf } })`.
|
|
2083
|
+
* The gateway forwards these (not a re-serialised `req.body`) as the
|
|
2084
|
+
* protocol artifacts' raw body, so body digests (MPP, RFC 9421
|
|
2085
|
+
* content-digest) match without mounting `express.raw`.
|
|
2086
|
+
*/
|
|
2087
|
+
rawBody?: Buffer | string;
|
|
1932
2088
|
}
|
|
1933
2089
|
}
|
|
1934
2090
|
}
|
|
@@ -2036,6 +2192,37 @@ declare class VerificationGatewayClient {
|
|
|
2036
2192
|
subAgentDepth?: number;
|
|
2037
2193
|
counterpartyUrl?: string;
|
|
2038
2194
|
counterpartyType?: string;
|
|
2195
|
+
/**
|
|
2196
|
+
* 5.19.0: `'quote'` marks a price / limit check (peek only: no order, no
|
|
2197
|
+
* approval redeemed) — prefer `quoteCheckout()`. Omitted with a
|
|
2198
|
+
* `transactionValue`, the call is a PURCHASE leg (see the warning below).
|
|
2199
|
+
*/
|
|
2200
|
+
commercePhase?: 'quote';
|
|
2201
|
+
}): Promise<VerificationResult>;
|
|
2202
|
+
/**
|
|
2203
|
+
* 5.19.0: the QUOTE leg of a checkout — a price / limit check before the
|
|
2204
|
+
* purchase. Sends `commercePhase: 'quote'`: verify-access evaluates the
|
|
2205
|
+
* agent's policy at this value and tells you whether a purchase would be
|
|
2206
|
+
* granted, held for the owner's approval, or denied, but records no order,
|
|
2207
|
+
* moves no money and never redeems an approval. Always reaches the backend
|
|
2208
|
+
* (no verdict cache).
|
|
2209
|
+
*
|
|
2210
|
+
* Quotes count toward limit-probing detection: a run of rising quotes is
|
|
2211
|
+
* how an agent (or a merchant) maps a spending limit. Quote what the buyer
|
|
2212
|
+
* asked for, not a ladder of values.
|
|
2213
|
+
*/
|
|
2214
|
+
quoteCheckout(options: {
|
|
2215
|
+
astraId?: string;
|
|
2216
|
+
apiKey?: string;
|
|
2217
|
+
jwt?: string;
|
|
2218
|
+
purpose?: string;
|
|
2219
|
+
action?: string;
|
|
2220
|
+
transactionValue?: number;
|
|
2221
|
+
currency?: string;
|
|
2222
|
+
checkoutSessionId?: string;
|
|
2223
|
+
attemptId?: string;
|
|
2224
|
+
counterpartyUrl?: string;
|
|
2225
|
+
counterpartyType?: string;
|
|
2039
2226
|
}): Promise<VerificationResult>;
|
|
2040
2227
|
/**
|
|
2041
2228
|
* 5.4.0 (astra-pay): confirm-leg of a checkout — the ONLY call that may fire
|
|
@@ -2075,6 +2262,14 @@ declare class VerificationGatewayClient {
|
|
|
2075
2262
|
* is matched to — and only to — this confirm. A held cart's approval is
|
|
2076
2263
|
* bound to its checkout session and exact value; a confirm for any other
|
|
2077
2264
|
* cart is held for its own approval.
|
|
2265
|
+
*
|
|
2266
|
+
* 5.19.0 checkout kits: pass the kit's `agentArtifacts` (the inbound agent
|
|
2267
|
+
* request — signed RFC 9421 headers with the public URL and raw-body
|
|
2268
|
+
* digest, or `{ unsigned: true }`) and `metadata` (`{ kitSessionId,
|
|
2269
|
+
* protocol }`) from the `verifyPurchase` context. The platform attributes
|
|
2270
|
+
* the confirm to the agent from the artifacts, and stores the metadata on
|
|
2271
|
+
* any approval this confirm creates so the approval event
|
|
2272
|
+
* (`handleApprovalEvents`) can find the kit session.
|
|
2078
2273
|
*/
|
|
2079
2274
|
confirmCheckout(options: {
|
|
2080
2275
|
astraId?: string;
|
|
@@ -2093,6 +2288,10 @@ declare class VerificationGatewayClient {
|
|
|
2093
2288
|
/** 5.6.0: alternate receipt/delivery email (transit-only) — omit to let
|
|
2094
2289
|
* the platform default `fulfilment.email` to the buyer's account email. */
|
|
2095
2290
|
buyerEmail?: string;
|
|
2291
|
+
/** 5.19.0: the inbound agent request behind this confirm (from the kit's verifyPurchase ctx). */
|
|
2292
|
+
agentArtifacts?: AgentArtifacts;
|
|
2293
|
+
/** 5.19.0: `{ kitSessionId, protocol }` (from the kit's verifyPurchase ctx). */
|
|
2294
|
+
metadata?: CheckoutMetadata;
|
|
2096
2295
|
counterpartyUrl?: string;
|
|
2097
2296
|
counterpartyType?: string;
|
|
2098
2297
|
}): Promise<VerificationResult>;
|
|
@@ -2124,6 +2323,40 @@ declare class VerificationGatewayClient {
|
|
|
2124
2323
|
status: string;
|
|
2125
2324
|
alreadySettled?: boolean;
|
|
2126
2325
|
}>;
|
|
2326
|
+
/**
|
|
2327
|
+
* 5.20.0 (round 29.1): change an endpoint's OPERATIONAL URLs with this
|
|
2328
|
+
* client's API key — `PATCH /api/endpoints/:id`. Accepts the key of the
|
|
2329
|
+
* endpoint's owner, or a personal key of an individual with an active seat
|
|
2330
|
+
* in the owning organisation. Policy (rules, trust floor, challenge, edge
|
|
2331
|
+
* config) stays dashboard-only. `null` clears a field. The owner is alerted
|
|
2332
|
+
* when `eventsUrl` changes.
|
|
2333
|
+
*
|
|
2334
|
+
* @param endpointId the ASTRAE id (defaults to the client's `counterpartyId`)
|
|
2335
|
+
* @returns the endpoint as stored, plus `changed` (the fields that changed)
|
|
2336
|
+
* @throws AstraSyncError — 400 `UNKNOWN_FIELDS` / validation, 401/403, 404
|
|
2337
|
+
*/
|
|
2338
|
+
updateEndpoint(endpointId: string | undefined, patch: EndpointOperationalPatch): Promise<Record<string, unknown> & {
|
|
2339
|
+
changed: Array<keyof EndpointOperationalPatch>;
|
|
2340
|
+
}>;
|
|
2341
|
+
/**
|
|
2342
|
+
* 5.20.0 (round 29.1): ask AstraSync to send ONE signed step-up event to the
|
|
2343
|
+
* endpoint's Events URL now — `POST /api/endpoints/:id/events/test`.
|
|
2344
|
+
* Delivered synchronously, outside the event outbox (random `eventId`, no
|
|
2345
|
+
* retries), signed with the endpoint's webhook secret like a real event.
|
|
2346
|
+
* Without `approvalId` the payload is synthetic (a kit acknowledges and
|
|
2347
|
+
* ignores it). With the id of a held kit approval at this endpoint the
|
|
2348
|
+
* payload is the real one, so your resume path runs: `approved` makes the
|
|
2349
|
+
* kit re-confirm (held again — nothing is charged); `denied` / `expired` /
|
|
2350
|
+
* `lapsed` release the session.
|
|
2351
|
+
*
|
|
2352
|
+
* Resolves even when your endpoint refused the event (`delivered: false`,
|
|
2353
|
+
* with `responseCode` / `error`).
|
|
2354
|
+
*/
|
|
2355
|
+
sendTestEvent(endpointId: string | undefined, options: {
|
|
2356
|
+
type: TestEventType;
|
|
2357
|
+
approvalId?: string;
|
|
2358
|
+
}): Promise<TestEventResult>;
|
|
2359
|
+
private endpointCall;
|
|
2127
2360
|
/**
|
|
2128
2361
|
* Quick verification — checks credentials and policy in one call.
|
|
2129
2362
|
*
|
|
@@ -2163,6 +2396,28 @@ declare class VerificationGatewayClient {
|
|
|
2163
2396
|
*/
|
|
2164
2397
|
private executeWithRetry;
|
|
2165
2398
|
}
|
|
2399
|
+
/** 5.20.0: the operational fields `updateEndpoint` may change (`null` clears). */
|
|
2400
|
+
interface EndpointOperationalPatch {
|
|
2401
|
+
eventsUrl?: string | null;
|
|
2402
|
+
healthCheckUrl?: string | null;
|
|
2403
|
+
skillUrl?: string | null;
|
|
2404
|
+
catalogUrl?: string | null;
|
|
2405
|
+
checkoutUrl?: string | null;
|
|
2406
|
+
}
|
|
2407
|
+
/** 5.20.0: the step-up event types `sendTestEvent` can send. */
|
|
2408
|
+
type TestEventType = 'step_up.approved' | 'step_up.denied' | 'step_up.expired' | 'step_up.lapsed';
|
|
2409
|
+
/** 5.20.0: what `sendTestEvent` reports. */
|
|
2410
|
+
interface TestEventResult {
|
|
2411
|
+
delivered: boolean;
|
|
2412
|
+
/** delivered | failed (bad answer / unreachable) | not_configured (no Events URL or secret). */
|
|
2413
|
+
status: 'delivered' | 'failed' | 'not_configured';
|
|
2414
|
+
/** Your endpoint's HTTP status, or null when nothing answered. */
|
|
2415
|
+
responseCode: number | null;
|
|
2416
|
+
error: string | null;
|
|
2417
|
+
eventId: string;
|
|
2418
|
+
type: TestEventType;
|
|
2419
|
+
approvalId: string | null;
|
|
2420
|
+
}
|
|
2166
2421
|
/**
|
|
2167
2422
|
* Create a new SDK client
|
|
2168
2423
|
*/
|
|
@@ -2178,13 +2433,16 @@ declare function verifyOnce(options: SDKOptions & {
|
|
|
2178
2433
|
action?: string;
|
|
2179
2434
|
}): Promise<VerificationResult>;
|
|
2180
2435
|
|
|
2436
|
+
type sdk_EndpointOperationalPatch = EndpointOperationalPatch;
|
|
2437
|
+
type sdk_TestEventResult = TestEventResult;
|
|
2438
|
+
type sdk_TestEventType = TestEventType;
|
|
2181
2439
|
type sdk_VerificationGatewayClient = VerificationGatewayClient;
|
|
2182
2440
|
declare const sdk_VerificationGatewayClient: typeof VerificationGatewayClient;
|
|
2183
2441
|
declare const sdk_createClient: typeof createClient;
|
|
2184
2442
|
declare const sdk_getTrustLevel: typeof getTrustLevel;
|
|
2185
2443
|
declare const sdk_verifyOnce: typeof verifyOnce;
|
|
2186
2444
|
declare namespace sdk {
|
|
2187
|
-
export { sdk_VerificationGatewayClient as VerificationGatewayClient, sdk_createClient as createClient, sdk_getTrustLevel as getTrustLevel, sdk_verifyOnce as verifyOnce };
|
|
2445
|
+
export { type sdk_EndpointOperationalPatch as EndpointOperationalPatch, type sdk_TestEventResult as TestEventResult, type sdk_TestEventType as TestEventType, sdk_VerificationGatewayClient as VerificationGatewayClient, sdk_createClient as createClient, sdk_getTrustLevel as getTrustLevel, sdk_verifyOnce as verifyOnce };
|
|
2188
2446
|
}
|
|
2189
2447
|
|
|
2190
2448
|
/**
|
|
@@ -3954,19 +4212,71 @@ interface McpMiddlewareOptions extends GatewayConfig {
|
|
|
3954
4212
|
recordDecisions?: boolean;
|
|
3955
4213
|
/** Forward runtime challenge (default `true`). */
|
|
3956
4214
|
enableRuntimeChallenge?: boolean;
|
|
4215
|
+
/**
|
|
4216
|
+
* 5.19.0: how a dashboard tool rule combines with a code `toolGates`
|
|
4217
|
+
* entry for the same tool. With `apiKey` + `counterpartyId` set, the
|
|
4218
|
+
* middleware fetches the endpoint's tool rules (`{tool, purpose, action,
|
|
4219
|
+
* resource?, observe?}`, edited in the AstraSync dashboard; refreshed every
|
|
4220
|
+
* `routesRefreshMs`) and turns each into a gate for that tool.
|
|
4221
|
+
*
|
|
4222
|
+
* - `'code'` (default): a dashboard rule can TIGHTEN a code gate but never
|
|
4223
|
+
* loosen it. For a tool gated in code (object form), a dashboard
|
|
4224
|
+
* `observe` rule, or one with no purpose, is ignored; a dashboard rule
|
|
4225
|
+
* whose purpose or action differs is evaluated IN ADDITION — both must
|
|
4226
|
+
* pass. Tools with no code gate (or a code `'observe'`) follow the
|
|
4227
|
+
* dashboard rule.
|
|
4228
|
+
* - `'dashboard'`: the dashboard rule wins outright for every tool it
|
|
4229
|
+
* names (including `observe`).
|
|
4230
|
+
*
|
|
4231
|
+
* Rules flagged `legacy: true` (path rules stored on an MCP endpoint before
|
|
4232
|
+
* tool rules existed) are ignored. The middleware sends its code-gated tool
|
|
4233
|
+
* names on the policy fetch (`?codeGates=`) so the dashboard can mark them.
|
|
4234
|
+
*/
|
|
4235
|
+
toolGatePrecedence?: 'code' | 'dashboard';
|
|
4236
|
+
/** 5.19.0: refresh interval (ms) for the dashboard tool rules. Default 5 minutes. */
|
|
4237
|
+
routesRefreshMs?: number;
|
|
4238
|
+
/**
|
|
4239
|
+
* 5.20.0: tools and JSON-RPC methods that pass through with NO verify-access
|
|
4240
|
+
* call at all — not even the audit evaluation `evaluateAlwaysIfCredentialed`
|
|
4241
|
+
* adds for credentialed callers. Applies only while the call is not
|
|
4242
|
+
* enforced (an `'observe'` gate, or a handshake/introspection method with
|
|
4243
|
+
* no `methodGates` entry); a dashboard rule that enforces a listed tool
|
|
4244
|
+
* still verifies.
|
|
4245
|
+
*
|
|
4246
|
+
* Use it for:
|
|
4247
|
+
* - `methods`: handshake and introspection (`initialize`, `tools/list`,
|
|
4248
|
+
* `resources/list`, `resources/read`) — nothing to attribute, and a
|
|
4249
|
+
* backend round trip slows the host's first card fetch;
|
|
4250
|
+
* - `tools`: observe tools whose handler calls verify-access itself, so
|
|
4251
|
+
* the gate's evaluation would be a second backend verify for the same
|
|
4252
|
+
* call (the MCP bridge measured ~3 backend calls per `verify_agent`).
|
|
4253
|
+
*
|
|
4254
|
+
* Listed calls leave `req.agentVerification` unset.
|
|
4255
|
+
*/
|
|
4256
|
+
skipEvaluation?: {
|
|
4257
|
+
tools?: readonly string[];
|
|
4258
|
+
methods?: readonly string[];
|
|
4259
|
+
};
|
|
3957
4260
|
/**
|
|
3958
4261
|
* Posture when the MCP middleware itself throws an internal error.
|
|
3959
|
-
* Default `'open'` for backward compatibility in SDK 2.4.13. Shadow logs
|
|
3960
|
-
* record what WOULD be denied with `failOnError: 'closed'` so merchants
|
|
3961
|
-
* can grep correlationId for impact analysis during the observation
|
|
3962
|
-
* window. Default flips to `'closed'` in a follow-up release.
|
|
3963
4262
|
*
|
|
3964
|
-
* 5.
|
|
3965
|
-
* JSON-RPC error (HTTP 503 +
|
|
3966
|
-
* identity-shaped 401
|
|
4263
|
+
* 5.19.0 (behaviour change): default `'closed'` — an internal throw answers
|
|
4264
|
+
* the retryable verification-unavailable JSON-RPC error (HTTP 503 +
|
|
4265
|
+
* Retry-After, code -32003; never an identity-shaped 401) and the tool
|
|
4266
|
+
* handler is not called. `'open'` (pass the call through unverified) is
|
|
4267
|
+
* an explicit opt-in. The `[SHADOW] would-have-denied` log line is still
|
|
4268
|
+
* written on every throw, with the correlationId.
|
|
3967
4269
|
*/
|
|
3968
4270
|
failOnError?: 'open' | 'closed';
|
|
3969
4271
|
}
|
|
4272
|
+
/** 5.19.0: a dashboard tool rule as the MCP middleware evaluates it. */
|
|
4273
|
+
interface DashboardToolRule {
|
|
4274
|
+
tool: string;
|
|
4275
|
+
purpose?: string;
|
|
4276
|
+
action?: string;
|
|
4277
|
+
resource?: string;
|
|
4278
|
+
observe?: boolean;
|
|
4279
|
+
}
|
|
3970
4280
|
/**
|
|
3971
4281
|
* Create the MCP middleware. Attach AFTER `express.json()` — the body must
|
|
3972
4282
|
* already be a parsed object.
|
|
@@ -4263,7 +4573,12 @@ interface AgentRecord {
|
|
|
4263
4573
|
description?: string;
|
|
4264
4574
|
agentType: string;
|
|
4265
4575
|
agentStatus: string;
|
|
4266
|
-
|
|
4576
|
+
/**
|
|
4577
|
+
* @deprecated Round 29.1: no longer returned. An agent never sees its own
|
|
4578
|
+
* trust score (the register response omits it; counterparties read it
|
|
4579
|
+
* from verify-access).
|
|
4580
|
+
*/
|
|
4581
|
+
trustScore?: number;
|
|
4267
4582
|
astrasyncIdLevel1?: string | null;
|
|
4268
4583
|
tempId?: string | null;
|
|
4269
4584
|
metadata?: Record<string, unknown>;
|
|
@@ -4277,7 +4592,11 @@ interface VerifyResponse {
|
|
|
4277
4592
|
agentUuid: string;
|
|
4278
4593
|
agentName: string;
|
|
4279
4594
|
agentDescription: string;
|
|
4280
|
-
|
|
4595
|
+
/**
|
|
4596
|
+
* @deprecated Round 29.1: no longer returned by public verification.
|
|
4597
|
+
* Counterparties read the score from verify-access.
|
|
4598
|
+
*/
|
|
4599
|
+
agentTrustScore?: number;
|
|
4281
4600
|
agentStatus: string;
|
|
4282
4601
|
ownerName?: string;
|
|
4283
4602
|
};
|
|
@@ -5166,7 +5485,7 @@ declare function detectRuntime(userAgent: string | undefined | null): string | u
|
|
|
5166
5485
|
* silently (never throwing), so this is a no-op there — which is correct:
|
|
5167
5486
|
* in a browser the page's real UA is the honest identity.
|
|
5168
5487
|
*/
|
|
5169
|
-
declare const SDK_USER_AGENT = "astrasync-sdk/5.
|
|
5488
|
+
declare const SDK_USER_AGENT = "astrasync-sdk/5.20.0";
|
|
5170
5489
|
declare const sdkFetch: typeof fetch;
|
|
5171
5490
|
|
|
5172
5491
|
interface LocalPolicy {
|
|
@@ -5284,7 +5603,7 @@ declare function parseYaml(yamlContent: string): ParseResult;
|
|
|
5284
5603
|
* is fine — bumping both in the release-ceremony commit keeps them
|
|
5285
5604
|
* lockstep.
|
|
5286
5605
|
*/
|
|
5287
|
-
declare const SDK_VERSION = "5.
|
|
5606
|
+
declare const SDK_VERSION = "5.20.0";
|
|
5288
5607
|
|
|
5289
5608
|
/**
|
|
5290
5609
|
* 5.15.0 — the `UCP-Agent` request header (UCP 2026-08-25): an RFC 8941
|
|
@@ -5327,6 +5646,9 @@ declare function checkUcpAgentBinding(header: string | string[] | null | undefin
|
|
|
5327
5646
|
* `ucp.payment_handlers` are required even when empty; signing keys are the
|
|
5328
5647
|
* TOP-LEVEL `keys[]` (a JWK Set). Served over HTTPS, never redirected, with
|
|
5329
5648
|
* `Cache-Control: public, max-age >= 60`.
|
|
5649
|
+
*
|
|
5650
|
+
* 5.20.0: platforms that publish their keys as `signing_keys` are read too —
|
|
5651
|
+
* use {@link ucpProfileKeys} wherever a profile's signing keys are needed.
|
|
5330
5652
|
*/
|
|
5331
5653
|
|
|
5332
5654
|
declare const UCP_VERSION = "2026-08-25";
|
|
@@ -5363,7 +5685,14 @@ interface UcpProfile {
|
|
|
5363
5685
|
payment_handlers: Record<string, UcpPaymentHandlerEntry[]>;
|
|
5364
5686
|
};
|
|
5365
5687
|
keys?: JWK[];
|
|
5688
|
+
/** 5.20.0: accepted alongside `keys[]` (some platforms publish this name). */
|
|
5689
|
+
signing_keys?: JWK[];
|
|
5366
5690
|
}
|
|
5691
|
+
/**
|
|
5692
|
+
* 5.20.0: a profile's signing keys — `keys[]` plus `signing_keys`, skipping
|
|
5693
|
+
* malformed entries and encryption keys (`use: 'enc'`).
|
|
5694
|
+
*/
|
|
5695
|
+
declare function ucpProfileKeys(profile: Partial<UcpProfile> | null | undefined): JWK[];
|
|
5367
5696
|
/** AstraSync payment handler declarations (spec pages hosted on astrasync.ai). */
|
|
5368
5697
|
declare function astrasyncPaymentHandlers(handlers: string[], specBase?: string): Record<string, UcpPaymentHandlerEntry[]>;
|
|
5369
5698
|
interface BuildProfileOptions {
|
|
@@ -5634,6 +5963,15 @@ declare function finishIdempotent(opts: IdempotencyOptions, decision: Extract<Id
|
|
|
5634
5963
|
headers: Record<string, string>;
|
|
5635
5964
|
body: string;
|
|
5636
5965
|
}): Promise<void>;
|
|
5966
|
+
/**
|
|
5967
|
+
* 5.19.0: release a key without storing the response — for a NON-TERMINAL
|
|
5968
|
+
* outcome (e.g. a checkout held for the owner's approval) that a retry with
|
|
5969
|
+
* the same key must re-run rather than replay. The checkout kits use it for
|
|
5970
|
+
* held responses, so a re-drive after the approval reaches the kit.
|
|
5971
|
+
*/
|
|
5972
|
+
declare function abandonIdempotent(opts: IdempotencyOptions, decision: Extract<IdempotencyDecision, {
|
|
5973
|
+
kind: 'proceed';
|
|
5974
|
+
}>): Promise<void>;
|
|
5637
5975
|
interface ExpressReq {
|
|
5638
5976
|
method: string;
|
|
5639
5977
|
originalUrl?: string;
|
|
@@ -5664,12 +6002,76 @@ interface KitRequestContext {
|
|
|
5664
6002
|
*/
|
|
5665
6003
|
callerId?: string;
|
|
5666
6004
|
}
|
|
6005
|
+
/**
|
|
6006
|
+
* 5.19.0: a cart-level message from your `validateCart` hook. `type`
|
|
6007
|
+
* defaults to `'error'`; any error keeps the session from being completed
|
|
6008
|
+
* (UCP `incomplete`, ACP `not_ready_for_payment`) and `complete` is refused
|
|
6009
|
+
* before AstraSync is called. `path` points at the offending part of the
|
|
6010
|
+
* cart (e.g. `$.line_items[0].quantity`) — UCP `path`, ACP `param`.
|
|
6011
|
+
*/
|
|
6012
|
+
interface KitMessage {
|
|
6013
|
+
type?: 'error' | 'warning' | 'info';
|
|
6014
|
+
code: string;
|
|
6015
|
+
content: string;
|
|
6016
|
+
path?: string;
|
|
6017
|
+
}
|
|
6018
|
+
/** 5.19.0: retry policy for settlement reports (`reportRetry` kit option). */
|
|
6019
|
+
interface ReportRetryOptions {
|
|
6020
|
+
/** Total attempts. Default 3. */
|
|
6021
|
+
attempts?: number;
|
|
6022
|
+
/** First backoff in ms, doubled per retry. Default 250. */
|
|
6023
|
+
backoffMs?: number;
|
|
6024
|
+
}
|
|
6025
|
+
/**
|
|
6026
|
+
* 5.19.0: what an approval-event resume did. `terminal` outcomes are final
|
|
6027
|
+
* for the event (the dispatcher answers 2xx and marks the event seen);
|
|
6028
|
+
* non-terminal ones (`busy`, `still_held`) answer 5xx so the platform
|
|
6029
|
+
* retries.
|
|
6030
|
+
*/
|
|
6031
|
+
type ResumeOutcome = 'completed' | 'pending' | 'payment_failed' | 'cart_invalid' | 'not_authorized' | 'declined' | 'already_completed' | 'canceled' | 'not_held' | 'stale' | 'not_found' | 'busy' | 'still_held';
|
|
6032
|
+
interface ResumeResult<S> {
|
|
6033
|
+
outcome: ResumeOutcome;
|
|
6034
|
+
terminal: boolean;
|
|
6035
|
+
session: S | null;
|
|
6036
|
+
}
|
|
6037
|
+
/** 5.19.0: the approval event AstraSync POSTs to your endpoint's Events URL. */
|
|
6038
|
+
interface ApprovalEvent {
|
|
6039
|
+
/** Stable across retries — dedupe on it. */
|
|
6040
|
+
eventId: string;
|
|
6041
|
+
type: 'step_up.approved' | 'step_up.denied' | 'step_up.expired' | 'step_up.lapsed';
|
|
6042
|
+
approvalId: string;
|
|
6043
|
+
/** The cart id the confirm carried (the platform's, else the kit's session id). */
|
|
6044
|
+
checkoutSessionId: string;
|
|
6045
|
+
/** The kit session id the confirm carried in `metadata`. */
|
|
6046
|
+
kitSessionId?: string;
|
|
6047
|
+
protocol?: 'ucp' | 'acp';
|
|
6048
|
+
counterpartyId: string;
|
|
6049
|
+
agentAstraId: string;
|
|
6050
|
+
transactionValue: number;
|
|
6051
|
+
currency: string;
|
|
6052
|
+
decidedAt: string;
|
|
6053
|
+
/** Approved only: the approval can be redeemed until this instant (ISO). */
|
|
6054
|
+
redeemBy?: string;
|
|
6055
|
+
}
|
|
6056
|
+
/** A kit the approval-event dispatcher can route to (both checkout kits). */
|
|
6057
|
+
interface ApprovalEventKit {
|
|
6058
|
+
readonly protocol: 'ucp' | 'acp';
|
|
6059
|
+
/** Apply one verified event to the kit session it names. */
|
|
6060
|
+
applyApprovalEvent(event: ApprovalEvent): Promise<ResumeResult<unknown>>;
|
|
6061
|
+
}
|
|
5667
6062
|
|
|
5668
6063
|
interface CatalogItem {
|
|
5669
6064
|
id: string;
|
|
5670
6065
|
title: string;
|
|
5671
6066
|
/** Minor units. */
|
|
5672
6067
|
price: number;
|
|
6068
|
+
/**
|
|
6069
|
+
* 5.20.0: product image, an absolute http(s) URL. A relative or invalid value is
|
|
6070
|
+
* dropped when the kit prices the line.
|
|
6071
|
+
*/
|
|
6072
|
+
image_url?: string;
|
|
6073
|
+
/** 5.20.0: short product description. */
|
|
6074
|
+
description?: string;
|
|
5673
6075
|
}
|
|
5674
6076
|
interface CheckoutLine {
|
|
5675
6077
|
id: string;
|
|
@@ -5682,7 +6084,9 @@ interface CheckoutLine {
|
|
|
5682
6084
|
}
|
|
5683
6085
|
interface CheckoutSession {
|
|
5684
6086
|
id: string;
|
|
5685
|
-
status: 'incomplete' | 'requires_escalation' | 'ready_for_complete' | 'complete_in_progress' | 'completed' | 'canceled'
|
|
6087
|
+
status: 'incomplete' | 'requires_escalation' | 'ready_for_complete' | 'complete_in_progress' | 'completed' | 'canceled'
|
|
6088
|
+
/** 5.19.0: kit-internal — `resolvePending` is finishing it (rendered as `complete_in_progress`). */
|
|
6089
|
+
| 'finishing';
|
|
5686
6090
|
currency: string;
|
|
5687
6091
|
line_items: CheckoutLine[];
|
|
5688
6092
|
totals: Array<{
|
|
@@ -5705,6 +6109,8 @@ interface CheckoutSession {
|
|
|
5705
6109
|
/** 5.18.0: a settlement the processor hasn't confirmed yet (see `resolvePending`). */
|
|
5706
6110
|
_pending?: {
|
|
5707
6111
|
orderId?: string;
|
|
6112
|
+
/** 5.19.0: the confirm's verification session id (report fallback when there is no orderId). */
|
|
6113
|
+
sessionId?: string;
|
|
5708
6114
|
report: {
|
|
5709
6115
|
amountMinor: number;
|
|
5710
6116
|
currency: string;
|
|
@@ -5712,6 +6118,25 @@ interface CheckoutSession {
|
|
|
5712
6118
|
/** The verification result, minus merchant-lane secrets. */
|
|
5713
6119
|
result: VerificationResult;
|
|
5714
6120
|
};
|
|
6121
|
+
/** 5.19.0: the owner approval a held checkout waits for. */
|
|
6122
|
+
_approvalId?: string;
|
|
6123
|
+
/** 5.19.0: the agent behind the held confirm (re-sent when the hold resumes). */
|
|
6124
|
+
_astraId?: string;
|
|
6125
|
+
/**
|
|
6126
|
+
* 5.19.0: what was held — the priced cart and the non-secret payment input
|
|
6127
|
+
* — so an approved hold settles exactly what the owner approved, without
|
|
6128
|
+
* the agent and without re-pricing.
|
|
6129
|
+
*/
|
|
6130
|
+
_held?: {
|
|
6131
|
+
line_items: CheckoutLine[];
|
|
6132
|
+
totals: Array<{
|
|
6133
|
+
type: string;
|
|
6134
|
+
amount: number;
|
|
6135
|
+
}>;
|
|
6136
|
+
instrument?: Record<string, unknown>;
|
|
6137
|
+
pollUrl?: string;
|
|
6138
|
+
expiresAt?: string;
|
|
6139
|
+
};
|
|
5715
6140
|
/** 5.18.0: the platform's order webhook URL from its profile, when it declared one. */
|
|
5716
6141
|
_webhookUrl?: string;
|
|
5717
6142
|
_platformProfile?: string;
|
|
@@ -5737,6 +6162,15 @@ interface CheckoutStore {
|
|
|
5737
6162
|
claim?(id: string, from: CheckoutSession['status'], to: CheckoutSession['status']): Promise<boolean>;
|
|
5738
6163
|
/** 5.18.0: the session that produced an order (for `GET /orders/{id}`). */
|
|
5739
6164
|
findByOrderId?(orderId: string): Promise<CheckoutSession | null>;
|
|
6165
|
+
/**
|
|
6166
|
+
* 5.19.0: the session for an AstraSync cart id — the platform's
|
|
6167
|
+
* `X-Astra-Checkout-Session` value, else the session's own id. Approval
|
|
6168
|
+
* events name the cart this way; without it the kit can only use the
|
|
6169
|
+
* event's `kitSessionId`.
|
|
6170
|
+
*/
|
|
6171
|
+
findByCheckoutSessionId?(checkoutSessionId: string): Promise<CheckoutSession | null>;
|
|
6172
|
+
/** 5.19.0: sessions held for an owner approval (`pollHeldSessions` with no ids). */
|
|
6173
|
+
listHeld?(): Promise<CheckoutSession[]>;
|
|
5740
6174
|
}
|
|
5741
6175
|
declare class MemoryCheckoutStore implements CheckoutStore {
|
|
5742
6176
|
private m;
|
|
@@ -5745,6 +6179,8 @@ declare class MemoryCheckoutStore implements CheckoutStore {
|
|
|
5745
6179
|
put(s: CheckoutSession): Promise<void>;
|
|
5746
6180
|
claim(id: string, from: CheckoutSession['status'], to: CheckoutSession['status']): Promise<boolean>;
|
|
5747
6181
|
findByOrderId(orderId: string): Promise<CheckoutSession | null>;
|
|
6182
|
+
findByCheckoutSessionId(checkoutSessionId: string): Promise<CheckoutSession | null>;
|
|
6183
|
+
listHeld(): Promise<CheckoutSession[]>;
|
|
5748
6184
|
}
|
|
5749
6185
|
/** 5.18.0: a policy link shown with the checkout (part of the signed body). */
|
|
5750
6186
|
interface UcpLink {
|
|
@@ -5816,8 +6252,20 @@ interface UcpCheckoutKitOptions {
|
|
|
5816
6252
|
/** Profile inputs (endpoint, keys, paymentHandlers, ap2Mandates). */
|
|
5817
6253
|
profile: BuildProfileOptions;
|
|
5818
6254
|
currency: string;
|
|
5819
|
-
/**
|
|
5820
|
-
|
|
6255
|
+
/**
|
|
6256
|
+
* Your catalog: the item, or null when unknown. 5.19.0: also receives the
|
|
6257
|
+
* requested quantity (for simple per-line caps — or use `validateCart`).
|
|
6258
|
+
*/
|
|
6259
|
+
catalog: (itemId: string, quantity: number) => Promise<CatalogItem | null>;
|
|
6260
|
+
/**
|
|
6261
|
+
* 5.19.0: cart-level validation (stock, per-line or per-cart caps, …). Runs
|
|
6262
|
+
* on create, update and complete — before the session is claimed and
|
|
6263
|
+
* before `verifyPurchase` — and when an approved hold resumes. Any error
|
|
6264
|
+
* message keeps the session `incomplete` (messages are `recoverable`, with
|
|
6265
|
+
* your `path`, e.g. `$.line_items[0].quantity`) and `complete` is refused
|
|
6266
|
+
* without calling AstraSync.
|
|
6267
|
+
*/
|
|
6268
|
+
validateCart?: (session: CheckoutSession) => Promise<KitMessage[]>;
|
|
5821
6269
|
/** AstraSync verification of the purchase (e.g. `client.confirmCheckout`). */
|
|
5822
6270
|
verifyPurchase: (ctx: {
|
|
5823
6271
|
session: CheckoutSession;
|
|
@@ -5831,6 +6279,18 @@ interface UcpCheckoutKitOptions {
|
|
|
5831
6279
|
attemptId?: string;
|
|
5832
6280
|
checkoutJwt?: string;
|
|
5833
6281
|
valueMajor: number;
|
|
6282
|
+
/**
|
|
6283
|
+
* 5.19.0: the inbound agent request (pass to `confirmCheckout`). An
|
|
6284
|
+
* approved hold resuming has none (`undefined`) — no agent request is
|
|
6285
|
+
* involved.
|
|
6286
|
+
*/
|
|
6287
|
+
agentArtifacts?: AgentArtifacts;
|
|
6288
|
+
/** 5.19.0: `{ kitSessionId, protocol: 'ucp' }` — pass to `confirmCheckout`. */
|
|
6289
|
+
metadata: CheckoutMetadata;
|
|
6290
|
+
/** 5.19.0: set when an approved hold resumes (`resumeApproved`). */
|
|
6291
|
+
resumed?: {
|
|
6292
|
+
approvalId?: string;
|
|
6293
|
+
};
|
|
5834
6294
|
}) => Promise<VerificationResult>;
|
|
5835
6295
|
/** Charge / redeem with YOUR processor using the artifact AstraSync handed you. */
|
|
5836
6296
|
settle: (ctx: {
|
|
@@ -5840,14 +6300,36 @@ interface UcpCheckoutKitOptions {
|
|
|
5840
6300
|
}) => Promise<SettleResult>;
|
|
5841
6301
|
/** Report the outcome to AstraSync (e.g. `client.reportSettlement`). */
|
|
5842
6302
|
reportSettlement?: (r: Parameters<VerificationGatewayClient['reportSettlement']>[0]) => Promise<unknown>;
|
|
5843
|
-
/** Create your order once paid. */
|
|
6303
|
+
/** Create your order once paid. 5.19.0: `settled` is your processor's settled outcome. */
|
|
5844
6304
|
fulfil: (ctx: {
|
|
5845
6305
|
session: CheckoutSession;
|
|
5846
6306
|
result: VerificationResult;
|
|
6307
|
+
settled: Extract<PendingResolution, {
|
|
6308
|
+
status: 'settled';
|
|
6309
|
+
}>;
|
|
5847
6310
|
}) => Promise<{
|
|
5848
6311
|
id: string;
|
|
5849
6312
|
permalink_url?: string;
|
|
5850
6313
|
}>;
|
|
6314
|
+
/** 5.19.0: settlement-report retries on network / 429 / 5xx (default 3 attempts, 250 ms backoff). */
|
|
6315
|
+
reportRetry?: ReportRetryOptions;
|
|
6316
|
+
/**
|
|
6317
|
+
* 5.19.0: a settlement report or order webhook that still failed after its
|
|
6318
|
+
* retries (default: `console.error`). The order is yours to reconcile.
|
|
6319
|
+
*/
|
|
6320
|
+
onReportError?: (err: unknown, ctx: {
|
|
6321
|
+
sessionId: string;
|
|
6322
|
+
orderId?: string;
|
|
6323
|
+
kind?: 'settlement_report' | 'order_webhook';
|
|
6324
|
+
}) => void;
|
|
6325
|
+
/**
|
|
6326
|
+
* 5.19.0: the public origin agents reach this kit at (e.g.
|
|
6327
|
+
* `https://shop.example` behind a TLS-terminating proxy). Used by
|
|
6328
|
+
* `expressHandler` to rebuild the request URL (signature `@target-uri` /
|
|
6329
|
+
* `@authority`) and for the forwarded agent artifacts. Default: the origin
|
|
6330
|
+
* of `profile.endpoint`.
|
|
6331
|
+
*/
|
|
6332
|
+
publicOrigin?: string;
|
|
5851
6333
|
/** Merchant key for ap2.merchant_authorization (when ap2Mandates). */
|
|
5852
6334
|
signingKey?: {
|
|
5853
6335
|
privateKey: KeyLike | KeyObject;
|
|
@@ -5926,11 +6408,73 @@ declare function createUcpCheckoutKit(opts: UcpCheckoutKitOptions): {
|
|
|
5926
6408
|
status: number;
|
|
5927
6409
|
attempts: number;
|
|
5928
6410
|
} | null>;
|
|
6411
|
+
/** 5.19.0 */
|
|
6412
|
+
protocol: "ucp";
|
|
6413
|
+
publicOrigin: string;
|
|
6414
|
+
resumeApproved: (sessionId: string, event?: Pick<ApprovalEvent, "approvalId">) => Promise<ResumeResult<CheckoutSession>>;
|
|
6415
|
+
resumeDeclined: (sessionId: string, reason?: "denied" | "expired" | "lapsed" | (string & {}), event?: Pick<ApprovalEvent, "approvalId">) => Promise<ResumeResult<CheckoutSession>>;
|
|
6416
|
+
applyApprovalEvent: (event: ApprovalEvent) => Promise<ResumeResult<CheckoutSession>>;
|
|
6417
|
+
pollHeldSessions: (o?: {
|
|
6418
|
+
sessionIds?: string[];
|
|
6419
|
+
/** Resolves relative poll URLs (your `apiBaseUrl`). */
|
|
6420
|
+
apiBaseUrl?: string;
|
|
6421
|
+
}) => Promise<Array<{
|
|
6422
|
+
sessionId: string;
|
|
6423
|
+
outcome: ResumeResult<CheckoutSession>["outcome"] | "pending";
|
|
6424
|
+
}>>;
|
|
5929
6425
|
};
|
|
5930
6426
|
|
|
5931
6427
|
/** RFC 8785-style canonical JSON (sorted keys, no whitespace). */
|
|
5932
6428
|
declare function canonicalJson(value: unknown): string;
|
|
5933
6429
|
|
|
6430
|
+
/** Where the dispatcher remembers events it finished (dedupe). */
|
|
6431
|
+
interface SeenEvents {
|
|
6432
|
+
has(eventId: string): Promise<boolean>;
|
|
6433
|
+
add(eventId: string): Promise<void>;
|
|
6434
|
+
}
|
|
6435
|
+
/** Process-local {@link SeenEvents} (single instance / tests). Bounded. */
|
|
6436
|
+
declare class MemorySeenEvents implements SeenEvents {
|
|
6437
|
+
private max;
|
|
6438
|
+
private ids;
|
|
6439
|
+
constructor(max?: number);
|
|
6440
|
+
has(eventId: string): Promise<boolean>;
|
|
6441
|
+
add(eventId: string): Promise<void>;
|
|
6442
|
+
}
|
|
6443
|
+
interface HandleApprovalEventsOptions {
|
|
6444
|
+
/** The kits the events can name (e.g. `[ucpKit, acpKit]`). */
|
|
6445
|
+
kits: ApprovalEventKit[];
|
|
6446
|
+
/**
|
|
6447
|
+
* Dedupe store. An object gets `add(eventId)` at a terminal outcome; a
|
|
6448
|
+
* function is a check only (you record seen ids yourself). Default: a
|
|
6449
|
+
* process-local memory set — use a shared store across instances.
|
|
6450
|
+
*/
|
|
6451
|
+
seen?: SeenEvents | ((eventId: string) => Promise<boolean>);
|
|
6452
|
+
/** Signature timestamp tolerance (s). Default 300. */
|
|
6453
|
+
toleranceSeconds?: number;
|
|
6454
|
+
/** Override "now" (tests). */
|
|
6455
|
+
nowMs?: number;
|
|
6456
|
+
/** Called for every applied event (logging / metrics). */
|
|
6457
|
+
onEvent?: (event: ApprovalEvent, outcome: ResumeOutcome | 'duplicate' | 'ignored') => void;
|
|
6458
|
+
}
|
|
6459
|
+
interface ApprovalEventsResponse {
|
|
6460
|
+
/** 2xx: done (don't retry). 401/400: refused. 503: retry later. */
|
|
6461
|
+
status: number;
|
|
6462
|
+
body: {
|
|
6463
|
+
ok: boolean;
|
|
6464
|
+
eventId?: string;
|
|
6465
|
+
outcome?: ResumeOutcome | 'duplicate' | 'ignored';
|
|
6466
|
+
error?: string;
|
|
6467
|
+
};
|
|
6468
|
+
}
|
|
6469
|
+
/**
|
|
6470
|
+
* 5.19.0: verify and apply one approval event. Approved → the kit's
|
|
6471
|
+
* `resumeApproved` (settle, report, fulfil — no agent call); denied /
|
|
6472
|
+
* expired / lapsed → `resumeDeclined`. Routes by `protocol` and
|
|
6473
|
+
* `kitSessionId`, falling back to each kit's cart-id lookup. Never throws:
|
|
6474
|
+
* answer the returned `status` and `body`.
|
|
6475
|
+
*/
|
|
6476
|
+
declare function handleApprovalEvents(rawBody: string | Buffer | Uint8Array, headers: Record<string, string | string[] | undefined> | Headers, secret: string | readonly string[], opts: HandleApprovalEventsOptions): Promise<ApprovalEventsResponse>;
|
|
6477
|
+
|
|
5934
6478
|
/**
|
|
5935
6479
|
* 5.15.0 — x402 v2 (x402 Foundation, specs/transports-v2/http.md) helpers for
|
|
5936
6480
|
* a MERCHANT. The merchant's own facilitator verifies and settles; AstraSync
|
|
@@ -6306,7 +6850,9 @@ declare function aepPublicKeyDocument(keys: Array<{
|
|
|
6306
6850
|
declare const ACP_API_VERSION = "2026-04-17";
|
|
6307
6851
|
/** 5.18.0: `API-Version` values this kit serves. */
|
|
6308
6852
|
declare const ACP_SUPPORTED_API_VERSIONS: readonly string[];
|
|
6309
|
-
type AcpStatus = 'not_ready_for_payment' | 'ready_for_payment' | 'pending_approval' | 'complete_in_progress' | 'completed' | 'canceled'
|
|
6853
|
+
type AcpStatus = 'not_ready_for_payment' | 'ready_for_payment' | 'pending_approval' | 'complete_in_progress' | 'completed' | 'canceled'
|
|
6854
|
+
/** 5.19.0: kit-internal — `resolvePending` is finishing it (rendered as `complete_in_progress`). */
|
|
6855
|
+
| 'finishing';
|
|
6310
6856
|
interface AcpMessage {
|
|
6311
6857
|
type: 'error' | 'info' | 'warning';
|
|
6312
6858
|
code?: string;
|
|
@@ -6325,6 +6871,10 @@ interface AcpCheckoutSession {
|
|
|
6325
6871
|
id: string;
|
|
6326
6872
|
name: string;
|
|
6327
6873
|
unit_amount: number;
|
|
6874
|
+
/** 5.20.0: absolute http(s) product image from the catalog. */
|
|
6875
|
+
image_url?: string;
|
|
6876
|
+
/** 5.20.0: product description from the catalog. */
|
|
6877
|
+
description?: string;
|
|
6328
6878
|
};
|
|
6329
6879
|
quantity: number;
|
|
6330
6880
|
name: string;
|
|
@@ -6347,12 +6897,29 @@ interface AcpCheckoutSession {
|
|
|
6347
6897
|
/** 5.18.0: a settlement the processor hasn't confirmed yet (see `resolvePending`). */
|
|
6348
6898
|
_pending?: {
|
|
6349
6899
|
orderId?: string;
|
|
6900
|
+
/** 5.19.0: the confirm's verification session id (report fallback). */
|
|
6901
|
+
sessionId?: string;
|
|
6350
6902
|
report: {
|
|
6351
6903
|
amountMinor: number;
|
|
6352
6904
|
currency: string;
|
|
6353
6905
|
};
|
|
6354
6906
|
result: VerificationResult;
|
|
6355
6907
|
};
|
|
6908
|
+
/** 5.19.0: the owner approval a held session waits for, and the held confirm's agent + chain. */
|
|
6909
|
+
_approvalId?: string;
|
|
6910
|
+
_astraId?: string;
|
|
6911
|
+
_attemptId?: string;
|
|
6912
|
+
/** 5.19.0: the held cart and the NON-SECRET `payment_data` fields (see the UCP `_held`). */
|
|
6913
|
+
_held?: {
|
|
6914
|
+
line_items: AcpCheckoutSession['line_items'];
|
|
6915
|
+
totals: Array<{
|
|
6916
|
+
type: string;
|
|
6917
|
+
amount: number;
|
|
6918
|
+
}>;
|
|
6919
|
+
paymentData?: Record<string, unknown>;
|
|
6920
|
+
pollUrl?: string;
|
|
6921
|
+
expiresAt?: string;
|
|
6922
|
+
};
|
|
6356
6923
|
}
|
|
6357
6924
|
/** 5.18.0: the ACP kit's session store (`claim` and the memory default as in the UCP kit). */
|
|
6358
6925
|
interface AcpCheckoutStore {
|
|
@@ -6360,13 +6927,24 @@ interface AcpCheckoutStore {
|
|
|
6360
6927
|
put(s: AcpCheckoutSession): Promise<void>;
|
|
6361
6928
|
/** Atomic compare-and-set of `status` (see the UCP `CheckoutStore.claim`). */
|
|
6362
6929
|
claim?(id: string, from: AcpStatus, to: AcpStatus): Promise<boolean>;
|
|
6930
|
+
/** 5.19.0: the session for an AstraSync cart id (see the UCP `CheckoutStore`). */
|
|
6931
|
+
findByCheckoutSessionId?(checkoutSessionId: string): Promise<AcpCheckoutSession | null>;
|
|
6932
|
+
/** 5.19.0: sessions held for an owner approval (`pollHeldSessions` with no ids). */
|
|
6933
|
+
listHeld?(): Promise<AcpCheckoutSession[]>;
|
|
6363
6934
|
}
|
|
6364
6935
|
type AcpCheckoutStatus = AcpStatus;
|
|
6365
6936
|
interface AcpCheckoutKitOptions {
|
|
6366
6937
|
currency: string;
|
|
6367
6938
|
/** Payment handlers you accept (endpoint paymentHandlers), e.g. ['ai.astrasync.voucher']. */
|
|
6368
6939
|
paymentHandlers: string[];
|
|
6369
|
-
catalog
|
|
6940
|
+
/** Your catalog. 5.19.0: also receives the requested quantity. */
|
|
6941
|
+
catalog: (itemId: string, quantity: number) => Promise<CatalogItem | null>;
|
|
6942
|
+
/**
|
|
6943
|
+
* 5.19.0: cart-level validation (see the UCP kit). Any error keeps the
|
|
6944
|
+
* session `not_ready_for_payment` (messages are `invalid`, with your path
|
|
6945
|
+
* as `param`) and `complete` is refused without calling AstraSync.
|
|
6946
|
+
*/
|
|
6947
|
+
validateCart?: (session: AcpCheckoutSession) => Promise<KitMessage[]>;
|
|
6370
6948
|
verifyPurchase: (ctx: {
|
|
6371
6949
|
session: AcpCheckoutSession;
|
|
6372
6950
|
/** Pass as `checkoutSessionId` to AstraSync (the platform's cart id when sent). */
|
|
@@ -6374,6 +6952,14 @@ interface AcpCheckoutKitOptions {
|
|
|
6374
6952
|
astraId?: string;
|
|
6375
6953
|
attemptId?: string;
|
|
6376
6954
|
valueMajor: number;
|
|
6955
|
+
/** 5.19.0: always `{ unsigned: true, protocol: 'acp' }` (pass to `confirmCheckout`); absent on a resume. */
|
|
6956
|
+
agentArtifacts?: AgentArtifacts;
|
|
6957
|
+
/** 5.19.0: `{ kitSessionId, protocol: 'acp' }` — pass to `confirmCheckout`. */
|
|
6958
|
+
metadata: CheckoutMetadata;
|
|
6959
|
+
/** 5.19.0: set when an approved hold resumes. */
|
|
6960
|
+
resumed?: {
|
|
6961
|
+
approvalId?: string;
|
|
6962
|
+
};
|
|
6377
6963
|
}) => Promise<VerificationResult>;
|
|
6378
6964
|
settle: (ctx: {
|
|
6379
6965
|
session: AcpCheckoutSession;
|
|
@@ -6381,13 +6967,37 @@ interface AcpCheckoutKitOptions {
|
|
|
6381
6967
|
paymentData?: Record<string, unknown>;
|
|
6382
6968
|
}) => Promise<SettleResult>;
|
|
6383
6969
|
reportSettlement?: (r: Parameters<VerificationGatewayClient['reportSettlement']>[0]) => Promise<unknown>;
|
|
6970
|
+
/** 5.19.0: `settled` is your processor's settled outcome. */
|
|
6384
6971
|
fulfil: (ctx: {
|
|
6385
6972
|
session: AcpCheckoutSession;
|
|
6386
6973
|
result: VerificationResult;
|
|
6974
|
+
settled: Extract<PendingResolution, {
|
|
6975
|
+
status: 'settled';
|
|
6976
|
+
}>;
|
|
6387
6977
|
}) => Promise<{
|
|
6388
6978
|
id: string;
|
|
6389
6979
|
permalink_url?: string;
|
|
6390
6980
|
}>;
|
|
6981
|
+
/** 5.19.0: settlement-report retries (default 3 attempts, 250 ms backoff). */
|
|
6982
|
+
reportRetry?: ReportRetryOptions;
|
|
6983
|
+
/** 5.19.0: a settlement report that still failed after retries (default `console.error`). */
|
|
6984
|
+
onReportError?: (err: unknown, ctx: {
|
|
6985
|
+
sessionId: string;
|
|
6986
|
+
orderId?: string;
|
|
6987
|
+
kind?: 'settlement_report' | 'order_webhook';
|
|
6988
|
+
}) => void;
|
|
6989
|
+
/**
|
|
6990
|
+
* 5.19.0: the public origin agents reach this kit at; `expressHandler`
|
|
6991
|
+
* rebuilds the request URL from it. Default: Express's own view, using
|
|
6992
|
+
* `X-Forwarded-Proto` / `X-Forwarded-Host` only when `trust proxy` is set.
|
|
6993
|
+
*/
|
|
6994
|
+
publicOrigin?: string;
|
|
6995
|
+
/** 5.19.0: policy links (terms of use, privacy, …) returned on every session. */
|
|
6996
|
+
links?: Array<{
|
|
6997
|
+
type: string;
|
|
6998
|
+
url: string;
|
|
6999
|
+
title?: string;
|
|
7000
|
+
}>;
|
|
6391
7001
|
/** Base path the kit is mounted at (default ''). */
|
|
6392
7002
|
basePath?: string;
|
|
6393
7003
|
store?: AcpCheckoutStore;
|
|
@@ -6465,6 +7075,19 @@ declare function buildAcpWellKnown(opts: AcpWellKnownOptions): {
|
|
|
6465
7075
|
declare function createAcpCheckoutKit(opts: AcpCheckoutKitOptions): {
|
|
6466
7076
|
handle: (req: Request, reqCtx?: KitRequestContext) => Promise<Response>;
|
|
6467
7077
|
resolvePending: (sessionId: string, outcome: PendingResolution) => Promise<AcpCheckoutSession | null>;
|
|
7078
|
+
/** 5.19.0 */
|
|
7079
|
+
protocol: "acp";
|
|
7080
|
+
publicOrigin: string | undefined;
|
|
7081
|
+
resumeApproved: (sessionId: string, event?: Pick<ApprovalEvent, "approvalId">) => Promise<ResumeResult<AcpCheckoutSession>>;
|
|
7082
|
+
resumeDeclined: (sessionId: string, reason?: "denied" | "expired" | "lapsed" | (string & {}), event?: Pick<ApprovalEvent, "approvalId">) => Promise<ResumeResult<AcpCheckoutSession>>;
|
|
7083
|
+
applyApprovalEvent: (event: ApprovalEvent) => Promise<ResumeResult<AcpCheckoutSession>>;
|
|
7084
|
+
pollHeldSessions: (o?: {
|
|
7085
|
+
sessionIds?: string[];
|
|
7086
|
+
apiBaseUrl?: string;
|
|
7087
|
+
}) => Promise<Array<{
|
|
7088
|
+
sessionId: string;
|
|
7089
|
+
outcome: ResumeResult<AcpCheckoutSession>["outcome"] | "pending";
|
|
7090
|
+
}>>;
|
|
6468
7091
|
};
|
|
6469
7092
|
|
|
6470
7093
|
/**
|
|
@@ -6483,11 +7106,28 @@ declare function createAcpCheckoutKit(opts: AcpCheckoutKitOptions): {
|
|
|
6483
7106
|
* When the AstraSync middleware ran first, the caller's verified ASTRA-id
|
|
6484
7107
|
* (`req.agentVerification.agent.astraId`) scopes sessions and idempotency
|
|
6485
7108
|
* keys; override with `callerId`.
|
|
7109
|
+
*
|
|
7110
|
+
* 5.19.0:
|
|
7111
|
+
* - the request URL the kit sees uses the kit's `publicOrigin` (UCP default:
|
|
7112
|
+
* the origin of `profile.endpoint`), so RFC 9421 `@target-uri` /
|
|
7113
|
+
* `@authority` and the forwarded agent artifacts match what the agent
|
|
7114
|
+
* signed behind a TLS-terminating proxy. Without one (ACP default), the
|
|
7115
|
+
* origin is `X-Forwarded-Proto` / `X-Forwarded-Host` when Express
|
|
7116
|
+
* `trust proxy` is set, else `req.protocol` + Host.
|
|
7117
|
+
* - `approvalEventsPath` + `webhookSecret` mount the owner-approval events
|
|
7118
|
+
* receiver on the same handler (`handleApprovalEvents`); or mount
|
|
7119
|
+
* `approvalEventsHandler({ secret, kits: [ucpKit, acpKit] })` on its own
|
|
7120
|
+
* path to serve both kits from one Events URL.
|
|
6486
7121
|
*/
|
|
6487
7122
|
|
|
6488
7123
|
/** Anything with a fetch-style `handle` (both checkout kits). */
|
|
6489
7124
|
interface FetchKit {
|
|
6490
7125
|
handle(req: Request, ctx?: KitRequestContext): Promise<Response>;
|
|
7126
|
+
/** 5.19.0: the public origin to rebuild request URLs with (both kits expose it). */
|
|
7127
|
+
readonly publicOrigin?: string;
|
|
7128
|
+
/** 5.19.0: present on both kits — makes the kit an approval-event target. */
|
|
7129
|
+
readonly protocol?: 'ucp' | 'acp';
|
|
7130
|
+
applyApprovalEvent?: ApprovalEventKit['applyApprovalEvent'];
|
|
6491
7131
|
}
|
|
6492
7132
|
/** The parts of an Express request this adapter reads. */
|
|
6493
7133
|
interface KitExpressRequest {
|
|
@@ -6499,6 +7139,10 @@ interface KitExpressRequest {
|
|
|
6499
7139
|
body?: unknown;
|
|
6500
7140
|
rawBody?: unknown;
|
|
6501
7141
|
get?(name: string): string | undefined;
|
|
7142
|
+
/** Express app (to read the `trust proxy` setting). */
|
|
7143
|
+
app?: {
|
|
7144
|
+
get(name: string): unknown;
|
|
7145
|
+
};
|
|
6502
7146
|
agentVerification?: {
|
|
6503
7147
|
identityVerified?: boolean;
|
|
6504
7148
|
agent?: {
|
|
@@ -6515,7 +7159,35 @@ interface KitExpressResponse {
|
|
|
6515
7159
|
interface ExpressHandlerOptions {
|
|
6516
7160
|
/** The caller's verified ASTRA-id (default: from `req.agentVerification` when identity-verified). */
|
|
6517
7161
|
callerId?: (req: KitExpressRequest) => string | undefined;
|
|
6518
|
-
|
|
7162
|
+
/**
|
|
7163
|
+
* 5.19.0: serve owner-approval events on this path (POST; matched against
|
|
7164
|
+
* the full request path or the path under the mount point), e.g.
|
|
7165
|
+
* `'/astrasync/events'`. Set the endpoint's Events URL to it. Needs
|
|
7166
|
+
* `webhookSecret`.
|
|
7167
|
+
*/
|
|
7168
|
+
approvalEventsPath?: string;
|
|
7169
|
+
/** 5.19.0: the endpoint's webhook secret — or `[current, previous]` during a rotation. */
|
|
7170
|
+
webhookSecret?: string | readonly string[];
|
|
7171
|
+
/** 5.19.0: the kits events may name (default: this kit). */
|
|
7172
|
+
approvalEventKits?: ApprovalEventKit[];
|
|
7173
|
+
/** 5.19.0: dedupe store for event ids (default: process-local memory). */
|
|
7174
|
+
seenEvents?: SeenEvents | ((eventId: string) => Promise<boolean>);
|
|
7175
|
+
}
|
|
7176
|
+
interface ApprovalEventsHandlerOptions {
|
|
7177
|
+
/** The endpoint's webhook secret — or `[current, previous]` during a rotation. */
|
|
7178
|
+
secret: string | readonly string[];
|
|
7179
|
+
/** The kits events may name, e.g. `[ucpKit, acpKit]`. */
|
|
7180
|
+
kits: ApprovalEventKit[];
|
|
7181
|
+
/** Dedupe store (default: process-local memory). */
|
|
7182
|
+
seen?: SeenEvents | ((eventId: string) => Promise<boolean>);
|
|
7183
|
+
}
|
|
7184
|
+
/**
|
|
7185
|
+
* 5.19.0: an Express handler for the endpoint's Events URL, serving both
|
|
7186
|
+
* kits: `app.post('/astrasync/events', express.raw({ type: '*\/*' }),
|
|
7187
|
+
* approvalEventsHandler({ secret, kits: [ucpKit, acpKit] }))`. Answers 2xx
|
|
7188
|
+
* when done, 401 on a bad signature, 503 to have the platform retry.
|
|
7189
|
+
*/
|
|
7190
|
+
declare function approvalEventsHandler(options: ApprovalEventsHandlerOptions): (req: KitExpressRequest, res: KitExpressResponse, next: (err?: unknown) => void) => Promise<void>;
|
|
6519
7191
|
/** An Express handler that runs a checkout kit and writes its Response back. */
|
|
6520
7192
|
declare function expressHandler(kit: FetchKit, options?: ExpressHandlerOptions): (req: KitExpressRequest, res: KitExpressResponse, next: (err?: unknown) => void) => Promise<void>;
|
|
6521
7193
|
|
|
@@ -6766,4 +7438,4 @@ declare function contentDigest(body: string): string;
|
|
|
6766
7438
|
*/
|
|
6767
7439
|
declare function signHttpRequest(req: SignableRequest, opts: SignHttpRequestOptions): Promise<Record<string, string>>;
|
|
6768
7440
|
|
|
6769
|
-
export { ACP_API_VERSION, ACP_SUPPORTED_API_VERSIONS, AEP_SPEC_VERSION, AP2_VCT, type AcpCheckoutKitOptions, type AcpCheckoutSession, type AcpCheckoutStatus, type AcpCheckoutStore, type AcpWellKnownOptions, type AepActorType, type AepArtifactRecord, type AepArtifactType, AepChain, type AepChainOptions, type AepChainVerification, type AepHashInput, AgentClient, type AgentCredentials, type AgentProtocol, type AgentProtocolIdentities, type AgentRecord, type Ap2Party, type Ap2VerifyResult, AstraSync, type AstraSyncAepEvidence, type AstraSyncConfig, type AstraSyncCredentials, AstraSyncError, type AstraSyncMandates, type AttemptOutcome, type AttemptReport, AuthenticationError, type BuildGuidanceParams, CAPTURE_SCHEMA_VERSION, type CallerMetadata, ChallengeHandler, type CommerceArtifactsPayload, type CommerceContext, type CommercePipelineInput, type CommerceShieldProps, type ConsiderationItem, type ConsiderationSet, type CounterpartyType, DECLARED_SOURCE_MAX, DEFAULT_EDGE_CONFIG, DEFAULT_IDEMPOTENCY_TTL_MS, type DynamicPlatformFingerprint, type EdgeConfig, type EdgeMode, type EdgePathRule, type EdgeVerificationDepth, type EnhancedVerificationResult, type ExpressHandlerOptions, type ExpressMiddlewareOptions, type FetchEdgeConfigResult, type FetchEdgeConfigSuccess, type FetchKit, type FiatSettlementBinding, type FrameworkConfig, type FulfilmentInfo, type GatewayConfig, type GuidanceEnvelope, type GuidanceInfo, type HealthResponse, type HttpSignatureAlgorithm, type IdempotencyOptions, type IdempotencyRecord, type IdempotencyStore, KYDRequiredError, type KitExpressRequest, type KitExpressResponse, type KitRequestContext, type KyaPayIdentity, type KyaPayResult, type KyaPayTokenType, type KyaPayVerifyOptions, type ParseResult as LocalPolicyParseResult, type ValidationError as LocalPolicyValidationError, type ValidationResult as LocalPolicyValidationResult, MAX_HEADERS, MAX_HEADER_VALUE_BYTES, MAX_TOTAL_BYTES, MCP_VERIFIED_HOP_HEADER, MCP_VERIFIED_HOP_MAX_AGE_MS, type McpMiddlewareOptions, MemoryCheckoutStore, MemoryIdempotencyStore, MemoryMppChallengeStore, type MerchantSettlementToken, type ModelConfig, type MppChallenge, type MppChallengeStore, type MppCredential, type MppReceipt, type MppVerifyOptions, type MppVerifyResult, type NegotiationResult, type NextJsMiddlewareOptions, type ObservedMetadata, type PDLSSConfig$1 as PDLSSConfig, type PDLSSDuration, type PDLSSInfo, type PDLSSLimits, type PDLSSPurpose, type PDLSSScope, type PDLSSSelfInstantiation, PLATFORM_AGENT_SIGNATURES, type PendingRegistrationResponse, type PendingResolution, type PlatformAgentVendor, type PlatformDetectionInput, type PlatformFingerprint, type PlatformSignatureDef, type PollRegistrationResult, type ProtocolTransport, RUNTIME_SIGNATURES, RedisIdempotencyStore, type RedisLike, type RegisterOptions, type RegisterResult, RegistrationDeniedError, RegistrationExpiredError, type RegistrationResponse, RegistrationTimeoutError, type ReportAttemptOptions, type RootKeyResolver, type RouteAccessConfig, type RoutePolicy, type RuntimeChallengeResult, type RuntimeSignature, type SDKOptions, SDK_USER_AGENT, type SanitizeHeadersResult, type SettlementArtifact, type SettlementArtifactBinding, type SettlementArtifactBindingBase, type SettlementDecision, type SettlementOutcomeInfo, SettlementReportError, type SettlementRequest, type SignHttpRequestOptions, type SignableRequest, type StablecoinSettlementBinding, type StepUpApprovalInfo, type StepUpApprovalStatus, type StepUpOutcome, TRUST_LEVEL_RANGES, type TokenGuidance, type ToolGate, type ToolGateConfig, type TrustLevel, UCP_ORDER_CAPABILITY, UCP_VERSION, type UcpAgentBinding, type CatalogItem as UcpCatalogItem, type UcpCheckoutKitOptions, type CheckoutSession as UcpCheckoutSession, type CheckoutStore as UcpCheckoutStore, type UcpLink, type UcpMessage, type UcpOrder, type UcpProfile, type UcpProfileResult, type SettleResult as UcpSettleResult, type UcpSeverity, type UcpSignatureResult, VERIFICATION_STATUS_HEADER, SDK_VERSION as VERSION, type VerificationInterstitialProps, type VerificationRequest, type VerificationResult, type VerifiedAgent, type VerifiedDeveloper, type VerifiedHopMarker, type VerifiedOrganization, type VerifyAp2Options, type VerifyOptions, type VerifyResponse, type WaitForApprovalOptions, type WellKnownAgenticCommerce, type X402PaymentPayload, type X402PaymentRequired, type X402PaymentRequirements, type X402ResourceInfo, type X402SettlementResponse, _resetEdgeConfigCache, acpPaymentHandlers, aepCanonicalJson, aepHash, aepPrivateKeyFromSeed, aepPublicKeyDocument, aepPublicKeyFromBase64, aepRawPublicKey, aepSign, aepTimestamp, aepVerifySignature, index as agent, astrasyncPaymentHandlers, authorizeSettlement, awaitStepUpApproval, beginIdempotent, buildAcpWellKnown, buildGuidance, buildMpp402Response, buildMppChallenge, buildSdkObservedMetadata, buildUcpOrder, buildUcpProfile, buildVerificationUnavailableBody, buildX402Challenge, canonicalJson, checkUcpAgentBinding, checkoutHash, clearCache, closedCheckoutMandate, closedPaymentMandate, contentDigest, createAcpCheckoutKit, createKbHop, createMcpMiddleware, createUcpCheckoutKit, decodeMppRequest, degradeToObserve, denyStatusFor, deriveConnectionFromHeaders, detectPlatformFingerprint, detectRuntime, encodeMppReceipt, encodeX402SettlementResponse, express, expressHandler, extractApiKeyFormat, extractCredentials, extractMcpCredentials, extractPlatformHeaders, fetchEdgeConfig, fetchRoutes, fetchUcpProfile, finishIdempotent, getCachedWellKnownUrls, getEdgeConfig, getTrustLevel, getWellKnownUrls, hasCredentials, idempotencyMiddleware, isEdgeConfig, isRejectedIdentityClaim, isRetryableSettlementError, isSpecialUseIp, isVerificationUnavailable, isVerifiedHopValidFor, issueDelegateSdJwt, matchEdgePathRule, matchPlatformSignature, matchRoutePattern, mppBodyDigest, negotiateUcp, nextjs, normalizeDeclaredSource, openCheckoutMandate, openPaymentMandate, parseYaml as parseLocalPolicyYaml, parseMppCredential, parseUcpAgentHeader, parseVerifiedHop, parseX402Challenge, parseX402Payment, pollStepUpStatus, prefetchWellKnown, quickVerify, recordDecision, reportAttempt, reportUnregisteredAttempt, requestFingerprint, rootMandateDigest, routePatternToRegExp, routePolicyOf, sanitizeHeaders, sdk, sdkFetch, sendUcpWebhook, serializeVerifiedHop, setMcpMeta, signHttpRequest, signRootMandate, signUcpRequest, signUcpResponse, index$1 as transport, ucpError, ucpEscalation, ucpFailure, ucpProfileHandler, ucpRequiredComponents, unavailableRetryAfterSeconds, validatePolicy as validateLocalPolicy, verify, verifyAepChain, verifyAp2Mandate, verifyDelegateChain, verifyKyaPayTokens, verifyMppChallenge, verifyUcpRequest, withIdempotency, x402PaymentMatchesOffer };
|
|
7441
|
+
export { ACP_API_VERSION, ACP_SUPPORTED_API_VERSIONS, AEP_SPEC_VERSION, AP2_VCT, type AcpCheckoutKitOptions, type AcpCheckoutSession, type AcpCheckoutStatus, type AcpCheckoutStore, type AcpWellKnownOptions, type AepActorType, type AepArtifactRecord, type AepArtifactType, AepChain, type AepChainOptions, type AepChainVerification, type AepHashInput, type AgentArtifacts, AgentClient, type AgentCredentials, type AgentProtocol, type AgentProtocolIdentities, type AgentRecord, type Ap2Party, type Ap2VerifyResult, type ApprovalEvent, type ApprovalEventKit, type ApprovalEventsHandlerOptions, type ApprovalEventsResponse, AstraSync, type AstraSyncAepEvidence, type AstraSyncConfig, type AstraSyncCredentials, AstraSyncError, type AstraSyncMandates, type AttemptOutcome, type AttemptReport, AuthenticationError, type BuildGuidanceParams, CAPTURE_SCHEMA_VERSION, type CallerMetadata, ChallengeHandler, type CheckoutMetadata, type CommerceArtifactsPayload, type CommerceContext, type CommercePipelineInput, type CommerceShieldProps, type ConsiderationItem, type ConsiderationSet, type CounterpartyType, DECLARED_SOURCE_MAX, DEFAULT_EDGE_CONFIG, DEFAULT_IDEMPOTENCY_TTL_MS, type DashboardToolRule, type DynamicPlatformFingerprint, type EdgeConfig, type EdgeMode, type EdgePathRule, type EdgeVerificationDepth, type EndpointOperationalPatch, type EnhancedVerificationResult, type ExpressHandlerOptions, type ExpressMiddlewareOptions, type FetchEdgeConfigResult, type FetchEdgeConfigSuccess, type FetchKit, type FiatSettlementBinding, type FrameworkConfig, type FulfilmentInfo, type GatewayConfig, type GuidanceEnvelope, type GuidanceInfo, type HandleApprovalEventsOptions, type HealthResponse, type HttpSignatureAlgorithm, type IdempotencyOptions, type IdempotencyRecord, type IdempotencyStore, KYDRequiredError, type KitExpressRequest, type KitExpressResponse, type KitMessage, type KitRequestContext, type KyaPayIdentity, type KyaPayResult, type KyaPayTokenType, type KyaPayVerifyOptions, type ParseResult as LocalPolicyParseResult, type ValidationError as LocalPolicyValidationError, type ValidationResult as LocalPolicyValidationResult, MAX_HEADERS, MAX_HEADER_VALUE_BYTES, MAX_TOTAL_BYTES, MCP_VERIFIED_HOP_HEADER, MCP_VERIFIED_HOP_MAX_AGE_MS, type McpMiddlewareOptions, MemoryCheckoutStore, MemoryIdempotencyStore, MemoryMppChallengeStore, MemorySeenEvents, type MerchantSettlementToken, type ModelConfig, type MppChallenge, type MppChallengeStore, type MppCredential, type MppReceipt, type MppVerifyOptions, type MppVerifyResult, type NegotiationResult, type NextJsMiddlewareOptions, type ObservedMetadata, type PDLSSConfig$1 as PDLSSConfig, type PDLSSDuration, type PDLSSInfo, type PDLSSLimits, type PDLSSPurpose, type PDLSSScope, type PDLSSSelfInstantiation, PLATFORM_AGENT_SIGNATURES, type PendingRegistrationResponse, type PendingResolution, type PlatformAgentVendor, type PlatformDetectionInput, type PlatformFingerprint, type PlatformSignatureDef, type PollRegistrationResult, type ProtocolTransport, type PurposeSource, RUNTIME_SIGNATURES, RedisIdempotencyStore, type RedisLike, type RegisterOptions, type RegisterResult, RegistrationDeniedError, RegistrationExpiredError, type RegistrationResponse, RegistrationTimeoutError, type ReportAttemptOptions, type ReportRetryOptions, type ResumeOutcome, type ResumeResult, type RootKeyResolver, type RouteAccessConfig, type RoutePolicy, type RuntimeChallengeResult, type RuntimeSignature, type SDKOptions, SDK_USER_AGENT, type SanitizeHeadersResult, type SeenEvents, type SettlementArtifact, type SettlementArtifactBinding, type SettlementArtifactBindingBase, type SettlementDecision, type SettlementOutcomeInfo, SettlementReportError, type SettlementRequest, type SignHttpRequestOptions, type SignableRequest, type StablecoinSettlementBinding, type StepUpApprovalInfo, type StepUpApprovalStatus, type StepUpOutcome, TRUST_LEVEL_RANGES, type TestEventResult, type TestEventType, type TokenGuidance, type ToolGate, type ToolGateConfig, type TrustLevel, UCP_ORDER_CAPABILITY, UCP_VERSION, type UcpAgentBinding, type CatalogItem as UcpCatalogItem, type UcpCheckoutKitOptions, type CheckoutSession as UcpCheckoutSession, type CheckoutStore as UcpCheckoutStore, type UcpLink, type UcpMessage, type UcpOrder, type UcpProfile, type UcpProfileResult, type SettleResult as UcpSettleResult, type UcpSeverity, type UcpSignatureResult, VERIFICATION_STATUS_HEADER, SDK_VERSION as VERSION, type VerificationInterstitialProps, type VerificationRequest, type VerificationResult, type VerificationWarning, type VerifiedAgent, type VerifiedDeveloper, type VerifiedHopMarker, type VerifiedOrganization, type VerifyAp2Options, type VerifyOptions, type VerifyResponse, type WaitForApprovalOptions, type WellKnownAgenticCommerce, type X402PaymentPayload, type X402PaymentRequired, type X402PaymentRequirements, type X402ResourceInfo, type X402SettlementResponse, _resetEdgeConfigCache, abandonIdempotent, acpPaymentHandlers, aepCanonicalJson, aepHash, aepPrivateKeyFromSeed, aepPublicKeyDocument, aepPublicKeyFromBase64, aepRawPublicKey, aepSign, aepTimestamp, aepVerifySignature, index as agent, approvalEventsHandler, astrasyncPaymentHandlers, authorizeSettlement, awaitStepUpApproval, beginIdempotent, buildAcpWellKnown, buildGuidance, buildMpp402Response, buildMppChallenge, buildSdkObservedMetadata, buildUcpOrder, buildUcpProfile, buildVerificationUnavailableBody, buildX402Challenge, canonicalJson, checkUcpAgentBinding, checkoutHash, clearCache, closedCheckoutMandate, closedPaymentMandate, contentDigest, createAcpCheckoutKit, createKbHop, createMcpMiddleware, createUcpCheckoutKit, decodeMppRequest, degradeToObserve, denyStatusFor, deriveConnectionFromHeaders, detectPlatformFingerprint, detectRuntime, encodeMppReceipt, encodeX402SettlementResponse, express, expressHandler, extractApiKeyFormat, extractCredentials, extractMcpCredentials, extractPlatformHeaders, fetchEdgeConfig, fetchRoutes, fetchUcpProfile, finishIdempotent, getCachedWellKnownUrls, getEdgeConfig, getTrustLevel, getWellKnownUrls, handleApprovalEvents, hasCredentials, idempotencyMiddleware, isEdgeConfig, isRejectedIdentityClaim, isRetryableSettlementError, isSharedVerdict, isSpecialUseIp, isVerificationUnavailable, isVerifiedHopValidFor, issueDelegateSdJwt, matchEdgePathRule, matchPlatformSignature, matchRoutePattern, mppBodyDigest, negotiateUcp, nextjs, normalizeDeclaredSource, onVerificationResult, openCheckoutMandate, openPaymentMandate, parseYaml as parseLocalPolicyYaml, parseMppCredential, parseUcpAgentHeader, parseVerifiedHop, parseX402Challenge, parseX402Payment, pollStepUpStatus, prefetchWellKnown, quickVerify, recordDecision, reportAttempt, reportUnregisteredAttempt, requestFingerprint, rootMandateDigest, routePatternToRegExp, routePolicyOf, sanitizeHeaders, sdk, sdkFetch, sendUcpWebhook, serializeVerifiedHop, setMcpMeta, signHttpRequest, signRootMandate, signUcpRequest, signUcpResponse, index$1 as transport, ucpError, ucpEscalation, ucpFailure, ucpProfileHandler, ucpProfileKeys, ucpRequiredComponents, unavailableRetryAfterSeconds, validatePolicy as validateLocalPolicy, verify, verifyAepChain, verifyAp2Mandate, verifyDelegateChain, verifyKyaPayTokens, verifyMppChallenge, verifyUcpRequest, withIdempotency, x402PaymentMatchesOffer };
|