@astrasyncai/verification-gateway 1.0.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 +213 -0
- package/dist/adapters/express.d.mts +3 -0
- package/dist/adapters/express.d.ts +3 -0
- package/dist/adapters/express.js +516 -0
- package/dist/adapters/express.js.map +1 -0
- package/dist/adapters/express.mjs +486 -0
- package/dist/adapters/express.mjs.map +1 -0
- package/dist/adapters/nextjs.d.mts +3 -0
- package/dist/adapters/nextjs.d.ts +3 -0
- package/dist/adapters/nextjs.js +624 -0
- package/dist/adapters/nextjs.js.map +1 -0
- package/dist/adapters/nextjs.mjs +586 -0
- package/dist/adapters/nextjs.mjs.map +1 -0
- package/dist/adapters/sdk.d.mts +2 -0
- package/dist/adapters/sdk.d.ts +2 -0
- package/dist/adapters/sdk.js +505 -0
- package/dist/adapters/sdk.js.map +1 -0
- package/dist/adapters/sdk.mjs +473 -0
- package/dist/adapters/sdk.mjs.map +1 -0
- package/dist/express-BhD3mWsL.d.ts +64 -0
- package/dist/express-DUDYpvNZ.d.mts +64 -0
- package/dist/index.d.mts +353 -0
- package/dist/index.d.ts +353 -0
- package/dist/index.js +1499 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1446 -0
- package/dist/index.mjs.map +1 -0
- package/dist/nextjs-BtqyLSVQ.d.mts +22 -0
- package/dist/nextjs-C9FPOjSh.d.ts +22 -0
- package/dist/sdk-BkVigGjF.d.ts +190 -0
- package/dist/sdk-xCbZgeZx.d.mts +190 -0
- package/dist/types-CS6v75-d.d.mts +359 -0
- package/dist/types-CS6v75-d.d.ts +359 -0
- package/dist/ui/index.d.mts +140 -0
- package/dist/ui/index.d.ts +140 -0
- package/dist/ui/index.js +826 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/index.mjs +782 -0
- package/dist/ui/index.mjs.map +1 -0
- package/package.json +89 -0
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AstraSync Universal Verification Gateway Types
|
|
3
|
+
*
|
|
4
|
+
* TypeScript type definitions for agent verification across all counterparty types.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Trust levels assigned to agents based on their composite trust score
|
|
8
|
+
*/
|
|
9
|
+
type TrustLevel = 'BRONZE' | 'SILVER' | 'GOLD' | 'PLATINUM';
|
|
10
|
+
/**
|
|
11
|
+
* Access levels granted based on verification result
|
|
12
|
+
* - none: No credentials provided, show guidance
|
|
13
|
+
* - guidance: Commerce Shield overlay with registration info
|
|
14
|
+
* - read-only: Can browse, no mutations
|
|
15
|
+
* - standard: Normal access per PDLSS
|
|
16
|
+
* - full: Full access for high-trust agents
|
|
17
|
+
* - internal: Internal org access (same organization)
|
|
18
|
+
*/
|
|
19
|
+
type AccessLevel = 'none' | 'guidance' | 'read-only' | 'standard' | 'full' | 'internal';
|
|
20
|
+
/**
|
|
21
|
+
* Types of counterparties that can integrate the gateway
|
|
22
|
+
*/
|
|
23
|
+
type CounterpartyType = 'agent' | 'api' | 'mcp_server' | 'website' | 'other';
|
|
24
|
+
/**
|
|
25
|
+
* Agent credentials extracted from request
|
|
26
|
+
*/
|
|
27
|
+
interface AgentCredentials {
|
|
28
|
+
/** ASTRA-xxx identifier */
|
|
29
|
+
astraId?: string;
|
|
30
|
+
/** API key for authentication */
|
|
31
|
+
apiKey?: string;
|
|
32
|
+
/** JWT token */
|
|
33
|
+
jwt?: string;
|
|
34
|
+
/** Raw authorization header */
|
|
35
|
+
authorizationHeader?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Configuration options for the verification gateway
|
|
39
|
+
*/
|
|
40
|
+
interface GatewayConfig {
|
|
41
|
+
/** AstraSync API base URL */
|
|
42
|
+
apiBaseUrl: string;
|
|
43
|
+
/** API key for authenticating with AstraSync (optional for public endpoints) */
|
|
44
|
+
apiKey?: string;
|
|
45
|
+
/** Default access level for unverified requests */
|
|
46
|
+
defaultAccessLevel?: AccessLevel;
|
|
47
|
+
/** Minimum trust score required for standard access */
|
|
48
|
+
minTrustScore?: number;
|
|
49
|
+
/** Minimum trust score required for full access */
|
|
50
|
+
minTrustScoreForFull?: number;
|
|
51
|
+
/** Cache verification results (TTL in seconds) */
|
|
52
|
+
cacheTtl?: number;
|
|
53
|
+
/** Enable debug logging */
|
|
54
|
+
debug?: boolean;
|
|
55
|
+
/** Custom headers to send with verification requests */
|
|
56
|
+
customHeaders?: Record<string, string>;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Verified agent information
|
|
60
|
+
*/
|
|
61
|
+
interface VerifiedAgent {
|
|
62
|
+
/** ASTRA-xxx identifier */
|
|
63
|
+
astraId: string;
|
|
64
|
+
/** Agent display name */
|
|
65
|
+
name: string;
|
|
66
|
+
/** Composite trust score (0-100) */
|
|
67
|
+
trustScore: number;
|
|
68
|
+
/** Trust level tier */
|
|
69
|
+
trustLevel: TrustLevel;
|
|
70
|
+
/** Whether agent is blockchain-verified */
|
|
71
|
+
blockchainVerified: boolean;
|
|
72
|
+
/** Agent status */
|
|
73
|
+
status: 'active' | 'inactive' | 'suspended' | 'migrating' | 'terminated' | 'retired';
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Verified developer (KYD) information
|
|
77
|
+
*/
|
|
78
|
+
interface VerifiedDeveloper {
|
|
79
|
+
/** ASTRAD-xxx identifier */
|
|
80
|
+
astradId: string;
|
|
81
|
+
/** Developer name */
|
|
82
|
+
name?: string;
|
|
83
|
+
/** Developer trust score */
|
|
84
|
+
trustScore: number;
|
|
85
|
+
/** Whether developer identity is verified */
|
|
86
|
+
verified: boolean;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Verified organization (KYO) information
|
|
90
|
+
*/
|
|
91
|
+
interface VerifiedOrganization {
|
|
92
|
+
/** Organization name */
|
|
93
|
+
name: string;
|
|
94
|
+
/** Whether organization is verified */
|
|
95
|
+
verified: boolean;
|
|
96
|
+
/** Organization trust score */
|
|
97
|
+
trustScore: number;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* PDLSS policy information returned with verification
|
|
101
|
+
*/
|
|
102
|
+
interface PDLSSInfo {
|
|
103
|
+
/** Whether purpose was allowed */
|
|
104
|
+
purposeAllowed: boolean;
|
|
105
|
+
/** Whether within duration constraints */
|
|
106
|
+
withinDuration: boolean;
|
|
107
|
+
/** Whether within limits */
|
|
108
|
+
withinLimits: boolean;
|
|
109
|
+
/** Whether scope is allowed */
|
|
110
|
+
scopeAllowed: boolean;
|
|
111
|
+
/** Whether self-instantiation is allowed (if applicable) */
|
|
112
|
+
selfInstantiationAllowed: boolean;
|
|
113
|
+
/** Allowed purpose categories */
|
|
114
|
+
allowedPurposes?: string[];
|
|
115
|
+
/** Transaction limits */
|
|
116
|
+
limits?: Record<string, number>;
|
|
117
|
+
/** Allowed scope/resources */
|
|
118
|
+
scope?: string[];
|
|
119
|
+
/** Applied policy details */
|
|
120
|
+
appliedPolicy?: {
|
|
121
|
+
boundaryId: string;
|
|
122
|
+
boundaryName: string;
|
|
123
|
+
policyId: string;
|
|
124
|
+
policyVersion: string;
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Guidance information for unverified agents
|
|
129
|
+
*/
|
|
130
|
+
interface GuidanceInfo {
|
|
131
|
+
/** Human-readable guidance message */
|
|
132
|
+
message: string;
|
|
133
|
+
/** URL to register for AstraSync */
|
|
134
|
+
registrationUrl: string;
|
|
135
|
+
/** URL to documentation */
|
|
136
|
+
documentationUrl: string;
|
|
137
|
+
/** Steps to get verified */
|
|
138
|
+
steps?: string[];
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Complete verification result
|
|
142
|
+
*/
|
|
143
|
+
interface VerificationResult {
|
|
144
|
+
/** Whether the agent is verified */
|
|
145
|
+
verified: boolean;
|
|
146
|
+
/** Access level granted */
|
|
147
|
+
accessLevel: AccessLevel;
|
|
148
|
+
/** Verified agent info (if verified) */
|
|
149
|
+
agent?: VerifiedAgent;
|
|
150
|
+
/** Developer info (if available) */
|
|
151
|
+
developer?: VerifiedDeveloper;
|
|
152
|
+
/** Organization info (if available) */
|
|
153
|
+
organization?: VerifiedOrganization;
|
|
154
|
+
/** PDLSS policy info (if verified) */
|
|
155
|
+
pdlss?: PDLSSInfo;
|
|
156
|
+
/** Guidance for unverified agents */
|
|
157
|
+
guidance?: GuidanceInfo;
|
|
158
|
+
/** Reasons for denial (if not allowed) */
|
|
159
|
+
denialReasons?: string[];
|
|
160
|
+
/** Whether step-up authentication is required */
|
|
161
|
+
requiresStepUp?: boolean;
|
|
162
|
+
/** Whether approval is required */
|
|
163
|
+
requiresApproval?: boolean;
|
|
164
|
+
/** Timestamp of verification */
|
|
165
|
+
verifiedAt: Date;
|
|
166
|
+
/** TTL for this result (seconds) */
|
|
167
|
+
cacheTtl?: number;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Request context for verification
|
|
171
|
+
*/
|
|
172
|
+
interface VerificationRequest {
|
|
173
|
+
/** Agent credentials */
|
|
174
|
+
credentials: AgentCredentials;
|
|
175
|
+
/** Purpose of the access request */
|
|
176
|
+
purpose?: string;
|
|
177
|
+
/** Specific action being performed */
|
|
178
|
+
action?: string;
|
|
179
|
+
/** Type of resource being accessed */
|
|
180
|
+
resourceType?: string;
|
|
181
|
+
/** Specific resource identifier */
|
|
182
|
+
resource?: string;
|
|
183
|
+
/** Jurisdiction for the request */
|
|
184
|
+
jurisdiction?: string;
|
|
185
|
+
/** Transaction value (if applicable) */
|
|
186
|
+
transactionValue?: number;
|
|
187
|
+
/** Currency for transaction value */
|
|
188
|
+
currency?: string;
|
|
189
|
+
/** Whether this is a sub-agent request */
|
|
190
|
+
isSubAgentRequest?: boolean;
|
|
191
|
+
/** Parent agent ID for sub-agent requests */
|
|
192
|
+
parentAgentId?: string;
|
|
193
|
+
/** Depth of sub-agent chain */
|
|
194
|
+
subAgentDepth?: number;
|
|
195
|
+
/** Client IP address */
|
|
196
|
+
clientIp?: string;
|
|
197
|
+
/** User agent string */
|
|
198
|
+
userAgent?: string;
|
|
199
|
+
/** Enable runtime challenge for this request */
|
|
200
|
+
enableRuntimeChallenge?: boolean;
|
|
201
|
+
/** Create a verification session (returns sessionId) */
|
|
202
|
+
createSession?: boolean;
|
|
203
|
+
/** Counterparty type */
|
|
204
|
+
counterpartyType?: CounterpartyType;
|
|
205
|
+
/** Runtime challenge options */
|
|
206
|
+
runtimeChallengeOptions?: {
|
|
207
|
+
timeoutOverride?: number;
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Route-specific access configuration
|
|
212
|
+
*/
|
|
213
|
+
interface RouteAccessConfig {
|
|
214
|
+
/** Route pattern (supports wildcards) */
|
|
215
|
+
pattern: string;
|
|
216
|
+
/** HTTP method (or * for all) */
|
|
217
|
+
method: string | '*';
|
|
218
|
+
/** Minimum access level required */
|
|
219
|
+
minAccessLevel: AccessLevel;
|
|
220
|
+
/** Minimum trust score required (optional) */
|
|
221
|
+
minTrustScore?: number;
|
|
222
|
+
/** Required purposes (optional) */
|
|
223
|
+
requiredPurposes?: string[];
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Express middleware options
|
|
227
|
+
*/
|
|
228
|
+
interface ExpressMiddlewareOptions extends GatewayConfig {
|
|
229
|
+
/** Route access configurations */
|
|
230
|
+
routes?: RouteAccessConfig[];
|
|
231
|
+
/** Function to extract credentials from request */
|
|
232
|
+
extractCredentials?: (req: unknown) => AgentCredentials;
|
|
233
|
+
/** Function to extract purpose from request */
|
|
234
|
+
extractPurpose?: (req: unknown) => string | undefined;
|
|
235
|
+
/** Skip verification for certain paths */
|
|
236
|
+
skipPaths?: string[];
|
|
237
|
+
/** Custom response for denied requests */
|
|
238
|
+
onDenied?: (result: VerificationResult, req: unknown, res: unknown) => void;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Next.js middleware options
|
|
242
|
+
*/
|
|
243
|
+
interface NextJsMiddlewareOptions extends GatewayConfig {
|
|
244
|
+
/** Route access configurations */
|
|
245
|
+
routes?: RouteAccessConfig[];
|
|
246
|
+
/** Paths to skip verification */
|
|
247
|
+
skipPaths?: string[];
|
|
248
|
+
/** Whether to show Commerce Shield overlay for unverified */
|
|
249
|
+
showCommerceShield?: boolean;
|
|
250
|
+
/** Commerce Shield configuration */
|
|
251
|
+
commerceShield?: {
|
|
252
|
+
title?: string;
|
|
253
|
+
message?: string;
|
|
254
|
+
allowGuestAccess?: boolean;
|
|
255
|
+
guestAccessLevel?: AccessLevel;
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* SDK function options
|
|
260
|
+
*/
|
|
261
|
+
interface SDKOptions extends GatewayConfig {
|
|
262
|
+
/** Timeout for verification requests (ms) */
|
|
263
|
+
timeout?: number;
|
|
264
|
+
/** Retry configuration */
|
|
265
|
+
retry?: {
|
|
266
|
+
maxRetries: number;
|
|
267
|
+
backoffMs: number;
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Token guidance returned from verify-access
|
|
272
|
+
*/
|
|
273
|
+
interface TokenGuidance {
|
|
274
|
+
recommendedScopes: string[];
|
|
275
|
+
recommendedTtlSeconds: number;
|
|
276
|
+
recommendedRateLimit?: {
|
|
277
|
+
requestsPerMinute: number;
|
|
278
|
+
maxTransactionValue?: number;
|
|
279
|
+
currency?: string;
|
|
280
|
+
};
|
|
281
|
+
jurisdictionConstraints?: string[];
|
|
282
|
+
delegationAllowed: boolean;
|
|
283
|
+
maxDelegationDepth?: number;
|
|
284
|
+
safetyDefaults: {
|
|
285
|
+
writePrivilegesRequested: boolean;
|
|
286
|
+
shortLivedTokenRecommended: boolean;
|
|
287
|
+
scopeConvention: 'astrasync-canonical';
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Runtime challenge result
|
|
292
|
+
*/
|
|
293
|
+
interface RuntimeChallengeResult {
|
|
294
|
+
status: 'passed' | 'failed' | 'skipped' | 'timeout' | 'not_supported';
|
|
295
|
+
challengeId?: string;
|
|
296
|
+
challengeSentAt?: string;
|
|
297
|
+
responseReceivedAt?: string;
|
|
298
|
+
latencyMs?: number;
|
|
299
|
+
reason?: string;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Enhanced verification result (extends existing VerificationResult)
|
|
303
|
+
*/
|
|
304
|
+
interface EnhancedVerificationResult extends VerificationResult {
|
|
305
|
+
sessionId?: string;
|
|
306
|
+
runtimeChallenge?: RuntimeChallengeResult;
|
|
307
|
+
tokenGuidance?: TokenGuidance;
|
|
308
|
+
recommendation?: 'grant' | 'deny' | 'step_up_required';
|
|
309
|
+
recommendationReasons?: string[];
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Cross-protocol credential config
|
|
313
|
+
*/
|
|
314
|
+
interface AstraSyncCredentials {
|
|
315
|
+
agentId: string;
|
|
316
|
+
verifyUrl?: string;
|
|
317
|
+
challengeUrl?: string;
|
|
318
|
+
pdlss?: {
|
|
319
|
+
purpose?: {
|
|
320
|
+
category: string;
|
|
321
|
+
action?: string;
|
|
322
|
+
};
|
|
323
|
+
duration?: {
|
|
324
|
+
maxSessionDuration?: number;
|
|
325
|
+
};
|
|
326
|
+
scope?: {
|
|
327
|
+
jurisdiction?: string;
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Protocol transport type
|
|
333
|
+
*/
|
|
334
|
+
type ProtocolTransport = 'http' | 'a2a' | 'mcp';
|
|
335
|
+
/**
|
|
336
|
+
* Commerce Shield UI props
|
|
337
|
+
*/
|
|
338
|
+
interface CommerceShieldProps {
|
|
339
|
+
/** Whether the shield is visible */
|
|
340
|
+
visible: boolean;
|
|
341
|
+
/** Verification result (if any) */
|
|
342
|
+
result?: VerificationResult;
|
|
343
|
+
/** Callback when user chooses to register */
|
|
344
|
+
onRegister?: () => void;
|
|
345
|
+
/** Callback when user chooses guest access */
|
|
346
|
+
onGuestAccess?: () => void;
|
|
347
|
+
/** Callback when user dismisses */
|
|
348
|
+
onDismiss?: () => void;
|
|
349
|
+
/** Custom title */
|
|
350
|
+
title?: string;
|
|
351
|
+
/** Custom message */
|
|
352
|
+
message?: string;
|
|
353
|
+
/** Whether guest access is allowed */
|
|
354
|
+
allowGuestAccess?: boolean;
|
|
355
|
+
/** Custom styles */
|
|
356
|
+
className?: string;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
export type { AgentCredentials as A, CommerceShieldProps as C, EnhancedVerificationResult as E, GatewayConfig as G, NextJsMiddlewareOptions as N, ProtocolTransport as P, RouteAccessConfig as R, SDKOptions as S, TokenGuidance as T, VerificationRequest as V, AccessLevel as a, VerificationResult as b, AstraSyncCredentials as c, CounterpartyType as d, ExpressMiddlewareOptions as e, GuidanceInfo as f, PDLSSInfo as g, RuntimeChallengeResult as h, TrustLevel as i, VerifiedAgent as j, VerifiedDeveloper as k, VerifiedOrganization as l };
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { C as CommerceShieldProps, b as VerificationResult, A as AgentCredentials, f as GuidanceInfo, i as TrustLevel } from '../types-CS6v75-d.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* AstraSync Commerce Shield Component
|
|
5
|
+
*
|
|
6
|
+
* A React component that displays a verification overlay for unverified agents.
|
|
7
|
+
* Shows guidance on how to register and get verified access.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Commerce Shield overlay component
|
|
12
|
+
*/
|
|
13
|
+
declare function CommerceShield({ visible, result, onRegister, onGuestAccess, onDismiss, title, message, allowGuestAccess, className, }: CommerceShieldProps): JSX.Element | null;
|
|
14
|
+
/**
|
|
15
|
+
* Hook to manage Commerce Shield visibility
|
|
16
|
+
*/
|
|
17
|
+
declare function useCommerceShield(verificationResult: VerificationResult | null): {
|
|
18
|
+
visible: boolean;
|
|
19
|
+
dismiss: () => void;
|
|
20
|
+
reset: () => void;
|
|
21
|
+
result: VerificationResult | null;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* AstraSync Credential Prompt Component
|
|
26
|
+
*
|
|
27
|
+
* A React component for prompting users to enter their agent credentials.
|
|
28
|
+
* Useful for single-page applications where agents may provide credentials interactively.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Credential prompt props
|
|
33
|
+
*/
|
|
34
|
+
interface CredentialPromptProps {
|
|
35
|
+
/** Whether the prompt is visible */
|
|
36
|
+
visible: boolean;
|
|
37
|
+
/** Callback when credentials are submitted */
|
|
38
|
+
onSubmit: (credentials: AgentCredentials) => void;
|
|
39
|
+
/** Callback when prompt is dismissed */
|
|
40
|
+
onDismiss?: () => void;
|
|
41
|
+
/** Title text */
|
|
42
|
+
title?: string;
|
|
43
|
+
/** Description text */
|
|
44
|
+
description?: string;
|
|
45
|
+
/** Whether to show API key input */
|
|
46
|
+
showApiKey?: boolean;
|
|
47
|
+
/** Whether to show JWT input */
|
|
48
|
+
showJwt?: boolean;
|
|
49
|
+
/** Loading state */
|
|
50
|
+
loading?: boolean;
|
|
51
|
+
/** Error message to display */
|
|
52
|
+
error?: string;
|
|
53
|
+
/** Custom class name */
|
|
54
|
+
className?: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Credential prompt component
|
|
58
|
+
*/
|
|
59
|
+
declare function CredentialPrompt({ visible, onSubmit, onDismiss, title, description, showApiKey, showJwt, loading, error, className, }: CredentialPromptProps): JSX.Element | null;
|
|
60
|
+
/**
|
|
61
|
+
* Hook to manage credential prompt state
|
|
62
|
+
*/
|
|
63
|
+
declare function useCredentialPrompt(): {
|
|
64
|
+
visible: boolean;
|
|
65
|
+
credentials: AgentCredentials | null;
|
|
66
|
+
loading: boolean;
|
|
67
|
+
error: string | null;
|
|
68
|
+
show: () => void;
|
|
69
|
+
hide: () => void;
|
|
70
|
+
submit: (creds: AgentCredentials) => void;
|
|
71
|
+
setError: (err: string) => void;
|
|
72
|
+
complete: () => void;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* AstraSync Guidance Components
|
|
77
|
+
*
|
|
78
|
+
* React components for displaying guidance information to unverified agents.
|
|
79
|
+
* Provides helpful information on how to register and get verified.
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Guidance card props
|
|
84
|
+
*/
|
|
85
|
+
interface GuidanceCardProps {
|
|
86
|
+
/** Guidance information */
|
|
87
|
+
guidance: GuidanceInfo;
|
|
88
|
+
/** Card title */
|
|
89
|
+
title?: string;
|
|
90
|
+
/** Whether to show as compact inline */
|
|
91
|
+
compact?: boolean;
|
|
92
|
+
/** Custom class name */
|
|
93
|
+
className?: string;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Trust level badge props
|
|
97
|
+
*/
|
|
98
|
+
interface TrustLevelBadgeProps {
|
|
99
|
+
/** Trust level */
|
|
100
|
+
level: TrustLevel;
|
|
101
|
+
/** Trust score */
|
|
102
|
+
score?: number;
|
|
103
|
+
/** Size variant */
|
|
104
|
+
size?: 'sm' | 'md' | 'lg';
|
|
105
|
+
/** Custom class name */
|
|
106
|
+
className?: string;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Access level indicator props
|
|
110
|
+
*/
|
|
111
|
+
interface AccessLevelIndicatorProps {
|
|
112
|
+
/** Current access level */
|
|
113
|
+
accessLevel: string;
|
|
114
|
+
/** Required access level */
|
|
115
|
+
requiredLevel?: string;
|
|
116
|
+
/** Custom class name */
|
|
117
|
+
className?: string;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Guidance card component
|
|
121
|
+
*/
|
|
122
|
+
declare function GuidanceCard({ guidance, title, compact, className, }: GuidanceCardProps): JSX.Element;
|
|
123
|
+
/**
|
|
124
|
+
* Trust level badge component
|
|
125
|
+
*/
|
|
126
|
+
declare function TrustLevelBadge({ level, score, size, className, }: TrustLevelBadgeProps): JSX.Element;
|
|
127
|
+
/**
|
|
128
|
+
* Access level indicator component
|
|
129
|
+
*/
|
|
130
|
+
declare function AccessLevelIndicator({ accessLevel, requiredLevel, className, }: AccessLevelIndicatorProps): JSX.Element;
|
|
131
|
+
/**
|
|
132
|
+
* Denial reasons list component
|
|
133
|
+
*/
|
|
134
|
+
interface DenialReasonsProps {
|
|
135
|
+
reasons: string[];
|
|
136
|
+
className?: string;
|
|
137
|
+
}
|
|
138
|
+
declare function DenialReasons({ reasons, className }: DenialReasonsProps): JSX.Element;
|
|
139
|
+
|
|
140
|
+
export { AccessLevelIndicator, type AccessLevelIndicatorProps, CommerceShield, CredentialPrompt, type CredentialPromptProps, DenialReasons, type DenialReasonsProps, GuidanceCard, type GuidanceCardProps, TrustLevelBadge, type TrustLevelBadgeProps, useCommerceShield, useCredentialPrompt };
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { C as CommerceShieldProps, b as VerificationResult, A as AgentCredentials, f as GuidanceInfo, i as TrustLevel } from '../types-CS6v75-d.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* AstraSync Commerce Shield Component
|
|
5
|
+
*
|
|
6
|
+
* A React component that displays a verification overlay for unverified agents.
|
|
7
|
+
* Shows guidance on how to register and get verified access.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Commerce Shield overlay component
|
|
12
|
+
*/
|
|
13
|
+
declare function CommerceShield({ visible, result, onRegister, onGuestAccess, onDismiss, title, message, allowGuestAccess, className, }: CommerceShieldProps): JSX.Element | null;
|
|
14
|
+
/**
|
|
15
|
+
* Hook to manage Commerce Shield visibility
|
|
16
|
+
*/
|
|
17
|
+
declare function useCommerceShield(verificationResult: VerificationResult | null): {
|
|
18
|
+
visible: boolean;
|
|
19
|
+
dismiss: () => void;
|
|
20
|
+
reset: () => void;
|
|
21
|
+
result: VerificationResult | null;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* AstraSync Credential Prompt Component
|
|
26
|
+
*
|
|
27
|
+
* A React component for prompting users to enter their agent credentials.
|
|
28
|
+
* Useful for single-page applications where agents may provide credentials interactively.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Credential prompt props
|
|
33
|
+
*/
|
|
34
|
+
interface CredentialPromptProps {
|
|
35
|
+
/** Whether the prompt is visible */
|
|
36
|
+
visible: boolean;
|
|
37
|
+
/** Callback when credentials are submitted */
|
|
38
|
+
onSubmit: (credentials: AgentCredentials) => void;
|
|
39
|
+
/** Callback when prompt is dismissed */
|
|
40
|
+
onDismiss?: () => void;
|
|
41
|
+
/** Title text */
|
|
42
|
+
title?: string;
|
|
43
|
+
/** Description text */
|
|
44
|
+
description?: string;
|
|
45
|
+
/** Whether to show API key input */
|
|
46
|
+
showApiKey?: boolean;
|
|
47
|
+
/** Whether to show JWT input */
|
|
48
|
+
showJwt?: boolean;
|
|
49
|
+
/** Loading state */
|
|
50
|
+
loading?: boolean;
|
|
51
|
+
/** Error message to display */
|
|
52
|
+
error?: string;
|
|
53
|
+
/** Custom class name */
|
|
54
|
+
className?: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Credential prompt component
|
|
58
|
+
*/
|
|
59
|
+
declare function CredentialPrompt({ visible, onSubmit, onDismiss, title, description, showApiKey, showJwt, loading, error, className, }: CredentialPromptProps): JSX.Element | null;
|
|
60
|
+
/**
|
|
61
|
+
* Hook to manage credential prompt state
|
|
62
|
+
*/
|
|
63
|
+
declare function useCredentialPrompt(): {
|
|
64
|
+
visible: boolean;
|
|
65
|
+
credentials: AgentCredentials | null;
|
|
66
|
+
loading: boolean;
|
|
67
|
+
error: string | null;
|
|
68
|
+
show: () => void;
|
|
69
|
+
hide: () => void;
|
|
70
|
+
submit: (creds: AgentCredentials) => void;
|
|
71
|
+
setError: (err: string) => void;
|
|
72
|
+
complete: () => void;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* AstraSync Guidance Components
|
|
77
|
+
*
|
|
78
|
+
* React components for displaying guidance information to unverified agents.
|
|
79
|
+
* Provides helpful information on how to register and get verified.
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Guidance card props
|
|
84
|
+
*/
|
|
85
|
+
interface GuidanceCardProps {
|
|
86
|
+
/** Guidance information */
|
|
87
|
+
guidance: GuidanceInfo;
|
|
88
|
+
/** Card title */
|
|
89
|
+
title?: string;
|
|
90
|
+
/** Whether to show as compact inline */
|
|
91
|
+
compact?: boolean;
|
|
92
|
+
/** Custom class name */
|
|
93
|
+
className?: string;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Trust level badge props
|
|
97
|
+
*/
|
|
98
|
+
interface TrustLevelBadgeProps {
|
|
99
|
+
/** Trust level */
|
|
100
|
+
level: TrustLevel;
|
|
101
|
+
/** Trust score */
|
|
102
|
+
score?: number;
|
|
103
|
+
/** Size variant */
|
|
104
|
+
size?: 'sm' | 'md' | 'lg';
|
|
105
|
+
/** Custom class name */
|
|
106
|
+
className?: string;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Access level indicator props
|
|
110
|
+
*/
|
|
111
|
+
interface AccessLevelIndicatorProps {
|
|
112
|
+
/** Current access level */
|
|
113
|
+
accessLevel: string;
|
|
114
|
+
/** Required access level */
|
|
115
|
+
requiredLevel?: string;
|
|
116
|
+
/** Custom class name */
|
|
117
|
+
className?: string;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Guidance card component
|
|
121
|
+
*/
|
|
122
|
+
declare function GuidanceCard({ guidance, title, compact, className, }: GuidanceCardProps): JSX.Element;
|
|
123
|
+
/**
|
|
124
|
+
* Trust level badge component
|
|
125
|
+
*/
|
|
126
|
+
declare function TrustLevelBadge({ level, score, size, className, }: TrustLevelBadgeProps): JSX.Element;
|
|
127
|
+
/**
|
|
128
|
+
* Access level indicator component
|
|
129
|
+
*/
|
|
130
|
+
declare function AccessLevelIndicator({ accessLevel, requiredLevel, className, }: AccessLevelIndicatorProps): JSX.Element;
|
|
131
|
+
/**
|
|
132
|
+
* Denial reasons list component
|
|
133
|
+
*/
|
|
134
|
+
interface DenialReasonsProps {
|
|
135
|
+
reasons: string[];
|
|
136
|
+
className?: string;
|
|
137
|
+
}
|
|
138
|
+
declare function DenialReasons({ reasons, className }: DenialReasonsProps): JSX.Element;
|
|
139
|
+
|
|
140
|
+
export { AccessLevelIndicator, type AccessLevelIndicatorProps, CommerceShield, CredentialPrompt, type CredentialPromptProps, DenialReasons, type DenialReasonsProps, GuidanceCard, type GuidanceCardProps, TrustLevelBadge, type TrustLevelBadgeProps, useCommerceShield, useCredentialPrompt };
|