@astrasyncai/verification-gateway 2.0.0 → 2.1.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.
Files changed (101) hide show
  1. package/dist/adapter-interface/interface.d.mts +2 -2
  2. package/dist/adapter-interface/interface.d.ts +2 -2
  3. package/dist/adapters/express.d.mts +2 -2
  4. package/dist/adapters/express.d.ts +2 -2
  5. package/dist/adapters/express.js +118 -5
  6. package/dist/adapters/express.js.map +1 -1
  7. package/dist/adapters/express.mjs +118 -5
  8. package/dist/adapters/express.mjs.map +1 -1
  9. package/dist/adapters/nextjs.d.mts +2 -2
  10. package/dist/adapters/nextjs.d.ts +2 -2
  11. package/dist/adapters/nextjs.js +189 -9
  12. package/dist/adapters/nextjs.js.map +1 -1
  13. package/dist/adapters/nextjs.mjs +189 -9
  14. package/dist/adapters/nextjs.mjs.map +1 -1
  15. package/dist/adapters/sdk.d.mts +2 -2
  16. package/dist/adapters/sdk.d.ts +2 -2
  17. package/dist/adapters/sdk.js +1 -0
  18. package/dist/adapters/sdk.js.map +1 -1
  19. package/dist/adapters/sdk.mjs +1 -0
  20. package/dist/adapters/sdk.mjs.map +1 -1
  21. package/dist/agent/index.d.mts +2 -2
  22. package/dist/agent/index.d.ts +2 -2
  23. package/dist/agent/index.js +33 -0
  24. package/dist/agent/index.js.map +1 -1
  25. package/dist/agent/index.mjs +36 -0
  26. package/dist/agent/index.mjs.map +1 -1
  27. package/dist/browser/background.d.mts +2 -0
  28. package/dist/browser/background.d.ts +2 -0
  29. package/dist/browser/background.js +4123 -0
  30. package/dist/browser/background.js.map +1 -0
  31. package/dist/browser/background.mjs +4124 -0
  32. package/dist/browser/background.mjs.map +1 -0
  33. package/dist/browser/browser-adapter.d.mts +10 -6
  34. package/dist/browser/browser-adapter.d.ts +10 -6
  35. package/dist/browser/browser-adapter.js +16 -5
  36. package/dist/browser/browser-adapter.js.map +1 -1
  37. package/dist/browser/browser-adapter.mjs +14 -4
  38. package/dist/browser/browser-adapter.mjs.map +1 -1
  39. package/dist/cli/index.d.mts +2 -2
  40. package/dist/cli/index.d.ts +2 -2
  41. package/dist/cli/index.js +1 -1
  42. package/dist/cli/index.js.map +1 -1
  43. package/dist/cli/index.mjs +1 -1
  44. package/dist/cli/index.mjs.map +1 -1
  45. package/dist/cursor/cursor-adapter.d.mts +3 -4
  46. package/dist/cursor/cursor-adapter.d.ts +3 -4
  47. package/dist/cursor/cursor-adapter.js.map +1 -1
  48. package/dist/cursor/cursor-adapter.mjs.map +1 -1
  49. package/dist/cursor/extension.d.mts +27 -0
  50. package/dist/cursor/extension.d.ts +27 -0
  51. package/dist/cursor/extension.js +4090 -0
  52. package/dist/cursor/extension.js.map +1 -0
  53. package/dist/cursor/extension.mjs +4065 -0
  54. package/dist/cursor/extension.mjs.map +1 -0
  55. package/dist/{express-DIEyq1Tz.d.ts → express-Bcl-uBUE.d.ts} +1 -1
  56. package/dist/{express-Cp4eg77F.d.mts → express-CtwDIZyF.d.mts} +1 -1
  57. package/dist/gateway/gateway.d.mts +2 -2
  58. package/dist/gateway/gateway.d.ts +2 -2
  59. package/dist/gateway/gateway.js +50 -17
  60. package/dist/gateway/gateway.js.map +1 -1
  61. package/dist/gateway/gateway.mjs +47 -18
  62. package/dist/gateway/gateway.mjs.map +1 -1
  63. package/dist/git-trigger/git-hooks.d.mts +2 -2
  64. package/dist/git-trigger/git-hooks.d.ts +2 -2
  65. package/dist/git-trigger/git-hooks.js +1 -2
  66. package/dist/git-trigger/git-hooks.js.map +1 -1
  67. package/dist/git-trigger/git-hooks.mjs +1 -9
  68. package/dist/git-trigger/git-hooks.mjs.map +1 -1
  69. package/dist/index-3NRaBNvp.d.mts +1397 -0
  70. package/dist/{index-BhTbGU-o.d.mts → index-BY8yQ8N8.d.mts} +1 -1
  71. package/dist/index-CME6r4uH.d.ts +1397 -0
  72. package/dist/{index-Bhfxq9xI.d.ts → index-CtYSYwn3.d.ts} +1 -1
  73. package/dist/index.d.mts +8 -7
  74. package/dist/index.d.ts +8 -7
  75. package/dist/index.js +2525 -15
  76. package/dist/index.js.map +1 -1
  77. package/dist/index.mjs +2528 -15
  78. package/dist/index.mjs.map +1 -1
  79. package/dist/local-evaluator/evaluator.d.mts +2 -2
  80. package/dist/local-evaluator/evaluator.d.ts +2 -2
  81. package/dist/local-evaluator/evaluator.js.map +1 -1
  82. package/dist/local-evaluator/evaluator.mjs.map +1 -1
  83. package/dist/{nextjs-_C_FcJY5.d.mts → nextjs-BQyMCSx_.d.mts} +1 -1
  84. package/dist/{nextjs-Cag7libc.d.ts → nextjs-CEldnIJ9.d.ts} +1 -1
  85. package/dist/{sdk-DAJahT3p.d.mts → sdk-BhvuJSrH.d.mts} +1 -1
  86. package/dist/{sdk-CMPDFUjo.d.ts → sdk-BlyVSC_S.d.ts} +1 -1
  87. package/dist/transport/index.d.mts +3 -2
  88. package/dist/transport/index.d.ts +3 -2
  89. package/dist/transport/index.js +2384 -2
  90. package/dist/transport/index.js.map +1 -1
  91. package/dist/transport/index.mjs +2327 -1
  92. package/dist/transport/index.mjs.map +1 -1
  93. package/dist/{types-Ce2mFJkO.d.ts → types-79qS7aON.d.ts} +2 -2
  94. package/dist/{types-Bf8pML07.d.mts → types-CxQwJKbd.d.mts} +17 -2
  95. package/dist/{types-Bf8pML07.d.ts → types-CxQwJKbd.d.ts} +17 -2
  96. package/dist/{types-BvpGdsv1.d.mts → types-jJnPXStc.d.mts} +2 -2
  97. package/dist/ui/index.d.mts +1 -1
  98. package/dist/ui/index.d.ts +1 -1
  99. package/package.json +18 -3
  100. package/dist/index-CNkmHmpi.d.ts +0 -89
  101. package/dist/index-CoLebmwv.d.mts +0 -89
