@astrasyncai/verification-gateway 1.1.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 +6 -7
  16. package/dist/adapters/express.js.map +1 -1
  17. package/dist/adapters/express.mjs +6 -7
  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 +5 -7
  22. package/dist/adapters/nextjs.js.map +1 -1
  23. package/dist/adapters/nextjs.mjs +5 -7
  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 +6 -2
  28. package/dist/adapters/sdk.js.map +1 -1
  29. package/dist/adapters/sdk.mjs +6 -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/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-BoayLpqq.d.mts → express-Cp4eg77F.d.mts} +1 -1
  56. package/dist/{express-BGZiLINd.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 +17 -16
  76. package/dist/index.js.map +1 -1
  77. package/dist/index.mjs +17 -16
  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-DTCS5Sw8.d.ts → nextjs-Cag7libc.d.ts} +1 -1
  86. package/dist/{nextjs-BNbHm5Ui.d.mts → nextjs-_C_FcJY5.d.mts} +1 -1
  87. package/dist/{sdk-9TKZzhxE.d.ts → sdk-CMPDFUjo.d.ts} +3 -1
  88. package/dist/{sdk-VAFRmdt7.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-cA_xfFU7.d.mts → types-Bf8pML07.d.mts} +1 -1
  96. package/dist/{types-cA_xfFU7.d.ts → types-Bf8pML07.d.ts} +1 -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,241 @@
