@astrasyncai/verification-gateway 1.0.0 → 2.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.
Files changed (101) 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 +46 -9
  16. package/dist/adapters/express.js.map +1 -1
  17. package/dist/adapters/express.mjs +46 -9
  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 +19 -9
  22. package/dist/adapters/nextjs.js.map +1 -1
  23. package/dist/adapters/nextjs.mjs +19 -9
  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 +20 -4
  28. package/dist/adapters/sdk.js.map +1 -1
  29. package/dist/adapters/sdk.mjs +20 -4
  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/browser-adapter.d.mts +106 -0
  38. package/dist/browser/browser-adapter.d.ts +106 -0
  39. package/dist/browser/browser-adapter.js +286 -0
  40. package/dist/browser/browser-adapter.js.map +1 -0
  41. package/dist/browser/browser-adapter.mjs +259 -0
  42. package/dist/browser/browser-adapter.mjs.map +1 -0
  43. package/dist/cli/index.d.mts +241 -0
  44. package/dist/cli/index.d.ts +241 -0
  45. package/dist/cli/index.js +3734 -0
  46. package/dist/cli/index.js.map +1 -0
  47. package/dist/cli/index.mjs +3688 -0
  48. package/dist/cli/index.mjs.map +1 -0
  49. package/dist/cursor/cursor-adapter.d.mts +92 -0
  50. package/dist/cursor/cursor-adapter.d.ts +92 -0
  51. package/dist/cursor/cursor-adapter.js +273 -0
  52. package/dist/cursor/cursor-adapter.js.map +1 -0
  53. package/dist/cursor/cursor-adapter.mjs +246 -0
  54. package/dist/cursor/cursor-adapter.mjs.map +1 -0
  55. package/dist/{express-DUDYpvNZ.d.mts → express-Cp4eg77F.d.mts} +1 -1
  56. package/dist/{express-BhD3mWsL.d.ts → express-DIEyq1Tz.d.ts} +1 -1
  57. package/dist/gateway/gateway.d.mts +70 -0
  58. package/dist/gateway/gateway.d.ts +70 -0
  59. package/dist/gateway/gateway.js +3726 -0
  60. package/dist/gateway/gateway.js.map +1 -0
  61. package/dist/gateway/gateway.mjs +3706 -0
  62. package/dist/gateway/gateway.mjs.map +1 -0
  63. package/dist/git-trigger/git-hooks.d.mts +69 -0
  64. package/dist/git-trigger/git-hooks.d.ts +69 -0
  65. package/dist/git-trigger/git-hooks.js +244 -0
  66. package/dist/git-trigger/git-hooks.js.map +1 -0
  67. package/dist/git-trigger/git-hooks.mjs +221 -0
  68. package/dist/git-trigger/git-hooks.mjs.map +1 -0
  69. package/dist/index-BhTbGU-o.d.mts +206 -0
  70. package/dist/index-Bhfxq9xI.d.ts +206 -0
  71. package/dist/index-CNkmHmpi.d.ts +89 -0
  72. package/dist/index-CoLebmwv.d.mts +89 -0
  73. package/dist/index.d.mts +8 -295
  74. package/dist/index.d.ts +8 -295
  75. package/dist/index.js +60 -21
  76. package/dist/index.js.map +1 -1
  77. package/dist/index.mjs +60 -21
  78. package/dist/index.mjs.map +1 -1
  79. package/dist/local-evaluator/evaluator.d.mts +55 -0
  80. package/dist/local-evaluator/evaluator.d.ts +55 -0
  81. package/dist/local-evaluator/evaluator.js +272 -0
  82. package/dist/local-evaluator/evaluator.js.map +1 -0
  83. package/dist/local-evaluator/evaluator.mjs +244 -0
  84. package/dist/local-evaluator/evaluator.mjs.map +1 -0
  85. package/dist/{nextjs-C9FPOjSh.d.ts → nextjs-Cag7libc.d.ts} +1 -1
  86. package/dist/{nextjs-BtqyLSVQ.d.mts → nextjs-_C_FcJY5.d.mts} +1 -1
  87. package/dist/{sdk-BkVigGjF.d.ts → sdk-CMPDFUjo.d.ts} +3 -1
  88. package/dist/{sdk-xCbZgeZx.d.mts → sdk-DAJahT3p.d.mts} +3 -1
  89. package/dist/transport/index.d.mts +2 -0
  90. package/dist/transport/index.d.ts +2 -0
  91. package/dist/transport/index.js +211 -0
  92. package/dist/transport/index.js.map +1 -0
  93. package/dist/transport/index.mjs +176 -0
  94. package/dist/transport/index.mjs.map +1 -0
  95. package/dist/{types-CS6v75-d.d.mts → types-Bf8pML07.d.mts} +9 -1
  96. package/dist/{types-CS6v75-d.d.ts → types-Bf8pML07.d.ts} +9 -1
  97. package/dist/types-BvpGdsv1.d.mts +153 -0
  98. package/dist/types-Ce2mFJkO.d.ts +153 -0
  99. package/dist/ui/index.d.mts +1 -1
  100. package/dist/ui/index.d.ts +1 -1
  101. package/package.json +46 -1
