@astrasyncai/verification-gateway 5.19.0 → 5.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +83 -0
- package/README.md +51 -2
- package/dist/adapter-interface/interface.d.mts +2 -2
- package/dist/adapter-interface/interface.d.ts +2 -2
- package/dist/adapters/express.d.mts +1 -1
- package/dist/adapters/express.d.ts +1 -1
- package/dist/adapters/express.js +65 -16
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +65 -16
- package/dist/adapters/express.mjs.map +1 -1
- package/dist/adapters/mcp.d.mts +23 -1
- package/dist/adapters/mcp.d.ts +23 -1
- package/dist/adapters/mcp.js +91 -16
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +91 -16
- 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 +57 -11
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +57 -11
- package/dist/adapters/nextjs.mjs.map +1 -1
- package/dist/adapters/sdk.d.mts +58 -2
- package/dist/adapters/sdk.d.ts +58 -2
- package/dist/adapters/sdk.js +124 -11
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +124 -11
- package/dist/adapters/sdk.mjs.map +1 -1
- package/dist/agent/index.d.mts +1 -1
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.js +1 -1
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/index.mjs +1 -1
- package/dist/agent/index.mjs.map +1 -1
- package/dist/bin/astrasync-claude-hook.js +49 -11
- package/dist/bin/astrasync-codex-hook.js +49 -11
- package/dist/bin/astrasync-guard.js +49 -11
- package/dist/bin/astrasync.js +51 -12
- package/dist/browser/background.js +49 -11
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +49 -11
- 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 +49 -11
- package/dist/codex/index.js.map +1 -1
- package/dist/codex/index.mjs +49 -11
- package/dist/codex/index.mjs.map +1 -1
- package/dist/cursor/extension.js +49 -11
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +49 -11
- package/dist/cursor/extension.mjs.map +1 -1
- package/dist/edge-config.d.mts +1 -1
- package/dist/edge-config.d.ts +1 -1
- package/dist/edge-config.js +1 -1
- package/dist/edge-config.js.map +1 -1
- package/dist/edge-config.mjs +1 -1
- package/dist/edge-config.mjs.map +1 -1
- package/dist/edge-core/index.d.mts +1 -1
- package/dist/edge-core/index.d.ts +1 -1
- package/dist/edge-core/index.js +49 -11
- package/dist/edge-core/index.js.map +1 -1
- package/dist/edge-core/index.mjs +49 -11
- package/dist/edge-core/index.mjs.map +1 -1
- package/dist/gateway/gateway.d.mts +2 -2
- package/dist/gateway/gateway.d.ts +2 -2
- package/dist/gateway/gateway.js +49 -11
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +49 -11
- 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 +168 -8
- package/dist/index.d.ts +168 -8
- package/dist/index.js +229 -31
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +226 -31
- package/dist/index.mjs.map +1 -1
- package/dist/local-evaluator/evaluator.d.mts +2 -2
- package/dist/local-evaluator/evaluator.d.ts +2 -2
- package/dist/registration/index.d.mts +11 -2
- package/dist/registration/index.d.ts +11 -2
- package/dist/registration/index.js +1 -1
- package/dist/registration/index.js.map +1 -1
- package/dist/registration/index.mjs +1 -1
- package/dist/registration/index.mjs.map +1 -1
- package/dist/transport/index.d.mts +1 -1
- package/dist/transport/index.d.ts +1 -1
- package/dist/transport/index.js +1 -1
- package/dist/transport/index.js.map +1 -1
- package/dist/transport/index.mjs +1 -1
- package/dist/transport/index.mjs.map +1 -1
- package/dist/{types-BRz2U0Pn.d.ts → types-B_HLhZ9n.d.ts} +1 -1
- package/dist/{types-BfILnheI.d.mts → types-CU17R4Nr.d.mts} +11 -0
- package/dist/{types-BfILnheI.d.ts → types-CU17R4Nr.d.ts} +11 -0
- package/dist/{types-DqWPkiYl.d.mts → types-CxjqmPl-.d.mts} +25 -1
- package/dist/{types-DqWPkiYl.d.ts → types-CxjqmPl-.d.ts} +25 -1
- package/dist/{types-BoGjyon0.d.mts → types-D37aSQ9c.d.mts} +25 -1
- package/dist/{types-CfBpm3w5.d.mts → types-Djpz-L0w.d.mts} +1 -1
- package/dist/{types-eWyZuz-3.d.ts → types-Dn8tXnei.d.ts} +25 -1
- package/dist/ui/index.d.mts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/verify.d.mts +28 -3
- package/dist/verify.d.ts +28 -3
- package/dist/verify.js +71 -11
- package/dist/verify.js.map +1 -1
- package/dist/verify.mjs +69 -11
- package/dist/verify.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -34,6 +34,17 @@ interface GatewayConfig {
|
|
|
34
34
|
debug?: boolean;
|
|
35
35
|
/** Custom headers to send with verification requests */
|
|
36
36
|
customHeaders?: Record<string, string>;
|
|
37
|
+
/**
|
|
38
|
+
* 5.20.0: proof that this caller may act as the agent, sent as
|
|
39
|
+
* `actingProof` in the verify-access body. Honoured only from a
|
|
40
|
+
* first-party AstraSync service caller (the bridge): the backend checks the
|
|
41
|
+
* connector's OAuth access token and records a `connector_owner` proof when
|
|
42
|
+
* its owner owns the agent. Ignored for any other key. A verify carrying it
|
|
43
|
+
* is never served from, or written to, the verdict cache.
|
|
44
|
+
*/
|
|
45
|
+
actingProof?: {
|
|
46
|
+
connectorToken: string;
|
|
47
|
+
};
|
|
37
48
|
/** This counterparty's URL (sent with verify-access requests for analytics) */
|
|
38
49
|
counterpartyUrl?: string;
|
|
39
50
|
/** This counterparty's type (sent with verify-access requests for analytics) */
|
|
@@ -34,6 +34,17 @@ interface GatewayConfig {
|
|
|
34
34
|
debug?: boolean;
|
|
35
35
|
/** Custom headers to send with verification requests */
|
|
36
36
|
customHeaders?: Record<string, string>;
|
|
37
|
+
/**
|
|
38
|
+
* 5.20.0: proof that this caller may act as the agent, sent as
|
|
39
|
+
* `actingProof` in the verify-access body. Honoured only from a
|
|
40
|
+
* first-party AstraSync service caller (the bridge): the backend checks the
|
|
41
|
+
* connector's OAuth access token and records a `connector_owner` proof when
|
|
42
|
+
* its owner owns the agent. Ignored for any other key. A verify carrying it
|
|
43
|
+
* is never served from, or written to, the verdict cache.
|
|
44
|
+
*/
|
|
45
|
+
actingProof?: {
|
|
46
|
+
connectorToken: string;
|
|
47
|
+
};
|
|
37
48
|
/** This counterparty's URL (sent with verify-access requests for analytics) */
|
|
38
49
|
counterpartyUrl?: string;
|
|
39
50
|
/** This counterparty's type (sent with verify-access requests for analytics) */
|
|
@@ -111,6 +111,17 @@ interface GatewayConfig {
|
|
|
111
111
|
debug?: boolean;
|
|
112
112
|
/** Custom headers to send with verification requests */
|
|
113
113
|
customHeaders?: Record<string, string>;
|
|
114
|
+
/**
|
|
115
|
+
* 5.20.0: proof that this caller may act as the agent, sent as
|
|
116
|
+
* `actingProof` in the verify-access body. Honoured only from a
|
|
117
|
+
* first-party AstraSync service caller (the bridge): the backend checks the
|
|
118
|
+
* connector's OAuth access token and records a `connector_owner` proof when
|
|
119
|
+
* its owner owns the agent. Ignored for any other key. A verify carrying it
|
|
120
|
+
* is never served from, or written to, the verdict cache.
|
|
121
|
+
*/
|
|
122
|
+
actingProof?: {
|
|
123
|
+
connectorToken: string;
|
|
124
|
+
};
|
|
114
125
|
/** This counterparty's URL (sent with verify-access requests for analytics) */
|
|
115
126
|
counterpartyUrl?: string;
|
|
116
127
|
/** This counterparty's type (sent with verify-access requests for analytics) */
|
|
@@ -361,7 +372,9 @@ interface StepUpApprovalInfo {
|
|
|
361
372
|
* Lifecycle states of a step-up approval row (mirrors the backend's
|
|
362
373
|
* step_up_approval_status_check constraint).
|
|
363
374
|
*/
|
|
364
|
-
type StepUpApprovalStatus = 'pending' | 'approved' | 'denied' | 'expired' | 'consumed'
|
|
375
|
+
type StepUpApprovalStatus = 'pending' | 'approved' | 'denied' | 'expired' | 'consumed'
|
|
376
|
+
/** 5.20.0: approved but never redeemed inside the redemption window. */
|
|
377
|
+
| 'lapsed';
|
|
365
378
|
/**
|
|
366
379
|
* Terminal outcome of a hold-and-poll wait: any non-pending status, or
|
|
367
380
|
* 'timeout' when the hold budget ran out while the approval was still pending.
|
|
@@ -553,6 +566,12 @@ interface VerificationResult {
|
|
|
553
566
|
* (steer the user to add one via onboarding).
|
|
554
567
|
*/
|
|
555
568
|
settlementOutcome?: SettlementOutcomeInfo;
|
|
569
|
+
/**
|
|
570
|
+
* 5.20.0 (round 29.1): non-fatal integration warnings for the caller —
|
|
571
|
+
* e.g. `events_url_missing` when a kit's held confirm is on an endpoint with
|
|
572
|
+
* no Events URL (the kit would never hear the owner's decision).
|
|
573
|
+
*/
|
|
574
|
+
warnings?: VerificationWarning[];
|
|
556
575
|
/**
|
|
557
576
|
* Card settlement token. Present on a card purchase at a first-party
|
|
558
577
|
* storefront (our Stripe tenant) — 5.14.1: always, there is no charge-here
|
|
@@ -1289,5 +1308,10 @@ interface AstraSyncAepEvidence {
|
|
|
1289
1308
|
platform_countersignature: string;
|
|
1290
1309
|
}>;
|
|
1291
1310
|
}
|
|
1311
|
+
/** 5.20.0: a non-fatal warning on a verify-access result (see `warnings`). */
|
|
1312
|
+
interface VerificationWarning {
|
|
1313
|
+
code: string;
|
|
1314
|
+
message: string;
|
|
1315
|
+
}
|
|
1292
1316
|
|
|
1293
1317
|
export type { AgentArtifacts as A, CheckoutMetadata as C, ExpressMiddlewareOptions as E, GatewayConfig as G, NextJsMiddlewareOptions as N, SDKOptions as S, TrustLevel as T, VerificationInterstitialProps as V, AgentCredentials as a, AstraSyncCredentials as b, GuidanceInfo as c, VerificationRequest as d, VerificationResult as e };
|
|
@@ -111,6 +111,17 @@ interface GatewayConfig {
|
|
|
111
111
|
debug?: boolean;
|
|
112
112
|
/** Custom headers to send with verification requests */
|
|
113
113
|
customHeaders?: Record<string, string>;
|
|
114
|
+
/**
|
|
115
|
+
* 5.20.0: proof that this caller may act as the agent, sent as
|
|
116
|
+
* `actingProof` in the verify-access body. Honoured only from a
|
|
117
|
+
* first-party AstraSync service caller (the bridge): the backend checks the
|
|
118
|
+
* connector's OAuth access token and records a `connector_owner` proof when
|
|
119
|
+
* its owner owns the agent. Ignored for any other key. A verify carrying it
|
|
120
|
+
* is never served from, or written to, the verdict cache.
|
|
121
|
+
*/
|
|
122
|
+
actingProof?: {
|
|
123
|
+
connectorToken: string;
|
|
124
|
+
};
|
|
114
125
|
/** This counterparty's URL (sent with verify-access requests for analytics) */
|
|
115
126
|
counterpartyUrl?: string;
|
|
116
127
|
/** This counterparty's type (sent with verify-access requests for analytics) */
|
|
@@ -361,7 +372,9 @@ interface StepUpApprovalInfo {
|
|
|
361
372
|
* Lifecycle states of a step-up approval row (mirrors the backend's
|
|
362
373
|
* step_up_approval_status_check constraint).
|
|
363
374
|
*/
|
|
364
|
-
type StepUpApprovalStatus = 'pending' | 'approved' | 'denied' | 'expired' | 'consumed'
|
|
375
|
+
type StepUpApprovalStatus = 'pending' | 'approved' | 'denied' | 'expired' | 'consumed'
|
|
376
|
+
/** 5.20.0: approved but never redeemed inside the redemption window. */
|
|
377
|
+
| 'lapsed';
|
|
365
378
|
/**
|
|
366
379
|
* Terminal outcome of a hold-and-poll wait: any non-pending status, or
|
|
367
380
|
* 'timeout' when the hold budget ran out while the approval was still pending.
|
|
@@ -553,6 +566,12 @@ interface VerificationResult {
|
|
|
553
566
|
* (steer the user to add one via onboarding).
|
|
554
567
|
*/
|
|
555
568
|
settlementOutcome?: SettlementOutcomeInfo;
|
|
569
|
+
/**
|
|
570
|
+
* 5.20.0 (round 29.1): non-fatal integration warnings for the caller —
|
|
571
|
+
* e.g. `events_url_missing` when a kit's held confirm is on an endpoint with
|
|
572
|
+
* no Events URL (the kit would never hear the owner's decision).
|
|
573
|
+
*/
|
|
574
|
+
warnings?: VerificationWarning[];
|
|
556
575
|
/**
|
|
557
576
|
* Card settlement token. Present on a card purchase at a first-party
|
|
558
577
|
* storefront (our Stripe tenant) — 5.14.1: always, there is no charge-here
|
|
@@ -1289,5 +1308,10 @@ interface AstraSyncAepEvidence {
|
|
|
1289
1308
|
platform_countersignature: string;
|
|
1290
1309
|
}>;
|
|
1291
1310
|
}
|
|
1311
|
+
/** 5.20.0: a non-fatal warning on a verify-access result (see `warnings`). */
|
|
1312
|
+
interface VerificationWarning {
|
|
1313
|
+
code: string;
|
|
1314
|
+
message: string;
|
|
1315
|
+
}
|
|
1292
1316
|
|
|
1293
1317
|
export type { AgentArtifacts as A, CheckoutMetadata as C, ExpressMiddlewareOptions as E, GatewayConfig as G, NextJsMiddlewareOptions as N, SDKOptions as S, TrustLevel as T, VerificationInterstitialProps as V, AgentCredentials as a, AstraSyncCredentials as b, GuidanceInfo as c, VerificationRequest as d, VerificationResult as e };
|
|
@@ -53,6 +53,17 @@ interface GatewayConfig {
|
|
|
53
53
|
debug?: boolean;
|
|
54
54
|
/** Custom headers to send with verification requests */
|
|
55
55
|
customHeaders?: Record<string, string>;
|
|
56
|
+
/**
|
|
57
|
+
* 5.20.0: proof that this caller may act as the agent, sent as
|
|
58
|
+
* `actingProof` in the verify-access body. Honoured only from a
|
|
59
|
+
* first-party AstraSync service caller (the bridge): the backend checks the
|
|
60
|
+
* connector's OAuth access token and records a `connector_owner` proof when
|
|
61
|
+
* its owner owns the agent. Ignored for any other key. A verify carrying it
|
|
62
|
+
* is never served from, or written to, the verdict cache.
|
|
63
|
+
*/
|
|
64
|
+
actingProof?: {
|
|
65
|
+
connectorToken: string;
|
|
66
|
+
};
|
|
56
67
|
/** This counterparty's URL (sent with verify-access requests for analytics) */
|
|
57
68
|
counterpartyUrl?: string;
|
|
58
69
|
/** This counterparty's type (sent with verify-access requests for analytics) */
|
|
@@ -303,7 +314,9 @@ interface StepUpApprovalInfo {
|
|
|
303
314
|
* Lifecycle states of a step-up approval row (mirrors the backend's
|
|
304
315
|
* step_up_approval_status_check constraint).
|
|
305
316
|
*/
|
|
306
|
-
type StepUpApprovalStatus = 'pending' | 'approved' | 'denied' | 'expired' | 'consumed'
|
|
317
|
+
type StepUpApprovalStatus = 'pending' | 'approved' | 'denied' | 'expired' | 'consumed'
|
|
318
|
+
/** 5.20.0: approved but never redeemed inside the redemption window. */
|
|
319
|
+
| 'lapsed';
|
|
307
320
|
/**
|
|
308
321
|
* Terminal outcome of a hold-and-poll wait: any non-pending status, or
|
|
309
322
|
* 'timeout' when the hold budget ran out while the approval was still pending.
|
|
@@ -495,6 +508,12 @@ interface VerificationResult {
|
|
|
495
508
|
* (steer the user to add one via onboarding).
|
|
496
509
|
*/
|
|
497
510
|
settlementOutcome?: SettlementOutcomeInfo;
|
|
511
|
+
/**
|
|
512
|
+
* 5.20.0 (round 29.1): non-fatal integration warnings for the caller —
|
|
513
|
+
* e.g. `events_url_missing` when a kit's held confirm is on an endpoint with
|
|
514
|
+
* no Events URL (the kit would never hear the owner's decision).
|
|
515
|
+
*/
|
|
516
|
+
warnings?: VerificationWarning[];
|
|
498
517
|
/**
|
|
499
518
|
* Card settlement token. Present on a card purchase at a first-party
|
|
500
519
|
* storefront (our Stripe tenant) — 5.14.1: always, there is no charge-here
|
|
@@ -1071,5 +1090,10 @@ interface AstraSyncAepEvidence {
|
|
|
1071
1090
|
platform_countersignature: string;
|
|
1072
1091
|
}>;
|
|
1073
1092
|
}
|
|
1093
|
+
/** 5.20.0: a non-fatal warning on a verify-access result (see `warnings`). */
|
|
1094
|
+
interface VerificationWarning {
|
|
1095
|
+
code: string;
|
|
1096
|
+
message: string;
|
|
1097
|
+
}
|
|
1074
1098
|
|
|
1075
1099
|
export type { AgentCredentials as A, CommerceArtifactsPayload as C, GatewayConfig as G, TokenGuidance as T, VerificationRequest as V, AttemptReport as a, CounterpartyType as b, VerificationResult as c };
|
|
@@ -53,6 +53,17 @@ interface GatewayConfig {
|
|
|
53
53
|
debug?: boolean;
|
|
54
54
|
/** Custom headers to send with verification requests */
|
|
55
55
|
customHeaders?: Record<string, string>;
|
|
56
|
+
/**
|
|
57
|
+
* 5.20.0: proof that this caller may act as the agent, sent as
|
|
58
|
+
* `actingProof` in the verify-access body. Honoured only from a
|
|
59
|
+
* first-party AstraSync service caller (the bridge): the backend checks the
|
|
60
|
+
* connector's OAuth access token and records a `connector_owner` proof when
|
|
61
|
+
* its owner owns the agent. Ignored for any other key. A verify carrying it
|
|
62
|
+
* is never served from, or written to, the verdict cache.
|
|
63
|
+
*/
|
|
64
|
+
actingProof?: {
|
|
65
|
+
connectorToken: string;
|
|
66
|
+
};
|
|
56
67
|
/** This counterparty's URL (sent with verify-access requests for analytics) */
|
|
57
68
|
counterpartyUrl?: string;
|
|
58
69
|
/** This counterparty's type (sent with verify-access requests for analytics) */
|
|
@@ -303,7 +314,9 @@ interface StepUpApprovalInfo {
|
|
|
303
314
|
* Lifecycle states of a step-up approval row (mirrors the backend's
|
|
304
315
|
* step_up_approval_status_check constraint).
|
|
305
316
|
*/
|
|
306
|
-
type StepUpApprovalStatus = 'pending' | 'approved' | 'denied' | 'expired' | 'consumed'
|
|
317
|
+
type StepUpApprovalStatus = 'pending' | 'approved' | 'denied' | 'expired' | 'consumed'
|
|
318
|
+
/** 5.20.0: approved but never redeemed inside the redemption window. */
|
|
319
|
+
| 'lapsed';
|
|
307
320
|
/**
|
|
308
321
|
* Terminal outcome of a hold-and-poll wait: any non-pending status, or
|
|
309
322
|
* 'timeout' when the hold budget ran out while the approval was still pending.
|
|
@@ -495,6 +508,12 @@ interface VerificationResult {
|
|
|
495
508
|
* (steer the user to add one via onboarding).
|
|
496
509
|
*/
|
|
497
510
|
settlementOutcome?: SettlementOutcomeInfo;
|
|
511
|
+
/**
|
|
512
|
+
* 5.20.0 (round 29.1): non-fatal integration warnings for the caller —
|
|
513
|
+
* e.g. `events_url_missing` when a kit's held confirm is on an endpoint with
|
|
514
|
+
* no Events URL (the kit would never hear the owner's decision).
|
|
515
|
+
*/
|
|
516
|
+
warnings?: VerificationWarning[];
|
|
498
517
|
/**
|
|
499
518
|
* Card settlement token. Present on a card purchase at a first-party
|
|
500
519
|
* storefront (our Stripe tenant) — 5.14.1: always, there is no charge-here
|
|
@@ -1071,5 +1090,10 @@ interface AstraSyncAepEvidence {
|
|
|
1071
1090
|
platform_countersignature: string;
|
|
1072
1091
|
}>;
|
|
1073
1092
|
}
|
|
1093
|
+
/** 5.20.0: a non-fatal warning on a verify-access result (see `warnings`). */
|
|
1094
|
+
interface VerificationWarning {
|
|
1095
|
+
code: string;
|
|
1096
|
+
message: string;
|
|
1097
|
+
}
|
|
1074
1098
|
|
|
1075
1099
|
export type { AgentCredentials as A, CommerceArtifactsPayload as C, GatewayConfig as G, TokenGuidance as T, VerificationRequest as V, AttemptReport as a, CounterpartyType as b, VerificationResult as c };
|
package/dist/ui/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { V as VerificationInterstitialProps, e as VerificationResult, a as AgentCredentials, c as GuidanceInfo, T as TrustLevel } from '../types-
|
|
1
|
+
import { V as VerificationInterstitialProps, e as VerificationResult, a as AgentCredentials, c as GuidanceInfo, T as TrustLevel } from '../types-CxjqmPl-.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* AstraSync Verification Interstitial Component
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { V as VerificationInterstitialProps, e as VerificationResult, a as AgentCredentials, c as GuidanceInfo, T as TrustLevel } from '../types-
|
|
1
|
+
import { V as VerificationInterstitialProps, e as VerificationResult, a as AgentCredentials, c as GuidanceInfo, T as TrustLevel } from '../types-CxjqmPl-.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* AstraSync Verification Interstitial Component
|
package/dist/verify.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AgentCredentials, G as GatewayConfig,
|
|
1
|
+
import { A as AgentCredentials, G as GatewayConfig, c as VerificationResult, V as VerificationRequest, a as AttemptReport } from './types-D37aSQ9c.mjs';
|
|
2
2
|
import { ObservedMetadata } from './metadata-capture.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -11,7 +11,8 @@ import { ObservedMetadata } from './metadata-capture.mjs';
|
|
|
11
11
|
/** Test-only: re-arm the one-time init self-check. */
|
|
12
12
|
declare function _resetInitCheck(): void;
|
|
13
13
|
/**
|
|
14
|
-
* Clear the verification cache
|
|
14
|
+
* Clear the verification cache, and (5.20.0) forget in-flight single-flight
|
|
15
|
+
* calls so a later identical request reaches the backend on its own.
|
|
15
16
|
*/
|
|
16
17
|
declare function clearCache(): void;
|
|
17
18
|
/**
|
|
@@ -48,6 +49,24 @@ interface VerifyOptions {
|
|
|
48
49
|
* Main verification function
|
|
49
50
|
*/
|
|
50
51
|
declare function verify(config: GatewayConfig, request: VerificationRequest, options?: VerifyOptions): Promise<VerificationResult>;
|
|
52
|
+
/**
|
|
53
|
+
* Whether `result` was served from the verdict cache or shared from a
|
|
54
|
+
* concurrent identical call (5.20.0). The adapters skip the decision POST for
|
|
55
|
+
* these: the session already has its decision from the call that created it.
|
|
56
|
+
*/
|
|
57
|
+
declare function isSharedVerdict(result: VerificationResult): boolean;
|
|
58
|
+
type VerificationListener = (result: VerificationResult, request: VerificationRequest) => void;
|
|
59
|
+
/**
|
|
60
|
+
* 5.20.0: observe every verdict this process fetched from verify-access
|
|
61
|
+
* (cache hits and single-flight followers are not repeated). Listeners run
|
|
62
|
+
* synchronously after the result is built and must not throw (a throw is
|
|
63
|
+
* swallowed). Returns an unsubscribe function.
|
|
64
|
+
*
|
|
65
|
+
* The MCP bridge uses it to size its per-agent rate limit from the trust
|
|
66
|
+
* score its tools' own verifies return, instead of paying for a second
|
|
67
|
+
* verify-access call in the gate.
|
|
68
|
+
*/
|
|
69
|
+
declare function onVerificationResult(listener: VerificationListener): () => void;
|
|
51
70
|
/**
|
|
52
71
|
* Record a counterparty's grant/deny decision for a verification session.
|
|
53
72
|
* Fire-and-forget — errors are silently swallowed.
|
|
@@ -86,6 +105,12 @@ declare function fetchRoutes(config: GatewayConfig, counterpartyId: string, opti
|
|
|
86
105
|
* here can only add checks".
|
|
87
106
|
*/
|
|
88
107
|
codeGates?: string[];
|
|
108
|
+
/**
|
|
109
|
+
* 5.20.0: called with the endpoint's `counterpartyType` when the routes
|
|
110
|
+
* response carries it (backend round 29.1+). The MCP middleware uses it
|
|
111
|
+
* to warn when it is pointed at a non-`mcp_server` endpoint.
|
|
112
|
+
*/
|
|
113
|
+
onEndpointType?: (counterpartyType: string) => void;
|
|
89
114
|
}): Promise<RouteAccessConfigShape[] | null>;
|
|
90
115
|
/**
|
|
91
116
|
* Minimal shape of an EndpointRoute as the SDK consumes it. Mirrors the
|
|
@@ -215,4 +240,4 @@ declare function quickVerify(config: GatewayConfig, credentials: AgentCredential
|
|
|
215
240
|
retryAfterMs?: number;
|
|
216
241
|
}>;
|
|
217
242
|
|
|
218
|
-
export { type ReportAttemptOptions, type RouteAccessConfigShape, type VerifyOptions, _resetInitCheck, clearCache, extractCredentials, fetchRoutes, hasCredentials, parseRetryAfterMs, quickVerify, recordDecision, reportAttempt, reportCounterpartyPreCheckFailure, reportUnregisteredAttempt, verify, verifyAndRecord };
|
|
243
|
+
export { type ReportAttemptOptions, type RouteAccessConfigShape, type VerifyOptions, _resetInitCheck, clearCache, extractCredentials, fetchRoutes, hasCredentials, isSharedVerdict, onVerificationResult, parseRetryAfterMs, quickVerify, recordDecision, reportAttempt, reportCounterpartyPreCheckFailure, reportUnregisteredAttempt, verify, verifyAndRecord };
|
package/dist/verify.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AgentCredentials, G as GatewayConfig,
|
|
1
|
+
import { A as AgentCredentials, G as GatewayConfig, c as VerificationResult, V as VerificationRequest, a as AttemptReport } from './types-Dn8tXnei.js';
|
|
2
2
|
import { ObservedMetadata } from './metadata-capture.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -11,7 +11,8 @@ import { ObservedMetadata } from './metadata-capture.js';
|
|
|
11
11
|
/** Test-only: re-arm the one-time init self-check. */
|
|
12
12
|
declare function _resetInitCheck(): void;
|
|
13
13
|
/**
|
|
14
|
-
* Clear the verification cache
|
|
14
|
+
* Clear the verification cache, and (5.20.0) forget in-flight single-flight
|
|
15
|
+
* calls so a later identical request reaches the backend on its own.
|
|
15
16
|
*/
|
|
16
17
|
declare function clearCache(): void;
|
|
17
18
|
/**
|
|
@@ -48,6 +49,24 @@ interface VerifyOptions {
|
|
|
48
49
|
* Main verification function
|
|
49
50
|
*/
|
|
50
51
|
declare function verify(config: GatewayConfig, request: VerificationRequest, options?: VerifyOptions): Promise<VerificationResult>;
|
|
52
|
+
/**
|
|
53
|
+
* Whether `result` was served from the verdict cache or shared from a
|
|
54
|
+
* concurrent identical call (5.20.0). The adapters skip the decision POST for
|
|
55
|
+
* these: the session already has its decision from the call that created it.
|
|
56
|
+
*/
|
|
57
|
+
declare function isSharedVerdict(result: VerificationResult): boolean;
|
|
58
|
+
type VerificationListener = (result: VerificationResult, request: VerificationRequest) => void;
|
|
59
|
+
/**
|
|
60
|
+
* 5.20.0: observe every verdict this process fetched from verify-access
|
|
61
|
+
* (cache hits and single-flight followers are not repeated). Listeners run
|
|
62
|
+
* synchronously after the result is built and must not throw (a throw is
|
|
63
|
+
* swallowed). Returns an unsubscribe function.
|
|
64
|
+
*
|
|
65
|
+
* The MCP bridge uses it to size its per-agent rate limit from the trust
|
|
66
|
+
* score its tools' own verifies return, instead of paying for a second
|
|
67
|
+
* verify-access call in the gate.
|
|
68
|
+
*/
|
|
69
|
+
declare function onVerificationResult(listener: VerificationListener): () => void;
|
|
51
70
|
/**
|
|
52
71
|
* Record a counterparty's grant/deny decision for a verification session.
|
|
53
72
|
* Fire-and-forget — errors are silently swallowed.
|
|
@@ -86,6 +105,12 @@ declare function fetchRoutes(config: GatewayConfig, counterpartyId: string, opti
|
|
|
86
105
|
* here can only add checks".
|
|
87
106
|
*/
|
|
88
107
|
codeGates?: string[];
|
|
108
|
+
/**
|
|
109
|
+
* 5.20.0: called with the endpoint's `counterpartyType` when the routes
|
|
110
|
+
* response carries it (backend round 29.1+). The MCP middleware uses it
|
|
111
|
+
* to warn when it is pointed at a non-`mcp_server` endpoint.
|
|
112
|
+
*/
|
|
113
|
+
onEndpointType?: (counterpartyType: string) => void;
|
|
89
114
|
}): Promise<RouteAccessConfigShape[] | null>;
|
|
90
115
|
/**
|
|
91
116
|
* Minimal shape of an EndpointRoute as the SDK consumes it. Mirrors the
|
|
@@ -215,4 +240,4 @@ declare function quickVerify(config: GatewayConfig, credentials: AgentCredential
|
|
|
215
240
|
retryAfterMs?: number;
|
|
216
241
|
}>;
|
|
217
242
|
|
|
218
|
-
export { type ReportAttemptOptions, type RouteAccessConfigShape, type VerifyOptions, _resetInitCheck, clearCache, extractCredentials, fetchRoutes, hasCredentials, parseRetryAfterMs, quickVerify, recordDecision, reportAttempt, reportCounterpartyPreCheckFailure, reportUnregisteredAttempt, verify, verifyAndRecord };
|
|
243
|
+
export { type ReportAttemptOptions, type RouteAccessConfigShape, type VerifyOptions, _resetInitCheck, clearCache, extractCredentials, fetchRoutes, hasCredentials, isSharedVerdict, onVerificationResult, parseRetryAfterMs, quickVerify, recordDecision, reportAttempt, reportCounterpartyPreCheckFailure, reportUnregisteredAttempt, verify, verifyAndRecord };
|
package/dist/verify.js
CHANGED
|
@@ -25,6 +25,8 @@ __export(verify_exports, {
|
|
|
25
25
|
extractCredentials: () => extractCredentials,
|
|
26
26
|
fetchRoutes: () => fetchRoutes,
|
|
27
27
|
hasCredentials: () => hasCredentials,
|
|
28
|
+
isSharedVerdict: () => isSharedVerdict,
|
|
29
|
+
onVerificationResult: () => onVerificationResult,
|
|
28
30
|
parseRetryAfterMs: () => parseRetryAfterMs,
|
|
29
31
|
quickVerify: () => quickVerify,
|
|
30
32
|
recordDecision: () => recordDecision,
|
|
@@ -37,7 +39,7 @@ __export(verify_exports, {
|
|
|
37
39
|
module.exports = __toCommonJS(verify_exports);
|
|
38
40
|
|
|
39
41
|
// src/version.ts
|
|
40
|
-
var SDK_VERSION = "5.
|
|
42
|
+
var SDK_VERSION = "5.20.0";
|
|
41
43
|
|
|
42
44
|
// src/http.ts
|
|
43
45
|
var SDK_USER_AGENT = `astrasync-sdk/${SDK_VERSION}`;
|
|
@@ -248,6 +250,7 @@ function cacheResult(request, result, configuredTtl, counterpartyId) {
|
|
|
248
250
|
}
|
|
249
251
|
function clearCache() {
|
|
250
252
|
verificationCache.clear();
|
|
253
|
+
inflightVerifies.clear();
|
|
251
254
|
}
|
|
252
255
|
function extractCredentials(headers, query) {
|
|
253
256
|
const credentials = {};
|
|
@@ -421,6 +424,9 @@ async function callVerifyAccessAPI(config, request) {
|
|
|
421
424
|
if (requestData.enableRuntimeChallenge)
|
|
422
425
|
body.enableRuntimeChallenge = requestData.enableRuntimeChallenge;
|
|
423
426
|
if (requestData.routePolicy) body.routePolicy = requestData.routePolicy;
|
|
427
|
+
if (config.actingProof?.connectorToken) {
|
|
428
|
+
body.actingProof = { connectorToken: config.actingProof.connectorToken };
|
|
429
|
+
}
|
|
424
430
|
if (requestData.approvalHeldByRoute) body.approvalHeldByRoute = true;
|
|
425
431
|
if (requestData.createSession) body.createSession = requestData.createSession;
|
|
426
432
|
if (requestData.durationRequired) body.durationRequired = requestData.durationRequired;
|
|
@@ -588,22 +594,46 @@ async function verify(config, request, options) {
|
|
|
588
594
|
"[VerificationGateway] minTrustScore / minTrustScoreForFull are deprecated in v2.3.0 and have no effect. Server is now the single source of truth for access decisions (verified ID + runtime challenge + PDLSS + trust score). To gate access to an endpoint, configure the endpoint's trust_score_requirement server-side."
|
|
589
595
|
);
|
|
590
596
|
}
|
|
591
|
-
const uncacheable = Boolean(request.commerceArtifacts);
|
|
597
|
+
const uncacheable = Boolean(request.commerceArtifacts) || Boolean(mergedConfig.actingProof);
|
|
592
598
|
if (mergedConfig.cacheTtl !== 0 && !options?.bypassCache && !uncacheable) {
|
|
593
599
|
const cached = getCachedResult(request, mergedConfig.counterpartyId);
|
|
594
600
|
if (cached) {
|
|
595
601
|
if (mergedConfig.debug) {
|
|
596
602
|
console.log("[VerificationGateway] Returning cached result");
|
|
597
603
|
}
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
604
|
+
return sharedVerdict(cached, request);
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
if (mergedConfig.cacheTtl !== 0 && !options?.bypassCache && !uncacheable) {
|
|
608
|
+
const key = getCacheKey(request, mergedConfig.counterpartyId);
|
|
609
|
+
const pending = inflightVerifies.get(key);
|
|
610
|
+
if (pending) return sharedVerdict(await pending, request);
|
|
611
|
+
const flight = verifyViaApi(mergedConfig, request, urls, uncacheable);
|
|
612
|
+
inflightVerifies.set(key, flight);
|
|
613
|
+
try {
|
|
614
|
+
return await flight;
|
|
615
|
+
} finally {
|
|
616
|
+
inflightVerifies.delete(key);
|
|
605
617
|
}
|
|
606
618
|
}
|
|
619
|
+
return verifyViaApi(mergedConfig, request, urls, uncacheable);
|
|
620
|
+
}
|
|
621
|
+
var inflightVerifies = /* @__PURE__ */ new Map();
|
|
622
|
+
var sharedVerdicts = /* @__PURE__ */ new WeakSet();
|
|
623
|
+
function isSharedVerdict(result) {
|
|
624
|
+
return sharedVerdicts.has(result);
|
|
625
|
+
}
|
|
626
|
+
function sharedVerdict(source, request) {
|
|
627
|
+
const hit = { ...source };
|
|
628
|
+
if (request.attemptId) {
|
|
629
|
+
hit.attemptId = request.attemptId;
|
|
630
|
+
} else {
|
|
631
|
+
delete hit.attemptId;
|
|
632
|
+
}
|
|
633
|
+
sharedVerdicts.add(hit);
|
|
634
|
+
return hit;
|
|
635
|
+
}
|
|
636
|
+
async function verifyViaApi(mergedConfig, request, urls, uncacheable) {
|
|
607
637
|
const enrichedRequest = { ...request };
|
|
608
638
|
if (!enrichedRequest.counterpartyUrl && mergedConfig.counterpartyUrl) {
|
|
609
639
|
enrichedRequest.counterpartyUrl = mergedConfig.counterpartyUrl;
|
|
@@ -682,7 +712,9 @@ async function verify(config, request, options) {
|
|
|
682
712
|
fulfilment: apiResponse.fulfilment,
|
|
683
713
|
mandates: apiResponse.mandates,
|
|
684
714
|
kyaToken: apiResponse.kyaToken,
|
|
685
|
-
aep: apiResponse.aep
|
|
715
|
+
aep: apiResponse.aep,
|
|
716
|
+
// 5.20.0 (round 29.1): non-fatal integration warnings (e.g. events_url_missing).
|
|
717
|
+
warnings: apiResponse.warnings
|
|
686
718
|
};
|
|
687
719
|
return result2;
|
|
688
720
|
}
|
|
@@ -750,7 +782,9 @@ async function verify(config, request, options) {
|
|
|
750
782
|
// 5.15.0: merchant-lane AP2 mandates + KYAPay identity token.
|
|
751
783
|
mandates: apiResponse.mandates,
|
|
752
784
|
kyaToken: apiResponse.kyaToken,
|
|
753
|
-
aep: apiResponse.aep
|
|
785
|
+
aep: apiResponse.aep,
|
|
786
|
+
// 5.20.0 (round 29.1): non-fatal integration warnings (e.g. events_url_missing).
|
|
787
|
+
warnings: apiResponse.warnings
|
|
754
788
|
};
|
|
755
789
|
if (result.recommendation === "deny") {
|
|
756
790
|
result.policyAllowed = false;
|
|
@@ -776,8 +810,24 @@ async function verify(config, request, options) {
|
|
|
776
810
|
cacheResult(request, result, mergedConfig.cacheTtl, mergedConfig.counterpartyId);
|
|
777
811
|
}
|
|
778
812
|
}
|
|
813
|
+
notifyVerificationListeners(request, result);
|
|
779
814
|
return result;
|
|
780
815
|
}
|
|
816
|
+
var verificationListeners = /* @__PURE__ */ new Set();
|
|
817
|
+
function onVerificationResult(listener) {
|
|
818
|
+
verificationListeners.add(listener);
|
|
819
|
+
return () => {
|
|
820
|
+
verificationListeners.delete(listener);
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
function notifyVerificationListeners(request, result) {
|
|
824
|
+
for (const listener of verificationListeners) {
|
|
825
|
+
try {
|
|
826
|
+
listener(result, request);
|
|
827
|
+
} catch {
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
}
|
|
781
831
|
async function recordDecision(config, sessionId, decision, reason) {
|
|
782
832
|
const headers = { "Content-Type": "application/json" };
|
|
783
833
|
if (config.apiKey) {
|
|
@@ -842,6 +892,7 @@ async function fetchRoutes(config, counterpartyId, options = {}) {
|
|
|
842
892
|
headers["X-API-Key"] = config.apiKey;
|
|
843
893
|
}
|
|
844
894
|
try {
|
|
895
|
+
headers["X-AstraSync-SDK-Version"] = SDK_VERSION;
|
|
845
896
|
const response = await sdkFetch(
|
|
846
897
|
`${config.apiBaseUrl}/endpoints/${encodeURIComponent(counterpartyId)}/routes` + (options.codeGates?.length ? `?codeGates=${options.codeGates.map(encodeURIComponent).join(",")}` : ""),
|
|
847
898
|
{ method: "GET", headers }
|
|
@@ -856,6 +907,13 @@ async function fetchRoutes(config, counterpartyId, options = {}) {
|
|
|
856
907
|
return null;
|
|
857
908
|
}
|
|
858
909
|
const body = await response.json();
|
|
910
|
+
const type = body.data?.counterpartyType;
|
|
911
|
+
if (typeof type === "string" && options.onEndpointType) {
|
|
912
|
+
try {
|
|
913
|
+
options.onEndpointType(type);
|
|
914
|
+
} catch {
|
|
915
|
+
}
|
|
916
|
+
}
|
|
859
917
|
return body.data?.routes ?? [];
|
|
860
918
|
} catch {
|
|
861
919
|
return null;
|
|
@@ -925,6 +983,8 @@ async function quickVerify(config, credentials) {
|
|
|
925
983
|
extractCredentials,
|
|
926
984
|
fetchRoutes,
|
|
927
985
|
hasCredentials,
|
|
986
|
+
isSharedVerdict,
|
|
987
|
+
onVerificationResult,
|
|
928
988
|
parseRetryAfterMs,
|
|
929
989
|
quickVerify,
|
|
930
990
|
recordDecision,
|