@@ -208,6 +208,8 @@ interface VerificationRequest {
208
208
  counterpartyType?: CounterpartyType;
209
209
  /** Counterparty URL */
210
210
  counterpartyUrl?: string;
211
+ /** Requested session duration in seconds (from agent's X-Astra-Duration header) */
212
+ durationRequired?: number;
211
213
  /** Runtime challenge options */
212
214
  runtimeChallengeOptions?: {
213
215
  timeoutOverride?: number;
@@ -225,8 +227,17 @@ interface RouteAccessConfig {
225
227
  minAccessLevel: AccessLevel;
226
228
  /** Minimum trust score required (optional) */
227
229
  minTrustScore?: number;
228
- /** Required purposes (optional) */
230
+ /** Required purposes (optional, agent must declare one of these) */
229
231
  requiredPurposes?: string[];
232
+ /** Counterparty-defined PDLSS maximums — agent requests exceeding these are rejected before calling AstraSync */
233
+ /** Maximum session duration in seconds the counterparty will allow */
234
+ maxDuration?: number;
235
+ /** Whitelist of allowed purposes — agent's declared purpose must be in this list */
236
+ allowedPurposes?: string[];
237
+ /** Whitelist of allowed jurisdictions */
238
+ allowedJurisdictions?: string[];
239
+ /** Maximum transaction value for this route */
240
+ maxTransactionValue?: number;
230
241
  }
231
242
  /**
232
243
  * Express middleware options
@@ -244,6 +255,8 @@ interface ExpressMiddlewareOptions extends GatewayConfig {
244
255
  onDenied?: (result: VerificationResult, req: unknown, res: unknown) => void;
245
256
  /** Automatically create sessions and record grant/deny decisions (default: true) */
246
257
  recordDecisions?: boolean;
258
+ /** Enable runtime challenge for all verify-access calls (default: true) */
259
+ enableRuntimeChallenge?: boolean;
247
260
  }
248
261
  /**
249
262
  * Next.js middleware options
@@ -262,6 +275,8 @@ interface NextJsMiddlewareOptions extends GatewayConfig {
262
275
  allowGuestAccess?: boolean;
263
276
  guestAccessLevel?: AccessLevel;
264
277
  };
278
+ /** Enable runtime challenge for all verify-access calls (default: true) */
279
+ enableRuntimeChallenge?: boolean;
265
280
  }