@@ -0,0 +1,153 @@
1
+ import { a as AccessLevel, d as CounterpartyType, T as TokenGuidance } from './types-Bf8pML07.mjs';
2
+
3
+ /**
4
+ * AstraSync Gateway - Types for gateway modes, local evaluation, and adapter interface.
5
+ */
6
+ type GatewayMode = 'online' | 'local' | 'hybrid';
7
+ /**
8
+ * Posture controls whether the gateway actively blocks or just monitors.
9
+ * - active: Evaluate and enforce decisions (block/allow/review)
10
+ * - passive: Evaluate and log but never block (telemetry-only mode)
11
+ */
12
+ type GatewayPosture = 'active' | 'passive';
13
+ interface AstraSyncGatewayConfig {
14
+ mode: GatewayMode;
15
+ /** Enforcement posture: 'active' blocks actions, 'passive' logs only (default: 'active') */
16
+ posture?: GatewayPosture;
17
+ /** AstraSync API base URL (required for online/hybrid modes) */
18
+ apiBaseUrl?: string;
19
+ /** API key for authenticating with AstraSync (required for online/hybrid modes) */
20
+ apiKey?: string;
21
+ /** Path to local PDLSS policy YAML file (required for local/hybrid modes) */
22
+ policyFile?: string;
23
+ /** Inline policy object (alternative to policyFile) */
24
+ policy?: LocalPolicy;
25
+ /** Sync interval in seconds for hybrid mode (default: 3600) */
26
+ syncInterval?: number;
27
+ /** Cache verification results TTL in seconds (default: 300) */
28
+ cacheTtl?: number;
29
+ /** Enable debug logging */
30
+ debug?: boolean;
31
+ /** Enable trace logging to .astrasync/traces/ (default: false) */
32
+ traceEnabled?: boolean;
33
+ /** Trace log directory (default: .astrasync/traces/) */
34
+ tracePath?: string;
35
+ /** Default access level for unverified requests */
36
+ defaultAccessLevel?: AccessLevel;
37
+ /** Minimum trust score for standard access (online/hybrid) */
38
+ minTrustScore?: number;
39
+ /** Minimum trust score for full access (online/hybrid) */
40
+ minTrustScoreForFull?: number;
41
+ /** Custom headers to send with API requests */
42
+ customHeaders?: Record<string, string>;
43
+ /** Counterparty URL for analytics */
44
+ counterpartyUrl?: string;
45
+ /** Counterparty type for analytics */
46
+ counterpartyType?: CounterpartyType;
47
+ }
48
+ interface PDLSSContext {
49
+ /** Purpose category (e.g. email.send, shell.exec, file.read) */
50
+ purpose: string;
51
+ /** Specific action within purpose */
52
+ action: string;
53
+ /** Target resource, recipient, or counterparty */
54
+ target: string;
55
+ /** Types of data access (read, write, delete) */
56
+ dataAccess?: string[];
57
+ /** Network domains/IPs being accessed */
58
+ networkAccess?: string[];
59
+ /** Resource type (customer, order, file, directory, process) */
60
+ resourceType?: string;
61
+ /** Risk factors for this action */
62
+ riskFactors?: RiskFactor[];
63
+ /** Transaction value (if financial) */
64
+ transactionValue?: number;
65
+ /** Currency for transaction */
66
+ currency?: string;
67
+ /** Additional metadata */
68
+ metadata?: Record<string, unknown>;
69
+ }
70
+ interface RiskFactor {
71
+ type: 'financial' | 'data_sensitivity' | 'privilege_escalation' | 'network_scope' | 'destructive';
72
+ severity: 'low' | 'medium' | 'high' | 'critical';
73
+ detail: string;
74
+ }
75
+ interface VerificationDecision {
76
+ recommendation: 'ALLOW' | 'DENY' | 'MANUAL_REVIEW';
77
+ reason: string;
78
+ trustScore?: number;
79
+ tokenGuidance?: TokenGuidance;
80
+ sessionId?: string;
81
+ /** PDLSS dimensions that were evaluated */
82
+ evaluatedDimensions?: {
83
+ purpose: boolean;
84
+ scope: boolean;
85
+ limits: boolean;
86
+ riskThresholds: boolean;
87
+ };
88
+ }
89
+ interface LocalPolicy {
90
+ version: string;
91
+ name: string;
92
+ description?: string;
93
+ purposes: LocalPurposeRule[];
94
+ scope?: LocalScope;
95
+ limits?: LocalLimits;
96
+ riskThresholds?: LocalRiskThresholds;
97
+ selfInstantiation?: LocalSelfInstantiation;
98
+ }
99
+ interface LocalPurposeRule {
100
+ id: string;
101
+ allowed: boolean;
102
+ targets?: string[];
103
+ blockedPatterns?: string[];
104
+ requiresApproval?: boolean;
105
+ }
106
+ interface LocalScope {
107
+ allowedDomains?: string[];
108
+ blockedDomains?: string[];
109
+ blockedResources?: string[];
110
+ }
111
+ interface LocalLimits {
112
+ maxTransactionAmount?: number;
113
+ maxRequestsPerHour?: number;
114
+ currency?: string;
115
+ }
116
+ interface LocalRiskThresholds {
117
+ autoAllow: {
118
+ min: number;
119
+ max: number;
120
+ };
121
+ requireApproval: {
122
+ min: number;
123
+ max: number;
124
+ };
125
+ autoBlock: {
126
+ min: number;
127
+ max: number;
128
+ };
129
+ }
130
+ interface LocalSelfInstantiation {
131
+ /** Whether sub-agent spawning is allowed */
132
+ allowed: boolean;
133
+ /** Maximum depth of sub-agent chain */
134
+ maxDepth?: number;
135
+ }
136
+ interface AgentAction {
137
+ /** Raw action data from the platform */
138
+ raw: unknown;
139
+ /** Platform identifier (e.g. 'openclaw-cli', 'cursor', 'browser') */
140
+ platform: string;
141
+ /** Timestamp of the action */
142
+ timestamp: Date;
143
+ }
144
+ interface InterceptResult {
145
+ /** Whether the action was intercepted */
146
+ intercepted: boolean;
147
+ /** Extracted PDLSS context (if intercepted) */
148
+ context?: PDLSSContext;
149
+ /** Reason for not intercepting (if not intercepted) */
150
+ skipReason?: string;
151
+ }
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 };
@@ -0,0 +1,153 @@
1
+ import { a as AccessLevel, d as CounterpartyType, T as TokenGuidance } from './types-Bf8pML07.js';
2
+
3
+ /**
4
+ * AstraSync Gateway - Types for gateway modes, local evaluation, and adapter interface.
5
+ */
6
+ type GatewayMode = 'online' | 'local' | 'hybrid';
7
+ /**
8
+ * Posture controls whether the gateway actively blocks or just monitors.
9
+ * - active: Evaluate and enforce decisions (block/allow/review)
10
+ * - passive: Evaluate and log but never block (telemetry-only mode)
11
+ */
12
+ type GatewayPosture = 'active' | 'passive';
13
+ interface AstraSyncGatewayConfig {
14
+ mode: GatewayMode;
15
+ /** Enforcement posture: 'active' blocks actions, 'passive' logs only (default: 'active') */
16
+ posture?: GatewayPosture;
17
+ /** AstraSync API base URL (required for online/hybrid modes) */
18
+ apiBaseUrl?: string;
19
+ /** API key for authenticating with AstraSync (required for online/hybrid modes) */
20
+ apiKey?: string;
21
+ /** Path to local PDLSS policy YAML file (required for local/hybrid modes) */
22
+ policyFile?: string;
23
+ /** Inline policy object (alternative to policyFile) */
24
+ policy?: LocalPolicy;
25
+ /** Sync interval in seconds for hybrid mode (default: 3600) */
26
+ syncInterval?: number;
27
+ /** Cache verification results TTL in seconds (default: 300) */
28
+ cacheTtl?: number;
29
+ /** Enable debug logging */
30
+ debug?: boolean;
31
+ /** Enable trace logging to .astrasync/traces/ (default: false) */
32
+ traceEnabled?: boolean;
33
+ /** Trace log directory (default: .astrasync/traces/) */
34
+ tracePath?: string;
35
+ /** Default access level for unverified requests */
36
+ defaultAccessLevel?: AccessLevel;
37
+ /** Minimum trust score for standard access (online/hybrid) */
38
+ minTrustScore?: number;
39
+ /** Minimum trust score for full access (online/hybrid) */
40
+ minTrustScoreForFull?: number;
41
+ /** Custom headers to send with API requests */
42
+ customHeaders?: Record<string, string>;
43
+ /** Counterparty URL for analytics */
44
+ counterpartyUrl?: string;
45
+ /** Counterparty type for analytics */
46
+ counterpartyType?: CounterpartyType;
47
+ }
48
+ interface PDLSSContext {
49
+ /** Purpose category (e.g. email.send, shell.exec, file.read) */
50
+ purpose: string;
51
+ /** Specific action within purpose */
52
+ action: string;
53
+ /** Target resource, recipient, or counterparty */
54
+ target: string;
55
+ /** Types of data access (read, write, delete) */
56
+ dataAccess?: string[];
57
+ /** Network domains/IPs being accessed */
58
+ networkAccess?: string[];
59
+ /** Resource type (customer, order, file, directory, process) */
60
+ resourceType?: string;
61
+ /** Risk factors for this action */
62
+ riskFactors?: RiskFactor[];
63
+ /** Transaction value (if financial) */
64
+ transactionValue?: number;
65
+ /** Currency for transaction */
66
+ currency?: string;
67
+ /** Additional metadata */
68
+ metadata?: Record<string, unknown>;
69
+ }
70
+ interface RiskFactor {
71
+ type: 'financial' | 'data_sensitivity' | 'privilege_escalation' | 'network_scope' | 'destructive';
72
+ severity: 'low' | 'medium' | 'high' | 'critical';
73
+ detail: string;
74
+ }
75
+ interface VerificationDecision {
76
+ recommendation: 'ALLOW' | 'DENY' | 'MANUAL_REVIEW';
77
+ reason: string;
78
+ trustScore?: number;
79
+ tokenGuidance?: TokenGuidance;
80
+ sessionId?: string;
81
+ /** PDLSS dimensions that were evaluated */
82
+ evaluatedDimensions?: {
83
+ purpose: boolean;
84
+ scope: boolean;
85
+ limits: boolean;
86
+ riskThresholds: boolean;
87
+ };
88
+ }
89
+ interface LocalPolicy {
90
+ version: string;
91
+ name: string;
92
+ description?: string;
93
+ purposes: LocalPurposeRule[];
94
+ scope?: LocalScope;
95
+ limits?: LocalLimits;
96
+ riskThresholds?: LocalRiskThresholds;
97
+ selfInstantiation?: LocalSelfInstantiation;
98
+ }
99
+ interface LocalPurposeRule {
100
+ id: string;
101
+ allowed: boolean;
102
+ targets?: string[];
103
+ blockedPatterns?: string[];
104
+ requiresApproval?: boolean;
105
+ }
106
+ interface LocalScope {
107
+ allowedDomains?: string[];
108
+ blockedDomains?: string[];
109
+ blockedResources?: string[];
110
+ }
111
+ interface LocalLimits {
112
+ maxTransactionAmount?: number;
113
+ maxRequestsPerHour?: number;
114
+ currency?: string;
115
+ }
116
+ interface LocalRiskThresholds {
117
+ autoAllow: {
118
+ min: number;
119
+ max: number;
120
+ };
121
+ requireApproval: {
122
+ min: number;
123
+ max: number;
124
+ };
125
+ autoBlock: {
126
+ min: number;
127
+ max: number;
128
+ };
129
+ }
130
+ interface LocalSelfInstantiation {
131
+ /** Whether sub-agent spawning is allowed */
132
+ allowed: boolean;
133
+ /** Maximum depth of sub-agent chain */
134
+ maxDepth?: number;
135
+ }
136
+ interface AgentAction {
137
+ /** Raw action data from the platform */
138
+ raw: unknown;
139
+ /** Platform identifier (e.g. 'openclaw-cli', 'cursor', 'browser') */
140
+ platform: string;
141
+ /** Timestamp of the action */
142
+ timestamp: Date;
143
+ }
144
+ interface InterceptResult {
145
+ /** Whether the action was intercepted */
146
+ intercepted: boolean;
147
+ /** Extracted PDLSS context (if intercepted) */
148
+ context?: PDLSSContext;
149
+ /** Reason for not intercepting (if not intercepted) */
150
+ skipReason?: string;
151
+ }
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 };
@@ -1,4 +1,4 @@
1
- import { C as CommerceShieldProps, b as VerificationResult, A as AgentCredentials, f as GuidanceInfo, i as TrustLevel } from '../types-CS6v75-d.mjs';
1
+ import { C as CommerceShieldProps, b as VerificationResult, A as AgentCredentials, f as GuidanceInfo, i as TrustLevel } from '../types-Bf8pML07.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-CS6v75-d.js';
1
+ import { C as CommerceShieldProps, b as VerificationResult, A as AgentCredentials, f as GuidanceInfo, i as TrustLevel } from '../types-Bf8pML07.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": "1.0.0",
3
+ "version": "2.0.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",
@@ -30,6 +30,51 @@
30
30
  "types": "./dist/ui/index.d.ts",
