@astrasyncai/verification-gateway 1.1.0 → 2.0.1

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.
Files changed (113) hide show
  1. package/dist/adapter-interface/interface.d.mts +71 -0
  2. package/dist/adapter-interface/interface.d.ts +71 -0
  3. package/dist/adapter-interface/interface.js +36 -0
  4. package/dist/adapter-interface/interface.js.map +1 -0
  5. package/dist/adapter-interface/interface.mjs +10 -0
  6. package/dist/adapter-interface/interface.mjs.map +1 -0
  7. package/dist/adapter-interface/purpose-mapping.d.mts +28 -0
  8. package/dist/adapter-interface/purpose-mapping.d.ts +28 -0
  9. package/dist/adapter-interface/purpose-mapping.js +117 -0
  10. package/dist/adapter-interface/purpose-mapping.js.map +1 -0
  11. package/dist/adapter-interface/purpose-mapping.mjs +89 -0
  12. package/dist/adapter-interface/purpose-mapping.mjs.map +1 -0
  13. package/dist/adapters/express.d.mts +2 -2
  14. package/dist/adapters/express.d.ts +2 -2
  15. package/dist/adapters/express.js +123 -11
  16. package/dist/adapters/express.js.map +1 -1
  17. package/dist/adapters/express.mjs +123 -11
  18. package/dist/adapters/express.mjs.map +1 -1
  19. package/dist/adapters/nextjs.d.mts +2 -2
  20. package/dist/adapters/nextjs.d.ts +2 -2
  21. package/dist/adapters/nextjs.js +192 -14
  22. package/dist/adapters/nextjs.js.map +1 -1
  23. package/dist/adapters/nextjs.mjs +192 -14
  24. package/dist/adapters/nextjs.mjs.map +1 -1
  25. package/dist/adapters/sdk.d.mts +2 -2
  26. package/dist/adapters/sdk.d.ts +2 -2
  27. package/dist/adapters/sdk.js +7 -2
  28. package/dist/adapters/sdk.js.map +1 -1
  29. package/dist/adapters/sdk.mjs +7 -2
  30. package/dist/adapters/sdk.mjs.map +1 -1
  31. package/dist/agent/index.d.mts +2 -0
  32. package/dist/agent/index.d.ts +2 -0
  33. package/dist/agent/index.js +354 -0
  34. package/dist/agent/index.js.map +1 -0
  35. package/dist/agent/index.mjs +323 -0
  36. package/dist/agent/index.mjs.map +1 -0
  37. package/dist/browser/background.d.mts +2 -0
  38. package/dist/browser/background.d.ts +2 -0
  39. package/dist/browser/background.js +4090 -0
  40. package/dist/browser/background.js.map +1 -0
  41. package/dist/browser/background.mjs +4088 -0
  42. package/dist/browser/background.mjs.map +1 -0
  43. package/dist/browser/browser-adapter.d.mts +110 -0
  44. package/dist/browser/browser-adapter.d.ts +110 -0
  45. package/dist/browser/browser-adapter.js +297 -0
  46. package/dist/browser/browser-adapter.js.map +1 -0
  47. package/dist/browser/browser-adapter.mjs +269 -0
  48. package/dist/browser/browser-adapter.mjs.map +1 -0
  49. package/dist/cli/index.d.mts +241 -0
  50. package/dist/cli/index.d.ts +241 -0
  51. package/dist/cli/index.js +3734 -0
  52. package/dist/cli/index.js.map +1 -0
  53. package/dist/cli/index.mjs +3688 -0
  54. package/dist/cli/index.mjs.map +1 -0
  55. package/dist/cursor/cursor-adapter.d.mts +91 -0
  56. package/dist/cursor/cursor-adapter.d.ts +91 -0
  57. package/dist/cursor/cursor-adapter.js +273 -0
  58. package/dist/cursor/cursor-adapter.js.map +1 -0
  59. package/dist/cursor/cursor-adapter.mjs +246 -0
  60. package/dist/cursor/cursor-adapter.mjs.map +1 -0
  61. package/dist/cursor/extension.d.mts +27 -0
  62. package/dist/cursor/extension.d.ts +27 -0
  63. package/dist/cursor/extension.js +4057 -0
  64. package/dist/cursor/extension.js.map +1 -0
  65. package/dist/cursor/extension.mjs +4029 -0
  66. package/dist/cursor/extension.mjs.map +1 -0
  67. package/dist/{express-BGZiLINd.d.ts → express-Bcl-uBUE.d.ts} +1 -1
  68. package/dist/{express-BoayLpqq.d.mts → express-CtwDIZyF.d.mts} +1 -1
  69. package/dist/gateway/gateway.d.mts +70 -0
  70. package/dist/gateway/gateway.d.ts +70 -0
  71. package/dist/gateway/gateway.js +3726 -0
  72. package/dist/gateway/gateway.js.map +1 -0
  73. package/dist/gateway/gateway.mjs +3699 -0
  74. package/dist/gateway/gateway.mjs.map +1 -0
  75. package/dist/git-trigger/git-hooks.d.mts +69 -0
  76. package/dist/git-trigger/git-hooks.d.ts +69 -0
  77. package/dist/git-trigger/git-hooks.js +243 -0
  78. package/dist/git-trigger/git-hooks.js.map +1 -0
  79. package/dist/git-trigger/git-hooks.mjs +213 -0
  80. package/dist/git-trigger/git-hooks.mjs.map +1 -0
  81. package/dist/index-B1ThcGZl.d.mts +89 -0
  82. package/dist/index-BY8yQ8N8.d.mts +206 -0
  83. package/dist/index-CtYSYwn3.d.ts +206 -0
  84. package/dist/index-DnoXfdFd.d.ts +89 -0
  85. package/dist/index.d.mts +8 -295
  86. package/dist/index.d.ts +8 -295
  87. package/dist/index.js +215 -27
  88. package/dist/index.js.map +1 -1
  89. package/dist/index.mjs +215 -27
  90. package/dist/index.mjs.map +1 -1
  91. package/dist/local-evaluator/evaluator.d.mts +55 -0
  92. package/dist/local-evaluator/evaluator.d.ts +55 -0
  93. package/dist/local-evaluator/evaluator.js +272 -0
  94. package/dist/local-evaluator/evaluator.js.map +1 -0
  95. package/dist/local-evaluator/evaluator.mjs +244 -0
  96. package/dist/local-evaluator/evaluator.mjs.map +1 -0
  97. package/dist/{nextjs-BNbHm5Ui.d.mts → nextjs-BQyMCSx_.d.mts} +1 -1
  98. package/dist/{nextjs-DTCS5Sw8.d.ts → nextjs-CEldnIJ9.d.ts} +1 -1
  99. package/dist/{sdk-VAFRmdt7.d.mts → sdk-BhvuJSrH.d.mts} +3 -1
  100. package/dist/{sdk-9TKZzhxE.d.ts → sdk-BlyVSC_S.d.ts} +3 -1
  101. package/dist/transport/index.d.mts +2 -0
  102. package/dist/transport/index.d.ts +2 -0
  103. package/dist/transport/index.js +211 -0
  104. package/dist/transport/index.js.map +1 -0
  105. package/dist/transport/index.mjs +176 -0
  106. package/dist/transport/index.mjs.map +1 -0
  107. package/dist/types-79qS7aON.d.ts +153 -0
  108. package/dist/{types-cA_xfFU7.d.mts → types-CxQwJKbd.d.mts} +17 -2
  109. package/dist/{types-cA_xfFU7.d.ts → types-CxQwJKbd.d.ts} +17 -2
  110. package/dist/types-jJnPXStc.d.mts +153 -0
  111. package/dist/ui/index.d.mts +1 -1
  112. package/dist/ui/index.d.ts +1 -1
  113. package/package.json +48 -2