266
281
  /**
267
282
  * SDK function options
@@ -364,4 +379,4 @@ interface CommerceShieldProps {
364
379
  className?: string;
365
380
  }
366
381
 
367
- export type { AgentCredentials as A, CommerceShieldProps as C, EnhancedVerificationResult as E, GatewayConfig as G, NextJsMiddlewareOptions as N, PDLSSInfo 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, ProtocolTransport as g, RuntimeChallengeResult as h, TrustLevel as i, VerifiedAgent as j, VerifiedDeveloper as k, VerifiedOrganization as l };
382
+ export type { AstraSyncCredentials as A, CounterpartyType as C, ExpressMiddlewareOptions as E, GatewayConfig as G, NextJsMiddlewareOptions as N, PDLSSInfo as P, RouteAccessConfig as R, SDKOptions as S, TokenGuidance as T, VerificationResult as V, AccessLevel as a, AgentCredentials as b, VerificationRequest as c, CommerceShieldProps as d, EnhancedVerificationResult as e, GuidanceInfo as f, ProtocolTransport as g, RuntimeChallengeResult as h, TrustLevel as i, VerifiedAgent as j, VerifiedDeveloper as k, VerifiedOrganization as l };
@@ -1,4 +1,4 @@
1
- import { a as AccessLevel, d as CounterpartyType, T as TokenGuidance } from './types-Bf8pML07.mjs';
1
+ import { a as AccessLevel, C as CounterpartyType, T as TokenGuidance } from './types-CxQwJKbd.mjs';
2
2
 
3
3
  /**
4
4
  * AstraSync Gateway - Types for gateway modes, local evaluation, and adapter interface.
@@ -150,4 +150,4 @@ interface InterceptResult {
150
150
  skipReason?: string;
151
151
  }
152
152
 
153
- export type { AgentAction as A, InterceptResult as I, LocalPolicy as L, PDLSSContext as P, VerificationDecision as V, LocalPurposeRule as a, LocalScope as b, LocalRiskThresholds as c, AstraSyncGatewayConfig as d };
153
+ export type { AgentAction as A, InterceptResult as I, LocalPolicy as L, PDLSSContext as P, VerificationDecision as V, LocalPurposeRule as a, AstraSyncGatewayConfig as b, LocalScope as c, LocalRiskThresholds as d };
@@ -1,4 +1,4 @@
1
- import { C as CommerceShieldProps, b as VerificationResult, A as AgentCredentials, f as GuidanceInfo, i as TrustLevel } from '../types-Bf8pML07.mjs';
1
+ import { d as CommerceShieldProps, V as VerificationResult, b as AgentCredentials, f as GuidanceInfo, i as TrustLevel } from '../types-CxQwJKbd.mjs';
2
2
 
3
3
  /**
4
4
  * AstraSync Commerce Shield Component
@@ -1,4 +1,4 @@
1
- import { C as CommerceShieldProps, b as VerificationResult, A as AgentCredentials, f as GuidanceInfo, i as TrustLevel } from '../types-Bf8pML07.js';
1
+ import { d as CommerceShieldProps, V as VerificationResult, b as AgentCredentials, f as GuidanceInfo, i as TrustLevel } from '../types-CxQwJKbd.js';
2
2
 
3
3
  /**
4
4
  * AstraSync Commerce Shield Component
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrasyncai/verification-gateway",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Universal Verification Gateway for AstraSync KYA Platform - verify AI agents across any counterparty type",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -82,13 +82,15 @@
82
82
  "README.md"
83
83
  ],
84
84
  "scripts": {
85
- "build": "tsup",
85
+ "build": "cross-env NODE_OPTIONS=--max-old-space-size=4096 tsup",
86
86
  "dev": "tsup --watch",
87
87
  "lint": "eslint src --ext .ts,.tsx",
88
88
  "typecheck": "tsc --noEmit",
89
89
  "test": "vitest run",
90
90
  "test:watch": "vitest watch",
91
- "clean": "rm -rf dist"
91
+ "clean": "rm -rf dist extensions",
92
+ "package:extensions": "bash scripts/package-extensions.sh",
93
+ "prepublishOnly": "npm run clean && npm run typecheck && npm run build"
92
94
  },
93
95
  "keywords": [
94
96
  "astrasync",
@@ -106,6 +108,18 @@
106
108
  "url": "https://github.com/AstraSync-KYA/KYA-Platform.git",
107
109
  "directory": "packages/verification-gateway"
108
110
  },
111
+ "dependencies": {
112
+ "@sd-jwt/core": "^0.19.0",
113
+ "@sd-jwt/decode": "^0.19.0",
114
+ "@sd-jwt/utils": "^0.19.0",
115
+ "ajv": "^8.17.1",
116
+ "http-message-signatures": "^1.0.5",
117
+ "structured-headers": "^2.0.1",
118
+ "jose": "^5.9.6",
119
+ "mppx": "0.5.13",
120
+ "@x402/core": "^2.10.0",
121
+ "web-bot-auth": "^0.1.3"
122
+ },
109
123
  "peerDependencies": {
110
124
  "express": ">=4.0.0",
111
125
  "next": ">=13.0.0",
@@ -124,6 +138,7 @@
124
138
  },
125
139
  "devDependencies": {
126
140
  "@types/express": "^4.17.21",
141
+ "@types/js-yaml": "^4.0.9",
127
142
  "@types/node": "^20.10.0",
128
143
  "@types/react": "^18.2.45",
129
144
  "eslint": "^8.56.0",
@@ -1,89 +0,0 @@
1
- import { c as AstraSyncCredentials, g as ProtocolTransport } from './types-Bf8pML07.js';
2
-
3
- /**
4
- * HTTP Transport Adapter
5
- *
6
- * Maps AstraSync credentials to/from HTTP headers (X-Astra-* convention).
7
- */
8
-
9
- /**
10
- * Inject AstraSync credentials into HTTP headers.
11
- */
12
- declare function setHttpHeaders(headers: Record<string, string>, credentials: AstraSyncCredentials): Record<string, string>;
13
- /**
14
- * Extract AstraSync credentials from HTTP headers.
15
- */
16
- declare function extractHttpCredentials(headers: Record<string, string | string[] | undefined>): AstraSyncCredentials | null;
17
-
18
- /**
19
- * A2A (Agent-to-Agent) Transport Adapter
20
- *
21
- * Maps AstraSync credentials to/from A2A task metadata.astrasync block.
22
- */
23
-
24
- interface A2ATask {
25
- metadata?: Record<string, unknown>;
26
- [key: string]: unknown;
27
- }
28
- /**
29
- * Add AstraSync credentials to an A2A task's metadata block.
30
- */
31
- declare function setA2AMetadata(task: A2ATask, credentials: AstraSyncCredentials): A2ATask;
32
- /**
33
- * Extract AstraSync credentials from an A2A task's metadata block.
34
- */
35
- declare function extractA2ACredentials(task: A2ATask): AstraSyncCredentials | null;
36
-
37
- /**
38
- * MCP (Model Context Protocol) Transport Adapter
39
- *
40
- * Maps AstraSync credentials to/from MCP params._meta.astrasync block.
41
- */
42
-
43
- interface McpParams {
44
- _meta?: Record<string, unknown>;
45
- [key: string]: unknown;
46
- }
47
- /**
48
- * Add AstraSync credentials to MCP params' _meta block.
49
- */
50
- declare function setMcpMeta(params: McpParams, credentials: AstraSyncCredentials): McpParams;
51
- /**
52
- * Extract AstraSync credentials from MCP params' _meta block.
53
- */
54
- declare function extractMcpCredentials(params: McpParams): AstraSyncCredentials | null;
55
-
56
- /**
57
- * Cross-Protocol Transport Module
58
- *
59
- * Provides adapters for injecting/extracting AstraSync credentials
60
- * across HTTP, A2A, and MCP protocols.
61
- */
62
-
63
- /**
64
- * Auto-detect protocol from request/context shape.
65
- */
66
- declare function detectProtocol(context: Record<string, unknown>): ProtocolTransport;
67
- /**
68
- * Apply credentials to any protocol target.
69
- */
70
- declare function applyCredentials(protocol: ProtocolTransport, target: Record<string, unknown>, credentials: AstraSyncCredentials): Record<string, unknown>;
71
- /**
72
- * Extract credentials from any protocol context.
73
- */
74
- declare function extractCredentialsFromProtocol(protocol: ProtocolTransport, context: Record<string, unknown>): AstraSyncCredentials | null;
75
-
76
- declare const index_applyCredentials: typeof applyCredentials;
77
- declare const index_detectProtocol: typeof detectProtocol;
78
- declare const index_extractA2ACredentials: typeof extractA2ACredentials;
79
- declare const index_extractCredentialsFromProtocol: typeof extractCredentialsFromProtocol;
80
- declare const index_extractHttpCredentials: typeof extractHttpCredentials;
81
- declare const index_extractMcpCredentials: typeof extractMcpCredentials;
82
- declare const index_setA2AMetadata: typeof setA2AMetadata;
83
- declare const index_setHttpHeaders: typeof setHttpHeaders;
84
- declare const index_setMcpMeta: typeof setMcpMeta;
85
- declare namespace index {
86
- export { index_applyCredentials as applyCredentials, index_detectProtocol as detectProtocol, index_extractA2ACredentials as extractA2ACredentials, index_extractCredentialsFromProtocol as extractCredentialsFromProtocol, index_extractHttpCredentials as extractHttpCredentials, index_extractMcpCredentials as extractMcpCredentials, index_setA2AMetadata as setA2AMetadata, index_setHttpHeaders as setHttpHeaders, index_setMcpMeta as setMcpMeta };
87
- }
88
-
89
- export { applyCredentials as a, extractCredentialsFromProtocol as b, extractHttpCredentials as c, detectProtocol as d, extractA2ACredentials as e, extractMcpCredentials as f, setHttpHeaders as g, setMcpMeta as h, index as i, setA2AMetadata as s };
@@ -1,89 +0,0 @@
1
- import { c as AstraSyncCredentials, g as ProtocolTransport } from './types-Bf8pML07.mjs';
2
-
3
- /**
4
- * HTTP Transport Adapter
5
- *
6
- * Maps AstraSync credentials to/from HTTP headers (X-Astra-* convention).
7
- */
8
-
9
- /**
10
- * Inject AstraSync credentials into HTTP headers.
11
- */
12
- declare function setHttpHeaders(headers: Record<string, string>, credentials: AstraSyncCredentials): Record<string, string>;
13
- /**
14
- * Extract AstraSync credentials from HTTP headers.
15
- */
16
- declare function extractHttpCredentials(headers: Record<string, string | string[] | undefined>): AstraSyncCredentials | null;
17
-
18
- /**
19
- * A2A (Agent-to-Agent) Transport Adapter
20
- *
21
- * Maps AstraSync credentials to/from A2A task metadata.astrasync block.
22
- */
23
-
24
- interface A2ATask {
25
- metadata?: Record<string, unknown>;
26
- [key: string]: unknown;
27
- }
28
- /**
29
- * Add AstraSync credentials to an A2A task's metadata block.
30
- */
31
- declare function setA2AMetadata(task: A2ATask, credentials: AstraSyncCredentials): A2ATask;
32
- /**
33
- * Extract AstraSync credentials from an A2A task's metadata block.
34
- */
35
- declare function extractA2ACredentials(task: A2ATask): AstraSyncCredentials | null;
36
-
37
- /**
38
- * MCP (Model Context Protocol) Transport Adapter
39
- *
40
- * Maps AstraSync credentials to/from MCP params._meta.astrasync block.
41
- */
42
-
43
- interface McpParams {
44
- _meta?: Record<string, unknown>;
45
- [key: string]: unknown;
46
- }
47
- /**
48
- * Add AstraSync credentials to MCP params' _meta block.
49
- */
50
- declare function setMcpMeta(params: McpParams, credentials: AstraSyncCredentials): McpParams;
51
- /**
52
- * Extract AstraSync credentials from MCP params' _meta block.
53
- */
54
- declare function extractMcpCredentials(params: McpParams): AstraSyncCredentials | null;
55
-
56
- /**
57
- * Cross-Protocol Transport Module
58
- *
59
- * Provides adapters for injecting/extracting AstraSync credentials
60
- * across HTTP, A2A, and MCP protocols.
61
- */
62
-
63
- /**
64
- * Auto-detect protocol from request/context shape.
65
- */
66
- declare function detectProtocol(context: Record<string, unknown>): ProtocolTransport;
67
- /**
68
- * Apply credentials to any protocol target.
69
- */
70
- declare function applyCredentials(protocol: ProtocolTransport, target: Record<string, unknown>, credentials: AstraSyncCredentials): Record<string, unknown>;
71
- /**
72
- * Extract credentials from any protocol context.
73
- */
74
- declare function extractCredentialsFromProtocol(protocol: ProtocolTransport, context: Record<string, unknown>): AstraSyncCredentials | null;
75
-
76
- declare const index_applyCredentials: typeof applyCredentials;
77
- declare const index_detectProtocol: typeof detectProtocol;
78
- declare const index_extractA2ACredentials: typeof extractA2ACredentials;
79
- declare const index_extractCredentialsFromProtocol: typeof extractCredentialsFromProtocol;
80
- declare const index_extractHttpCredentials: typeof extractHttpCredentials;
81
- declare const index_extractMcpCredentials: typeof extractMcpCredentials;
82
- declare const index_setA2AMetadata: typeof setA2AMetadata;
83
- declare const index_setHttpHeaders: typeof setHttpHeaders;
84
- declare const index_setMcpMeta: typeof setMcpMeta;
85
- declare namespace index {
86
- export { index_applyCredentials as applyCredentials, index_detectProtocol as detectProtocol, index_extractA2ACredentials as extractA2ACredentials, index_extractCredentialsFromProtocol as extractCredentialsFromProtocol, index_extractHttpCredentials as extractHttpCredentials, index_extractMcpCredentials as extractMcpCredentials, index_setA2AMetadata as setA2AMetadata, index_setHttpHeaders as setHttpHeaders, index_setMcpMeta as setMcpMeta };
87
- }
88
-
89
- export { applyCredentials as a, extractCredentialsFromProtocol as b, extractHttpCredentials as c, detectProtocol as d, extractA2ACredentials as e, extractMcpCredentials as f, setHttpHeaders as g, setMcpMeta as h, index as i, setA2AMetadata as s };