@astrasyncai/verification-gateway 5.14.0 → 5.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -17
- package/dist/adapters/express.d.mts +1 -1
- package/dist/adapters/express.d.ts +1 -1
- package/dist/adapters/express.js +477 -240
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +477 -240
- package/dist/adapters/express.mjs.map +1 -1
- package/dist/adapters/mcp.d.mts +1 -1
- package/dist/adapters/mcp.d.ts +1 -1
- package/dist/adapters/mcp.js +20 -6
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +20 -6
- 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 +460 -239
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +460 -239
- package/dist/adapters/nextjs.mjs.map +1 -1
- package/dist/adapters/sdk.d.mts +18 -10
- package/dist/adapters/sdk.d.ts +18 -10
- package/dist/adapters/sdk.js +80 -23
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +80 -23
- package/dist/adapters/sdk.mjs.map +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 +55 -11
- package/dist/bin/astrasync-codex-hook.js +55 -11
- package/dist/bin/astrasync-guard.js +55 -11
- package/dist/bin/astrasync.js +288 -33
- package/dist/browser/background.js +50 -6
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +60 -6
- 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 +55 -11
- package/dist/codex/index.js.map +1 -1
- package/dist/codex/index.mjs +65 -11
- package/dist/codex/index.mjs.map +1 -1
- package/dist/cursor/extension.js +55 -11
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +65 -11
- package/dist/cursor/extension.mjs.map +1 -1
- package/dist/edge-config.d.mts +31 -2
- package/dist/edge-config.d.ts +31 -2
- package/dist/edge-config.js +35 -5
- package/dist/edge-config.js.map +1 -1
- package/dist/edge-config.mjs +32 -4
- package/dist/edge-config.mjs.map +1 -1
- package/dist/edge-core/index.d.mts +11 -2
- package/dist/edge-core/index.d.ts +11 -2
- package/dist/edge-core/index.js +93 -10
- package/dist/edge-core/index.js.map +1 -1
- package/dist/edge-core/index.mjs +91 -10
- package/dist/edge-core/index.mjs.map +1 -1
- package/dist/gateway/gateway.js +50 -6
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +60 -6
- 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 +1314 -34
- package/dist/index.d.ts +1314 -34
- package/dist/index.js +5116 -2612
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5063 -2614
- package/dist/index.mjs.map +1 -1
- package/dist/registration/index.d.mts +28 -2
- package/dist/registration/index.d.ts +28 -2
- package/dist/registration/index.js +18 -3
- package/dist/registration/index.js.map +1 -1
- package/dist/registration/index.mjs +15 -2
- package/dist/registration/index.mjs.map +1 -1
- package/dist/transport/index.d.mts +7 -5
- package/dist/transport/index.d.ts +7 -5
- package/dist/transport/index.js +61 -5
- package/dist/transport/index.js.map +1 -1
- package/dist/transport/index.mjs +67 -11
- package/dist/transport/index.mjs.map +1 -1
- package/dist/{types-C_b4QTyO.d.ts → types-DtJjlW4O.d.ts} +104 -10
- package/dist/{types-BCkwBA84.d.mts → types-Dxf9DBpr.d.mts} +106 -12
- package/dist/{types-BCkwBA84.d.ts → types-Dxf9DBpr.d.ts} +106 -12
- package/dist/{types-DlshIIR-.d.mts → types-Eg6VoBNH.d.mts} +104 -10
- package/dist/ui/index.d.mts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/verify.d.mts +1 -1
- package/dist/verify.d.ts +1 -1
- package/dist/verify.js +20 -6
- package/dist/verify.js.map +1 -1
- package/dist/verify.mjs +20 -6
- package/dist/verify.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -169,6 +169,30 @@ interface VerifiedAgent {
|
|
|
169
169
|
blockchainAnchored: boolean;
|
|
170
170
|
/** Agent status */
|
|
171
171
|
status: 'active' | 'inactive' | 'suspended' | 'migrating' | 'terminated' | 'retired';
|
|
172
|
+
/**
|
|
173
|
+
* 5.15.0: the protocol identities the agent declared at registration (its
|
|
174
|
+
* shared signing key, UCP profile, Web Bot Auth key directory, x402 wallet,
|
|
175
|
+
* network agent ids). Bind incoming protocol requests to these — e.g.
|
|
176
|
+
* {@link checkUcpAgentBinding} rejects a `UCP-Agent` profile that isn't the
|
|
177
|
+
* agent's. Identities AstraSync failed to verify are never included.
|
|
178
|
+
*/
|
|
179
|
+
protocolIdentities?: AgentProtocolIdentities;
|
|
180
|
+
}
|
|
181
|
+
interface AgentProtocolIdentities {
|
|
182
|
+
/** Shared signing key (AP2 / VI `cnf`, RFC 9421). `thumbprint` = RFC 7638. */
|
|
183
|
+
agentKey?: {
|
|
184
|
+
kid: string | null;
|
|
185
|
+
thumbprint: string | null;
|
|
186
|
+
jwk: Record<string, unknown>;
|
|
187
|
+
};
|
|
188
|
+
ucpProfile?: string;
|
|
189
|
+
webBotAuthKeyDirectory?: string;
|
|
190
|
+
a2aCard?: string;
|
|
191
|
+
x402Wallet?: string;
|
|
192
|
+
visaAgentId?: string;
|
|
193
|
+
mastercardAgentId?: string;
|
|
194
|
+
/** Protocols whose identity AstraSync checked successfully. */
|
|
195
|
+
verified: string[];
|
|
172
196
|
}
|
|
173
197
|
/**
|
|
174
198
|
* Verified developer (KYD) information
|
|
@@ -253,6 +277,13 @@ interface GuidanceInfo {
|
|
|
253
277
|
interface StepUpApprovalInfo {
|
|
254
278
|
approvalId: string;
|
|
255
279
|
pollUrl: string;
|
|
280
|
+
/**
|
|
281
|
+
* 5.15.0: absolute https URL of the buyer-facing approval page. A UCP
|
|
282
|
+
* merchant returns it as `continue_url` with status `requires_escalation`;
|
|
283
|
+
* after the buyer approves, complete the same checkout again and the
|
|
284
|
+
* approval is redeemed once. Absent from backends older than 27.9.
|
|
285
|
+
*/
|
|
286
|
+
approvalUrl?: string;
|
|
256
287
|
expiresAt: string;
|
|
257
288
|
}
|
|
258
289
|
/**
|
|
@@ -428,19 +459,19 @@ interface VerificationResult {
|
|
|
428
459
|
/** Settlement voucher (present on clean merchant-mediated grants with a verified wallet). */
|
|
429
460
|
settlement?: SettlementArtifact;
|
|
430
461
|
/**
|
|
431
|
-
*
|
|
432
|
-
*
|
|
433
|
-
*
|
|
434
|
-
*
|
|
435
|
-
*
|
|
436
|
-
* `no_instrument` = policy passed but the owner has
|
|
437
|
-
*
|
|
462
|
+
* Sanitized order outcome for a purchase leg. 5.14.1: AstraSync never
|
|
463
|
+
* charges — every purchase grant records an order and hands YOU the
|
|
464
|
+
* settlement artifact, so the status is `pending_merchant` (with
|
|
465
|
+
* `orderId`): charge the `settlementToken` (card, first-party tenant) or
|
|
466
|
+
* redeem the `settlement` voucher (stablecoin), then `reportSettlement()`.
|
|
467
|
+
* `no_instrument` = policy passed but the owner has nothing usable on file
|
|
468
|
+
* (steer the user to add one via onboarding).
|
|
438
469
|
*/
|
|
439
470
|
settlementOutcome?: SettlementOutcomeInfo;
|
|
440
471
|
/**
|
|
441
|
-
*
|
|
442
|
-
*
|
|
443
|
-
*
|
|
472
|
+
* Card settlement token. Present on a card purchase at a first-party
|
|
473
|
+
* storefront (our Stripe tenant) — 5.14.1: always, there is no charge-here
|
|
474
|
+
* mode. YOUR server charges with this material on the shared Stripe
|
|
444
475
|
* account and reports the outcome via `client.reportSettlement()`.
|
|
445
476
|
* MERCHANT-ONLY lane: never expose it to the agent plane, never log it,
|
|
446
477
|
* never echo it back over the bridge handoff (the bridge strips it
|
|
@@ -461,6 +492,29 @@ interface VerificationResult {
|
|
|
461
492
|
* confirm handoff body wins over `fulfilment.email` (the platform default).
|
|
462
493
|
*/
|
|
463
494
|
fulfilment?: FulfilmentInfo;
|
|
495
|
+
/**
|
|
496
|
+
* 5.15.0: AP2 v0.2 mandates AstraSync issued for this purchase (merchant
|
|
497
|
+
* lane — never forward to the agent). `mode: 'closed'` on a purchase leg
|
|
498
|
+
* (Checkout + Payment, bound to your `checkoutJwt`), `'open'` on a quote
|
|
499
|
+
* leg for an agent with a registered key. Verify with `verifyAp2Mandate()`
|
|
500
|
+
* against AstraSync's JWKS (`kid`).
|
|
501
|
+
*/
|
|
502
|
+
mandates?: AstraSyncMandates;
|
|
503
|
+
/**
|
|
504
|
+
* 5.15.0: a KYAPay `kya+jwt` identity token AstraSync issued for this agent
|
|
505
|
+
* at your endpoint (commerce legs; merchant lane). `hid.email` is where to
|
|
506
|
+
* send the receipt. Verify with `verifyKyaPayTokens()` (issuer = the
|
|
507
|
+
* AstraSync origin, audience = your ASTRAE-id).
|
|
508
|
+
*/
|
|
509
|
+
kyaToken?: string;
|
|
510
|
+
/**
|
|
511
|
+
* 5.15.0: A-Comm Evidence Protocol (AEP v1.0.3-rc.2) artifact payloads for
|
|
512
|
+
* your AEP chain — present when your endpoint lists `aep`: `policy` (section 3.4),
|
|
513
|
+
* `delegation` (section 3.9 protocol_metadata: kya_identity, consumer_authorization)
|
|
514
|
+
* and, for AstraSync bridge traffic, platform-countersigned `intents` (section 8.7).
|
|
515
|
+
* Append them with `AepChain` (your Ed25519 key). Merchant lane only.
|
|
516
|
+
*/
|
|
517
|
+
aep?: AstraSyncAepEvidence;
|
|
464
518
|
/** Timestamp of verification */
|
|
465
519
|
verifiedAt: Date;
|
|
466
520
|
/** TTL for this result (seconds) */
|
|
@@ -612,6 +666,12 @@ interface VerificationRequest {
|
|
|
612
666
|
* key charge the owner's card at most once. Omit for raw one-shot confirms.
|
|
613
667
|
*/
|
|
614
668
|
checkoutSessionId?: string;
|
|
669
|
+
/**
|
|
670
|
+
* 5.15.0: your signed checkout as a compact JWS (AP2 `checkout_jwt`). At a
|
|
671
|
+
* merchant whose endpoint lists `ap2`, a granted purchase leg returns
|
|
672
|
+
* `mandates` — closed AP2 Checkout + Payment mandates bound to it.
|
|
673
|
+
*/
|
|
674
|
+
checkoutJwt?: string;
|
|
615
675
|
/**
|
|
616
676
|
* 5.3.0 (astra-pay): the checkout's authoritative line items, forwarded on
|
|
617
677
|
* the confirm leg for the ORDER plane (receipts + digital-goods fulfillment
|
|
@@ -875,5 +935,39 @@ interface TokenGuidance {
|
|
|
875
935
|
scopeConvention: 'astrasync-canonical';
|
|
876
936
|
};
|
|
877
937
|
}
|
|
938
|
+
/** 5.15.0: AP2 mandates AstraSync issued (see VerificationResult.mandates). */
|
|
939
|
+
interface AstraSyncMandates {
|
|
940
|
+
kid: string;
|
|
941
|
+
mode: 'closed' | 'open';
|
|
942
|
+
/** Delegate SD-JWT: mandate.checkout.1 / mandate.checkout.open.1. */
|
|
943
|
+
checkout: string;
|
|
944
|
+
/** Delegate SD-JWT: mandate.payment.1 / mandate.payment.open.1. */
|
|
945
|
+
payment?: string;
|
|
946
|
+
}
|
|
947
|
+
/** 5.15.0: AstraSync's AEP evidence (see VerificationResult.aep). */
|
|
948
|
+
interface AstraSyncAepEvidence {
|
|
949
|
+
spec_version: string;
|
|
950
|
+
policy: {
|
|
951
|
+
artifact_type: 'policy';
|
|
952
|
+
actor_type: 'merchant';
|
|
953
|
+
payload: Record<string, unknown>;
|
|
954
|
+
};
|
|
955
|
+
delegation?: {
|
|
956
|
+
artifact_type: 'delegation';
|
|
957
|
+
actor_type: 'agent';
|
|
958
|
+
actor_id: string;
|
|
959
|
+
payload: {
|
|
960
|
+
protocol_metadata: Record<string, unknown>;
|
|
961
|
+
};
|
|
962
|
+
};
|
|
963
|
+
intents?: Array<{
|
|
964
|
+
artifact_type: 'intent';
|
|
965
|
+
actor_type: 'agent';
|
|
966
|
+
actor_id: string;
|
|
967
|
+
payload: Record<string, unknown>;
|
|
968
|
+
/** Compact JWS (ES256) over the canonical payload; key in AstraSync's JWKS. */
|
|
969
|
+
platform_countersignature: string;
|
|
970
|
+
}>;
|
|
971
|
+
}
|
|
878
972
|
|
|
879
973
|
export type { AgentCredentials as A, CommerceArtifactsPayload as C, GatewayConfig as G, TokenGuidance as T, VerificationRequest as V, AttemptReport as a, CounterpartyType as b, VerificationResult as c };
|
|
@@ -227,6 +227,30 @@ interface VerifiedAgent {
|
|
|
227
227
|
blockchainAnchored: boolean;
|
|
228
228
|
/** Agent status */
|
|
229
229
|
status: 'active' | 'inactive' | 'suspended' | 'migrating' | 'terminated' | 'retired';
|
|
230
|
+
/**
|
|
231
|
+
* 5.15.0: the protocol identities the agent declared at registration (its
|
|
232
|
+
* shared signing key, UCP profile, Web Bot Auth key directory, x402 wallet,
|
|
233
|
+
* network agent ids). Bind incoming protocol requests to these — e.g.
|
|
234
|
+
* {@link checkUcpAgentBinding} rejects a `UCP-Agent` profile that isn't the
|
|
235
|
+
* agent's. Identities AstraSync failed to verify are never included.
|
|
236
|
+
*/
|
|
237
|
+
protocolIdentities?: AgentProtocolIdentities;
|
|
238
|
+
}
|
|
239
|
+
interface AgentProtocolIdentities {
|
|
240
|
+
/** Shared signing key (AP2 / VI `cnf`, RFC 9421). `thumbprint` = RFC 7638. */
|
|
241
|
+
agentKey?: {
|
|
242
|
+
kid: string | null;
|
|
243
|
+
thumbprint: string | null;
|
|
244
|
+
jwk: Record<string, unknown>;
|
|
245
|
+
};
|
|
246
|
+
ucpProfile?: string;
|
|
247
|
+
webBotAuthKeyDirectory?: string;
|
|
248
|
+
a2aCard?: string;
|
|
249
|
+
x402Wallet?: string;
|
|
250
|
+
visaAgentId?: string;
|
|
251
|
+
mastercardAgentId?: string;
|
|
252
|
+
/** Protocols whose identity AstraSync checked successfully. */
|
|
253
|
+
verified: string[];
|
|
230
254
|
}
|
|
231
255
|
/**
|
|
232
256
|
* Verified developer (KYD) information
|
|
@@ -311,6 +335,13 @@ interface GuidanceInfo {
|
|
|
311
335
|
interface StepUpApprovalInfo {
|
|
312
336
|
approvalId: string;
|
|
313
337
|
pollUrl: string;
|
|
338
|
+
/**
|
|
339
|
+
* 5.15.0: absolute https URL of the buyer-facing approval page. A UCP
|
|
340
|
+
* merchant returns it as `continue_url` with status `requires_escalation`;
|
|
341
|
+
* after the buyer approves, complete the same checkout again and the
|
|
342
|
+
* approval is redeemed once. Absent from backends older than 27.9.
|
|
343
|
+
*/
|
|
344
|
+
approvalUrl?: string;
|
|
314
345
|
expiresAt: string;
|
|
315
346
|
}
|
|
316
347
|
/**
|
|
@@ -486,19 +517,19 @@ interface VerificationResult {
|
|
|
486
517
|
/** Settlement voucher (present on clean merchant-mediated grants with a verified wallet). */
|
|
487
518
|
settlement?: SettlementArtifact;
|
|
488
519
|
/**
|
|
489
|
-
*
|
|
490
|
-
*
|
|
491
|
-
*
|
|
492
|
-
*
|
|
493
|
-
*
|
|
494
|
-
* `no_instrument` = policy passed but the owner has
|
|
495
|
-
*
|
|
520
|
+
* Sanitized order outcome for a purchase leg. 5.14.1: AstraSync never
|
|
521
|
+
* charges — every purchase grant records an order and hands YOU the
|
|
522
|
+
* settlement artifact, so the status is `pending_merchant` (with
|
|
523
|
+
* `orderId`): charge the `settlementToken` (card, first-party tenant) or
|
|
524
|
+
* redeem the `settlement` voucher (stablecoin), then `reportSettlement()`.
|
|
525
|
+
* `no_instrument` = policy passed but the owner has nothing usable on file
|
|
526
|
+
* (steer the user to add one via onboarding).
|
|
496
527
|
*/
|
|
497
528
|
settlementOutcome?: SettlementOutcomeInfo;
|
|
498
529
|
/**
|
|
499
|
-
*
|
|
500
|
-
*
|
|
501
|
-
*
|
|
530
|
+
* Card settlement token. Present on a card purchase at a first-party
|
|
531
|
+
* storefront (our Stripe tenant) — 5.14.1: always, there is no charge-here
|
|
532
|
+
* mode. YOUR server charges with this material on the shared Stripe
|
|
502
533
|
* account and reports the outcome via `client.reportSettlement()`.
|
|
503
534
|
* MERCHANT-ONLY lane: never expose it to the agent plane, never log it,
|
|
504
535
|
* never echo it back over the bridge handoff (the bridge strips it
|
|
@@ -519,6 +550,29 @@ interface VerificationResult {
|
|
|
519
550
|
* confirm handoff body wins over `fulfilment.email` (the platform default).
|
|
520
551
|
*/
|
|
521
552
|
fulfilment?: FulfilmentInfo;
|
|
553
|
+
/**
|
|
554
|
+
* 5.15.0: AP2 v0.2 mandates AstraSync issued for this purchase (merchant
|
|
555
|
+
* lane — never forward to the agent). `mode: 'closed'` on a purchase leg
|
|
556
|
+
* (Checkout + Payment, bound to your `checkoutJwt`), `'open'` on a quote
|
|
557
|
+
* leg for an agent with a registered key. Verify with `verifyAp2Mandate()`
|
|
558
|
+
* against AstraSync's JWKS (`kid`).
|
|
559
|
+
*/
|
|
560
|
+
mandates?: AstraSyncMandates;
|
|
561
|
+
/**
|
|
562
|
+
* 5.15.0: a KYAPay `kya+jwt` identity token AstraSync issued for this agent
|
|
563
|
+
* at your endpoint (commerce legs; merchant lane). `hid.email` is where to
|
|
564
|
+
* send the receipt. Verify with `verifyKyaPayTokens()` (issuer = the
|
|
565
|
+
* AstraSync origin, audience = your ASTRAE-id).
|
|
566
|
+
*/
|
|
567
|
+
kyaToken?: string;
|
|
568
|
+
/**
|
|
569
|
+
* 5.15.0: A-Comm Evidence Protocol (AEP v1.0.3-rc.2) artifact payloads for
|
|
570
|
+
* your AEP chain — present when your endpoint lists `aep`: `policy` (section 3.4),
|
|
571
|
+
* `delegation` (section 3.9 protocol_metadata: kya_identity, consumer_authorization)
|
|
572
|
+
* and, for AstraSync bridge traffic, platform-countersigned `intents` (section 8.7).
|
|
573
|
+
* Append them with `AepChain` (your Ed25519 key). Merchant lane only.
|
|
574
|
+
*/
|
|
575
|
+
aep?: AstraSyncAepEvidence;
|
|
522
576
|
/** Timestamp of verification */
|
|
523
577
|
verifiedAt: Date;
|
|
524
578
|
/** TTL for this result (seconds) */
|
|
@@ -670,6 +724,12 @@ interface VerificationRequest {
|
|
|
670
724
|
* key charge the owner's card at most once. Omit for raw one-shot confirms.
|
|
671
725
|
*/
|
|
672
726
|
checkoutSessionId?: string;
|
|
727
|
+
/**
|
|
728
|
+
* 5.15.0: your signed checkout as a compact JWS (AP2 `checkout_jwt`). At a
|
|
729
|
+
* merchant whose endpoint lists `ap2`, a granted purchase leg returns
|
|
730
|
+
* `mandates` — closed AP2 Checkout + Payment mandates bound to it.
|
|
731
|
+
*/
|
|
732
|
+
checkoutJwt?: string;
|
|
673
733
|
/**
|
|
674
734
|
* 5.3.0 (astra-pay): the checkout's authoritative line items, forwarded on
|
|
675
735
|
* the confirm leg for the ORDER plane (receipts + digital-goods fulfillment
|
|
@@ -913,7 +973,7 @@ interface ExpressMiddlewareOptions extends GatewayConfig {
|
|
|
913
973
|
onDenied?: (result: VerificationResult, req: unknown, res: unknown) => void;
|
|
914
974
|
/** Automatically create sessions and record grant/deny decisions (default: true) */
|
|
915
975
|
recordDecisions?: boolean;
|
|
916
|
-
/**
|
|
976
|
+
/** Ask for a runtime challenge on every verify-access call (default: false — opt-in, round 27.8) */
|
|
917
977
|
enableRuntimeChallenge?: boolean;
|
|
918
978
|
/**
|
|
919
979
|
* Refresh interval (ms) for the remote-fetched route policy. Default:
|
|
@@ -1010,7 +1070,7 @@ interface NextJsMiddlewareOptions extends GatewayConfig {
|
|
|
1010
1070
|
message?: string;
|
|
1011
1071
|
allowGuestAccess?: boolean;
|
|
1012
1072
|
};
|
|
1013
|
-
/**
|
|
1073
|
+
/** Ask for a runtime challenge on every verify-access call (default: false — opt-in, round 27.8) */
|
|
1014
1074
|
enableRuntimeChallenge?: boolean;
|
|
1015
1075
|
/**
|
|
1016
1076
|
* Emit a fire-and-forget beacon for bot- and agent-shaped traffic that
|
|
@@ -1076,5 +1136,39 @@ interface VerificationInterstitialProps {
|
|
|
1076
1136
|
/** Custom styles */
|
|
1077
1137
|
className?: string;
|
|
1078
1138
|
}
|
|
1139
|
+
/** 5.15.0: AP2 mandates AstraSync issued (see VerificationResult.mandates). */
|
|
1140
|
+
interface AstraSyncMandates {
|
|
1141
|
+
kid: string;
|
|
1142
|
+
mode: 'closed' | 'open';
|
|
1143
|
+
/** Delegate SD-JWT: mandate.checkout.1 / mandate.checkout.open.1. */
|
|
1144
|
+
checkout: string;
|
|
1145
|
+
/** Delegate SD-JWT: mandate.payment.1 / mandate.payment.open.1. */
|
|
1146
|
+
payment?: string;
|
|
1147
|
+
}
|
|
1148
|
+
/** 5.15.0: AstraSync's AEP evidence (see VerificationResult.aep). */
|
|
1149
|
+
interface AstraSyncAepEvidence {
|
|
1150
|
+
spec_version: string;
|
|
1151
|
+
policy: {
|
|
1152
|
+
artifact_type: 'policy';
|
|
1153
|
+
actor_type: 'merchant';
|
|
1154
|
+
payload: Record<string, unknown>;
|
|
1155
|
+
};
|
|
1156
|
+
delegation?: {
|
|
1157
|
+
artifact_type: 'delegation';
|
|
1158
|
+
actor_type: 'agent';
|
|
1159
|
+
actor_id: string;
|
|
1160
|
+
payload: {
|
|
1161
|
+
protocol_metadata: Record<string, unknown>;
|
|
1162
|
+
};
|
|
1163
|
+
};
|
|
1164
|
+
intents?: Array<{
|
|
1165
|
+
artifact_type: 'intent';
|
|
1166
|
+
actor_type: 'agent';
|
|
1167
|
+
actor_id: string;
|
|
1168
|
+
payload: Record<string, unknown>;
|
|
1169
|
+
/** Compact JWS (ES256) over the canonical payload; key in AstraSync's JWKS. */
|
|
1170
|
+
platform_countersignature: string;
|
|
1171
|
+
}>;
|
|
1172
|
+
}
|
|
1079
1173
|
|
|
1080
1174
|
export type { AgentCredentials as A, ExpressMiddlewareOptions as E, GatewayConfig as G, NextJsMiddlewareOptions as N, SDKOptions as S, TrustLevel as T, VerificationInterstitialProps as V, AstraSyncCredentials as a, GuidanceInfo as b, VerificationRequest as c, VerificationResult as d };
|
|
@@ -227,6 +227,30 @@ interface VerifiedAgent {
|
|
|
227
227
|
blockchainAnchored: boolean;
|
|
228
228
|
/** Agent status */
|
|
229
229
|
status: 'active' | 'inactive' | 'suspended' | 'migrating' | 'terminated' | 'retired';
|
|
230
|
+
/**
|
|
231
|
+
* 5.15.0: the protocol identities the agent declared at registration (its
|
|
232
|
+
* shared signing key, UCP profile, Web Bot Auth key directory, x402 wallet,
|
|
233
|
+
* network agent ids). Bind incoming protocol requests to these — e.g.
|
|
234
|
+
* {@link checkUcpAgentBinding} rejects a `UCP-Agent` profile that isn't the
|
|
235
|
+
* agent's. Identities AstraSync failed to verify are never included.
|
|
236
|
+
*/
|
|
237
|
+
protocolIdentities?: AgentProtocolIdentities;
|
|
238
|
+
}
|
|
239
|
+
interface AgentProtocolIdentities {
|
|
240
|
+
/** Shared signing key (AP2 / VI `cnf`, RFC 9421). `thumbprint` = RFC 7638. */
|
|
241
|
+
agentKey?: {
|
|
242
|
+
kid: string | null;
|
|
243
|
+
thumbprint: string | null;
|
|
244
|
+
jwk: Record<string, unknown>;
|
|
245
|
+
};
|
|
246
|
+
ucpProfile?: string;
|
|
247
|
+
webBotAuthKeyDirectory?: string;
|
|
248
|
+
a2aCard?: string;
|
|
249
|
+
x402Wallet?: string;
|
|
250
|
+
visaAgentId?: string;
|
|
251
|
+
mastercardAgentId?: string;
|
|
252
|
+
/** Protocols whose identity AstraSync checked successfully. */
|
|
253
|
+
verified: string[];
|
|
230
254
|
}
|
|
231
255
|
/**
|
|
232
256
|
* Verified developer (KYD) information
|
|
@@ -311,6 +335,13 @@ interface GuidanceInfo {
|
|
|
311
335
|
interface StepUpApprovalInfo {
|
|
312
336
|
approvalId: string;
|
|
313
337
|
pollUrl: string;
|
|
338
|
+
/**
|
|
339
|
+
* 5.15.0: absolute https URL of the buyer-facing approval page. A UCP
|
|
340
|
+
* merchant returns it as `continue_url` with status `requires_escalation`;
|
|
341
|
+
* after the buyer approves, complete the same checkout again and the
|
|
342
|
+
* approval is redeemed once. Absent from backends older than 27.9.
|
|
343
|
+
*/
|
|
344
|
+
approvalUrl?: string;
|
|
314
345
|
expiresAt: string;
|
|
315
346
|
}
|
|
316
347
|
/**
|
|
@@ -486,19 +517,19 @@ interface VerificationResult {
|
|
|
486
517
|
/** Settlement voucher (present on clean merchant-mediated grants with a verified wallet). */
|
|
487
518
|
settlement?: SettlementArtifact;
|
|
488
519
|
/**
|
|
489
|
-
*
|
|
490
|
-
*
|
|
491
|
-
*
|
|
492
|
-
*
|
|
493
|
-
*
|
|
494
|
-
* `no_instrument` = policy passed but the owner has
|
|
495
|
-
*
|
|
520
|
+
* Sanitized order outcome for a purchase leg. 5.14.1: AstraSync never
|
|
521
|
+
* charges — every purchase grant records an order and hands YOU the
|
|
522
|
+
* settlement artifact, so the status is `pending_merchant` (with
|
|
523
|
+
* `orderId`): charge the `settlementToken` (card, first-party tenant) or
|
|
524
|
+
* redeem the `settlement` voucher (stablecoin), then `reportSettlement()`.
|
|
525
|
+
* `no_instrument` = policy passed but the owner has nothing usable on file
|
|
526
|
+
* (steer the user to add one via onboarding).
|
|
496
527
|
*/
|
|
497
528
|
settlementOutcome?: SettlementOutcomeInfo;
|
|
498
529
|
/**
|
|
499
|
-
*
|
|
500
|
-
*
|
|
501
|
-
*
|
|
530
|
+
* Card settlement token. Present on a card purchase at a first-party
|
|
531
|
+
* storefront (our Stripe tenant) — 5.14.1: always, there is no charge-here
|
|
532
|
+
* mode. YOUR server charges with this material on the shared Stripe
|
|
502
533
|
* account and reports the outcome via `client.reportSettlement()`.
|
|
503
534
|
* MERCHANT-ONLY lane: never expose it to the agent plane, never log it,
|
|
504
535
|
* never echo it back over the bridge handoff (the bridge strips it
|
|
@@ -519,6 +550,29 @@ interface VerificationResult {
|
|
|
519
550
|
* confirm handoff body wins over `fulfilment.email` (the platform default).
|
|
520
551
|
*/
|
|
521
552
|
fulfilment?: FulfilmentInfo;
|
|
553
|
+
/**
|
|
554
|
+
* 5.15.0: AP2 v0.2 mandates AstraSync issued for this purchase (merchant
|
|
555
|
+
* lane — never forward to the agent). `mode: 'closed'` on a purchase leg
|
|
556
|
+
* (Checkout + Payment, bound to your `checkoutJwt`), `'open'` on a quote
|
|
557
|
+
* leg for an agent with a registered key. Verify with `verifyAp2Mandate()`
|
|
558
|
+
* against AstraSync's JWKS (`kid`).
|
|
559
|
+
*/
|
|
560
|
+
mandates?: AstraSyncMandates;
|
|
561
|
+
/**
|
|
562
|
+
* 5.15.0: a KYAPay `kya+jwt` identity token AstraSync issued for this agent
|
|
563
|
+
* at your endpoint (commerce legs; merchant lane). `hid.email` is where to
|
|
564
|
+
* send the receipt. Verify with `verifyKyaPayTokens()` (issuer = the
|
|
565
|
+
* AstraSync origin, audience = your ASTRAE-id).
|
|
566
|
+
*/
|
|
567
|
+
kyaToken?: string;
|
|
568
|
+
/**
|
|
569
|
+
* 5.15.0: A-Comm Evidence Protocol (AEP v1.0.3-rc.2) artifact payloads for
|
|
570
|
+
* your AEP chain — present when your endpoint lists `aep`: `policy` (section 3.4),
|
|
571
|
+
* `delegation` (section 3.9 protocol_metadata: kya_identity, consumer_authorization)
|
|
572
|
+
* and, for AstraSync bridge traffic, platform-countersigned `intents` (section 8.7).
|
|
573
|
+
* Append them with `AepChain` (your Ed25519 key). Merchant lane only.
|
|
574
|
+
*/
|
|
575
|
+
aep?: AstraSyncAepEvidence;
|
|
522
576
|
/** Timestamp of verification */
|
|
523
577
|
verifiedAt: Date;
|
|
524
578
|
/** TTL for this result (seconds) */
|
|
@@ -670,6 +724,12 @@ interface VerificationRequest {
|
|
|
670
724
|
* key charge the owner's card at most once. Omit for raw one-shot confirms.
|
|
671
725
|
*/
|
|
672
726
|
checkoutSessionId?: string;
|
|
727
|
+
/**
|
|
728
|
+
* 5.15.0: your signed checkout as a compact JWS (AP2 `checkout_jwt`). At a
|
|
729
|
+
* merchant whose endpoint lists `ap2`, a granted purchase leg returns
|
|
730
|
+
* `mandates` — closed AP2 Checkout + Payment mandates bound to it.
|
|
731
|
+
*/
|
|
732
|
+
checkoutJwt?: string;
|
|
673
733
|
/**
|
|
674
734
|
* 5.3.0 (astra-pay): the checkout's authoritative line items, forwarded on
|
|
675
735
|
* the confirm leg for the ORDER plane (receipts + digital-goods fulfillment
|
|
@@ -913,7 +973,7 @@ interface ExpressMiddlewareOptions extends GatewayConfig {
|
|
|
913
973
|
onDenied?: (result: VerificationResult, req: unknown, res: unknown) => void;
|
|
914
974
|
/** Automatically create sessions and record grant/deny decisions (default: true) */
|
|
915
975
|
recordDecisions?: boolean;
|
|
916
|
-
/**
|
|
976
|
+
/** Ask for a runtime challenge on every verify-access call (default: false — opt-in, round 27.8) */
|
|
917
977
|
enableRuntimeChallenge?: boolean;
|
|
918
978
|
/**
|
|
919
979
|
* Refresh interval (ms) for the remote-fetched route policy. Default:
|
|
@@ -1010,7 +1070,7 @@ interface NextJsMiddlewareOptions extends GatewayConfig {
|
|
|
1010
1070
|
message?: string;
|
|
1011
1071
|
allowGuestAccess?: boolean;
|
|
1012
1072
|
};
|
|
1013
|
-
/**
|
|
1073
|
+
/** Ask for a runtime challenge on every verify-access call (default: false — opt-in, round 27.8) */
|
|
1014
1074
|
enableRuntimeChallenge?: boolean;
|
|
1015
1075
|
/**
|
|
1016
1076
|
* Emit a fire-and-forget beacon for bot- and agent-shaped traffic that
|
|
@@ -1076,5 +1136,39 @@ interface VerificationInterstitialProps {
|
|
|
1076
1136
|
/** Custom styles */
|
|
1077
1137
|
className?: string;
|
|
1078
1138
|
}
|
|
1139
|
+
/** 5.15.0: AP2 mandates AstraSync issued (see VerificationResult.mandates). */
|
|
1140
|
+
interface AstraSyncMandates {
|
|
1141
|
+
kid: string;
|
|
1142
|
+
mode: 'closed' | 'open';
|
|
1143
|
+
/** Delegate SD-JWT: mandate.checkout.1 / mandate.checkout.open.1. */
|
|
1144
|
+
checkout: string;
|
|
1145
|
+
/** Delegate SD-JWT: mandate.payment.1 / mandate.payment.open.1. */
|
|
1146
|
+
payment?: string;
|
|
1147
|
+
}
|
|
1148
|
+
/** 5.15.0: AstraSync's AEP evidence (see VerificationResult.aep). */
|
|
1149
|
+
interface AstraSyncAepEvidence {
|
|
1150
|
+
spec_version: string;
|
|
1151
|
+
policy: {
|
|
1152
|
+
artifact_type: 'policy';
|
|
1153
|
+
actor_type: 'merchant';
|
|
1154
|
+
payload: Record<string, unknown>;
|
|
1155
|
+
};
|
|
1156
|
+
delegation?: {
|
|
1157
|
+
artifact_type: 'delegation';
|
|
1158
|
+
actor_type: 'agent';
|
|
1159
|
+
actor_id: string;
|
|
1160
|
+
payload: {
|
|
1161
|
+
protocol_metadata: Record<string, unknown>;
|
|
1162
|
+
};
|
|
1163
|
+
};
|
|
1164
|
+
intents?: Array<{
|
|
1165
|
+
artifact_type: 'intent';
|
|
1166
|
+
actor_type: 'agent';
|
|
1167
|
+
actor_id: string;
|
|
1168
|
+
payload: Record<string, unknown>;
|
|
1169
|
+
/** Compact JWS (ES256) over the canonical payload; key in AstraSync's JWKS. */
|
|
1170
|
+
platform_countersignature: string;
|
|
1171
|
+
}>;
|
|
1172
|
+
}
|
|
1079
1173
|
|
|
1080
1174
|
export type { AgentCredentials as A, ExpressMiddlewareOptions as E, GatewayConfig as G, NextJsMiddlewareOptions as N, SDKOptions as S, TrustLevel as T, VerificationInterstitialProps as V, AstraSyncCredentials as a, GuidanceInfo as b, VerificationRequest as c, VerificationResult as d };
|
|
@@ -169,6 +169,30 @@ interface VerifiedAgent {
|
|
|
169
169
|
blockchainAnchored: boolean;
|
|
170
170
|
/** Agent status */
|
|
171
171
|
status: 'active' | 'inactive' | 'suspended' | 'migrating' | 'terminated' | 'retired';
|
|
172
|
+
/**
|
|
173
|
+
* 5.15.0: the protocol identities the agent declared at registration (its
|
|
174
|
+
* shared signing key, UCP profile, Web Bot Auth key directory, x402 wallet,
|
|
175
|
+
* network agent ids). Bind incoming protocol requests to these — e.g.
|
|
176
|
+
* {@link checkUcpAgentBinding} rejects a `UCP-Agent` profile that isn't the
|
|
177
|
+
* agent's. Identities AstraSync failed to verify are never included.
|
|
178
|
+
*/
|
|
179
|
+
protocolIdentities?: AgentProtocolIdentities;
|
|
180
|
+
}
|
|
181
|
+
interface AgentProtocolIdentities {
|
|
182
|
+
/** Shared signing key (AP2 / VI `cnf`, RFC 9421). `thumbprint` = RFC 7638. */
|
|
183
|
+
agentKey?: {
|
|
184
|
+
kid: string | null;
|
|
185
|
+
thumbprint: string | null;
|
|
186
|
+
jwk: Record<string, unknown>;
|
|
187
|
+
};
|
|
188
|
+
ucpProfile?: string;
|
|
189
|
+
webBotAuthKeyDirectory?: string;
|
|
190
|
+
a2aCard?: string;
|
|
191
|
+
x402Wallet?: string;
|
|
192
|
+
visaAgentId?: string;
|
|
193
|
+
mastercardAgentId?: string;
|
|
194
|
+
/** Protocols whose identity AstraSync checked successfully. */
|
|
195
|
+
verified: string[];
|
|
172
196
|
}
|
|
173
197
|
/**
|
|
174
198
|
* Verified developer (KYD) information
|
|
@@ -253,6 +277,13 @@ interface GuidanceInfo {
|
|
|
253
277
|
interface StepUpApprovalInfo {
|
|
254
278
|
approvalId: string;
|
|
255
279
|
pollUrl: string;
|
|
280
|
+
/**
|
|
281
|
+
* 5.15.0: absolute https URL of the buyer-facing approval page. A UCP
|
|
282
|
+
* merchant returns it as `continue_url` with status `requires_escalation`;
|
|
283
|
+
* after the buyer approves, complete the same checkout again and the
|
|
284
|
+
* approval is redeemed once. Absent from backends older than 27.9.
|
|
285
|
+
*/
|
|
286
|
+
approvalUrl?: string;
|
|
256
287
|
expiresAt: string;
|
|
257
288
|
}
|
|
258
289
|
/**
|
|
@@ -428,19 +459,19 @@ interface VerificationResult {
|
|
|
428
459
|
/** Settlement voucher (present on clean merchant-mediated grants with a verified wallet). */
|
|
429
460
|
settlement?: SettlementArtifact;
|
|
430
461
|
/**
|
|
431
|
-
*
|
|
432
|
-
*
|
|
433
|
-
*
|
|
434
|
-
*
|
|
435
|
-
*
|
|
436
|
-
* `no_instrument` = policy passed but the owner has
|
|
437
|
-
*
|
|
462
|
+
* Sanitized order outcome for a purchase leg. 5.14.1: AstraSync never
|
|
463
|
+
* charges — every purchase grant records an order and hands YOU the
|
|
464
|
+
* settlement artifact, so the status is `pending_merchant` (with
|
|
465
|
+
* `orderId`): charge the `settlementToken` (card, first-party tenant) or
|
|
466
|
+
* redeem the `settlement` voucher (stablecoin), then `reportSettlement()`.
|
|
467
|
+
* `no_instrument` = policy passed but the owner has nothing usable on file
|
|
468
|
+
* (steer the user to add one via onboarding).
|
|
438
469
|
*/
|
|
439
470
|
settlementOutcome?: SettlementOutcomeInfo;
|
|
440
471
|
/**
|
|
441
|
-
*
|
|
442
|
-
*
|
|
443
|
-
*
|
|
472
|
+
* Card settlement token. Present on a card purchase at a first-party
|
|
473
|
+
* storefront (our Stripe tenant) — 5.14.1: always, there is no charge-here
|
|
474
|
+
* mode. YOUR server charges with this material on the shared Stripe
|
|
444
475
|
* account and reports the outcome via `client.reportSettlement()`.
|
|
445
476
|
* MERCHANT-ONLY lane: never expose it to the agent plane, never log it,
|
|
446
477
|
* never echo it back over the bridge handoff (the bridge strips it
|
|
@@ -461,6 +492,29 @@ interface VerificationResult {
|
|
|
461
492
|
* confirm handoff body wins over `fulfilment.email` (the platform default).
|
|
462
493
|
*/
|
|
463
494
|
fulfilment?: FulfilmentInfo;
|
|
495
|
+
/**
|
|
496
|
+
* 5.15.0: AP2 v0.2 mandates AstraSync issued for this purchase (merchant
|
|
497
|
+
* lane — never forward to the agent). `mode: 'closed'` on a purchase leg
|
|
498
|
+
* (Checkout + Payment, bound to your `checkoutJwt`), `'open'` on a quote
|
|
499
|
+
* leg for an agent with a registered key. Verify with `verifyAp2Mandate()`
|
|
500
|
+
* against AstraSync's JWKS (`kid`).
|
|
501
|
+
*/
|
|
502
|
+
mandates?: AstraSyncMandates;
|
|
503
|
+
/**
|
|
504
|
+
* 5.15.0: a KYAPay `kya+jwt` identity token AstraSync issued for this agent
|
|
505
|
+
* at your endpoint (commerce legs; merchant lane). `hid.email` is where to
|
|
506
|
+
* send the receipt. Verify with `verifyKyaPayTokens()` (issuer = the
|
|
507
|
+
* AstraSync origin, audience = your ASTRAE-id).
|
|
508
|
+
*/
|
|
509
|
+
kyaToken?: string;
|
|
510
|
+
/**
|
|
511
|
+
* 5.15.0: A-Comm Evidence Protocol (AEP v1.0.3-rc.2) artifact payloads for
|
|
512
|
+
* your AEP chain — present when your endpoint lists `aep`: `policy` (section 3.4),
|
|
513
|
+
* `delegation` (section 3.9 protocol_metadata: kya_identity, consumer_authorization)
|
|
514
|
+
* and, for AstraSync bridge traffic, platform-countersigned `intents` (section 8.7).
|
|
515
|
+
* Append them with `AepChain` (your Ed25519 key). Merchant lane only.
|
|
516
|
+
*/
|
|
517
|
+
aep?: AstraSyncAepEvidence;
|
|
464
518
|
/** Timestamp of verification */
|
|
465
519
|
verifiedAt: Date;
|
|
466
520
|
/** TTL for this result (seconds) */
|
|
@@ -612,6 +666,12 @@ interface VerificationRequest {
|
|
|
612
666
|
* key charge the owner's card at most once. Omit for raw one-shot confirms.
|
|
613
667
|
*/
|
|
614
668
|
checkoutSessionId?: string;
|
|
669
|
+
/**
|
|
670
|
+
* 5.15.0: your signed checkout as a compact JWS (AP2 `checkout_jwt`). At a
|
|
671
|
+
* merchant whose endpoint lists `ap2`, a granted purchase leg returns
|
|
672
|
+
* `mandates` — closed AP2 Checkout + Payment mandates bound to it.
|
|
673
|
+
*/
|
|
674
|
+
checkoutJwt?: string;
|
|
615
675
|
/**
|
|
616
676
|
* 5.3.0 (astra-pay): the checkout's authoritative line items, forwarded on
|
|
617
677
|
* the confirm leg for the ORDER plane (receipts + digital-goods fulfillment
|
|
@@ -875,5 +935,39 @@ interface TokenGuidance {
|
|
|
875
935
|
scopeConvention: 'astrasync-canonical';
|
|
876
936
|
};
|
|
877
937
|
}
|
|
938
|
+
/** 5.15.0: AP2 mandates AstraSync issued (see VerificationResult.mandates). */
|
|
939
|
+
interface AstraSyncMandates {
|
|
940
|
+
kid: string;
|
|
941
|
+
mode: 'closed' | 'open';
|
|
942
|
+
/** Delegate SD-JWT: mandate.checkout.1 / mandate.checkout.open.1. */
|
|
943
|
+
checkout: string;
|
|
944
|
+
/** Delegate SD-JWT: mandate.payment.1 / mandate.payment.open.1. */
|
|
945
|
+
payment?: string;
|
|
946
|
+
}
|
|
947
|
+
/** 5.15.0: AstraSync's AEP evidence (see VerificationResult.aep). */
|
|
948
|
+
interface AstraSyncAepEvidence {
|
|
949
|
+
spec_version: string;
|
|
950
|
+
policy: {
|
|
951
|
+
artifact_type: 'policy';
|
|
952
|
+
actor_type: 'merchant';
|
|
953
|
+
payload: Record<string, unknown>;
|
|
954
|
+
};
|
|
955
|
+
delegation?: {
|
|
956
|
+
artifact_type: 'delegation';
|
|
957
|
+
actor_type: 'agent';
|
|
958
|
+
actor_id: string;
|
|
959
|
+
payload: {
|
|
960
|
+
protocol_metadata: Record<string, unknown>;
|
|
961
|
+
};
|
|
962
|
+
};
|
|
963
|
+
intents?: Array<{
|
|
964
|
+
artifact_type: 'intent';
|
|
965
|
+
actor_type: 'agent';
|
|
966
|
+
actor_id: string;
|
|
967
|
+
payload: Record<string, unknown>;
|
|
968
|
+
/** Compact JWS (ES256) over the canonical payload; key in AstraSync's JWKS. */
|
|
969
|
+
platform_countersignature: string;
|
|
970
|
+
}>;
|
|
971
|
+
}
|
|
878
972
|
|
|
879
973
|
export type { AgentCredentials as A, CommerceArtifactsPayload as C, GatewayConfig as G, TokenGuidance as T, VerificationRequest as V, AttemptReport as a, CounterpartyType as b, VerificationResult as c };
|