package/dist/index.d.mts CHANGED
@@ -1,8 +1,10 @@
1
- import { A as AgentCredentials, G as GatewayConfig, a as AccessLevel, V as VerificationRequest, b as VerificationResult, c as AstraSyncCredentials, P as ProtocolTransport } from './types-cA_xfFU7.mjs';
2
- export { C as CommerceShieldProps, d as CounterpartyType, E as EnhancedVerificationResult, e as ExpressMiddlewareOptions, f as GuidanceInfo, N as NextJsMiddlewareOptions, g as PDLSSInfo, R as RouteAccessConfig, h as RuntimeChallengeResult, S as SDKOptions, T as TokenGuidance, i as TrustLevel, j as VerifiedAgent, k as VerifiedDeveloper, l as VerifiedOrganization } from './types-cA_xfFU7.mjs';
3
- export { A as ACCESS_LEVEL_DESCRIPTIONS, a as ACCESS_LEVEL_HIERARCHY, b as AccessCapabilities, D as DEFAULT_TRUST_THRESHOLDS, T as TRUST_LEVEL_RANGES, d as determineAccessLevel, g as getAccessLevelForScore, c as getCapabilities, e as getTrustLevel, h as hasMinimumAccess, s as sdk } from './sdk-VAFRmdt7.mjs';
4
- export { e as express } from './express-BoayLpqq.mjs';
5
- export { n as nextjs } from './nextjs-BNbHm5Ui.mjs';
1
+ import { b as AgentCredentials, G as GatewayConfig, a as AccessLevel, c as VerificationRequest, V as VerificationResult } from './types-CxQwJKbd.mjs';
2
+ export { A as AstraSyncCredentials, d as CommerceShieldProps, C as CounterpartyType, e as EnhancedVerificationResult, E as ExpressMiddlewareOptions, f as GuidanceInfo, N as NextJsMiddlewareOptions, P as PDLSSInfo, g as ProtocolTransport, R as RouteAccessConfig, h as RuntimeChallengeResult, S as SDKOptions, T as TokenGuidance, i as TrustLevel, j as VerifiedAgent, k as VerifiedDeveloper, l as VerifiedOrganization } from './types-CxQwJKbd.mjs';
3
+ export { A as ACCESS_LEVEL_DESCRIPTIONS, a as ACCESS_LEVEL_HIERARCHY, b as AccessCapabilities, D as DEFAULT_TRUST_THRESHOLDS, T as TRUST_LEVEL_RANGES, d as determineAccessLevel, g as getAccessLevelForScore, c as getCapabilities, e as getTrustLevel, h as hasMinimumAccess, s as sdk } from './sdk-BhvuJSrH.mjs';
4
+ export { e as express } from './express-CtwDIZyF.mjs';
5
+ export { n as nextjs } from './nextjs-BQyMCSx_.mjs';
6
+ export { i as transport } from './index-B1ThcGZl.mjs';
7
+ export { A as AgentClient, C as ChallengeHandler, i as agent, r as recordDecision } from './index-BY8yQ8N8.mjs';
6
8
  import 'express';