1
+ import { a as LocalPurposeRule, b as LocalScope, c as LocalRiskThresholds, L as LocalPolicy, P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-BvpGdsv1.mjs';
2
+ import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.mjs';
3
+ import '../types-Bf8pML07.mjs';
4
+ import '../gateway/gateway.mjs';
5
+
6
+ /**
7
+ * Interactive Setup Wizard
8
+ *
9
+ * Generates a PDLSS-compliant local policy YAML file through
10
+ * plain-language questions with explainers for non-technical users.
11
+ *
12
+ * Usage:
13
+ * const wizard = new SetupWizard(readline);
14
+ * const policy = await wizard.run();
15
+ * // policy is a LocalPolicy ready to serialize to YAML
16
+ */
17
+
18
+ interface PromptInterface {
19
+ question(prompt: string): Promise<string>;
20
+ close(): void;
21
+ }
22
+ interface PurposeCategory {
23
+ id: string;
24
+ label: string;
25
+ explainer: string;
26
+ readId?: string;
27
+ writeId?: string;
28
+ deleteId?: string;
29
+ createId?: string;
30
+ modifyId?: string;
31
+ subActions?: {
32
+ id: string;
33
+ label: string;
34
+ explainer: string;
35
+ recommended: string;
36
+ }[];
37
+ recommendedDefault: string;
38
+ }
39
+ declare const PURPOSE_CATEGORIES: PurposeCategory[];
40
+ interface BlockedCommand {
41
+ pattern: string;
42
+ label: string;
43
+ recommended: boolean;
44
+ }
45
+ declare const DEFAULT_BLOCKED_COMMANDS: BlockedCommand[];
46
+ interface BlockedPath {
47
+ pattern: string;
48
+ label: string;
49
+ recommended: boolean;
50
+ }
51
+ declare const DEFAULT_BLOCKED_PATHS: BlockedPath[];
52
+ interface RiskPreset {
53
+ name: string;
54
+ label: string;
55
+ thresholds: LocalRiskThresholds;
56
+ }
57
+ declare const RISK_PRESETS: RiskPreset[];
58
+ declare class SetupWizard {
59
+ private prompt;
60
+ constructor(prompt: PromptInterface);
61
+ /**
62
+ * Run the full interactive wizard and return a validated LocalPolicy.
63
+ */
64
+ run(): Promise<LocalPolicy>;
65
+ /**
66
+ * Run the wizard and write the result to a YAML file.
67
+ */
68
+ runAndSave(outputPath: string): Promise<LocalPolicy>;
69
+ private askPurposeQuestion;
70
+ private askBlockedCommands;
71
+ private askBlockedPaths;
72
+ private askRiskPreset;
73
+ private askCommaSeparated;
74
+ private parseYesNoApproval;
75
+ private parseYesNo;
76
+ private ask;
77
+ private print;
78
+ }
79
+ interface ImportResult {
80
+ purposes: LocalPurposeRule[];
81
+ scope?: LocalScope;
82
+ source: string;
83
+ rulesImported: number;
84
+ }
85
+ /**
86
+ * Parse a .cursorrules file and extract PDLSS-compatible rules.
87
+ * Returns partial policy rules that can be merged with wizard output.
88
+ */
89
+ declare function importFromCursorRules(content: string): ImportResult;
90
+ /**
91
+ * Parse a .gitignore file to infer sensitive file patterns.
92
+ * These become blockedPatterns for file.read purposes.
93
+ */
94
+ declare function inferFromGitignore(content: string): string[];
95
+
96
+ /**
97
+ * AstraSync Guard Upgrade CLI
98
+ *
99
+ * Handles the free -> Developer tier upgrade flow:
100
+ * 1. Validate existing setup and check for prior upgrade
101
+ * 2. Open browser for KYD registration
102
+ * 3. Validate API key before proceeding
103
+ * 4. Upload local policy to cloud (YAML -> cloud PDLSS, 1:1 mapping)
104
+ * 5. Register agent and receive ASTRA-ID
105
+ * 6. Choose mode (online or hybrid) and switch gateway
106
+ *
107
+ * Also supports event-triggered upgrade prompts when counterparties
108
+ * reject unverified agents.
109
+ */
110
+
111
+ interface UpgradeConfig {
112
+ /** Path to local policy YAML file */
113
+ policyPath: string;
114
+ /** Loaded policy object */
115
+ policy: LocalPolicy;
116
+ /** AstraSync platform base URL */
117
+ platformUrl?: string;
118
+ /** Config directory for storing credentials (default: .astrasync/) */
119
+ configDir?: string;
120
+ }
121
+ interface UpgradeResult {
122
+ success: boolean;
123
+ kydId?: string;
124
+ agentId?: string;
125
+ apiKey?: string;
126
+ mode?: 'online' | 'hybrid';
127
+ error?: string;
128
+ }
129
+ interface UpgradeCallbacks {
130
+ /** Open a URL in the user's browser */
131
+ openBrowser: (url: string) => Promise<void>;
132
+ /** Prompt user for text input */
133
+ prompt: (message: string) => Promise<string>;
134
+ /** Display message to user */
135
+ print: (message: string) => void;
136
+ /** Write config file */
137
+ writeConfig: (path: string, content: string) => Promise<void>;
138
+ /** Read config file */
139
+ readConfig: (path: string) => Promise<string | null>;
140
+ }
141
+ /**
142
+ * Trigger context — why the upgrade was initiated.
143
+ * Used for event-triggered upgrade prompts.
144
+ */
145
+ interface UpgradeTrigger {
146
+ /** What triggered the upgrade prompt */
147
+ reason: 'cli' | 'counterparty-rejection' | 'deployment' | 'git-push';
148
+ /** Details from the triggering event */
149
+ details?: {
150
+ /** Counterparty that rejected the agent */
151
+ counterpartyUrl?: string;
152
+ /** Rejection message from counterparty */
153
+ rejectionMessage?: string;
154
+ /** Guidance URL from counterparty */
155
+ guidanceUrl?: string;
156
+ };
157
+ }
158
+ declare class UpgradeFlow {
159
+ private config;
160
+ private callbacks;
161
+ private platformUrl;
162
+ private configDir;
163
+ private trigger;
164
+ constructor(config: UpgradeConfig, callbacks: UpgradeCallbacks, trigger?: UpgradeTrigger);
165
+ /**
166
+ * Run the full upgrade flow.
167
+ */
168
+ run(): Promise<UpgradeResult>;
169
+ /**
170
+ * Continue the upgrade flow after API key validation.
171
+ */
172
+ private continueUpgrade;
173
+ /**
174
+ * Print the intro message based on what triggered the upgrade.
175
+ */
176
+ private printIntro;
177
+ /**
178
+ * Validate the API key by calling the platform.
179
+ */
180
+ private validateApiKey;
181
+ /**
182
+ * Upload local policy to the AstraSync cloud.
183
+ * YAML -> cloud PDLSS boundary, 1:1 mapping, no lossy transformation.
184
+ */
185
+ private uploadPolicy;
186
+ /**
187
+ * Write the config file for the chosen mode.
188
+ */
189
+ private writeLocalConfig;
190
+ }
191
+ /**
192
+ * Check if the project has already been upgraded.
193
+ */
194
+ declare function isUpgraded(configDir: string, readFile: (path: string) => Promise<string | null>): Promise<boolean>;
195
+
196
+ /**
197
+ * @astrasyncai/adapter-openclaw-cli
198
+ *
199
+ * Reference Layer 4 adapter for the OpenClaw CLI.
200
+ * Implements PlatformAdapter interface — proxy server that intercepts
201
+ * tool use requests before they reach the agent runtime.
202
+ *
203
+ * Configurable ports (defaults to OpenClaw conventions):
204
+ * proxyPort: 18790 (this adapter listens)
205
+ * targetPort: 18789 (OpenClaw CLI gateway)
206
+ */
207
+
208
+ interface OpenClawAdapterOptions {
209
+ /** Port this adapter listens on (default: 18790) */
210
+ proxyPort?: number;
211
+ /** Port the OpenClaw CLI gateway runs on (default: 18789) */
212
+ targetPort?: number;
213
+ /** Target host (default: 127.0.0.1) */
214
+ targetHost?: string;
215
+ /** Show approval prompts in terminal for MANUAL_REVIEW (default: true) */
216
+ interactiveApproval?: boolean;
217
+ /** Callback for MANUAL_REVIEW decisions (if not interactive) */
218
+ onApprovalRequired?: (context: PDLSSContext, decision: VerificationDecision) => Promise<boolean>;
219
+ }
220
+ declare class OpenClawCliAdapter implements PlatformAdapter {
221
+ readonly interfaceVersion = 1;
222
+ private gateway;
223
+ private options;
224
+ private server;
225
+ private _isRunning;
226
+ constructor(options?: OpenClawAdapterOptions);
227
+ get isRunning(): boolean;
228
+ get proxyPort(): number;
229
+ get targetPort(): number;
230
+ initialize(config: AdapterConfig): Promise<void>;
231
+ shutdown(): Promise<void>;
232
+ interceptAction(action: AgentAction): Promise<InterceptResult>;
233
+ extractContext(action: AgentAction): PDLSSContext;
234
+ enforceDecision(decision: VerificationDecision): Promise<void>;
235
+ private startProxy;
236
+ private handleProxyRequest;
237
+ private forwardRequest;
238
+ private handleApproval;
239
+ }
240
+
241
+ export { type BlockedCommand, type BlockedPath, DEFAULT_BLOCKED_COMMANDS, DEFAULT_BLOCKED_PATHS, type ImportResult, type OpenClawAdapterOptions, OpenClawCliAdapter, PURPOSE_CATEGORIES, type PromptInterface, type PurposeCategory, RISK_PRESETS, type RiskPreset, SetupWizard, type UpgradeCallbacks, type UpgradeConfig, UpgradeFlow, type UpgradeResult, importFromCursorRules, inferFromGitignore, isUpgraded };
@@ -0,0 +1,241 @@
1
+ import { a as LocalPurposeRule, b as LocalScope, c as LocalRiskThresholds, L as LocalPolicy, P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-Ce2mFJkO.js';
2
+ import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.js';
3
+ import '../types-Bf8pML07.js';
4
+ import '../gateway/gateway.js';
5
+
6
+ /**
7
+ * Interactive Setup Wizard
8
+ *
9
+ * Generates a PDLSS-compliant local policy YAML file through
10
+ * plain-language questions with explainers for non-technical users.
11
+ *
12
+ * Usage:
13
+ * const wizard = new SetupWizard(readline);
14
+ * const policy = await wizard.run();
15
+ * // policy is a LocalPolicy ready to serialize to YAML
16
+ */
17
+
18
+ interface PromptInterface {
19
+ question(prompt: string): Promise<string>;
20
+ close(): void;
21
+ }
22
+ interface PurposeCategory {
23
+ id: string;
24
+ label: string;
25
+ explainer: string;
26
+ readId?: string;
27
+ writeId?: string;
28
+ deleteId?: string;
29
+ createId?: string;
30
+ modifyId?: string;
31
+ subActions?: {
32
+ id: string;
33
+ label: string;
34
+ explainer: string;
35
+ recommended: string;
36
+ }[];
37
+ recommendedDefault: string;
38
+ }
39
+ declare const PURPOSE_CATEGORIES: PurposeCategory[];
40
+ interface BlockedCommand {
41
+ pattern: string;
42
+ label: string;
43
+ recommended: boolean;
44
+ }
45
+ declare const DEFAULT_BLOCKED_COMMANDS: BlockedCommand[];
46
+ interface BlockedPath {
47
+ pattern: string;
48
+ label: string;
49
+ recommended: boolean;
50
+ }
51
+ declare const DEFAULT_BLOCKED_PATHS: BlockedPath[];
52
+ interface RiskPreset {
53
+ name: string;
54
+ label: string;
55
+ thresholds: LocalRiskThresholds;
56
+ }
57
+ declare const RISK_PRESETS: RiskPreset[];
58
+ declare class SetupWizard {
59
+ private prompt;
60
+ constructor(prompt: PromptInterface);
61
+ /**
62
+ * Run the full interactive wizard and return a validated LocalPolicy.
63
+ */
64
+ run(): Promise<LocalPolicy>;
65
+ /**
66
+ * Run the wizard and write the result to a YAML file.
67
+ */
68
+ runAndSave(outputPath: string): Promise<LocalPolicy>;
69
+ private askPurposeQuestion;
70
+ private askBlockedCommands;
71
+ private askBlockedPaths;
72
+ private askRiskPreset;
73
+ private askCommaSeparated;
74
+ private parseYesNoApproval;
75
+ private parseYesNo;
76
+ private ask;
77
+ private print;
78
+ }
79
+ interface ImportResult {
80
+ purposes: LocalPurposeRule[];
81
+ scope?: LocalScope;
82
+ source: string;
83
+ rulesImported: number;
84
+ }
85
+ /**
86
+ * Parse a .cursorrules file and extract PDLSS-compatible rules.
87
+ * Returns partial policy rules that can be merged with wizard output.
88
+ */
89
+ declare function importFromCursorRules(content: string): ImportResult;
90
+ /**
91
+ * Parse a .gitignore file to infer sensitive file patterns.
92
+ * These become blockedPatterns for file.read purposes.
93
+ */
94
+ declare function inferFromGitignore(content: string): string[];
95
+
96
+ /**
97
+ * AstraSync Guard Upgrade CLI
98
+ *
99
+ * Handles the free -> Developer tier upgrade flow:
100
+ * 1. Validate existing setup and check for prior upgrade
101
+ * 2. Open browser for KYD registration
102
+ * 3. Validate API key before proceeding
103
+ * 4. Upload local policy to cloud (YAML -> cloud PDLSS, 1:1 mapping)
104
+ * 5. Register agent and receive ASTRA-ID
105
+ * 6. Choose mode (online or hybrid) and switch gateway
106
+ *
107
+ * Also supports event-triggered upgrade prompts when counterparties
108
+ * reject unverified agents.
109
+ */
110
+
111
+ interface UpgradeConfig {
112
+ /** Path to local policy YAML file */
113
+ policyPath: string;
114
+ /** Loaded policy object */
115
+ policy: LocalPolicy;
116
+ /** AstraSync platform base URL */
117
+ platformUrl?: string;
118
+ /** Config directory for storing credentials (default: .astrasync/) */
119
+ configDir?: string;
120
+ }
121
+ interface UpgradeResult {
122
+ success: boolean;
123
+ kydId?: string;
124
+ agentId?: string;
125
+ apiKey?: string;
126
+ mode?: 'online' | 'hybrid';
127
+ error?: string;
128
+ }
129
+ interface UpgradeCallbacks {
130
+ /** Open a URL in the user's browser */
131
+ openBrowser: (url: string) => Promise<void>;
132
+ /** Prompt user for text input */
133
+ prompt: (message: string) => Promise<string>;
134
+ /** Display message to user */
135
+ print: (message: string) => void;
136
+ /** Write config file */
137
+ writeConfig: (path: string, content: string) => Promise<void>;
138
+ /** Read config file */
139
+ readConfig: (path: string) => Promise<string | null>;
140
+ }
141
+ /**
142
+ * Trigger context — why the upgrade was initiated.
143
+ * Used for event-triggered upgrade prompts.
144
+ */
145
+ interface UpgradeTrigger {
146
+ /** What triggered the upgrade prompt */
147
+ reason: 'cli' | 'counterparty-rejection' | 'deployment' | 'git-push';
148
+ /** Details from the triggering event */
149
+ details?: {
150
+ /** Counterparty that rejected the agent */
151
+ counterpartyUrl?: string;
152
+ /** Rejection message from counterparty */
153
+ rejectionMessage?: string;
154
+ /** Guidance URL from counterparty */
155
+ guidanceUrl?: string;
156
+ };
157
+ }
158
+ declare class UpgradeFlow {
159
+ private config;
160
+ private callbacks;
161
+ private platformUrl;
162
+ private configDir;
163
+ private trigger;
164
+ constructor(config: UpgradeConfig, callbacks: UpgradeCallbacks, trigger?: UpgradeTrigger);
165
+ /**
166
+ * Run the full upgrade flow.
167
+ */
168
+ run(): Promise<UpgradeResult>;
169
+ /**
170
+ * Continue the upgrade flow after API key validation.
171
+ */
172
+ private continueUpgrade;
173
+ /**
174
+ * Print the intro message based on what triggered the upgrade.
175
+ */
176
+ private printIntro;
177
+ /**
178
+ * Validate the API key by calling the platform.
179
+ */
180
+ private validateApiKey;
181
+ /**
182
+ * Upload local policy to the AstraSync cloud.
183
+ * YAML -> cloud PDLSS boundary, 1:1 mapping, no lossy transformation.
184
+ */
185
+ private uploadPolicy;
186
+ /**
187
+ * Write the config file for the chosen mode.
188
+ */
189
+ private writeLocalConfig;
190
+ }
191
+ /**
192
+ * Check if the project has already been upgraded.
193
+ */
194
+ declare function isUpgraded(configDir: string, readFile: (path: string) => Promise<string | null>): Promise<boolean>;
195
+
196
+ /**
197
+ * @astrasyncai/adapter-openclaw-cli
198
+ *
199
+ * Reference Layer 4 adapter for the OpenClaw CLI.
200
+ * Implements PlatformAdapter interface — proxy server that intercepts
201
+ * tool use requests before they reach the agent runtime.
202
+ *
203
+ * Configurable ports (defaults to OpenClaw conventions):
204
+ * proxyPort: 18790 (this adapter listens)
205
+ * targetPort: 18789 (OpenClaw CLI gateway)
206
+ */
207
+
208
+ interface OpenClawAdapterOptions {
209
+ /** Port this adapter listens on (default: 18790) */
210
+ proxyPort?: number;
211
+ /** Port the OpenClaw CLI gateway runs on (default: 18789) */
212
+ targetPort?: number;
213
+ /** Target host (default: 127.0.0.1) */
214
+ targetHost?: string;
215
+ /** Show approval prompts in terminal for MANUAL_REVIEW (default: true) */
216
+ interactiveApproval?: boolean;
217
+ /** Callback for MANUAL_REVIEW decisions (if not interactive) */
218
+ onApprovalRequired?: (context: PDLSSContext, decision: VerificationDecision) => Promise<boolean>;
219
+ }
220
+ declare class OpenClawCliAdapter implements PlatformAdapter {
221
+ readonly interfaceVersion = 1;
222
+ private gateway;
223
+ private options;
224
+ private server;
225
+ private _isRunning;
226
+ constructor(options?: OpenClawAdapterOptions);
227
+ get isRunning(): boolean;
228
+ get proxyPort(): number;
229
+ get targetPort(): number;
230
+ initialize(config: AdapterConfig): Promise<void>;
231
+ shutdown(): Promise<void>;
232
+ interceptAction(action: AgentAction): Promise<InterceptResult>;
233
+ extractContext(action: AgentAction): PDLSSContext;
234
+ enforceDecision(decision: VerificationDecision): Promise<void>;
235
+ private startProxy;
236
+ private handleProxyRequest;
237
+ private forwardRequest;
238
+ private handleApproval;
239
+ }
240
+
241
+ export { type BlockedCommand, type BlockedPath, DEFAULT_BLOCKED_COMMANDS, DEFAULT_BLOCKED_PATHS, type ImportResult, type OpenClawAdapterOptions, OpenClawCliAdapter, PURPOSE_CATEGORIES, type PromptInterface, type PurposeCategory, RISK_PRESETS, type RiskPreset, SetupWizard, type UpgradeCallbacks, type UpgradeConfig, UpgradeFlow, type UpgradeResult, importFromCursorRules, inferFromGitignore, isUpgraded };