@astrasyncai/verification-gateway 2.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/index.js +33 -0
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/index.mjs +36 -0
- package/dist/agent/index.mjs.map +1 -1
- package/dist/browser/background.js +33 -0
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +36 -0
- package/dist/browser/background.mjs.map +1 -1
- package/dist/cursor/extension.js +33 -0
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +36 -0
- package/dist/cursor/extension.mjs.map +1 -1
- package/dist/gateway/gateway.js +33 -0
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +36 -0
- package/dist/gateway/gateway.mjs.map +1 -1
- package/dist/index-3NRaBNvp.d.mts +1397 -0
- package/dist/index-CME6r4uH.d.ts +1397 -0
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2324 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2327 -1
- package/dist/index.mjs.map +1 -1
- package/dist/transport/index.d.mts +2 -1
- package/dist/transport/index.d.ts +2 -1
- package/dist/transport/index.js +2384 -2
- package/dist/transport/index.js.map +1 -1
- package/dist/transport/index.mjs +2327 -1
- package/dist/transport/index.mjs.map +1 -1
- package/package.json +17 -3
- package/dist/index-B1ThcGZl.d.mts +0 -89
- package/dist/index-DnoXfdFd.d.ts +0 -89
|
@@ -0,0 +1,1397 @@
|
|
|
1
|
+
import { A as AstraSyncCredentials, g as ProtocolTransport } from './types-CxQwJKbd.js';
|
|
2
|
+
import { JWK } from 'jose';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* HTTP Transport Adapter
|
|
6
|
+
*
|
|
7
|
+
* Maps AstraSync credentials to/from HTTP headers (X-Astra-* convention).
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Inject AstraSync credentials into HTTP headers.
|
|
12
|
+
*/
|
|
13
|
+
declare function setHttpHeaders(headers: Record<string, string>, credentials: AstraSyncCredentials): Record<string, string>;
|
|
14
|
+
/**
|
|
15
|
+
* Extract AstraSync credentials from HTTP headers.
|
|
16
|
+
*/
|
|
17
|
+
declare function extractHttpCredentials(headers: Record<string, string | string[] | undefined>): AstraSyncCredentials | null;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A2A (Agent-to-Agent) Transport Adapter
|
|
21
|
+
*
|
|
22
|
+
* Maps AstraSync credentials to/from A2A task metadata.astrasync block.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
interface A2ATask {
|
|
26
|
+
metadata?: Record<string, unknown>;
|
|
27
|
+
[key: string]: unknown;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Add AstraSync credentials to an A2A task's metadata block.
|
|
31
|
+
*/
|
|
32
|
+
declare function setA2AMetadata(task: A2ATask, credentials: AstraSyncCredentials): A2ATask;
|
|
33
|
+
/**
|
|
34
|
+
* Extract AstraSync credentials from an A2A task's metadata block.
|
|
35
|
+
*/
|
|
36
|
+
declare function extractA2ACredentials(task: A2ATask): AstraSyncCredentials | null;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* MCP (Model Context Protocol) Transport Adapter
|
|
40
|
+
*
|
|
41
|
+
* Maps AstraSync credentials to/from MCP params._meta.astrasync block.
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
interface McpParams {
|
|
45
|
+
_meta?: Record<string, unknown>;
|
|
46
|
+
[key: string]: unknown;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Add AstraSync credentials to MCP params' _meta block.
|
|
50
|
+
*/
|
|
51
|
+
declare function setMcpMeta(params: McpParams, credentials: AstraSyncCredentials): McpParams;
|
|
52
|
+
/**
|
|
53
|
+
* Extract AstraSync credentials from MCP params' _meta block.
|
|
54
|
+
*/
|
|
55
|
+
declare function extractMcpCredentials(params: McpParams): AstraSyncCredentials | null;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Protocol request -> AstraSync PDLSS purpose category mapping.
|
|
59
|
+
*
|
|
60
|
+
* Per spec v2.6 §7.4.3 commerce purpose mapping table, extended with MPP + x402
|
|
61
|
+
* entries (April 2026 protocol landscape).
|
|
62
|
+
*/
|
|
63
|
+
type CommercePurpose = 'commerce.checkout.create' | 'commerce.checkout.update' | 'commerce.checkout.confirm' | 'commerce.checkout.cancel' | 'commerce.payment.execute' | 'commerce.payment.stream' | 'commerce.delegation.intent' | 'commerce.delegation.checkout' | 'commerce.delegation.payment' | 'commerce.identity_probe' | 'commerce.browsing';
|
|
64
|
+
declare function mapUCPRequestToPurpose(method: string, path: string): CommercePurpose | null;
|
|
65
|
+
declare function mapACPRequestToPurpose(method: string, path: string): CommercePurpose | null;
|
|
66
|
+
type AP2MandateType = 'intent_mandate' | 'cart_mandate' | 'payment_mandate';
|
|
67
|
+
declare function mapAP2MandateToPurpose(mandateType: AP2MandateType): CommercePurpose;
|
|
68
|
+
type VIMandateType = 'checkout' | 'payment' | 'checkout.open' | 'payment.open';
|
|
69
|
+
declare function mapVIMandateToPurpose(mandateType: VIMandateType): CommercePurpose;
|
|
70
|
+
type RFC9421Tag = 'browse' | 'purchase' | undefined;
|
|
71
|
+
declare function mapRFC9421TagToPurpose(tag: RFC9421Tag): CommercePurpose;
|
|
72
|
+
type MPPIntent = 'charge' | 'session';
|
|
73
|
+
declare function mapMPPRequestToPurpose(intent: MPPIntent | undefined, amount: number | undefined): CommercePurpose;
|
|
74
|
+
declare function mapX402RequestToPurpose(amount: number | undefined): CommercePurpose;
|
|
75
|
+
/**
|
|
76
|
+
* Informational Stripe webhook events surfaced as trust signals on
|
|
77
|
+
* `CommerceContext.trustSignals` but NOT routed to a PDLSS purpose.
|
|
78
|
+
*/
|
|
79
|
+
declare const STRIPE_WEBHOOK_INFORMATIONAL_EVENTS: readonly ["payment_intent.succeeded", "payment_intent.payment_failed", "charge.refunded", "checkout.session.completed", "customer.subscription.created"];
|
|
80
|
+
type StripeWebhookInformationalEvent = (typeof STRIPE_WEBHOOK_INFORMATIONAL_EVENTS)[number];
|
|
81
|
+
declare function isStripeWebhookInformational(eventType: string): boolean;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Per-protocol transaction-value normalization.
|
|
85
|
+
*
|
|
86
|
+
* Each protocol encodes amount/currency differently. This module produces a
|
|
87
|
+
* uniform `TransactionValueContext` with `source` recording the extraction
|
|
88
|
+
* path so trace logs can show where the value came from.
|
|
89
|
+
*
|
|
90
|
+
* Amount unit: "major units" (dollars/euros/etc. for fiat; native unit for
|
|
91
|
+
* tokens — we do NOT convert across currencies). UCP/ACP totals are in
|
|
92
|
+
* cents, so we divide by 100. MPP/x402/VI pass through as declared.
|
|
93
|
+
*/
|
|
94
|
+
interface TransactionValueContext {
|
|
95
|
+
protocol: 'vi' | 'ap2' | 'ucp' | 'acp' | 'mpp' | 'x402' | 'agentpay' | 'tap';
|
|
96
|
+
amount: number;
|
|
97
|
+
currency: string;
|
|
98
|
+
source: string;
|
|
99
|
+
}
|
|
100
|
+
declare function extractUCPTransactionValue(input: {
|
|
101
|
+
totals?: Array<{
|
|
102
|
+
type?: string;
|
|
103
|
+
amount?: number;
|
|
104
|
+
currency?: string;
|
|
105
|
+
}>;
|
|
106
|
+
}): TransactionValueContext | null;
|
|
107
|
+
declare function extractACPTransactionValue(input: {
|
|
108
|
+
totals?: Array<{
|
|
109
|
+
type?: string;
|
|
110
|
+
amount?: number;
|
|
111
|
+
currency?: string;
|
|
112
|
+
}>;
|
|
113
|
+
}): TransactionValueContext | null;
|
|
114
|
+
interface VIClaimsForValue {
|
|
115
|
+
constraints?: {
|
|
116
|
+
paymentAmount?: {
|
|
117
|
+
currency?: string;
|
|
118
|
+
min?: number;
|
|
119
|
+
max?: number;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
l3aPaymentAmount?: {
|
|
123
|
+
currency?: string;
|
|
124
|
+
amount?: number;
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
declare function extractVITransactionValue(claims: VIClaimsForValue): TransactionValueContext | null;
|
|
128
|
+
interface AP2PaymentMandateForValue {
|
|
129
|
+
payment_details_total?: {
|
|
130
|
+
amount?: {
|
|
131
|
+
value?: string | number;
|
|
132
|
+
currency?: string;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
declare function extractAP2TransactionValue(mandate: AP2PaymentMandateForValue | undefined): TransactionValueContext | null;
|
|
137
|
+
interface MPPChallengeForValue {
|
|
138
|
+
method?: string;
|
|
139
|
+
request?: {
|
|
140
|
+
amount?: number;
|
|
141
|
+
currency?: string;
|
|
142
|
+
} & Record<string, unknown>;
|
|
143
|
+
}
|
|
144
|
+
declare function extractMPPTransactionValue(challenge: MPPChallengeForValue): TransactionValueContext | null;
|
|
145
|
+
interface X402RequestForValue {
|
|
146
|
+
maxAmountRequired?: number;
|
|
147
|
+
amount?: number;
|
|
148
|
+
asset?: string;
|
|
149
|
+
currency?: string;
|
|
150
|
+
}
|
|
151
|
+
declare function extractX402TransactionValue(req: X402RequestForValue): TransactionValueContext | null;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* RFC 9421 HTTP Message Signatures parser.
|
|
155
|
+
*
|
|
156
|
+
* Wraps `structured-headers` (transitive dep of http-message-signatures) to
|
|
157
|
+
* parse the Signature-Input and Signature Dictionary headers per RFC 9421 §2.
|
|
158
|
+
*
|
|
159
|
+
* Produces structured metadata (kid, algorithm, covered components, tag,
|
|
160
|
+
* created/expires/nonce, signature bytes) without verifying the signature —
|
|
161
|
+
* verification lives in rfc9421-verify.ts.
|
|
162
|
+
*
|
|
163
|
+
* Shared by:
|
|
164
|
+
* - Agent Pay (Mastercard) — kid resolves via Mastercard Agent Registry
|
|
165
|
+
* - TAP (Visa) — kid resolves via Visa JWKS
|
|
166
|
+
* - Web Bot Auth (generic transport substrate) — kid resolves via
|
|
167
|
+
* /.well-known/http-message-signatures-directory
|
|
168
|
+
*/
|
|
169
|
+
interface RFC9421SignatureParams {
|
|
170
|
+
/** The label identifying the signature in the Dictionary header (e.g. "sig1"). */
|
|
171
|
+
label: string;
|
|
172
|
+
/** Key ID used to look up the verifying key in the relevant registry. */
|
|
173
|
+
kid: string;
|
|
174
|
+
/** Algorithm declared in the Signature-Input params (e.g. "ecdsa-p256-sha256", "ed25519"). */
|
|
175
|
+
alg?: string;
|
|
176
|
+
/** Covered components, in order, per RFC 9421 §2.1. */
|
|
177
|
+
covered: string[];
|
|
178
|
+
/** Base64url-encoded signature bytes extracted from the paired Signature header. */
|
|
179
|
+
signatureBase64: string;
|
|
180
|
+
/** Unix seconds when the signature was created. */
|
|
181
|
+
created?: number;
|
|
182
|
+
/** Unix seconds when the signature expires. */
|
|
183
|
+
expires?: number;
|
|
184
|
+
/** Nonce (opaque string) for replay protection. */
|
|
185
|
+
nonce?: string;
|
|
186
|
+
/** Tag parameter. For Agent Pay/TAP this is "browse" or "purchase"; undefined otherwise. */
|
|
187
|
+
tag?: 'browse' | 'purchase' | string;
|
|
188
|
+
}
|
|
189
|
+
interface ParsedRFC9421 {
|
|
190
|
+
signatures: RFC9421SignatureParams[];
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Parse the RFC 9421 Signature-Input and Signature headers from a request or response.
|
|
194
|
+
* Returns all signatures present (a single message may carry multiple labelled signatures).
|
|
195
|
+
*
|
|
196
|
+
* Returns null if either header is missing or malformed.
|
|
197
|
+
*/
|
|
198
|
+
declare function parseRFC9421(headers: Record<string, string | string[] | undefined>): ParsedRFC9421 | null;
|
|
199
|
+
|
|
200
|
+
type RegistryName = 'mastercard' | 'visa' | 'web-bot-auth';
|
|
201
|
+
interface RegistryResolver {
|
|
202
|
+
readonly name: RegistryName;
|
|
203
|
+
resolve(kid: string, context?: ResolveContext): Promise<JWK | null>;
|
|
204
|
+
}
|
|
205
|
+
interface ResolveContext {
|
|
206
|
+
origin?: string;
|
|
207
|
+
algorithm?: string;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* RFC 9421 HTTP Message Signatures verification.
|
|
212
|
+
*
|
|
213
|
+
* Wraps http-message-signatures (dhensby) verifyMessage() with a RegistryResolver
|
|
214
|
+
* hook for kid → JWK lookup. Library handles canonicalization + ES256/EdDSA/
|
|
215
|
+
* HMAC/RSA verification; we supply the key-finding callback and policy around
|
|
216
|
+
* clock skew.
|
|
217
|
+
*
|
|
218
|
+
* Shared by:
|
|
219
|
+
* - Agent Pay (Mastercard) — resolver = createMastercardRegistry
|
|
220
|
+
* - TAP (Visa) — resolver = createVisaRegistry
|
|
221
|
+
* - Web Bot Auth (generic) — resolver = createWebBotAuthRegistry
|
|
222
|
+
*/
|
|
223
|
+
|
|
224
|
+
interface RFC9421VerifyRequest {
|
|
225
|
+
method: string;
|
|
226
|
+
url: string;
|
|
227
|
+
headers: Record<string, string | string[]>;
|
|
228
|
+
body?: string;
|
|
229
|
+
}
|
|
230
|
+
interface RFC9421VerifyOptions {
|
|
231
|
+
resolver: RegistryResolver;
|
|
232
|
+
/** Seconds of tolerance around created/expires. Default 300. */
|
|
233
|
+
clockSkewSec?: number;
|
|
234
|
+
/** Injectable for deterministic tests. */
|
|
235
|
+
now?: () => number;
|
|
236
|
+
}
|
|
237
|
+
interface RFC9421VerifyResult {
|
|
238
|
+
ok: boolean;
|
|
239
|
+
kid?: string;
|
|
240
|
+
registry?: RegistryResolver['name'];
|
|
241
|
+
algorithm?: string;
|
|
242
|
+
error?: string;
|
|
243
|
+
}
|
|
244
|
+
declare function verifyRFC9421(request: RFC9421VerifyRequest, options: RFC9421VerifyOptions): Promise<RFC9421VerifyResult>;
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* UCP (Universal Commerce Protocol) checkout session extractor.
|
|
248
|
+
*
|
|
249
|
+
* Google + Shopify spec (ucp.dev). Extracts checkout session context from
|
|
250
|
+
* incoming HTTP requests and, at registration time, validates the
|
|
251
|
+
* `/.well-known/ucp` manifest via AJV against the mirrored JSON schema.
|
|
252
|
+
*/
|
|
253
|
+
|
|
254
|
+
interface UCPTotal {
|
|
255
|
+
type?: string;
|
|
256
|
+
amount?: number;
|
|
257
|
+
currency?: string;
|
|
258
|
+
}
|
|
259
|
+
interface UCPCheckoutContext {
|
|
260
|
+
sessionId?: string;
|
|
261
|
+
endpoint: string;
|
|
262
|
+
purpose: CommercePurpose | null;
|
|
263
|
+
merchantDomain?: string;
|
|
264
|
+
totals?: UCPTotal[];
|
|
265
|
+
paymentMethod?: string;
|
|
266
|
+
manifestUrl?: string;
|
|
267
|
+
}
|
|
268
|
+
interface UCPRequestLike {
|
|
269
|
+
method: string;
|
|
270
|
+
url: string;
|
|
271
|
+
headers?: Record<string, string | string[] | undefined>;
|
|
272
|
+
body?: unknown;
|
|
273
|
+
}
|
|
274
|
+
declare function extractUCPContext(request: UCPRequestLike): UCPCheckoutContext | null;
|
|
275
|
+
/**
|
|
276
|
+
* Fetch and parse a UCP manifest at registration time. Returns parsed JSON
|
|
277
|
+
* on success, null on any failure (network, parse, timeout). Does NOT throw.
|
|
278
|
+
*
|
|
279
|
+
* Schema validation is a separate step — see `validateUCPManifest`.
|
|
280
|
+
*/
|
|
281
|
+
declare function fetchUCPManifest(manifestUrl: string, options?: {
|
|
282
|
+
timeoutMs?: number;
|
|
283
|
+
}): Promise<unknown | null>;
|
|
284
|
+
/**
|
|
285
|
+
* Validate a UCP manifest against the minimal shape we care about.
|
|
286
|
+
*
|
|
287
|
+
* The full UCP manifest schema lives upstream (ucp.dev) and is out of scope
|
|
288
|
+
* to mirror here exhaustively. This function checks the structural guarantees
|
|
289
|
+
* we depend on: required top-level fields (version, capabilities, endpoints).
|
|
290
|
+
*
|
|
291
|
+
* For full schema validation, consumers can pass their own AJV compiled
|
|
292
|
+
* validator via `options.validator`.
|
|
293
|
+
*/
|
|
294
|
+
interface UCPManifestValidationResult {
|
|
295
|
+
ok: boolean;
|
|
296
|
+
errors: string[];
|
|
297
|
+
}
|
|
298
|
+
declare function validateUCPManifest(manifest: unknown, options?: {
|
|
299
|
+
validator?: (m: unknown) => {
|
|
300
|
+
ok: boolean;
|
|
301
|
+
errors: string[];
|
|
302
|
+
};
|
|
303
|
+
}): UCPManifestValidationResult;
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* ACP (Agentic Commerce Protocol) request extractor.
|
|
307
|
+
*
|
|
308
|
+
* Co-maintained by OpenAI + Stripe. Spec at agenticcommerce.dev.
|
|
309
|
+
*
|
|
310
|
+
* Extracts ACP request context from HTTP requests:
|
|
311
|
+
* - Multi-header parsing: Signature, Timestamp, Idempotency-Key,
|
|
312
|
+
* Authorization: Bearer, API-Version
|
|
313
|
+
* - Endpoint classification: Agentic Checkout (checkout_sessions.*) vs
|
|
314
|
+
* Delegate Payment (agentic_commerce/delegate_payment)
|
|
315
|
+
* - Payment token detection: spt_* (Stripe SharedPaymentToken),
|
|
316
|
+
* vt_* (ACP vault token), unknown
|
|
317
|
+
* - Totals + merchant extraction from body
|
|
318
|
+
*
|
|
319
|
+
* No signature verification here — see acp-verify.ts.
|
|
320
|
+
*/
|
|
321
|
+
|
|
322
|
+
type ACPEndpoint = 'checkout_sessions.create' | 'checkout_sessions.update' | 'checkout_sessions.complete' | 'checkout_sessions.cancel' | 'delegate_payment' | 'unknown';
|
|
323
|
+
type ACPPaymentTokenType = 'stripe-spt' | 'acp-vt' | 'other' | null;
|
|
324
|
+
interface ACPTotal {
|
|
325
|
+
type?: string;
|
|
326
|
+
amount?: number;
|
|
327
|
+
currency?: string;
|
|
328
|
+
}
|
|
329
|
+
interface ACPRequestContext {
|
|
330
|
+
endpoint: ACPEndpoint;
|
|
331
|
+
purpose: CommercePurpose | null;
|
|
332
|
+
sessionId?: string;
|
|
333
|
+
merchantId?: string;
|
|
334
|
+
apiVersion?: string;
|
|
335
|
+
bearer?: string;
|
|
336
|
+
signatureHeader?: string;
|
|
337
|
+
timestampHeader?: string;
|
|
338
|
+
idempotencyKey?: string;
|
|
339
|
+
paymentToken?: {
|
|
340
|
+
raw?: string;
|
|
341
|
+
type: ACPPaymentTokenType;
|
|
342
|
+
provider?: string;
|
|
343
|
+
};
|
|
344
|
+
totals?: ACPTotal[];
|
|
345
|
+
fulfillmentOption?: string;
|
|
346
|
+
rawBody?: string;
|
|
347
|
+
}
|
|
348
|
+
interface ACPRequestLike {
|
|
349
|
+
method: string;
|
|
350
|
+
url: string;
|
|
351
|
+
headers?: Record<string, string | string[] | undefined>;
|
|
352
|
+
body?: unknown;
|
|
353
|
+
rawBody?: string;
|
|
354
|
+
}
|
|
355
|
+
declare function extractACPContext(request: ACPRequestLike): ACPRequestContext | null;
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* VI (Verifiable Intent) SD-JWT extraction.
|
|
359
|
+
*
|
|
360
|
+
* Open-sourced 5 March 2026 by Mastercard + Google (v0.1-draft).
|
|
361
|
+
* VI is a 3-layer SD-JWT chain:
|
|
362
|
+
* L1 — issuer → wallet (credential provider)
|
|
363
|
+
* L2 — user → agent (cnf.jwk binding to L3 agent key)
|
|
364
|
+
* L3 — agent → merchant (payment or checkout mandate, split into L3a / L3b
|
|
365
|
+
* cross-referenced via transaction_id)
|
|
366
|
+
*
|
|
367
|
+
* This module does EXTRACTION ONLY — it decodes SD-JWT structure and pulls
|
|
368
|
+
* out the mandate type, kid, executionMode, 8 constraint types, checkoutHash
|
|
369
|
+
* (constraint type 8), transactionId, and raw layers for later verification.
|
|
370
|
+
*
|
|
371
|
+
* Signature verification lives in vi-verify.ts; this module uses @sd-jwt's
|
|
372
|
+
* sync decoder with a SHA-256 hasher for structural parsing only.
|
|
373
|
+
*/
|
|
374
|
+
|
|
375
|
+
type VIExecutionMode = 'Immediate' | 'Autonomous' | 'Both';
|
|
376
|
+
interface VIAllowedParty {
|
|
377
|
+
id?: string;
|
|
378
|
+
name?: string;
|
|
379
|
+
website?: string;
|
|
380
|
+
}
|
|
381
|
+
interface VILineItem {
|
|
382
|
+
id?: string;
|
|
383
|
+
acceptableItems?: string[];
|
|
384
|
+
quantity?: number;
|
|
385
|
+
}
|
|
386
|
+
interface VIPaymentAmount {
|
|
387
|
+
currency?: string;
|
|
388
|
+
min?: number;
|
|
389
|
+
max?: number;
|
|
390
|
+
}
|
|
391
|
+
interface VIBudgetLimit {
|
|
392
|
+
currency?: string;
|
|
393
|
+
max?: number;
|
|
394
|
+
}
|
|
395
|
+
interface VIRecurrence {
|
|
396
|
+
frequency?: string;
|
|
397
|
+
startDate?: string;
|
|
398
|
+
endDate?: string;
|
|
399
|
+
maxOccurrences?: number;
|
|
400
|
+
}
|
|
401
|
+
interface VIConstraints {
|
|
402
|
+
allowedMerchants?: VIAllowedParty[];
|
|
403
|
+
allowedPayees?: VIAllowedParty[];
|
|
404
|
+
lineItems?: VILineItem[];
|
|
405
|
+
paymentAmount?: VIPaymentAmount;
|
|
406
|
+
budgetLimit?: VIBudgetLimit;
|
|
407
|
+
recurrence?: VIRecurrence;
|
|
408
|
+
agentRecurrence?: VIRecurrence;
|
|
409
|
+
}
|
|
410
|
+
interface VIExtractedClaims {
|
|
411
|
+
mandateType: VIMandateType;
|
|
412
|
+
kid?: string;
|
|
413
|
+
executionMode?: VIExecutionMode;
|
|
414
|
+
credentialProvider?: string;
|
|
415
|
+
constraints: VIConstraints;
|
|
416
|
+
/** VI constraint type 8 — SHA-256 of the paired L2 checkout disclosure. */
|
|
417
|
+
checkoutHash?: string;
|
|
418
|
+
transactionId?: string;
|
|
419
|
+
rawLayers: {
|
|
420
|
+
l1?: string;
|
|
421
|
+
l2?: string;
|
|
422
|
+
l3?: string;
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Extract VI claims from a compact SD-JWT string.
|
|
427
|
+
*
|
|
428
|
+
* Input shape:
|
|
429
|
+
* <jwt>~<disclosure1>~<disclosure2>~...~<kbJwt?>
|
|
430
|
+
*
|
|
431
|
+
* Returns null if parsing fails at any layer. Does not verify signatures.
|
|
432
|
+
*/
|
|
433
|
+
declare function extractVIClaims(sdJwtCompact: string): VIExtractedClaims | null;
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* Stripe webhook HMAC-SHA256 verifier (inline).
|
|
437
|
+
*
|
|
438
|
+
* Stripe-Signature header format: "t=TIMESTAMP,v1=HEX_SIGNATURE"
|
|
439
|
+
* - t: unix seconds when Stripe signed the webhook
|
|
440
|
+
* - v1: HMAC-SHA256(webhook_secret, `${t}.${payload}`) as hex
|
|
441
|
+
*
|
|
442
|
+
* Multiple v1 signatures can coexist during secret rotation; any match wins.
|
|
443
|
+
* Default tolerance on timestamp age: 300s (matches Stripe's own default).
|
|
444
|
+
*
|
|
445
|
+
* Documented at docs.stripe.com — we intentionally inline ~25 LOC rather
|
|
446
|
+
* than pull in the full stripe npm package (MIT but 600KB+ with deps).
|
|
447
|
+
*/
|
|
448
|
+
interface VerifyStripeWebhookResult {
|
|
449
|
+
ok: boolean;
|
|
450
|
+
timestamp?: number;
|
|
451
|
+
error?: string;
|
|
452
|
+
}
|
|
453
|
+
interface VerifyStripeWebhookOptions {
|
|
454
|
+
toleranceSec?: number;
|
|
455
|
+
/** Injectable for deterministic tests. */
|
|
456
|
+
now?: () => number;
|
|
457
|
+
}
|
|
458
|
+
declare function verifyStripeWebhook(payload: string, signatureHeader: string | undefined, secret: string, options?: VerifyStripeWebhookOptions): VerifyStripeWebhookResult;
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* PDLSS constraint evaluation.
|
|
462
|
+
*
|
|
463
|
+
* Evaluates VI constraint types 1-4 (merchant/payee allowlists, line items,
|
|
464
|
+
* payment amount) + MPP/x402 payment-method allowlist + spending-limit
|
|
465
|
+
* against a transaction context.
|
|
466
|
+
*
|
|
467
|
+
* Types 5/6/7 (budget, recurrence, agent_recurrence) extract through but
|
|
468
|
+
* enforcement is deferred to the cross-merchant budget service (§3.3.15,
|
|
469
|
+
* separate PR). This module returns per-constraint {ok, reason} results
|
|
470
|
+
* so a policy layer can decide hard-deny vs trust-signal.
|
|
471
|
+
*/
|
|
472
|
+
|
|
473
|
+
interface TransactionContext {
|
|
474
|
+
amount?: number;
|
|
475
|
+
currency?: string;
|
|
476
|
+
merchant?: {
|
|
477
|
+
id?: string;
|
|
478
|
+
website?: string;
|
|
479
|
+
};
|
|
480
|
+
payee?: {
|
|
481
|
+
id?: string;
|
|
482
|
+
website?: string;
|
|
483
|
+
};
|
|
484
|
+
lineItems?: Array<{
|
|
485
|
+
id?: string;
|
|
486
|
+
quantity?: number;
|
|
487
|
+
}>;
|
|
488
|
+
/** For MPP / x402 payment-method enforcement. */
|
|
489
|
+
paymentMethod?: string;
|
|
490
|
+
}
|
|
491
|
+
type ConstraintKey = 'merchant' | 'payee' | 'lineItems' | 'amount' | 'paymentMethod';
|
|
492
|
+
interface ConstraintResult {
|
|
493
|
+
ok: boolean;
|
|
494
|
+
reason?: string;
|
|
495
|
+
}
|
|
496
|
+
interface ConstraintEvalResult {
|
|
497
|
+
ok: boolean;
|
|
498
|
+
results: Record<string, ConstraintResult>;
|
|
499
|
+
reasons: string[];
|
|
500
|
+
}
|
|
501
|
+
interface VIConstraintEvalInput {
|
|
502
|
+
constraints: VIConstraints;
|
|
503
|
+
transaction: TransactionContext;
|
|
504
|
+
}
|
|
505
|
+
declare function evaluateVIConstraints(input: VIConstraintEvalInput): ConstraintEvalResult;
|
|
506
|
+
interface PaymentMethodAllowlistInput {
|
|
507
|
+
allowedMethods?: string[];
|
|
508
|
+
requestedMethod?: string;
|
|
509
|
+
}
|
|
510
|
+
declare function evaluatePaymentMethodAllowlist(input: PaymentMethodAllowlistInput): ConstraintResult;
|
|
511
|
+
interface SpendingLimitInput {
|
|
512
|
+
limit?: {
|
|
513
|
+
amount?: number;
|
|
514
|
+
currency?: string;
|
|
515
|
+
};
|
|
516
|
+
requested?: {
|
|
517
|
+
amount?: number;
|
|
518
|
+
currency?: string;
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
declare function evaluateSpendingLimit(input: SpendingLimitInput): ConstraintResult;
|
|
522
|
+
|
|
523
|
+
/**
|
|
524
|
+
* Cross-protocol agent identity binding.
|
|
525
|
+
*
|
|
526
|
+
* Every commerce layer claims an agent identity differently:
|
|
527
|
+
* - VI L3 kid (SD-JWT header)
|
|
528
|
+
* - AP2 agent_id (mandate payload)
|
|
529
|
+
* - ACP Authorization: Bearer token (merchant-issued pre-shared)
|
|
530
|
+
* - MPP Credential `source` field (DID or chain-native key)
|
|
531
|
+
* - x402 client wallet address
|
|
532
|
+
* - RFC 9421 kid (Agent Pay / TAP / Web Bot Auth)
|
|
533
|
+
*
|
|
534
|
+
* This module maps any such claim to a single AstraSync agent via a
|
|
535
|
+
* caller-supplied resolver (typically delegates to the counterparty service),
|
|
536
|
+
* then flags whether multiple claims on the same request resolve to different
|
|
537
|
+
* agents (a trust signal for PDLSS).
|
|
538
|
+
*
|
|
539
|
+
* This is AstraSync whitespace — no vendor owns multi-protocol identity
|
|
540
|
+
* unification.
|
|
541
|
+
*/
|
|
542
|
+
interface IdentityClaim {
|
|
543
|
+
/** Originating protocol label: 'vi' | 'ap2' | 'acp' | 'mpp' | 'x402' | 'agentpay' | 'tap' | 'webbotauth' */
|
|
544
|
+
protocol: string;
|
|
545
|
+
/** Claim field name, e.g. 'kid', 'agent_id', 'source', 'bearer'. */
|
|
546
|
+
field: string;
|
|
547
|
+
/** Claim value as presented on the wire. */
|
|
548
|
+
value: string;
|
|
549
|
+
}
|
|
550
|
+
interface IdentityBindingResult {
|
|
551
|
+
claims: IdentityClaim[];
|
|
552
|
+
mappedAstraSyncAgentId?: string;
|
|
553
|
+
/**
|
|
554
|
+
* True when two or more claims resolve to different AstraSync agents.
|
|
555
|
+
* Surfaced as a trust signal rather than an auto-deny — legitimate flows
|
|
556
|
+
* (e.g. delegate payments) can legitimately carry multiple identities.
|
|
557
|
+
*/
|
|
558
|
+
mismatchAcrossLayers: boolean;
|
|
559
|
+
/** Per-claim resolution result for audit / debugging. */
|
|
560
|
+
resolutions: Array<{
|
|
561
|
+
claim: IdentityClaim;
|
|
562
|
+
agentId: string | null;
|
|
563
|
+
}>;
|
|
564
|
+
}
|
|
565
|
+
type IdentityResolver = (claim: IdentityClaim) => Promise<string | null>;
|
|
566
|
+
declare function bindIdentity(claims: IdentityClaim[], resolver: IdentityResolver): Promise<IdentityBindingResult>;
|
|
567
|
+
/**
|
|
568
|
+
* Helper constructors — keep protocol/field strings consistent across the
|
|
569
|
+
* codebase and make tests readable.
|
|
570
|
+
*/
|
|
571
|
+
declare const claim: {
|
|
572
|
+
viKid: (value: string) => IdentityClaim;
|
|
573
|
+
ap2AgentId: (value: string) => IdentityClaim;
|
|
574
|
+
acpBearer: (value: string) => IdentityClaim;
|
|
575
|
+
mppSource: (value: string) => IdentityClaim;
|
|
576
|
+
x402Wallet: (value: string) => IdentityClaim;
|
|
577
|
+
agentPayKid: (value: string) => IdentityClaim;
|
|
578
|
+
tapKid: (value: string) => IdentityClaim;
|
|
579
|
+
webBotAuthKid: (value: string) => IdentityClaim;
|
|
580
|
+
};
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* AP2 (Agent Payments Protocol) mandate extraction.
|
|
584
|
+
*
|
|
585
|
+
* Google-led, launched 3 April 2026 with 60+ partners (Mastercard, PayPal,
|
|
586
|
+
* Coinbase, AmEx, Revolut, UnionPay, ...). AP2 ships three mandate types as
|
|
587
|
+
* SD-JWTs in series:
|
|
588
|
+
* - intent_mandate — user declares intent (amount, merchant category, etc.)
|
|
589
|
+
* - cart_mandate — user approves a cart (specific items, totals)
|
|
590
|
+
* - payment_mandate — authorizes the actual payment rail
|
|
591
|
+
*
|
|
592
|
+
* Mandates are cross-referenced via ids; each is an SD-JWT over ES256 (or
|
|
593
|
+
* equivalent). We decode via @sd-jwt/decode and extract the AP2-specific
|
|
594
|
+
* shape — verification lives in ap2-verify.ts.
|
|
595
|
+
*/
|
|
596
|
+
|
|
597
|
+
interface AP2PaymentDetailsTotal {
|
|
598
|
+
amount?: {
|
|
599
|
+
value?: string | number;
|
|
600
|
+
currency?: string;
|
|
601
|
+
};
|
|
602
|
+
label?: string;
|
|
603
|
+
}
|
|
604
|
+
interface AP2IntentMandateClaims {
|
|
605
|
+
type: 'intent_mandate';
|
|
606
|
+
agent_id?: string;
|
|
607
|
+
user_id?: string;
|
|
608
|
+
merchant_category?: string;
|
|
609
|
+
allowedMerchantDomains?: string[];
|
|
610
|
+
paymentMethods?: string[];
|
|
611
|
+
expires?: string;
|
|
612
|
+
payment_details_total?: AP2PaymentDetailsTotal;
|
|
613
|
+
raw: Record<string, unknown>;
|
|
614
|
+
}
|
|
615
|
+
interface AP2CartMandateClaims {
|
|
616
|
+
type: 'cart_mandate';
|
|
617
|
+
agent_id?: string;
|
|
618
|
+
intent_mandate_id?: string;
|
|
619
|
+
merchant_id?: string;
|
|
620
|
+
line_items?: Array<{
|
|
621
|
+
id?: string;
|
|
622
|
+
quantity?: number;
|
|
623
|
+
price?: {
|
|
624
|
+
value?: string | number;
|
|
625
|
+
currency?: string;
|
|
626
|
+
};
|
|
627
|
+
}>;
|
|
628
|
+
payment_details_total?: AP2PaymentDetailsTotal;
|
|
629
|
+
expires?: string;
|
|
630
|
+
raw: Record<string, unknown>;
|
|
631
|
+
}
|
|
632
|
+
interface AP2PaymentMandateClaims {
|
|
633
|
+
type: 'payment_mandate';
|
|
634
|
+
agent_id?: string;
|
|
635
|
+
cart_mandate_id?: string;
|
|
636
|
+
payment_method?: string;
|
|
637
|
+
payment_details_total?: AP2PaymentDetailsTotal;
|
|
638
|
+
credential_provider?: string;
|
|
639
|
+
raw: Record<string, unknown>;
|
|
640
|
+
}
|
|
641
|
+
type AP2MandateClaims = AP2IntentMandateClaims | AP2CartMandateClaims | AP2PaymentMandateClaims;
|
|
642
|
+
interface AP2MandateTriple {
|
|
643
|
+
intent?: AP2IntentMandateClaims;
|
|
644
|
+
cart?: AP2CartMandateClaims;
|
|
645
|
+
payment?: AP2PaymentMandateClaims;
|
|
646
|
+
rawLayers: {
|
|
647
|
+
intentJwt?: string;
|
|
648
|
+
cartJwt?: string;
|
|
649
|
+
paymentJwt?: string;
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* Extract a single AP2 mandate from a compact SD-JWT.
|
|
654
|
+
* Returns null if the SD-JWT is malformed or lacks a recognized type field.
|
|
655
|
+
*/
|
|
656
|
+
declare function extractAP2Mandate(sdJwtCompact: string): AP2MandateClaims | null;
|
|
657
|
+
interface AP2MandateTripleInput {
|
|
658
|
+
intent?: string;
|
|
659
|
+
cart?: string;
|
|
660
|
+
payment?: string;
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
* Extract an intent / cart / payment triple, returning whichever are present.
|
|
664
|
+
* Does NOT enforce cross-reference consistency — that's ap2-verify.ts's job.
|
|
665
|
+
*/
|
|
666
|
+
declare function extractAP2Mandates(input: AP2MandateTripleInput): AP2MandateTriple;
|
|
667
|
+
|
|
668
|
+
/**
|
|
669
|
+
* AP2 mandate chain verification.
|
|
670
|
+
*
|
|
671
|
+
* Checks the cross-reference consistency of an intent → cart → payment
|
|
672
|
+
* triple. Does NOT verify cryptographic signatures here (that's a call to
|
|
673
|
+
* @sd-jwt/core which needs the agent's / CP's public key; expose via a
|
|
674
|
+
* verifier callback so pipeline can plug in the right resolver).
|
|
675
|
+
*
|
|
676
|
+
* Rules (per AP2 spec v0.1-draft):
|
|
677
|
+
* - cart.intent_mandate_id must equal the intent mandate's canonical id (if present)
|
|
678
|
+
* - payment.cart_mandate_id must equal the cart mandate's canonical id (if present)
|
|
679
|
+
* - agent_id must match across all three layers
|
|
680
|
+
* - payment_method in payment mandate must be in intent.paymentMethods (if declared)
|
|
681
|
+
* - cart totals must not exceed intent totals (if both declared in same currency)
|
|
682
|
+
* - no mandate may be expired (beyond clock skew)
|
|
683
|
+
*/
|
|
684
|
+
|
|
685
|
+
interface AP2VerifyInput {
|
|
686
|
+
triple: AP2MandateTriple;
|
|
687
|
+
clockSkewSec?: number;
|
|
688
|
+
now?: () => number;
|
|
689
|
+
}
|
|
690
|
+
interface AP2ChainResult {
|
|
691
|
+
ok: boolean;
|
|
692
|
+
checks: {
|
|
693
|
+
intentPresent: boolean;
|
|
694
|
+
cartRefOk: boolean;
|
|
695
|
+
paymentRefOk: boolean;
|
|
696
|
+
agentIdContinuity: boolean;
|
|
697
|
+
paymentMethodAllowed: boolean;
|
|
698
|
+
totalsConsistent: boolean;
|
|
699
|
+
expiryOk: boolean;
|
|
700
|
+
};
|
|
701
|
+
agentId?: string;
|
|
702
|
+
errors: string[];
|
|
703
|
+
}
|
|
704
|
+
declare function verifyAP2Chain(input: AP2VerifyInput): AP2ChainResult;
|
|
705
|
+
|
|
706
|
+
/**
|
|
707
|
+
* ACP detached-JSON-signature verifier.
|
|
708
|
+
*
|
|
709
|
+
* ACP (Agentic Commerce Protocol, OpenAI + Stripe) uses detached JSON
|
|
710
|
+
* signatures over request bodies. The public signature algorithm is NOT
|
|
711
|
+
* specified in open docs as of April 2026 (docs.stripe.com/agentic-commerce/*
|
|
712
|
+
* is Private Preview). We implement Ed25519 and ES256 candidates against
|
|
713
|
+
* whichever public key the caller supplies, and report algorithm-unsupported
|
|
714
|
+
* as a trust signal rather than a hard fail so policy can weight it.
|
|
715
|
+
*
|
|
716
|
+
* Timestamp freshness (>300s default) IS a hard fail — prevents replay.
|
|
717
|
+
*
|
|
718
|
+
* Bearer-token → AstraSync agent binding is delegated to caller-supplied
|
|
719
|
+
* resolver (typically the counterparty service).
|
|
720
|
+
*/
|
|
721
|
+
|
|
722
|
+
type ACPSignatureAlgorithm = 'ed25519' | 'es256' | 'unsupported';
|
|
723
|
+
interface ACPVerifyInput {
|
|
724
|
+
/** Raw request body over which the signature was computed. */
|
|
725
|
+
rawBody: string;
|
|
726
|
+
/** Value of the Signature header. Expected to be base64 (either standard or url). */
|
|
727
|
+
signatureHeader?: string;
|
|
728
|
+
/** Value of the Timestamp header (unix seconds as string, or ISO 8601). */
|
|
729
|
+
timestampHeader?: string;
|
|
730
|
+
/** Candidate public keys to try. First matching algorithm wins. */
|
|
731
|
+
candidateKeys: Array<{
|
|
732
|
+
jwk: JWK;
|
|
733
|
+
alg?: ACPSignatureAlgorithm | string;
|
|
734
|
+
}>;
|
|
735
|
+
/** Clock skew tolerance in seconds (default 300). */
|
|
736
|
+
clockSkewSec?: number;
|
|
737
|
+
/** Injectable now for tests. */
|
|
738
|
+
now?: () => number;
|
|
739
|
+
}
|
|
740
|
+
interface ACPVerifyResult {
|
|
741
|
+
ok: boolean;
|
|
742
|
+
algorithm?: ACPSignatureAlgorithm;
|
|
743
|
+
error?: string;
|
|
744
|
+
/** True when timestamp is outside tolerance. */
|
|
745
|
+
timestampStale?: boolean;
|
|
746
|
+
}
|
|
747
|
+
declare function verifyACPSignature(input: ACPVerifyInput): Promise<ACPVerifyResult>;
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
* MPP (Machine Payments Protocol) extractor.
|
|
751
|
+
*
|
|
752
|
+
* Wraps mppx (wevm) — pinned to 0.5.13, wrapped behind this adapter so
|
|
753
|
+
* upgrades localise here. MPP launched March 18 2026 (Stripe + Tempo +
|
|
754
|
+
* Paradigm), IETF draft-ryan-httpauth-payment-01.
|
|
755
|
+
*
|
|
756
|
+
* Flow:
|
|
757
|
+
* Client → GET /resource
|
|
758
|
+
* Server → 402 + WWW-Authenticate: Payment id=..., realm=..., method=tempo|stripe|...
|
|
759
|
+
* Client → GET /resource with Authorization: Payment <base64url-json credential>
|
|
760
|
+
* Server → 200 + Payment-Receipt: <base64url-json receipt>
|
|
761
|
+
*
|
|
762
|
+
* What we extract:
|
|
763
|
+
* - Challenge: id, realm, method, intent, request{amount,currency,...}, expires, digest
|
|
764
|
+
* - Credential: challenge + source (DID/chain-key) + payload (method-specific)
|
|
765
|
+
* - Receipt: challengeId, method, reference (tx hash / pi_... ID), settlement
|
|
766
|
+
* - Multi-method 402 offers (may be multiple WWW-Authenticate headers)
|
|
767
|
+
*
|
|
768
|
+
* What we do NOT verify here (pass-through):
|
|
769
|
+
* - HMAC challenge binding (requires merchant's MPP_SECRET_KEY)
|
|
770
|
+
* - Payment proof cryptography (Tempo tx sig, Stripe SPT, Lightning preimage)
|
|
771
|
+
* — each requires upstream connectivity
|
|
772
|
+
*
|
|
773
|
+
* Verification (expiry + BodyDigest + source extraction) in mpp-verify.ts.
|
|
774
|
+
*/
|
|
775
|
+
interface MPPChallengeSummary {
|
|
776
|
+
id: string;
|
|
777
|
+
realm: string;
|
|
778
|
+
method: string;
|
|
779
|
+
intent: string;
|
|
780
|
+
/** Method-specific request data (amount, currency, recipient, etc.) */
|
|
781
|
+
request: Record<string, unknown>;
|
|
782
|
+
expires?: string;
|
|
783
|
+
digest?: string;
|
|
784
|
+
description?: string;
|
|
785
|
+
opaque?: Record<string, string>;
|
|
786
|
+
}
|
|
787
|
+
interface MPPCredentialSummary {
|
|
788
|
+
challenge: MPPChallengeSummary;
|
|
789
|
+
/** DID or chain-native key identifying the payer. */
|
|
790
|
+
source?: string;
|
|
791
|
+
/** Method-specific payment proof (Tempo tx, SPT, Lightning preimage, etc.). */
|
|
792
|
+
payload: unknown;
|
|
793
|
+
}
|
|
794
|
+
interface MPPReceiptSummary {
|
|
795
|
+
method?: string;
|
|
796
|
+
reference?: string;
|
|
797
|
+
externalId?: string;
|
|
798
|
+
status?: string;
|
|
799
|
+
timestamp?: string;
|
|
800
|
+
raw: Record<string, unknown>;
|
|
801
|
+
}
|
|
802
|
+
type MPPKind = 'challenge' | 'credential' | 'receipt' | 'error' | 'unknown';
|
|
803
|
+
interface MPPRequestContext {
|
|
804
|
+
kind: MPPKind;
|
|
805
|
+
/** For 402 responses: one or more challenge offers. */
|
|
806
|
+
challenges?: MPPChallengeSummary[];
|
|
807
|
+
/** For requests with Authorization: Payment header. */
|
|
808
|
+
credential?: MPPCredentialSummary;
|
|
809
|
+
/** For 200 responses with Payment-Receipt header. */
|
|
810
|
+
receipt?: MPPReceiptSummary;
|
|
811
|
+
/** For problem+json error responses. */
|
|
812
|
+
error?: {
|
|
813
|
+
type?: string;
|
|
814
|
+
title?: string;
|
|
815
|
+
detail?: string;
|
|
816
|
+
};
|
|
817
|
+
/** Detected payment methods offered (for multi-method 402). */
|
|
818
|
+
offeredMethods?: string[];
|
|
819
|
+
/** Raw body captured for BodyDigest verification in mpp-verify.ts. */
|
|
820
|
+
rawBody?: string;
|
|
821
|
+
}
|
|
822
|
+
interface MPPRequestLike {
|
|
823
|
+
method: string;
|
|
824
|
+
url: string;
|
|
825
|
+
headers: Record<string, string | string[] | undefined>;
|
|
826
|
+
body?: unknown;
|
|
827
|
+
rawBody?: string;
|
|
828
|
+
}
|
|
829
|
+
interface MPPResponseLike {
|
|
830
|
+
status: number;
|
|
831
|
+
headers: Record<string, string | string[] | undefined>;
|
|
832
|
+
body?: unknown;
|
|
833
|
+
rawBody?: string;
|
|
834
|
+
}
|
|
835
|
+
/**
|
|
836
|
+
* Extract MPP context from an agent → merchant request.
|
|
837
|
+
* Looks for `Authorization: Payment <credential>` header.
|
|
838
|
+
*/
|
|
839
|
+
declare function extractMPPFromRequest(request: MPPRequestLike): MPPRequestContext | null;
|
|
840
|
+
/**
|
|
841
|
+
* Extract MPP context from a merchant → agent response.
|
|
842
|
+
* Handles 402 (challenge offers), 200 (receipt), 4xx (problem+json errors).
|
|
843
|
+
*/
|
|
844
|
+
declare function extractMPPFromResponse(response: MPPResponseLike): MPPRequestContext | null;
|
|
845
|
+
/**
|
|
846
|
+
* Extract from either a request OR a response, auto-detecting which has MPP
|
|
847
|
+
* artifacts. Convenience for pipeline callers.
|
|
848
|
+
*/
|
|
849
|
+
declare function extractMPPContext(message: {
|
|
850
|
+
request: MPPRequestLike;
|
|
851
|
+
} | {
|
|
852
|
+
response: MPPResponseLike;
|
|
853
|
+
} | (MPPRequestLike & Partial<MPPResponseLike>)): MPPRequestContext | null;
|
|
854
|
+
|
|
855
|
+
/**
|
|
856
|
+
* MPP verification — expiry + optional BodyDigest + source extraction.
|
|
857
|
+
*
|
|
858
|
+
* We do NOT verify the challenge's HMAC binding (needs merchant's secret)
|
|
859
|
+
* or the cryptographic payment proof (per-method, requires upstream
|
|
860
|
+
* connectivity). Those are the merchant's / settlement layer's job.
|
|
861
|
+
*
|
|
862
|
+
* Our job: structural correctness, expiry policy, tamper detection via
|
|
863
|
+
* optional BodyDigest, and identity extraction for PDLSS binding.
|
|
864
|
+
*/
|
|
865
|
+
|
|
866
|
+
interface MPPVerifyInput {
|
|
867
|
+
context: MPPRequestContext;
|
|
868
|
+
/** Raw request body to validate BodyDigest against, if the challenge declares one. */
|
|
869
|
+
rawBody?: string;
|
|
870
|
+
/** Seconds of clock-skew tolerance on challenge.expires. Default 300. */
|
|
871
|
+
clockSkewSec?: number;
|
|
872
|
+
/** Injectable for deterministic tests. */
|
|
873
|
+
now?: () => number;
|
|
874
|
+
}
|
|
875
|
+
interface MPPVerifyResult {
|
|
876
|
+
ok: boolean;
|
|
877
|
+
expiryOk: boolean;
|
|
878
|
+
bodyDigestOk: boolean | null;
|
|
879
|
+
source?: string;
|
|
880
|
+
method?: string;
|
|
881
|
+
error?: string;
|
|
882
|
+
}
|
|
883
|
+
declare function verifyMPP(input: MPPVerifyInput): MPPVerifyResult;
|
|
884
|
+
|
|
885
|
+
/**
|
|
886
|
+
* x402 (Coinbase / Linux Foundation x402 Foundation) extractor.
|
|
887
|
+
*
|
|
888
|
+
* Wraps @x402/core's schema parsers. x402 Foundation launched April 2 2026
|
|
889
|
+
* with v2 adding network-agnostic identifiers + multiple facilitators +
|
|
890
|
+
* Bazaar discovery. MPP (Machine Payments Protocol) is the IETF-formalised
|
|
891
|
+
* superset of x402; this module normalizes x402 output to MPP-shape so
|
|
892
|
+
* downstream pipeline code is uniform.
|
|
893
|
+
*
|
|
894
|
+
* Where x402 lives on the wire:
|
|
895
|
+
* - 402 response body (v2) OR `X-PAYMENT-REQUIRED` header (v1) — PaymentRequired
|
|
896
|
+
* - Request body (v2) OR `X-PAYMENT` header (v1, base64) — PaymentPayload
|
|
897
|
+
*/
|
|
898
|
+
type X402Kind = 'required' | 'payload' | 'error' | 'unknown';
|
|
899
|
+
interface X402RequirementsSummary {
|
|
900
|
+
scheme: string;
|
|
901
|
+
network: string;
|
|
902
|
+
asset: string;
|
|
903
|
+
/** Normalized to string for v1/v2 compat — v1 uses maxAmountRequired, v2 uses amount. */
|
|
904
|
+
amount: string;
|
|
905
|
+
payTo: string;
|
|
906
|
+
maxTimeoutSeconds?: number;
|
|
907
|
+
resource?: string;
|
|
908
|
+
description?: string;
|
|
909
|
+
}
|
|
910
|
+
interface X402RequestContext {
|
|
911
|
+
kind: X402Kind;
|
|
912
|
+
version: 1 | 2 | null;
|
|
913
|
+
/** For 402 responses: the PaymentRequired body. */
|
|
914
|
+
paymentRequired?: {
|
|
915
|
+
resource: string;
|
|
916
|
+
accepts: X402RequirementsSummary[];
|
|
917
|
+
extensions?: Record<string, unknown>;
|
|
918
|
+
error?: string;
|
|
919
|
+
};
|
|
920
|
+
/** For request body (v2) or X-PAYMENT header (v1 base64): the PaymentPayload. */
|
|
921
|
+
paymentPayload?: {
|
|
922
|
+
scheme: string;
|
|
923
|
+
network: string;
|
|
924
|
+
/** Free-form per-scheme payload (e.g. EIP-3009 authorization, Solana tx). */
|
|
925
|
+
payload: Record<string, unknown>;
|
|
926
|
+
extensions?: Record<string, unknown>;
|
|
927
|
+
};
|
|
928
|
+
error?: {
|
|
929
|
+
type: string;
|
|
930
|
+
detail?: string;
|
|
931
|
+
};
|
|
932
|
+
/** Whether this was parsed from a header (v1 back-compat) or body (v2). */
|
|
933
|
+
source: 'header' | 'body' | null;
|
|
934
|
+
}
|
|
935
|
+
interface X402RequestLike {
|
|
936
|
+
method?: string;
|
|
937
|
+
url?: string;
|
|
938
|
+
headers?: Record<string, string | string[] | undefined>;
|
|
939
|
+
body?: unknown;
|
|
940
|
+
}
|
|
941
|
+
interface X402ResponseLike {
|
|
942
|
+
status?: number;
|
|
943
|
+
headers?: Record<string, string | string[] | undefined>;
|
|
944
|
+
body?: unknown;
|
|
945
|
+
}
|
|
946
|
+
/**
|
|
947
|
+
* Extract x402 PaymentPayload from an agent → merchant request.
|
|
948
|
+
* Checks v2 body (if it parses as PaymentPayload) and v1 X-PAYMENT header.
|
|
949
|
+
*/
|
|
950
|
+
declare function extractX402FromRequest(request: X402RequestLike): X402RequestContext | null;
|
|
951
|
+
/**
|
|
952
|
+
* Extract x402 PaymentRequired from a merchant → agent 402 response.
|
|
953
|
+
*/
|
|
954
|
+
declare function extractX402FromResponse(response: X402ResponseLike): X402RequestContext | null;
|
|
955
|
+
declare function extractX402Context(message: {
|
|
956
|
+
request: X402RequestLike;
|
|
957
|
+
} | {
|
|
958
|
+
response: X402ResponseLike;
|
|
959
|
+
} | (X402RequestLike & Partial<X402ResponseLike>)): X402RequestContext | null;
|
|
960
|
+
|
|
961
|
+
/**
|
|
962
|
+
* VI (Verifiable Intent) 3-layer SD-JWT chain verification.
|
|
963
|
+
*
|
|
964
|
+
* VI chains: L1 (credential provider → wallet) → L2 (user → agent) → L3
|
|
965
|
+
* (agent → merchant). L3 itself can split into L3a (payment mandate) + L3b
|
|
966
|
+
* (checkout mandate) cross-referenced via transaction_id, with L3b carrying
|
|
967
|
+
* a checkout_hash (VI constraint type 8) that must match SHA-256 of the L2
|
|
968
|
+
* checkout disclosure.
|
|
969
|
+
*
|
|
970
|
+
* Signature primitives are delegated to @sd-jwt/core (via our extractor);
|
|
971
|
+
* cnf.jwk chain-walking + cross-references + checkout_hash binding is
|
|
972
|
+
* AstraSync-specific composition logic — that's the whitespace here.
|
|
973
|
+
*
|
|
974
|
+
* This module does NOT re-verify selective-disclosure hashes (the extractor
|
|
975
|
+
* already applied them via @sd-jwt/decode). It DOES verify:
|
|
976
|
+
* - cnf.jwk in L1 payload points to L2's signing key (thumbprint match)
|
|
977
|
+
* - cnf.jwk in L2 payload points to L3's signing key
|
|
978
|
+
* - L3a.transaction_id === L3b.transaction_id (when both present)
|
|
979
|
+
* - L3b.checkout_hash === SHA-256(L2 canonical checkout disclosure) — type 8
|
|
980
|
+
* - mandate-level `exp` is not in the past (beyond clock skew)
|
|
981
|
+
*
|
|
982
|
+
* Cryptographic signature verification on each layer uses the verifier
|
|
983
|
+
* callback the caller supplies (e.g. resolves via @sd-jwt/core with the
|
|
984
|
+
* right JWK from the L1 issuer's JWKS).
|
|
985
|
+
*/
|
|
986
|
+
|
|
987
|
+
interface VILayer {
|
|
988
|
+
/** Compact SD-JWT / JWS for this layer. */
|
|
989
|
+
compact: string;
|
|
990
|
+
/** Decoded JWT payload (already disclosure-merged). */
|
|
991
|
+
payload: Record<string, unknown>;
|
|
992
|
+
/** Decoded JWT header. */
|
|
993
|
+
header: Record<string, unknown>;
|
|
994
|
+
}
|
|
995
|
+
interface VIVerifyInput {
|
|
996
|
+
/**
|
|
997
|
+
* Layers in chain order. L1 may be omitted when the caller has already
|
|
998
|
+
* resolved the chain via a trusted wallet binding.
|
|
999
|
+
*/
|
|
1000
|
+
layers: {
|
|
1001
|
+
l1?: VILayer;
|
|
1002
|
+
l2: VILayer;
|
|
1003
|
+
l3a?: VILayer;
|
|
1004
|
+
l3b?: VILayer;
|
|
1005
|
+
};
|
|
1006
|
+
/**
|
|
1007
|
+
* Verifier callback invoked per layer. Should return true iff the layer's
|
|
1008
|
+
* JWS signature verifies against the resolved public key (for L2 this is
|
|
1009
|
+
* L1's cnf.jwk; for L3 this is L2's cnf.jwk; for L1 this is the issuer's
|
|
1010
|
+
* JWKS per `iss` claim).
|
|
1011
|
+
*/
|
|
1012
|
+
verifySignature: (layer: VILayer, expectedKey: JWK | null) => Promise<boolean>;
|
|
1013
|
+
clockSkewSec?: number;
|
|
1014
|
+
now?: () => number;
|
|
1015
|
+
}
|
|
1016
|
+
interface VIVerifyResult {
|
|
1017
|
+
ok: boolean;
|
|
1018
|
+
checks: {
|
|
1019
|
+
l1SigOk: boolean | null;
|
|
1020
|
+
l2SigOk: boolean;
|
|
1021
|
+
l3aSigOk: boolean | null;
|
|
1022
|
+
l3bSigOk: boolean | null;
|
|
1023
|
+
l1BindsL2: boolean;
|
|
1024
|
+
l2BindsL3: boolean;
|
|
1025
|
+
l3aL3bTxnIdMatch: boolean | null;
|
|
1026
|
+
checkoutHashOk: boolean | null;
|
|
1027
|
+
expiryOk: boolean;
|
|
1028
|
+
};
|
|
1029
|
+
errors: string[];
|
|
1030
|
+
}
|
|
1031
|
+
declare function verifyVIChain(input: VIVerifyInput): Promise<VIVerifyResult>;
|
|
1032
|
+
|
|
1033
|
+
/**
|
|
1034
|
+
* Commerce pipeline orchestrator.
|
|
1035
|
+
*
|
|
1036
|
+
* Ties together extractors + verifiers + identity binding + constraint
|
|
1037
|
+
* evaluation + trust signals into a single CommerceContext result.
|
|
1038
|
+
*
|
|
1039
|
+
* This is AstraSync whitespace: the orchestration over the library-backed
|
|
1040
|
+
* primitives. PR 3's Commerce Shield Lambda will call this per request;
|
|
1041
|
+
* the admin playground page will call it ad-hoc.
|
|
1042
|
+
*
|
|
1043
|
+
* Policy:
|
|
1044
|
+
* - Hard-deny (ok=false) on bad signatures, expired mandates, constraint
|
|
1045
|
+
* failures, identity cannot be bound.
|
|
1046
|
+
* - Trust signal (ok remains policy-driven) on ACP algorithm unsupported,
|
|
1047
|
+
* Stripe webhook HMAC fail, payment-token type unknown, cross-layer
|
|
1048
|
+
* identity mismatch.
|
|
1049
|
+
*/
|
|
1050
|
+
|
|
1051
|
+
type CommerceProtocol = 'vi' | 'ap2' | 'ucp' | 'acp' | 'agentpay' | 'tap' | 'mpp' | 'x402';
|
|
1052
|
+
interface CommercePipelineInput {
|
|
1053
|
+
protocol: CommerceProtocol;
|
|
1054
|
+
vi?: {
|
|
1055
|
+
claims: VIExtractedClaims;
|
|
1056
|
+
verifyInput?: VIVerifyInput;
|
|
1057
|
+
};
|
|
1058
|
+
ap2?: {
|
|
1059
|
+
triple: AP2MandateTriple;
|
|
1060
|
+
};
|
|
1061
|
+
ucp?: UCPCheckoutContext;
|
|
1062
|
+
acp?: {
|
|
1063
|
+
context: ACPRequestContext;
|
|
1064
|
+
verifyInput?: Parameters<typeof verifyACPSignature>[0];
|
|
1065
|
+
};
|
|
1066
|
+
rfc9421?: {
|
|
1067
|
+
request: RFC9421VerifyRequest;
|
|
1068
|
+
tag?: 'browse' | 'purchase' | string;
|
|
1069
|
+
verifyOptions: Parameters<typeof verifyRFC9421>[1];
|
|
1070
|
+
};
|
|
1071
|
+
mpp?: {
|
|
1072
|
+
context: MPPRequestContext;
|
|
1073
|
+
rawBody?: string;
|
|
1074
|
+
};
|
|
1075
|
+
x402?: X402RequestContext;
|
|
1076
|
+
stripeWebhook?: {
|
|
1077
|
+
payload: string;
|
|
1078
|
+
signatureHeader: string;
|
|
1079
|
+
secret: string;
|
|
1080
|
+
};
|
|
1081
|
+
transaction?: TransactionContext;
|
|
1082
|
+
registeredConstraints?: {
|
|
1083
|
+
allowedPaymentMethods?: string[];
|
|
1084
|
+
spendingLimit?: {
|
|
1085
|
+
amount?: number;
|
|
1086
|
+
currency?: string;
|
|
1087
|
+
};
|
|
1088
|
+
};
|
|
1089
|
+
identityResolver?: IdentityResolver;
|
|
1090
|
+
clockSkewSec?: number;
|
|
1091
|
+
now?: () => number;
|
|
1092
|
+
}
|
|
1093
|
+
interface CommerceSignatureStack {
|
|
1094
|
+
vi?: VIVerifyResult;
|
|
1095
|
+
ap2?: AP2ChainResult;
|
|
1096
|
+
acp?: ACPVerifyResult;
|
|
1097
|
+
rfc9421?: RFC9421VerifyResult;
|
|
1098
|
+
mpp?: MPPVerifyResult;
|
|
1099
|
+
stripeWebhook?: VerifyStripeWebhookResult;
|
|
1100
|
+
}
|
|
1101
|
+
interface CommerceContext {
|
|
1102
|
+
protocol: CommerceProtocol;
|
|
1103
|
+
purpose: CommercePurpose | null;
|
|
1104
|
+
transactionValue?: TransactionValueContext;
|
|
1105
|
+
signatures: CommerceSignatureStack;
|
|
1106
|
+
identity?: {
|
|
1107
|
+
claims: IdentityClaim[];
|
|
1108
|
+
mappedAstraSyncAgentId?: string;
|
|
1109
|
+
mismatchAcrossLayers: boolean;
|
|
1110
|
+
};
|
|
1111
|
+
paymentToken?: {
|
|
1112
|
+
present: boolean;
|
|
1113
|
+
type: 'stripe-spt' | 'acp-vt' | 'tempo-tx' | 'other' | null;
|
|
1114
|
+
};
|
|
1115
|
+
mppMethodsOffered?: string[];
|
|
1116
|
+
constraints?: ConstraintEvalResult;
|
|
1117
|
+
receipt?: {
|
|
1118
|
+
method?: string;
|
|
1119
|
+
reference?: string;
|
|
1120
|
+
status?: string;
|
|
1121
|
+
timestamp?: string;
|
|
1122
|
+
};
|
|
1123
|
+
trustSignals: string[];
|
|
1124
|
+
timings: {
|
|
1125
|
+
extractMs: number;
|
|
1126
|
+
verifyMs: number;
|
|
1127
|
+
evalMs: number;
|
|
1128
|
+
};
|
|
1129
|
+
/** False when any hard-deny rule fires. */
|
|
1130
|
+
ok: boolean;
|
|
1131
|
+
}
|
|
1132
|
+
declare function runCommercePipeline(input: CommercePipelineInput): Promise<CommerceContext>;
|
|
1133
|
+
|
|
1134
|
+
/**
|
|
1135
|
+
* Pluggable extractor registry for PR 3 Commerce Shield Lambda@Edge.
|
|
1136
|
+
*
|
|
1137
|
+
* Built-in extractors (VI, UCP, ACP, RFC 9421, MPP, x402, Stripe webhook)
|
|
1138
|
+
* are NOT auto-registered. PR 3 Lambda imports this module, picks the set
|
|
1139
|
+
* it wants, and calls registerTransportExtractor() for each.
|
|
1140
|
+
*
|
|
1141
|
+
* Re-registering by name replaces the prior extractor (idempotent).
|
|
1142
|
+
*/
|
|
1143
|
+
interface ExtractorRequestLike {
|
|
1144
|
+
method?: string;
|
|
1145
|
+
url?: string;
|
|
1146
|
+
headers?: Record<string, string | string[] | undefined>;
|
|
1147
|
+
body?: unknown;
|
|
1148
|
+
}
|
|
1149
|
+
interface TransportExtractor<T = unknown> {
|
|
1150
|
+
readonly name: string;
|
|
1151
|
+
match(request: ExtractorRequestLike): boolean;
|
|
1152
|
+
extract(request: ExtractorRequestLike): T | Promise<T> | null;
|
|
1153
|
+
}
|
|
1154
|
+
declare function registerTransportExtractor<T>(extractor: TransportExtractor<T>): void;
|
|
1155
|
+
declare function getTransportExtractors(): ReadonlyArray<TransportExtractor>;
|
|
1156
|
+
declare function getTransportExtractor(name: string): TransportExtractor | undefined;
|
|
1157
|
+
declare function clearTransportExtractors(): void;
|
|
1158
|
+
/**
|
|
1159
|
+
* Helper: run all matching extractors against a request and return their
|
|
1160
|
+
* extracted contexts keyed by extractor name. Skips extractors whose
|
|
1161
|
+
* `match()` returns false.
|
|
1162
|
+
*/
|
|
1163
|
+
declare function runMatchingExtractors(request: ExtractorRequestLike): Promise<Record<string, unknown>>;
|
|
1164
|
+
|
|
1165
|
+
/**
|
|
1166
|
+
* Visa JWKS registry resolver.
|
|
1167
|
+
*
|
|
1168
|
+
* Default endpoint: https://mcp.visa.com/.well-known/jwks (per Visa TAP spec).
|
|
1169
|
+
* Wraps jose.createRemoteJWKSet which handles caching + rotation natively.
|
|
1170
|
+
*/
|
|
1171
|
+
|
|
1172
|
+
interface VisaRegistryOptions {
|
|
1173
|
+
jwksUrl?: string;
|
|
1174
|
+
cacheMaxAge?: number;
|
|
1175
|
+
cooldownDuration?: number;
|
|
1176
|
+
}
|
|
1177
|
+
declare function createVisaRegistry(options?: VisaRegistryOptions): RegistryResolver;
|
|
1178
|
+
|
|
1179
|
+
/**
|
|
1180
|
+
* Mastercard Agent Registry resolver — STUB.
|
|
1181
|
+
*
|
|
1182
|
+
* Mastercard Agent Pay is behind partnership (pilots Feb 2026, GA Q2 2026).
|
|
1183
|
+
* No public Agent Registry URL or open-source resolver exists as of April
|
|
1184
|
+
* 2026. This resolver accepts an optional `registryUrl` and, when absent,
|
|
1185
|
+
* returns null with a single one-time console.warn so callers can plumb
|
|
1186
|
+
* the flow end-to-end without a live registry.
|
|
1187
|
+
*
|
|
1188
|
+
* When Mastercard ships a public resolver or when a commercial relationship
|
|
1189
|
+
* provides a registry URL, pass it via `MastercardRegistryOptions.registryUrl`.
|
|
1190
|
+
* Response shape expected: { keys: JWK[] } (JWKS-style).
|
|
1191
|
+
*/
|
|
1192
|
+
|
|
1193
|
+
interface MastercardRegistryOptions {
|
|
1194
|
+
/** Partnership-provided registry URL. Without it, the resolver is inert. */
|
|
1195
|
+
registryUrl?: string;
|
|
1196
|
+
/** Cache TTL in seconds. Default 3600. */
|
|
1197
|
+
cacheTtlSec?: number;
|
|
1198
|
+
/** Fetch fn override for testing. */
|
|
1199
|
+
fetch?: typeof fetch;
|
|
1200
|
+
/** Silence the one-time warn (testing only). */
|
|
1201
|
+
silent?: boolean;
|
|
1202
|
+
}
|
|
1203
|
+
declare function createMastercardRegistry(options?: MastercardRegistryOptions): RegistryResolver;
|
|
1204
|
+
|
|
1205
|
+
/**
|
|
1206
|
+
* Web Bot Auth registry resolver.
|
|
1207
|
+
*
|
|
1208
|
+
* IETF draft-meunier-web-bot-auth-architecture-05 + draft-meunier-http-
|
|
1209
|
+
* message-signatures-directory-01. Shared transport substrate under TAP,
|
|
1210
|
+
* Agent Pay, and Cloudflare Pay Per Crawl.
|
|
1211
|
+
*
|
|
1212
|
+
* Fetches a Web Bot Auth signature directory
|
|
1213
|
+
* (default: `<origin>/.well-known/http-message-signatures-directory`).
|
|
1214
|
+
* Shape per spec is a JWKS with Ed25519 keys.
|
|
1215
|
+
*
|
|
1216
|
+
* Wraps Cloudflare's `web-bot-auth` npm package where feasible; for raw
|
|
1217
|
+
* directory fetch + kid matching we use fetch + JSON since web-bot-auth's
|
|
1218
|
+
* higher-level API assumes a full request to verify.
|
|
1219
|
+
*/
|
|
1220
|
+
|
|
1221
|
+
interface WebBotAuthRegistryOptions {
|
|
1222
|
+
/**
|
|
1223
|
+
* Optional explicit directory URL. When omitted, the resolver derives one
|
|
1224
|
+
* from `ResolveContext.origin` (e.g. the request URL's origin at verify time).
|
|
1225
|
+
*/
|
|
1226
|
+
directoryUrl?: string;
|
|
1227
|
+
cacheTtlSec?: number;
|
|
1228
|
+
fetch?: typeof fetch;
|
|
1229
|
+
}
|
|
1230
|
+
declare function createWebBotAuthRegistry(options?: WebBotAuthRegistryOptions): RegistryResolver;
|
|
1231
|
+
|
|
1232
|
+
/**
|
|
1233
|
+
* Cross-Protocol Transport Module
|
|
1234
|
+
*
|
|
1235
|
+
* Provides adapters for injecting/extracting AstraSync credentials
|
|
1236
|
+
* across HTTP, A2A, and MCP protocols.
|
|
1237
|
+
*/
|
|
1238
|
+
|
|
1239
|
+
/**
|
|
1240
|
+
* Auto-detect protocol from request/context shape.
|
|
1241
|
+
*/
|
|
1242
|
+
declare function detectProtocol(context: Record<string, unknown>): ProtocolTransport;
|
|
1243
|
+
/**
|
|
1244
|
+
* Apply credentials to any protocol target.
|
|
1245
|
+
*/
|
|
1246
|
+
declare function applyCredentials(protocol: ProtocolTransport, target: Record<string, unknown>, credentials: AstraSyncCredentials): Record<string, unknown>;
|
|
1247
|
+
/**
|
|
1248
|
+
* Extract credentials from any protocol context.
|
|
1249
|
+
*/
|
|
1250
|
+
declare function extractCredentialsFromProtocol(protocol: ProtocolTransport, context: Record<string, unknown>): AstraSyncCredentials | null;
|
|
1251
|
+
|
|
1252
|
+
type index_ACPEndpoint = ACPEndpoint;
|
|
1253
|
+
type index_ACPPaymentTokenType = ACPPaymentTokenType;
|
|
1254
|
+
type index_ACPRequestContext = ACPRequestContext;
|
|
1255
|
+
type index_ACPRequestLike = ACPRequestLike;
|
|
1256
|
+
type index_ACPSignatureAlgorithm = ACPSignatureAlgorithm;
|
|
1257
|
+
type index_ACPTotal = ACPTotal;
|
|
1258
|
+
type index_ACPVerifyInput = ACPVerifyInput;
|
|
1259
|
+
type index_ACPVerifyResult = ACPVerifyResult;
|
|
1260
|
+
type index_AP2CartMandateClaims = AP2CartMandateClaims;
|
|
1261
|
+
type index_AP2ChainResult = AP2ChainResult;
|
|
1262
|
+
type index_AP2IntentMandateClaims = AP2IntentMandateClaims;
|
|
1263
|
+
type index_AP2MandateClaims = AP2MandateClaims;
|
|
1264
|
+
type index_AP2MandateTriple = AP2MandateTriple;
|
|
1265
|
+
type index_AP2MandateTripleInput = AP2MandateTripleInput;
|
|
1266
|
+
type index_AP2MandateType = AP2MandateType;
|
|
1267
|
+
type index_AP2PaymentDetailsTotal = AP2PaymentDetailsTotal;
|
|
1268
|
+
type index_AP2PaymentMandateClaims = AP2PaymentMandateClaims;
|
|
1269
|
+
type index_AP2PaymentMandateForValue = AP2PaymentMandateForValue;
|
|
1270
|
+
type index_AP2VerifyInput = AP2VerifyInput;
|
|
1271
|
+
type index_CommerceContext = CommerceContext;
|
|
1272
|
+
type index_CommercePipelineInput = CommercePipelineInput;
|
|
1273
|
+
type index_CommerceProtocol = CommerceProtocol;
|
|
1274
|
+
type index_CommercePurpose = CommercePurpose;
|
|
1275
|
+
type index_CommerceSignatureStack = CommerceSignatureStack;
|
|
1276
|
+
type index_ConstraintEvalResult = ConstraintEvalResult;
|
|
1277
|
+
type index_ConstraintKey = ConstraintKey;
|
|
1278
|
+
type index_ConstraintResult = ConstraintResult;
|
|
1279
|
+
type index_ExtractorRequestLike = ExtractorRequestLike;
|
|
1280
|
+
type index_IdentityBindingResult = IdentityBindingResult;
|
|
1281
|
+
type index_IdentityClaim = IdentityClaim;
|
|
1282
|
+
type index_IdentityResolver = IdentityResolver;
|
|
1283
|
+
type index_MPPChallengeForValue = MPPChallengeForValue;
|
|
1284
|
+
type index_MPPChallengeSummary = MPPChallengeSummary;
|
|
1285
|
+
type index_MPPCredentialSummary = MPPCredentialSummary;
|
|
1286
|
+
type index_MPPIntent = MPPIntent;
|
|
1287
|
+
type index_MPPKind = MPPKind;
|
|
1288
|
+
type index_MPPReceiptSummary = MPPReceiptSummary;
|
|
1289
|
+
type index_MPPRequestContext = MPPRequestContext;
|
|
1290
|
+
type index_MPPRequestLike = MPPRequestLike;
|
|
1291
|
+
type index_MPPResponseLike = MPPResponseLike;
|
|
1292
|
+
type index_MPPVerifyInput = MPPVerifyInput;
|
|
1293
|
+
type index_MPPVerifyResult = MPPVerifyResult;
|
|
1294
|
+
type index_ParsedRFC9421 = ParsedRFC9421;
|
|
1295
|
+
type index_PaymentMethodAllowlistInput = PaymentMethodAllowlistInput;
|
|
1296
|
+
type index_RFC9421SignatureParams = RFC9421SignatureParams;
|
|
1297
|
+
type index_RFC9421Tag = RFC9421Tag;
|
|
1298
|
+
type index_RFC9421VerifyOptions = RFC9421VerifyOptions;
|
|
1299
|
+
type index_RFC9421VerifyRequest = RFC9421VerifyRequest;
|
|
1300
|
+
type index_RFC9421VerifyResult = RFC9421VerifyResult;
|
|
1301
|
+
type index_RegistryName = RegistryName;
|
|
1302
|
+
type index_RegistryResolver = RegistryResolver;
|
|
1303
|
+
type index_ResolveContext = ResolveContext;
|
|
1304
|
+
declare const index_STRIPE_WEBHOOK_INFORMATIONAL_EVENTS: typeof STRIPE_WEBHOOK_INFORMATIONAL_EVENTS;
|
|
1305
|
+
type index_SpendingLimitInput = SpendingLimitInput;
|
|
1306
|
+
type index_StripeWebhookInformationalEvent = StripeWebhookInformationalEvent;
|
|
1307
|
+
type index_TransactionContext = TransactionContext;
|
|
1308
|
+
type index_TransactionValueContext = TransactionValueContext;
|
|
1309
|
+
type index_TransportExtractor<T = unknown> = TransportExtractor<T>;
|
|
1310
|
+
type index_UCPCheckoutContext = UCPCheckoutContext;
|
|
1311
|
+
type index_UCPManifestValidationResult = UCPManifestValidationResult;
|
|
1312
|
+
type index_UCPRequestLike = UCPRequestLike;
|
|
1313
|
+
type index_UCPTotal = UCPTotal;
|
|
1314
|
+
type index_VIAllowedParty = VIAllowedParty;
|
|
1315
|
+
type index_VIBudgetLimit = VIBudgetLimit;
|
|
1316
|
+
type index_VIClaimsForValue = VIClaimsForValue;
|
|
1317
|
+
type index_VIConstraintEvalInput = VIConstraintEvalInput;
|
|
1318
|
+
type index_VIConstraints = VIConstraints;
|
|
1319
|
+
type index_VIExecutionMode = VIExecutionMode;
|
|
1320
|
+
type index_VIExtractedClaims = VIExtractedClaims;
|
|
1321
|
+
type index_VILayer = VILayer;
|
|
1322
|
+
type index_VILineItem = VILineItem;
|
|
1323
|
+
type index_VIMandateType = VIMandateType;
|
|
1324
|
+
type index_VIPaymentAmount = VIPaymentAmount;
|
|
1325
|
+
type index_VIRecurrence = VIRecurrence;
|
|
1326
|
+
type index_VIVerifyInput = VIVerifyInput;
|
|
1327
|
+
type index_VIVerifyResult = VIVerifyResult;
|
|
1328
|
+
type index_VerifyStripeWebhookOptions = VerifyStripeWebhookOptions;
|
|
1329
|
+
type index_VerifyStripeWebhookResult = VerifyStripeWebhookResult;
|
|
1330
|
+
type index_X402Kind = X402Kind;
|
|
1331
|
+
type index_X402RequestContext = X402RequestContext;
|
|
1332
|
+
type index_X402RequestForValue = X402RequestForValue;
|
|
1333
|
+
type index_X402RequestLike = X402RequestLike;
|
|
1334
|
+
type index_X402RequirementsSummary = X402RequirementsSummary;
|
|
1335
|
+
type index_X402ResponseLike = X402ResponseLike;
|
|
1336
|
+
declare const index_applyCredentials: typeof applyCredentials;
|
|
1337
|
+
declare const index_bindIdentity: typeof bindIdentity;
|
|
1338
|
+
declare const index_claim: typeof claim;
|
|
1339
|
+
declare const index_clearTransportExtractors: typeof clearTransportExtractors;
|
|
1340
|
+
declare const index_createMastercardRegistry: typeof createMastercardRegistry;
|
|
1341
|
+
declare const index_createVisaRegistry: typeof createVisaRegistry;
|
|
1342
|
+
declare const index_createWebBotAuthRegistry: typeof createWebBotAuthRegistry;
|
|
1343
|
+
declare const index_detectProtocol: typeof detectProtocol;
|
|
1344
|
+
declare const index_evaluatePaymentMethodAllowlist: typeof evaluatePaymentMethodAllowlist;
|
|
1345
|
+
declare const index_evaluateSpendingLimit: typeof evaluateSpendingLimit;
|
|
1346
|
+
declare const index_evaluateVIConstraints: typeof evaluateVIConstraints;
|
|
1347
|
+
declare const index_extractA2ACredentials: typeof extractA2ACredentials;
|
|
1348
|
+
declare const index_extractACPContext: typeof extractACPContext;
|
|
1349
|
+
declare const index_extractACPTransactionValue: typeof extractACPTransactionValue;
|
|
1350
|
+
declare const index_extractAP2Mandate: typeof extractAP2Mandate;
|
|
1351
|
+
declare const index_extractAP2Mandates: typeof extractAP2Mandates;
|
|
1352
|
+
declare const index_extractAP2TransactionValue: typeof extractAP2TransactionValue;
|
|
1353
|
+
declare const index_extractCredentialsFromProtocol: typeof extractCredentialsFromProtocol;
|
|
1354
|
+
declare const index_extractHttpCredentials: typeof extractHttpCredentials;
|
|
1355
|
+
declare const index_extractMPPContext: typeof extractMPPContext;
|
|
1356
|
+
declare const index_extractMPPFromRequest: typeof extractMPPFromRequest;
|
|
1357
|
+
declare const index_extractMPPFromResponse: typeof extractMPPFromResponse;
|
|
1358
|
+
declare const index_extractMPPTransactionValue: typeof extractMPPTransactionValue;
|
|
1359
|
+
declare const index_extractMcpCredentials: typeof extractMcpCredentials;
|
|
1360
|
+
declare const index_extractUCPContext: typeof extractUCPContext;
|
|
1361
|
+
declare const index_extractUCPTransactionValue: typeof extractUCPTransactionValue;
|
|
1362
|
+
declare const index_extractVIClaims: typeof extractVIClaims;
|
|
1363
|
+
declare const index_extractVITransactionValue: typeof extractVITransactionValue;
|
|
1364
|
+
declare const index_extractX402Context: typeof extractX402Context;
|
|
1365
|
+
declare const index_extractX402FromRequest: typeof extractX402FromRequest;
|
|
1366
|
+
declare const index_extractX402FromResponse: typeof extractX402FromResponse;
|
|
1367
|
+
declare const index_extractX402TransactionValue: typeof extractX402TransactionValue;
|
|
1368
|
+
declare const index_fetchUCPManifest: typeof fetchUCPManifest;
|
|
1369
|
+
declare const index_getTransportExtractor: typeof getTransportExtractor;
|
|
1370
|
+
declare const index_getTransportExtractors: typeof getTransportExtractors;
|
|
1371
|
+
declare const index_isStripeWebhookInformational: typeof isStripeWebhookInformational;
|
|
1372
|
+
declare const index_mapACPRequestToPurpose: typeof mapACPRequestToPurpose;
|
|
1373
|
+
declare const index_mapAP2MandateToPurpose: typeof mapAP2MandateToPurpose;
|
|
1374
|
+
declare const index_mapMPPRequestToPurpose: typeof mapMPPRequestToPurpose;
|
|
1375
|
+
declare const index_mapRFC9421TagToPurpose: typeof mapRFC9421TagToPurpose;
|
|
1376
|
+
declare const index_mapUCPRequestToPurpose: typeof mapUCPRequestToPurpose;
|
|
1377
|
+
declare const index_mapVIMandateToPurpose: typeof mapVIMandateToPurpose;
|
|
1378
|
+
declare const index_mapX402RequestToPurpose: typeof mapX402RequestToPurpose;
|
|
1379
|
+
declare const index_parseRFC9421: typeof parseRFC9421;
|
|
1380
|
+
declare const index_registerTransportExtractor: typeof registerTransportExtractor;
|
|
1381
|
+
declare const index_runCommercePipeline: typeof runCommercePipeline;
|
|
1382
|
+
declare const index_runMatchingExtractors: typeof runMatchingExtractors;
|
|
1383
|
+
declare const index_setA2AMetadata: typeof setA2AMetadata;
|
|
1384
|
+
declare const index_setHttpHeaders: typeof setHttpHeaders;
|
|
1385
|
+
declare const index_setMcpMeta: typeof setMcpMeta;
|
|
1386
|
+
declare const index_validateUCPManifest: typeof validateUCPManifest;
|
|
1387
|
+
declare const index_verifyACPSignature: typeof verifyACPSignature;
|
|
1388
|
+
declare const index_verifyAP2Chain: typeof verifyAP2Chain;
|
|
1389
|
+
declare const index_verifyMPP: typeof verifyMPP;
|
|
1390
|
+
declare const index_verifyRFC9421: typeof verifyRFC9421;
|
|
1391
|
+
declare const index_verifyStripeWebhook: typeof verifyStripeWebhook;
|
|
1392
|
+
declare const index_verifyVIChain: typeof verifyVIChain;
|
|
1393
|
+
declare namespace index {
|
|
1394
|
+
export { type index_ACPEndpoint as ACPEndpoint, type index_ACPPaymentTokenType as ACPPaymentTokenType, type index_ACPRequestContext as ACPRequestContext, type index_ACPRequestLike as ACPRequestLike, type index_ACPSignatureAlgorithm as ACPSignatureAlgorithm, type index_ACPTotal as ACPTotal, type index_ACPVerifyInput as ACPVerifyInput, type index_ACPVerifyResult as ACPVerifyResult, type index_AP2CartMandateClaims as AP2CartMandateClaims, type index_AP2ChainResult as AP2ChainResult, type index_AP2IntentMandateClaims as AP2IntentMandateClaims, type index_AP2MandateClaims as AP2MandateClaims, type index_AP2MandateTriple as AP2MandateTriple, type index_AP2MandateTripleInput as AP2MandateTripleInput, type index_AP2MandateType as AP2MandateType, type index_AP2PaymentDetailsTotal as AP2PaymentDetailsTotal, type index_AP2PaymentMandateClaims as AP2PaymentMandateClaims, type index_AP2PaymentMandateForValue as AP2PaymentMandateForValue, type index_AP2VerifyInput as AP2VerifyInput, type index_CommerceContext as CommerceContext, type index_CommercePipelineInput as CommercePipelineInput, type index_CommerceProtocol as CommerceProtocol, type index_CommercePurpose as CommercePurpose, type index_CommerceSignatureStack as CommerceSignatureStack, type index_ConstraintEvalResult as ConstraintEvalResult, type index_ConstraintKey as ConstraintKey, type index_ConstraintResult as ConstraintResult, type index_ExtractorRequestLike as ExtractorRequestLike, type index_IdentityBindingResult as IdentityBindingResult, type index_IdentityClaim as IdentityClaim, type index_IdentityResolver as IdentityResolver, type index_MPPChallengeForValue as MPPChallengeForValue, type index_MPPChallengeSummary as MPPChallengeSummary, type index_MPPCredentialSummary as MPPCredentialSummary, type index_MPPIntent as MPPIntent, type index_MPPKind as MPPKind, type index_MPPReceiptSummary as MPPReceiptSummary, type index_MPPRequestContext as MPPRequestContext, type index_MPPRequestLike as MPPRequestLike, type index_MPPResponseLike as MPPResponseLike, type index_MPPVerifyInput as MPPVerifyInput, type index_MPPVerifyResult as MPPVerifyResult, type index_ParsedRFC9421 as ParsedRFC9421, type index_PaymentMethodAllowlistInput as PaymentMethodAllowlistInput, type index_RFC9421SignatureParams as RFC9421SignatureParams, type index_RFC9421Tag as RFC9421Tag, type index_RFC9421VerifyOptions as RFC9421VerifyOptions, type index_RFC9421VerifyRequest as RFC9421VerifyRequest, type index_RFC9421VerifyResult as RFC9421VerifyResult, type index_RegistryName as RegistryName, type index_RegistryResolver as RegistryResolver, type index_ResolveContext as ResolveContext, index_STRIPE_WEBHOOK_INFORMATIONAL_EVENTS as STRIPE_WEBHOOK_INFORMATIONAL_EVENTS, type index_SpendingLimitInput as SpendingLimitInput, type index_StripeWebhookInformationalEvent as StripeWebhookInformationalEvent, type index_TransactionContext as TransactionContext, type index_TransactionValueContext as TransactionValueContext, type index_TransportExtractor as TransportExtractor, type index_UCPCheckoutContext as UCPCheckoutContext, type index_UCPManifestValidationResult as UCPManifestValidationResult, type index_UCPRequestLike as UCPRequestLike, type index_UCPTotal as UCPTotal, type index_VIAllowedParty as VIAllowedParty, type index_VIBudgetLimit as VIBudgetLimit, type index_VIClaimsForValue as VIClaimsForValue, type index_VIConstraintEvalInput as VIConstraintEvalInput, type index_VIConstraints as VIConstraints, type index_VIExecutionMode as VIExecutionMode, type index_VIExtractedClaims as VIExtractedClaims, type index_VILayer as VILayer, type index_VILineItem as VILineItem, type index_VIMandateType as VIMandateType, type index_VIPaymentAmount as VIPaymentAmount, type index_VIRecurrence as VIRecurrence, type index_VIVerifyInput as VIVerifyInput, type index_VIVerifyResult as VIVerifyResult, type index_VerifyStripeWebhookOptions as VerifyStripeWebhookOptions, type index_VerifyStripeWebhookResult as VerifyStripeWebhookResult, type index_X402Kind as X402Kind, type index_X402RequestContext as X402RequestContext, type index_X402RequestForValue as X402RequestForValue, type index_X402RequestLike as X402RequestLike, type index_X402RequirementsSummary as X402RequirementsSummary, type index_X402ResponseLike as X402ResponseLike, index_applyCredentials as applyCredentials, index_bindIdentity as bindIdentity, index_claim as claim, index_clearTransportExtractors as clearTransportExtractors, index_createMastercardRegistry as createMastercardRegistry, index_createVisaRegistry as createVisaRegistry, index_createWebBotAuthRegistry as createWebBotAuthRegistry, index_detectProtocol as detectProtocol, index_evaluatePaymentMethodAllowlist as evaluatePaymentMethodAllowlist, index_evaluateSpendingLimit as evaluateSpendingLimit, index_evaluateVIConstraints as evaluateVIConstraints, index_extractA2ACredentials as extractA2ACredentials, index_extractACPContext as extractACPContext, index_extractACPTransactionValue as extractACPTransactionValue, index_extractAP2Mandate as extractAP2Mandate, index_extractAP2Mandates as extractAP2Mandates, index_extractAP2TransactionValue as extractAP2TransactionValue, index_extractCredentialsFromProtocol as extractCredentialsFromProtocol, index_extractHttpCredentials as extractHttpCredentials, index_extractMPPContext as extractMPPContext, index_extractMPPFromRequest as extractMPPFromRequest, index_extractMPPFromResponse as extractMPPFromResponse, index_extractMPPTransactionValue as extractMPPTransactionValue, index_extractMcpCredentials as extractMcpCredentials, index_extractUCPContext as extractUCPContext, index_extractUCPTransactionValue as extractUCPTransactionValue, index_extractVIClaims as extractVIClaims, index_extractVITransactionValue as extractVITransactionValue, index_extractX402Context as extractX402Context, index_extractX402FromRequest as extractX402FromRequest, index_extractX402FromResponse as extractX402FromResponse, index_extractX402TransactionValue as extractX402TransactionValue, index_fetchUCPManifest as fetchUCPManifest, index_getTransportExtractor as getTransportExtractor, index_getTransportExtractors as getTransportExtractors, index_isStripeWebhookInformational as isStripeWebhookInformational, index_mapACPRequestToPurpose as mapACPRequestToPurpose, index_mapAP2MandateToPurpose as mapAP2MandateToPurpose, index_mapMPPRequestToPurpose as mapMPPRequestToPurpose, index_mapRFC9421TagToPurpose as mapRFC9421TagToPurpose, index_mapUCPRequestToPurpose as mapUCPRequestToPurpose, index_mapVIMandateToPurpose as mapVIMandateToPurpose, index_mapX402RequestToPurpose as mapX402RequestToPurpose, index_parseRFC9421 as parseRFC9421, index_registerTransportExtractor as registerTransportExtractor, index_runCommercePipeline as runCommercePipeline, index_runMatchingExtractors as runMatchingExtractors, index_setA2AMetadata as setA2AMetadata, index_setHttpHeaders as setHttpHeaders, index_setMcpMeta as setMcpMeta, index_validateUCPManifest as validateUCPManifest, index_verifyACPSignature as verifyACPSignature, index_verifyAP2Chain as verifyAP2Chain, index_verifyMPP as verifyMPP, index_verifyRFC9421 as verifyRFC9421, index_verifyStripeWebhook as verifyStripeWebhook, index_verifyVIChain as verifyVIChain };
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
export { STRIPE_WEBHOOK_INFORMATIONAL_EVENTS as $, type ACPEndpoint as A, type IdentityClaim as B, type CommerceContext as C, type IdentityResolver as D, type ExtractorRequestLike as E, type MPPChallengeSummary as F, type MPPCredentialSummary as G, type MPPIntent as H, type IdentityBindingResult as I, type MPPKind as J, type MPPReceiptSummary as K, type MPPRequestContext as L, type MPPChallengeForValue as M, type MPPRequestLike as N, type MPPResponseLike as O, type MPPVerifyInput as P, type MPPVerifyResult as Q, type ParsedRFC9421 as R, type PaymentMethodAllowlistInput as S, type RFC9421SignatureParams as T, type RFC9421Tag as U, type RFC9421VerifyOptions as V, type RFC9421VerifyRequest as W, type RFC9421VerifyResult as X, type RegistryName as Y, type RegistryResolver as Z, type ResolveContext as _, type ACPPaymentTokenType as a, fetchUCPManifest as a$, type SpendingLimitInput as a0, type StripeWebhookInformationalEvent as a1, type TransactionContext as a2, type TransactionValueContext as a3, type TransportExtractor as a4, type UCPCheckoutContext as a5, type UCPManifestValidationResult as a6, type UCPRequestLike as a7, type UCPTotal as a8, type VIAllowedParty as a9, createVisaRegistry as aA, createWebBotAuthRegistry as aB, detectProtocol as aC, evaluatePaymentMethodAllowlist as aD, evaluateSpendingLimit as aE, evaluateVIConstraints as aF, extractA2ACredentials as aG, extractACPContext as aH, extractACPTransactionValue as aI, extractAP2Mandate as aJ, extractAP2Mandates as aK, extractAP2TransactionValue as aL, extractCredentialsFromProtocol as aM, extractHttpCredentials as aN, extractMPPContext as aO, extractMPPFromRequest as aP, extractMPPFromResponse as aQ, extractMPPTransactionValue as aR, extractMcpCredentials as aS, extractUCPContext as aT, extractUCPTransactionValue as aU, extractVIClaims as aV, extractVITransactionValue as aW, extractX402Context as aX, extractX402FromRequest as aY, extractX402FromResponse as aZ, extractX402TransactionValue as a_, type VIBudgetLimit as aa, type VIClaimsForValue as ab, type VIConstraintEvalInput as ac, type VIConstraints as ad, type VIExecutionMode as ae, type VIExtractedClaims as af, type VILayer as ag, type VILineItem as ah, type VIMandateType as ai, type VIPaymentAmount as aj, type VIRecurrence as ak, type VIVerifyInput as al, type VIVerifyResult as am, type VerifyStripeWebhookOptions as an, type VerifyStripeWebhookResult as ao, type X402Kind as ap, type X402RequestContext as aq, type X402RequestForValue as ar, type X402RequestLike as as, type X402RequirementsSummary as at, type X402ResponseLike as au, applyCredentials as av, bindIdentity as aw, claim as ax, clearTransportExtractors as ay, createMastercardRegistry as az, type ACPRequestContext as b, getTransportExtractor as b0, getTransportExtractors as b1, isStripeWebhookInformational as b2, mapACPRequestToPurpose as b3, mapAP2MandateToPurpose as b4, mapMPPRequestToPurpose as b5, mapRFC9421TagToPurpose as b6, mapUCPRequestToPurpose as b7, mapVIMandateToPurpose as b8, mapX402RequestToPurpose as b9, parseRFC9421 as ba, registerTransportExtractor as bb, runCommercePipeline as bc, runMatchingExtractors as bd, setA2AMetadata as be, setHttpHeaders as bf, setMcpMeta as bg, validateUCPManifest as bh, verifyACPSignature as bi, verifyAP2Chain as bj, verifyMPP as bk, verifyRFC9421 as bl, verifyStripeWebhook as bm, verifyVIChain as bn, type ACPRequestLike as c, type ACPSignatureAlgorithm as d, type ACPTotal as e, type ACPVerifyInput as f, type ACPVerifyResult as g, type AP2CartMandateClaims as h, index as i, type AP2ChainResult as j, type AP2IntentMandateClaims as k, type AP2MandateClaims as l, type AP2MandateTriple as m, type AP2MandateTripleInput as n, type AP2MandateType as o, type AP2PaymentDetailsTotal as p, type AP2PaymentMandateClaims as q, type AP2PaymentMandateForValue as r, type AP2VerifyInput as s, type CommercePipelineInput as t, type CommerceProtocol as u, type CommercePurpose as v, type CommerceSignatureStack as w, type ConstraintEvalResult as x, type ConstraintKey as y, type ConstraintResult as z };
|