7
9
  import 'next/server';
8
10
 
@@ -38,295 +40,6 @@ declare function quickVerify(config: GatewayConfig, credentials: AgentCredential
38
40
  reason?: string;
39
41
  }>;
40
42
 
41
- /**
42
- * HTTP Transport Adapter
43
- *
44
- * Maps AstraSync credentials to/from HTTP headers (X-Astra-* convention).
45
- */
46
-
47
- /**
48
- * Inject AstraSync credentials into HTTP headers.
49
- */
50
- declare function setHttpHeaders(headers: Record<string, string>, credentials: AstraSyncCredentials): Record<string, string>;
51
- /**
52
- * Extract AstraSync credentials from HTTP headers.
53
- */
54
- declare function extractHttpCredentials(headers: Record<string, string | string[] | undefined>): AstraSyncCredentials | null;
55
-
56
- /**
57
- * A2A (Agent-to-Agent) Transport Adapter
58
- *
59
- * Maps AstraSync credentials to/from A2A task metadata.astrasync block.
60
- */
61
-
62
- interface A2ATask {
63
- metadata?: Record<string, unknown>;
64
- [key: string]: unknown;
65
- }
66
- /**
67
- * Add AstraSync credentials to an A2A task's metadata block.
68
- */
69
- declare function setA2AMetadata(task: A2ATask, credentials: AstraSyncCredentials): A2ATask;
70
- /**
71
- * Extract AstraSync credentials from an A2A task's metadata block.
72
- */
73
- declare function extractA2ACredentials(task: A2ATask): AstraSyncCredentials | null;
74
-
75
- /**
76
- * MCP (Model Context Protocol) Transport Adapter
77
- *
78
- * Maps AstraSync credentials to/from MCP params._meta.astrasync block.
79
- */
80
-
81
- interface McpParams {
82
- _meta?: Record<string, unknown>;
83
- [key: string]: unknown;
84
- }
85
- /**
86
- * Add AstraSync credentials to MCP params' _meta block.
87
- */
88
- declare function setMcpMeta(params: McpParams, credentials: AstraSyncCredentials): McpParams;
89
- /**
90
- * Extract AstraSync credentials from MCP params' _meta block.
91
- */
92
- declare function extractMcpCredentials(params: McpParams): AstraSyncCredentials | null;
93
-
94
- /**
95
- * Cross-Protocol Transport Module
96
- *
97
- * Provides adapters for injecting/extracting AstraSync credentials
98
- * across HTTP, A2A, and MCP protocols.
99
- */
100
-
101
- /**
102
- * Auto-detect protocol from request/context shape.
103
- */
104
- declare function detectProtocol(context: Record<string, unknown>): ProtocolTransport;
105
- /**
106
- * Apply credentials to any protocol target.
107
- */
108
- declare function applyCredentials(protocol: ProtocolTransport, target: Record<string, unknown>, credentials: AstraSyncCredentials): Record<string, unknown>;
109
- /**
110
- * Extract credentials from any protocol context.
111
- */
112
- declare function extractCredentialsFromProtocol(protocol: ProtocolTransport, context: Record<string, unknown>): AstraSyncCredentials | null;
113
-
114
- declare const index$1_applyCredentials: typeof applyCredentials;
115
- declare const index$1_detectProtocol: typeof detectProtocol;
116
- declare const index$1_extractA2ACredentials: typeof extractA2ACredentials;
117
- declare const index$1_extractCredentialsFromProtocol: typeof extractCredentialsFromProtocol;
118
- declare const index$1_extractHttpCredentials: typeof extractHttpCredentials;
119
- declare const index$1_extractMcpCredentials: typeof extractMcpCredentials;
120
- declare const index$1_setA2AMetadata: typeof setA2AMetadata;
121
- declare const index$1_setHttpHeaders: typeof setHttpHeaders;
122
- declare const index$1_setMcpMeta: typeof setMcpMeta;
123
- declare namespace index$1 {
124
- export { index$1_applyCredentials as applyCredentials, index$1_detectProtocol as detectProtocol, index$1_extractA2ACredentials as extractA2ACredentials, index$1_extractCredentialsFromProtocol as extractCredentialsFromProtocol, index$1_extractHttpCredentials as extractHttpCredentials, index$1_extractMcpCredentials as extractMcpCredentials, index$1_setA2AMetadata as setA2AMetadata, index$1_setHttpHeaders as setHttpHeaders, index$1_setMcpMeta as setMcpMeta };
125
- }
126
-
127
- /**
128
- * AgentClient — Credential Presentation
129
- *
130
- * Agent-side SDK for automatically injecting AstraSync credentials
131
- * into outgoing requests across all supported protocols.
132
- */
133
-
134
- interface AgentClientConfig {
135
- agentId: string;
136
- verifyUrl?: string;
137
- challengeUrl?: string;
138
- pdlss?: AstraSyncCredentials['pdlss'];
139
- }
140
- interface FetchOptions extends RequestInit {
141
- purpose?: string;
142
- action?: string;
143
- }
144
- declare class AgentClient {
145
- private credentials;
146
- constructor(config: AgentClientConfig);
147
- /**
148
- * Make an HTTP request with AstraSync headers automatically injected.
149
- */
150
- fetch(url: string, options?: FetchOptions): Promise<Response>;
151
- /**
152
- * Prepare A2A task metadata with AstraSync credentials.
153
- */
154
- prepareA2AMetadata(task: Record<string, unknown>, overrides?: {
155
- purpose?: string;
156
- action?: string;
157
- }): Record<string, unknown>;
158
- /**
159
- * Prepare MCP params with AstraSync _meta.
160
- */
161
- prepareMcpMeta(params: Record<string, unknown>, overrides?: {
162
- purpose?: string;
163
- action?: string;
164
- }): Record<string, unknown>;
165
- /**
166
- * Generic: apply credentials to any protocol.
167
- */
168
- applyCredentials(protocol: ProtocolTransport, target: Record<string, unknown>, overrides?: {
169
- purpose?: string;
170
- action?: string;
171
- }): Record<string, unknown>;
172
- private buildCredentials;
173
- }
174
-
175
- /**
176
- * ChallengeHandler — Agent-Side Runtime Challenge Responder
177
- *
178
- * Handles incoming runtime challenges from AstraSync's verification service.
179
- * Agents register pending counterparties before initiating contact,
180
- * then this handler validates and responds to challenges.
181
- */
182
- interface ChallengeResponse {
183
- status: number;
184
- body: {
185
- challengeId: string;
186
- acknowledged: boolean;
187
- pendingCounterparties: string[];
188
- respondedAt: string;
189
- error?: string;
190
- };
191
- }
192
- interface ChallengeHandlerConfig {
193
- agentId: string;
194
- }
195
- declare class ChallengeHandler {
196
- private agentId;
197
- private pendingCounterparties;
198
- constructor(config: ChallengeHandlerConfig);
199
- /**
200
- * Register a counterparty as pending (before initiating contact).
201
- */
202
- registerPending(counterpartyId: string): void;
203
- /**
204
- * Remove a counterparty from pending list (after interaction complete).
205
- */
206
- removePending(counterpartyId: string): void;
207
- /**
208
- * Get current pending counterparties list.
209
- */
210
- getPendingList(): string[];
211
- /**
212
- * Express middleware for the challenge endpoint.
213
- * Mount at: app.post('/astrasync/challenge', handler.expressMiddleware())
214
- */
215
- expressMiddleware(): (req: {
216
- body: unknown;
217
- }, res: {
218
- status: (code: number) => {
219
- json: (body: unknown) => void;
220
- };
221
- }) => void;
222
- /**
223
- * Generic handler (framework-agnostic).
224
- * Returns { status, body } for the caller to send.
225
- */
226
- handleChallenge(body: unknown): ChallengeResponse;
227
- }
228
-
229
- /**
230
- * PDLSS Formatter — Transport Format Conversion
231
- *
232
- * Converts between full PDLSS boundaries and compact transport format
233
- * used in HTTP headers, A2A metadata, and MCP _meta blocks.
234
- */
235
-
236
- /**
237
- * Full PDLSS configuration (as returned by the backend).
238
- */
239
- interface PDLSSConfig {
240
- purpose?: {
241
- categories?: string[];
242
- allowedActions?: string[];
243
- deniedActions?: string[];
244
- };
245
- duration?: {
246
- maxSessionDuration?: number;
247
- ttl?: number;
248
- allowedDays?: number[];
249
- allowedHours?: {
250
- start: number;
251
- end: number;
252
- };
253
- };
254
- limits?: {
255
- autonomousThreshold?: number;
256
- stepUpThreshold?: number;
257
- approvalThreshold?: number;
258
- currency?: string;
259
- };
260
- scope?: {
261
- jurisdictions?: string[];
262
- resources?: string[];
263
- resourceTypes?: string[];
264
- };
265
- selfInstantiation?: {
266
- allowed: boolean;
267
- maxDepth?: number;
268
- maxSubAgents?: number;
269
- };
270
- }
271
- /**
272
- * Compact transport format (embedded in headers/metadata).
273
- */
274
- type TransportPDLSS = NonNullable<AstraSyncCredentials['pdlss']>;
275
- /**
276
- * Convert full PDLSS boundaries into compact transport format.
277
- * Used by AgentClient when building credential headers/metadata.
278
- */
279
- declare function formatPDLSSForTransport(pdlss: PDLSSConfig): TransportPDLSS;
280
- /**
281
- * Parse transport format back into full PDLSS config.
282
- * Used by counterparty-side when receiving credentials.
283
- */
284
- declare function parsePDLSSFromTransport(transport: TransportPDLSS): PDLSSConfig;
285
-
286
- /**
287
- * Decision Client — Counterparty-Side Decision Recording
288
- *
289
- * Helper for counterparties to record their grant/deny decisions
290
- * back to AstraSync after receiving a verification result.
291
- */
292
-
293
- interface RecordDecisionParams {
294
- sessionId: string;
295
- decision: 'granted' | 'denied';
296
- reason?: string;
297
- tokenIssued?: boolean;
298
- auditId?: string;
299
- }
300
- interface RecordDecisionResult {
301
- recorded: boolean;
302
- blockchainTxHash?: string;
303
- }
304
- /**
305
- * Record a counterparty's grant/deny decision for a verification session.
306
- * POST to /agents/verify-access/:sessionId/decision
307
- */
308
- declare function recordDecision(config: GatewayConfig, params: RecordDecisionParams): Promise<RecordDecisionResult>;
309
-
310
- /**
311
- * Agent-Side SDK Module
312
- *
313
- * Tools for AI agents to present credentials, handle challenges,
314
- * and interact with the AstraSync verification protocol.
315
- */
316
-
317
- type index_AgentClient = AgentClient;
318
- declare const index_AgentClient: typeof AgentClient;
319
- type index_ChallengeHandler = ChallengeHandler;
320
- declare const index_ChallengeHandler: typeof ChallengeHandler;
321
- type index_PDLSSConfig = PDLSSConfig;
322
- type index_TransportPDLSS = TransportPDLSS;
323
- declare const index_formatPDLSSForTransport: typeof formatPDLSSForTransport;
324
- declare const index_parsePDLSSFromTransport: typeof parsePDLSSFromTransport;
325
- declare const index_recordDecision: typeof recordDecision;
326
- declare namespace index {
327
- export { index_AgentClient as AgentClient, index_ChallengeHandler as ChallengeHandler, type index_PDLSSConfig as PDLSSConfig, type index_TransportPDLSS as TransportPDLSS, index_formatPDLSSForTransport as formatPDLSSForTransport, index_parsePDLSSFromTransport as parsePDLSSFromTransport, index_recordDecision as recordDecision };
328
- }
329
-
330
43
  /**
331
44
  * AstraSync Universal Verification Gateway
332
45
  *
@@ -350,4 +63,4 @@ declare namespace index {
350
63
 
351
64
  declare const VERSION = "2.0.0";
352
65
 
353
- export { AccessLevel, AgentClient, AgentCredentials, AstraSyncCredentials, ChallengeHandler, GatewayConfig, ProtocolTransport, VERSION, VerificationRequest, VerificationResult, index as agent, clearCache, extractCredentials, hasCredentials, quickVerify, recordDecision, index$1 as transport, verify };
66
+ export { AccessLevel, AgentCredentials, GatewayConfig, VERSION, VerificationRequest, VerificationResult, clearCache, extractCredentials, hasCredentials, quickVerify, verify };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,10 @@
1
- import { A as AgentCredentials, G as GatewayConfig, a as AccessLevel, V as VerificationRequest, b as VerificationResult, c as AstraSyncCredentials, P as ProtocolTransport } from './types-cA_xfFU7.js';
2
- export { C as CommerceShieldProps, d as CounterpartyType, E as EnhancedVerificationResult, e as ExpressMiddlewareOptions, f as GuidanceInfo, N as NextJsMiddlewareOptions, g as PDLSSInfo, R as RouteAccessConfig, h as RuntimeChallengeResult, S as SDKOptions, T as TokenGuidance, i as TrustLevel, j as VerifiedAgent, k as VerifiedDeveloper, l as VerifiedOrganization } from './types-cA_xfFU7.js';
3
- export { A as ACCESS_LEVEL_DESCRIPTIONS, a as ACCESS_LEVEL_HIERARCHY, b as AccessCapabilities, D as DEFAULT_TRUST_THRESHOLDS, T as TRUST_LEVEL_RANGES, d as determineAccessLevel, g as getAccessLevelForScore, c as getCapabilities, e as getTrustLevel, h as hasMinimumAccess, s as sdk } from './sdk-9TKZzhxE.js';
4
- export { e as express } from './express-BGZiLINd.js';
5
- export { n as nextjs } from './nextjs-DTCS5Sw8.js';
1
+ import { b as AgentCredentials, G as GatewayConfig, a as AccessLevel, c as VerificationRequest, V as VerificationResult } from './types-CxQwJKbd.js';
2
+ export { A as AstraSyncCredentials, d as CommerceShieldProps, C as CounterpartyType, e as EnhancedVerificationResult, E as ExpressMiddlewareOptions, f as GuidanceInfo, N as NextJsMiddlewareOptions, P as PDLSSInfo, g as ProtocolTransport, R as RouteAccessConfig, h as RuntimeChallengeResult, S as SDKOptions, T as TokenGuidance, i as TrustLevel, j as VerifiedAgent, k as VerifiedDeveloper, l as VerifiedOrganization } from './types-CxQwJKbd.js';
3
+ export { A as ACCESS_LEVEL_DESCRIPTIONS, a as ACCESS_LEVEL_HIERARCHY, b as AccessCapabilities, D as DEFAULT_TRUST_THRESHOLDS, T as TRUST_LEVEL_RANGES, d as determineAccessLevel, g as getAccessLevelForScore, c as getCapabilities, e as getTrustLevel, h as hasMinimumAccess, s as sdk } from './sdk-BlyVSC_S.js';
4
+ export { e as express } from './express-Bcl-uBUE.js';
5
+ export { n as nextjs } from './nextjs-CEldnIJ9.js';
6
+ export { i as transport } from './index-DnoXfdFd.js';
7
+ export { A as AgentClient, C as ChallengeHandler, i as agent, r as recordDecision } from './index-CtYSYwn3.js';
6
8
  import 'express';
7
9
  import 'next/server';
8
10
 
@@ -38,295 +40,6 @@ declare function quickVerify(config: GatewayConfig, credentials: AgentCredential
38
40
  reason?: string;
39
41
  }>;
40
42
 
41
- /**
42
- * HTTP Transport Adapter
43
- *
44
- * Maps AstraSync credentials to/from HTTP headers (X-Astra-* convention).
45
- */
46
-
47
- /**
48
- * Inject AstraSync credentials into HTTP headers.
49
- */
50
- declare function setHttpHeaders(headers: Record<string, string>, credentials: AstraSyncCredentials): Record<string, string>;
51
- /**
52
- * Extract AstraSync credentials from HTTP headers.
53
- */
54
- declare function extractHttpCredentials(headers: Record<string, string | string[] | undefined>): AstraSyncCredentials | null;
55
-
56
- /**
57
- * A2A (Agent-to-Agent) Transport Adapter
58
- *
59
- * Maps AstraSync credentials to/from A2A task metadata.astrasync block.
60
- */
61
-
62
- interface A2ATask {
63
- metadata?: Record<string, unknown>;
64
- [key: string]: unknown;
65
- }
66
- /**
67
- * Add AstraSync credentials to an A2A task's metadata block.
68
- */
69
- declare function setA2AMetadata(task: A2ATask, credentials: AstraSyncCredentials): A2ATask;
70
- /**
71
- * Extract AstraSync credentials from an A2A task's metadata block.
72
- */
73
- declare function extractA2ACredentials(task: A2ATask): AstraSyncCredentials | null;
74
-
75
- /**
76
- * MCP (Model Context Protocol) Transport Adapter
77
- *
78
- * Maps AstraSync credentials to/from MCP params._meta.astrasync block.
79
- */
80
-
81
- interface McpParams {
82
- _meta?: Record<string, unknown>;
83
- [key: string]: unknown;
84
- }
85
- /**
86
- * Add AstraSync credentials to MCP params' _meta block.
87
- */
88
- declare function setMcpMeta(params: McpParams, credentials: AstraSyncCredentials): McpParams;
89
- /**
90
- * Extract AstraSync credentials from MCP params' _meta block.
91
- */
92
- declare function extractMcpCredentials(params: McpParams): AstraSyncCredentials | null;
93
-
94
- /**
95
- * Cross-Protocol Transport Module
96
- *
97
- * Provides adapters for injecting/extracting AstraSync credentials
98
- * across HTTP, A2A, and MCP protocols.
99
- */
100
-
101
- /**
102
- * Auto-detect protocol from request/context shape.
103
- */
104
- declare function detectProtocol(context: Record<string, unknown>): ProtocolTransport;
105
- /**
106
- * Apply credentials to any protocol target.
107
- */
108
- declare function applyCredentials(protocol: ProtocolTransport, target: Record<string, unknown>, credentials: AstraSyncCredentials): Record<string, unknown>;
109
- /**
110
- * Extract credentials from any protocol context.
111
- */
112
- declare function extractCredentialsFromProtocol(protocol: ProtocolTransport, context: Record<string, unknown>): AstraSyncCredentials | null;
113
-
114
- declare const index$1_applyCredentials: typeof applyCredentials;
115
- declare const index$1_detectProtocol: typeof detectProtocol;
116
- declare const index$1_extractA2ACredentials: typeof extractA2ACredentials;
117
- declare const index$1_extractCredentialsFromProtocol: typeof extractCredentialsFromProtocol;
118
- declare const index$1_extractHttpCredentials: typeof extractHttpCredentials;
119
- declare const index$1_extractMcpCredentials: typeof extractMcpCredentials;
120
- declare const index$1_setA2AMetadata: typeof setA2AMetadata;
121
- declare const index$1_setHttpHeaders: typeof setHttpHeaders;
122
- declare const index$1_setMcpMeta: typeof setMcpMeta;
123
- declare namespace index$1 {
124
- export { index$1_applyCredentials as applyCredentials, index$1_detectProtocol as detectProtocol, index$1_extractA2ACredentials as extractA2ACredentials, index$1_extractCredentialsFromProtocol as extractCredentialsFromProtocol, index$1_extractHttpCredentials as extractHttpCredentials, index$1_extractMcpCredentials as extractMcpCredentials, index$1_setA2AMetadata as setA2AMetadata, index$1_setHttpHeaders as setHttpHeaders, index$1_setMcpMeta as setMcpMeta };
125
- }
126
-
127
- /**
128
- * AgentClient — Credential Presentation
129
- *
130
- * Agent-side SDK for automatically injecting AstraSync credentials
131
- * into outgoing requests across all supported protocols.
132
- */
133
-
134
- interface AgentClientConfig {
135
- agentId: string;
136
- verifyUrl?: string;
137
- challengeUrl?: string;
138
- pdlss?: AstraSyncCredentials['pdlss'];
139
- }
140
- interface FetchOptions extends RequestInit {
141
- purpose?: string;
142
- action?: string;
143
- }
144
- declare class AgentClient {
145
- private credentials;
146
- constructor(config: AgentClientConfig);
147
- /**
148
- * Make an HTTP request with AstraSync headers automatically injected.
149
- */
150
- fetch(url: string, options?: FetchOptions): Promise<Response>;
151
- /**
152
- * Prepare A2A task metadata with AstraSync credentials.
153
- */
154
- prepareA2AMetadata(task: Record<string, unknown>, overrides?: {
155
- purpose?: string;
156
- action?: string;
157
- }): Record<string, unknown>;
158
- /**
159
- * Prepare MCP params with AstraSync _meta.
160
- */
161
- prepareMcpMeta(params: Record<string, unknown>, overrides?: {
162
- purpose?: string;
163
- action?: string;
164
- }): Record<string, unknown>;
165
- /**
166
- * Generic: apply credentials to any protocol.
167
- */
168
- applyCredentials(protocol: ProtocolTransport, target: Record<string, unknown>, overrides?: {
169
- purpose?: string;
170
- action?: string;
171
- }): Record<string, unknown>;
172
- private buildCredentials;
173
- }
174
-
175
- /**
176
- * ChallengeHandler — Agent-Side Runtime Challenge Responder
177
- *
178
- * Handles incoming runtime challenges from AstraSync's verification service.
179
- * Agents register pending counterparties before initiating contact,
180
- * then this handler validates and responds to challenges.
181
- */
182
- interface ChallengeResponse {
183
- status: number;
184
- body: {
185
- challengeId: string;
186
- acknowledged: boolean;
187
- pendingCounterparties: string[];
188
- respondedAt: string;
189
- error?: string;
190
- };
191
- }
192
- interface ChallengeHandlerConfig {
193
- agentId: string;
194
- }
195
- declare class ChallengeHandler {
196
- private agentId;
197
- private pendingCounterparties;
198
- constructor(config: ChallengeHandlerConfig);
199
- /**
200
- * Register a counterparty as pending (before initiating contact).
201
- */
202
- registerPending(counterpartyId: string): void;
203
- /**
204
- * Remove a counterparty from pending list (after interaction complete).
205
- */
206
- removePending(counterpartyId: string): void;
207
- /**
208
- * Get current pending counterparties list.
209
- */
210
- getPendingList(): string[];
211
- /**
212
- * Express middleware for the challenge endpoint.
213
- * Mount at: app.post('/astrasync/challenge', handler.expressMiddleware())
214
- */
215
- expressMiddleware(): (req: {
216
- body: unknown;
217
- }, res: {
218
- status: (code: number) => {
219
- json: (body: unknown) => void;
220
- };
221
- }) => void;
222
- /**
223
- * Generic handler (framework-agnostic).
224
- * Returns { status, body } for the caller to send.
225
- */
226
- handleChallenge(body: unknown): ChallengeResponse;
227
- }
228
-
229
- /**
230
- * PDLSS Formatter — Transport Format Conversion
231
- *
232
- * Converts between full PDLSS boundaries and compact transport format
233
- * used in HTTP headers, A2A metadata, and MCP _meta blocks.
234
- */
235
-
236
- /**
237
- * Full PDLSS configuration (as returned by the backend).
238
- */
239
- interface PDLSSConfig {
240
- purpose?: {
241
- categories?: string[];
242
- allowedActions?: string[];
243
- deniedActions?: string[];
244
- };
245
- duration?: {
246
- maxSessionDuration?: number;
247
- ttl?: number;
248
- allowedDays?: number[];
249
- allowedHours?: {
250
- start: number;
251
- end: number;
252
- };
253
- };
254
- limits?: {
255
- autonomousThreshold?: number;
256
- stepUpThreshold?: number;
257
- approvalThreshold?: number;
258
- currency?: string;
259
- };
260
- scope?: {
261
- jurisdictions?: string[];
262
- resources?: string[];
263
- resourceTypes?: string[];
264
- };
265
- selfInstantiation?: {
266
- allowed: boolean;
267
- maxDepth?: number;
268
- maxSubAgents?: number;
269
- };
270
- }
271
- /**
272
- * Compact transport format (embedded in headers/metadata).
273
- */
274
- type TransportPDLSS = NonNullable<AstraSyncCredentials['pdlss']>;
275
- /**
276
- * Convert full PDLSS boundaries into compact transport format.
277
- * Used by AgentClient when building credential headers/metadata.
278
- */
279
- declare function formatPDLSSForTransport(pdlss: PDLSSConfig): TransportPDLSS;
280
- /**
281
- * Parse transport format back into full PDLSS config.
282
- * Used by counterparty-side when receiving credentials.
283
- */
284
- declare function parsePDLSSFromTransport(transport: TransportPDLSS): PDLSSConfig;
285
-
286
- /**
287
- * Decision Client — Counterparty-Side Decision Recording
288
- *
289
- * Helper for counterparties to record their grant/deny decisions
290
- * back to AstraSync after receiving a verification result.
291
- */
292
-
293
- interface RecordDecisionParams {
294
- sessionId: string;
295
- decision: 'granted' | 'denied';
296
- reason?: string;
297
- tokenIssued?: boolean;
298
- auditId?: string;
299
- }
300
- interface RecordDecisionResult {
301
- recorded: boolean;
302
- blockchainTxHash?: string;
303
- }
304
- /**
305
- * Record a counterparty's grant/deny decision for a verification session.
306
- * POST to /agents/verify-access/:sessionId/decision
307
- */
308
- declare function recordDecision(config: GatewayConfig, params: RecordDecisionParams): Promise<RecordDecisionResult>;
309
-
310
- /**
311
- * Agent-Side SDK Module
312
- *
313
- * Tools for AI agents to present credentials, handle challenges,
314
- * and interact with the AstraSync verification protocol.
315
- */
316
-
317
- type index_AgentClient = AgentClient;
318
- declare const index_AgentClient: typeof AgentClient;
319
- type index_ChallengeHandler = ChallengeHandler;
320
- declare const index_ChallengeHandler: typeof ChallengeHandler;
321
- type index_PDLSSConfig = PDLSSConfig;
322
- type index_TransportPDLSS = TransportPDLSS;
323
- declare const index_formatPDLSSForTransport: typeof formatPDLSSForTransport;
324
- declare const index_parsePDLSSFromTransport: typeof parsePDLSSFromTransport;
325
- declare const index_recordDecision: typeof recordDecision;
326
- declare namespace index {
327
- export { index_AgentClient as AgentClient, index_ChallengeHandler as ChallengeHandler, type index_PDLSSConfig as PDLSSConfig, type index_TransportPDLSS as TransportPDLSS, index_formatPDLSSForTransport as formatPDLSSForTransport, index_parsePDLSSFromTransport as parsePDLSSFromTransport, index_recordDecision as recordDecision };
328
- }
329
-
330
43
  /**
331
44
  * AstraSync Universal Verification Gateway
332
45
  *
@@ -350,4 +63,4 @@ declare namespace index {
350
63
 
351
64
  declare const VERSION = "2.0.0";
352
65
 
353
- export { AccessLevel, AgentClient, AgentCredentials, AstraSyncCredentials, ChallengeHandler, GatewayConfig, ProtocolTransport, VERSION, VerificationRequest, VerificationResult, index as agent, clearCache, extractCredentials, hasCredentials, quickVerify, recordDecision, index$1 as transport, verify };
66
+ export { AccessLevel, AgentCredentials, GatewayConfig, VERSION, VerificationRequest, VerificationResult, clearCache, extractCredentials, hasCredentials, quickVerify, verify };