31
31
  "import": "./dist/ui/index.mjs",
32
32
  "require": "./dist/ui/index.js"
33
+ },
34
+ "./agent": {
35
+ "types": "./dist/agent/index.d.ts",
36
+ "import": "./dist/agent/index.mjs",
37
+ "require": "./dist/agent/index.js"
38
+ },
39
+ "./transport": {
40
+ "types": "./dist/transport/index.d.ts",
41
+ "import": "./dist/transport/index.mjs",
42
+ "require": "./dist/transport/index.js"
43
+ },
44
+ "./gateway": {
45
+ "types": "./dist/gateway/gateway.d.ts",
46
+ "import": "./dist/gateway/gateway.mjs",
47
+ "require": "./dist/gateway/gateway.js"
48
+ },
49
+ "./local-evaluator": {
50
+ "types": "./dist/local-evaluator/evaluator.d.ts",
51
+ "import": "./dist/local-evaluator/evaluator.mjs",
52
+ "require": "./dist/local-evaluator/evaluator.js"
53
+ },
54
+ "./adapter-interface": {
55
+ "types": "./dist/adapter-interface/interface.d.ts",
56
+ "import": "./dist/adapter-interface/interface.mjs",
57
+ "require": "./dist/adapter-interface/interface.js"
58
+ },
59
+ "./cli": {
60
+ "types": "./dist/cli/index.d.ts",
61
+ "import": "./dist/cli/index.mjs",
62
+ "require": "./dist/cli/index.js"
63
+ },
64
+ "./cursor": {
65
+ "types": "./dist/cursor/cursor-adapter.d.ts",
66
+ "import": "./dist/cursor/cursor-adapter.mjs",
67
+ "require": "./dist/cursor/cursor-adapter.js"
68
+ },
69
+ "./browser": {
70
+ "types": "./dist/browser/browser-adapter.d.ts",
71
+ "import": "./dist/browser/browser-adapter.mjs",
72
+ "require": "./dist/browser/browser-adapter.js"
73
+ },
74
+ "./git-trigger": {
75
+ "types": "./dist/git-trigger/git-hooks.d.ts",
76
+ "import": "./dist/git-trigger/git-hooks.mjs",
77
+ "require": "./dist/git-trigger/git-hooks.js"
33
78
  }
34
79
  },
35
80
  "files": [