@astrasyncai/verification-gateway 5.4.0 → 5.4.2
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/adapter-interface/interface.d.mts +2 -3
- package/dist/adapter-interface/interface.d.ts +2 -3
- package/dist/adapters/express.d.mts +63 -4
- package/dist/adapters/express.d.ts +63 -4
- package/dist/adapters/express.js +9 -2
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +9 -2
- package/dist/adapters/express.mjs.map +1 -1
- package/dist/adapters/mcp.d.mts +396 -4
- package/dist/adapters/mcp.d.ts +396 -4
- package/dist/adapters/mcp.js +9 -2
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +9 -2
- package/dist/adapters/mcp.mjs.map +1 -1
- package/dist/adapters/nextjs.d.mts +22 -4
- package/dist/adapters/nextjs.d.ts +22 -4
- package/dist/adapters/nextjs.js +9 -2
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +9 -2
- package/dist/adapters/nextjs.mjs.map +1 -1
- package/dist/adapters/sdk.d.mts +157 -3
- package/dist/adapters/sdk.d.ts +157 -3
- package/dist/adapters/sdk.js +35 -15
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +35 -15
- package/dist/adapters/sdk.mjs.map +1 -1
- package/dist/agent/index.d.mts +224 -3
- package/dist/agent/index.d.ts +224 -3
- 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 +9 -2
- package/dist/bin/astrasync-codex-hook.js +9 -2
- package/dist/bin/astrasync-guard.js +9 -2
- package/dist/bin/astrasync.js +9 -2
- package/dist/browser/background.js +9 -2
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +9 -2
- package/dist/browser/background.mjs.map +1 -1
- package/dist/browser/browser-adapter.d.mts +1 -5
- package/dist/browser/browser-adapter.d.ts +1 -5
- package/dist/claude-code/claude-code-adapter.d.mts +1 -5
- package/dist/claude-code/claude-code-adapter.d.ts +1 -5
- package/dist/cli/index.d.mts +1 -5
- package/dist/cli/index.d.ts +1 -5
- 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.d.mts +1 -5
- package/dist/codex/index.d.ts +1 -5
- package/dist/codex/index.js +9 -2
- package/dist/codex/index.js.map +1 -1
- package/dist/codex/index.mjs +9 -2
- package/dist/codex/index.mjs.map +1 -1
- package/dist/cursor/cursor-adapter.d.mts +1 -5
- package/dist/cursor/cursor-adapter.d.ts +1 -5
- package/dist/cursor/extension.d.mts +1 -5
- package/dist/cursor/extension.d.ts +1 -5
- package/dist/cursor/extension.js +9 -2
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +9 -2
- 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 +9 -2
- package/dist/edge-core/index.js.map +1 -1
- package/dist/edge-core/index.mjs +9 -2
- package/dist/edge-core/index.mjs.map +1 -1
- package/dist/gateway/gateway.d.mts +2 -3
- package/dist/gateway/gateway.d.ts +2 -3
- package/dist/gateway/gateway.js +9 -2
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +9 -2
- package/dist/gateway/gateway.mjs.map +1 -1
- package/dist/git-trigger/git-hooks.d.mts +253 -3
- package/dist/git-trigger/git-hooks.d.ts +253 -3
- package/dist/index.d.mts +4506 -42
- package/dist/index.d.ts +4506 -42
- package/dist/index.js +35 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -15
- package/dist/index.mjs.map +1 -1
- package/dist/interface-q1WrMsB1.d.mts +365 -0
- package/dist/interface-q1WrMsB1.d.ts +365 -0
- package/dist/local-evaluator/evaluator.d.mts +2 -3
- package/dist/local-evaluator/evaluator.d.ts +2 -3
- 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 +1324 -4
- package/dist/transport/index.d.ts +1324 -4
- 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-DGh2akuh.d.ts → types-BRz2U0Pn.d.ts} +2 -2
- package/dist/{types-76TB0fxW.d.ts → types-BU04qAAR.d.mts} +59 -213
- package/dist/{types-CD1F9fmp.d.mts → types-BU04qAAR.d.ts} +59 -213
- package/dist/types-Bd2O3eX1.d.mts +769 -0
- package/dist/types-BfILnheI.d.mts +189 -0
- package/dist/types-BfILnheI.d.ts +189 -0
- package/dist/{types-z_RNjHWm.d.mts → types-CfBpm3w5.d.mts} +2 -2
- package/dist/types-DMChboN_.d.ts +769 -0
- package/dist/ui/index.d.mts +1 -2
- package/dist/ui/index.d.ts +1 -2
- package/dist/verify.d.mts +1 -1
- package/dist/verify.d.ts +1 -1
- package/dist/verify.js +9 -2
- package/dist/verify.js.map +1 -1
- package/dist/verify.mjs +9 -2
- package/dist/verify.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/express-BIAT2pe0.d.mts +0 -69
- package/dist/express-D3Tf-b23.d.ts +0 -69
- package/dist/index-BVJkTyIF.d.mts +0 -248
- package/dist/index-By021oSN.d.mts +0 -1469
- package/dist/index-DaMXZabg.d.ts +0 -248
- package/dist/index-iJ9_DdLk.d.ts +0 -1469
- package/dist/mcp-BqfTDZLh.d.mts +0 -397
- package/dist/mcp-OrVOrH-s.d.ts +0 -397
- package/dist/nextjs-DGJXzWst.d.mts +0 -28
- package/dist/nextjs-xM-jdNrX.d.ts +0 -28
- package/dist/sdk-C1IOA5LE.d.ts +0 -173
- package/dist/sdk-C6_-6D-9.d.mts +0 -173
package/dist/sdk-C6_-6D-9.d.mts
DELETED
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
import { v as TrustLevel, S as SDKOptions, x as VerificationResult, w as VerificationRequest } from './types-CD1F9fmp.mjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* AstraSync Universal Verification Gateway — Trust Level helpers.
|
|
5
|
-
*
|
|
6
|
-
* SDK 5.0.0: the `accessLevel` band (`none`/`restricted`/`read-only`/`standard`/
|
|
7
|
-
* `full`/`internal`) was removed entirely — it never gated the access decision
|
|
8
|
-
* (the server does, from a verified ID + runtime challenge + PDLSS match + trust
|
|
9
|
-
* score). What remains here is the coarse trust-level badge derived from the
|
|
10
|
-
* numeric trust score, used only for display.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Trust level score ranges
|
|
15
|
-
*/
|
|
16
|
-
declare const TRUST_LEVEL_RANGES: Record<TrustLevel, {
|
|
17
|
-
min: number;
|
|
18
|
-
max: number;
|
|
19
|
-
}>;
|
|
20
|
-
/**
|
|
21
|
-
* Determine trust level from score
|
|
22
|
-
*/
|
|
23
|
-
declare function getTrustLevel(score: number): TrustLevel;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* AstraSync Universal Verification Gateway - SDK Adapter
|
|
27
|
-
*
|
|
28
|
-
* Direct SDK for verifying agents in any JavaScript/TypeScript environment.
|
|
29
|
-
* Useful for agent-to-agent verification, serverless functions, or custom integrations.
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* ```typescript
|
|
33
|
-
* import { createClient } from '@astrasyncai/verification-gateway/sdk';
|
|
34
|
-
*
|
|
35
|
-
* const gateway = createClient({
|
|
36
|
-
* apiBaseUrl: 'https://astrasync.ai/api',
|
|
37
|
-
* });
|
|
38
|
-
*
|
|
39
|
-
* // Verify another agent before interacting
|
|
40
|
-
* const result = await gateway.verify({
|
|
41
|
-
* astraId: 'ASTRA-abc123',
|
|
42
|
-
* purpose: 'data-exchange',
|
|
43
|
-
* });
|
|
44
|
-
*
|
|
45
|
-
* if (result.identityVerified && result.policyAllowed) {
|
|
46
|
-
* // Safe to interact with this agent
|
|
47
|
-
* }
|
|
48
|
-
* ```
|
|
49
|
-
*/
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Verification Gateway SDK Client
|
|
53
|
-
*/
|
|
54
|
-
declare class VerificationGatewayClient {
|
|
55
|
-
private config;
|
|
56
|
-
private timeout;
|
|
57
|
-
private retryConfig;
|
|
58
|
-
constructor(options: SDKOptions);
|
|
59
|
-
/**
|
|
60
|
-
* Full verification with all details
|
|
61
|
-
*/
|
|
62
|
-
verify(options: {
|
|
63
|
-
astraId?: string;
|
|
64
|
-
apiKey?: string;
|
|
65
|
-
jwt?: string;
|
|
66
|
-
purpose?: string;
|
|
67
|
-
action?: string;
|
|
68
|
-
resourceType?: string;
|
|
69
|
-
resource?: string;
|
|
70
|
-
jurisdiction?: string;
|
|
71
|
-
transactionValue?: number;
|
|
72
|
-
currency?: string;
|
|
73
|
-
isSubAgentRequest?: boolean;
|
|
74
|
-
parentAgentId?: string;
|
|
75
|
-
subAgentDepth?: number;
|
|
76
|
-
counterpartyUrl?: string;
|
|
77
|
-
counterpartyType?: string;
|
|
78
|
-
}): Promise<VerificationResult>;
|
|
79
|
-
/**
|
|
80
|
-
* 5.4.0 (astra-pay): confirm-leg of a checkout — the ONLY call that may fire
|
|
81
|
-
* first-party charge-at-redeem (server-side settlement on the owner's saved
|
|
82
|
-
* instrument). This is the supported public surface for the confirm leg;
|
|
83
|
-
* `verify()` deliberately does not expose the checkout fields, so settlement
|
|
84
|
-
* can never fire by accident from a generic verify.
|
|
85
|
-
*
|
|
86
|
-
* Sends `commercePhase: 'confirm'` plus the checkout session id (per-cart
|
|
87
|
-
* idempotency) and line items (order/receipt plane), and identifies the
|
|
88
|
-
* merchant via `counterpartyUrl`/`counterpartyType` (required — the backend
|
|
89
|
-
* only settles a merchant-mediated grant against a first-party storefront).
|
|
90
|
-
* `purpose`/`action` default to the canonical shopping pair.
|
|
91
|
-
*
|
|
92
|
-
* Returns the full `VerificationResult`: read `.settlementOutcome` for the
|
|
93
|
-
* settled/failed/requires_action/no_instrument outcome (+ `orderId`), and the
|
|
94
|
-
* identity/policy/`failures` fields for a denial. On any non-`confirm`/first-
|
|
95
|
-
* party path `settlementOutcome` is simply absent — no money moves.
|
|
96
|
-
*/
|
|
97
|
-
confirmCheckout(options: {
|
|
98
|
-
astraId?: string;
|
|
99
|
-
apiKey?: string;
|
|
100
|
-
jwt?: string;
|
|
101
|
-
purpose?: string;
|
|
102
|
-
action?: string;
|
|
103
|
-
transactionValue?: number;
|
|
104
|
-
currency?: string;
|
|
105
|
-
checkoutSessionId?: string;
|
|
106
|
-
checkoutItems?: VerificationRequest['checkoutItems'];
|
|
107
|
-
counterpartyUrl?: string;
|
|
108
|
-
counterpartyType?: string;
|
|
109
|
-
}): Promise<VerificationResult>;
|
|
110
|
-
/**
|
|
111
|
-
* Quick verification — checks credentials and policy in one call.
|
|
112
|
-
*
|
|
113
|
-
* The return shape mirrors `VerificationResult`'s identity/policy
|
|
114
|
-
* split. Map to HTTP status the same way: `!identityVerified` → 401,
|
|
115
|
-
* `identityVerified && !policyAllowed` → 403.
|
|
116
|
-
*/
|
|
117
|
-
quickVerify(credentials: {
|
|
118
|
-
astraId?: string;
|
|
119
|
-
apiKey?: string;
|
|
120
|
-
jwt?: string;
|
|
121
|
-
}): Promise<{
|
|
122
|
-
identityVerified: boolean;
|
|
123
|
-
policyAllowed: boolean;
|
|
124
|
-
reason?: string;
|
|
125
|
-
}>;
|
|
126
|
-
/**
|
|
127
|
-
* Verify a specific ASTRA-ID
|
|
128
|
-
*/
|
|
129
|
-
verifyAstraId(astraId: string, options?: {
|
|
130
|
-
purpose?: string;
|
|
131
|
-
action?: string;
|
|
132
|
-
}): Promise<VerificationResult>;
|
|
133
|
-
/**
|
|
134
|
-
* Verify using an API key
|
|
135
|
-
*/
|
|
136
|
-
verifyApiKey(apiKey: string, options?: {
|
|
137
|
-
purpose?: string;
|
|
138
|
-
action?: string;
|
|
139
|
-
}): Promise<VerificationResult>;
|
|
140
|
-
/**
|
|
141
|
-
* Clear the verification cache
|
|
142
|
-
*/
|
|
143
|
-
clearCache(): void;
|
|
144
|
-
/**
|
|
145
|
-
* Execute a function with retry logic
|
|
146
|
-
*/
|
|
147
|
-
private executeWithRetry;
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Create a new SDK client
|
|
151
|
-
*/
|
|
152
|
-
declare function createClient(options: SDKOptions): VerificationGatewayClient;
|
|
153
|
-
/**
|
|
154
|
-
* One-shot verification without creating a client
|
|
155
|
-
*/
|
|
156
|
-
declare function verifyOnce(options: SDKOptions & {
|
|
157
|
-
astraId?: string;
|
|
158
|
-
apiKey?: string;
|
|
159
|
-
jwt?: string;
|
|
160
|
-
purpose?: string;
|
|
161
|
-
action?: string;
|
|
162
|
-
}): Promise<VerificationResult>;
|
|
163
|
-
|
|
164
|
-
type sdk_VerificationGatewayClient = VerificationGatewayClient;
|
|
165
|
-
declare const sdk_VerificationGatewayClient: typeof VerificationGatewayClient;
|
|
166
|
-
declare const sdk_createClient: typeof createClient;
|
|
167
|
-
declare const sdk_getTrustLevel: typeof getTrustLevel;
|
|
168
|
-
declare const sdk_verifyOnce: typeof verifyOnce;
|
|
169
|
-
declare namespace sdk {
|
|
170
|
-
export { sdk_VerificationGatewayClient as VerificationGatewayClient, sdk_createClient as createClient, sdk_getTrustLevel as getTrustLevel, sdk_verifyOnce as verifyOnce };
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
export { TRUST_LEVEL_RANGES as T, VerificationGatewayClient as V, createClient as c, getTrustLevel as g, sdk as s, verifyOnce as v };
|