@dexto/tools-process 1.5.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 (42) hide show
  1. package/LICENSE +44 -0
  2. package/dist/bash-exec-tool.cjs +130 -0
  3. package/dist/bash-exec-tool.d.cts +17 -0
  4. package/dist/bash-exec-tool.d.ts +17 -0
  5. package/dist/bash-exec-tool.js +96 -0
  6. package/dist/bash-output-tool.cjs +49 -0
  7. package/dist/bash-output-tool.d.cts +16 -0
  8. package/dist/bash-output-tool.d.ts +16 -0
  9. package/dist/bash-output-tool.js +25 -0
  10. package/dist/command-validator.cjs +554 -0
  11. package/dist/command-validator.d.cts +52 -0
  12. package/dist/command-validator.d.ts +52 -0
  13. package/dist/command-validator.js +530 -0
  14. package/dist/error-codes.cjs +47 -0
  15. package/dist/error-codes.d.cts +26 -0
  16. package/dist/error-codes.d.ts +26 -0
  17. package/dist/error-codes.js +23 -0
  18. package/dist/errors.cjs +243 -0
  19. package/dist/errors.d.cts +90 -0
  20. package/dist/errors.d.ts +90 -0
  21. package/dist/errors.js +219 -0
  22. package/dist/index.cjs +49 -0
  23. package/dist/index.d.cts +11 -0
  24. package/dist/index.d.ts +11 -0
  25. package/dist/index.js +18 -0
  26. package/dist/kill-process-tool.cjs +47 -0
  27. package/dist/kill-process-tool.d.cts +16 -0
  28. package/dist/kill-process-tool.d.ts +16 -0
  29. package/dist/kill-process-tool.js +23 -0
  30. package/dist/process-service.cjs +544 -0
  31. package/dist/process-service.d.cts +96 -0
  32. package/dist/process-service.d.ts +96 -0
  33. package/dist/process-service.js +510 -0
  34. package/dist/tool-provider.cjs +96 -0
  35. package/dist/tool-provider.d.cts +72 -0
  36. package/dist/tool-provider.d.ts +72 -0
  37. package/dist/tool-provider.js +72 -0
  38. package/dist/types.cjs +16 -0
  39. package/dist/types.d.cts +108 -0
  40. package/dist/types.d.ts +108 -0
  41. package/dist/types.js +0 -0
  42. package/package.json +38 -0
@@ -0,0 +1,554 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var command_validator_exports = {};
20
+ __export(command_validator_exports, {
21
+ CommandValidator: () => CommandValidator
22
+ });
23
+ module.exports = __toCommonJS(command_validator_exports);
24
+ const MAX_COMMAND_LENGTH = 1e4;
25
+ const DANGEROUS_PATTERNS = [
26
+ // File system destruction
27
+ /rm\s+-rf\s+\//,
28
+ // rm -rf /
29
+ /rm\s+-rf\s+\/\s*$/,
30
+ // rm -rf / (end of line)
31
+ /rm\s+-rf\s+\/\s*2/,
32
+ // rm -rf / 2>/dev/null (with error suppression)
33
+ // Fork bomb variations
34
+ /:\(\)\{\s*:\|:&\s*\};:/,
35
+ // Classic fork bomb
36
+ /:\(\)\{\s*:\|:&\s*\};/,
37
+ // Fork bomb without final colon
38
+ /:\(\)\{\s*:\|:&\s*\}/,
39
+ // Fork bomb without semicolon
40
+ // Disk operations
41
+ /dd\s+if=.*of=\/dev\//,
42
+ // dd to disk devices
43
+ /dd\s+if=\/dev\/zero.*of=\/dev\//,
44
+ // dd zero to disk
45
+ /dd\s+if=\/dev\/urandom.*of=\/dev\//,
46
+ // dd random to disk
47
+ />\s*\/dev\/sd[a-z]/,
48
+ // Write to disk devices
49
+ />>\s*\/dev\/sd[a-z]/,
50
+ // Append to disk devices
51
+ // Filesystem operations
52
+ /mkfs\./,
53
+ // Format filesystem
54
+ /mkfs\s+/,
55
+ // Format filesystem with space
56
+ /fdisk\s+\/dev\/sd[a-z]/,
57
+ // Partition disk
58
+ /parted\s+\/dev\/sd[a-z]/,
59
+ // Partition disk with parted
60
+ // Download and execute patterns
61
+ /wget.*\|\s*sh/,
62
+ // wget | sh
63
+ /wget.*\|\s*bash/,
64
+ // wget | bash
65
+ /curl.*\|\s*sh/,
66
+ // curl | sh
67
+ /curl.*\|\s*bash/,
68
+ // curl | bash
69
+ /wget.*\|\s*python/,
70
+ // wget | python
71
+ /curl.*\|\s*python/,
72
+ // curl | python
73
+ // Shell execution
74
+ /\|\s*bash/,
75
+ // Pipe to bash
76
+ /\|\s*sh/,
77
+ // Pipe to sh
78
+ /\|\s*zsh/,
79
+ // Pipe to zsh
80
+ /\|\s*fish/,
81
+ // Pipe to fish
82
+ // Command evaluation
83
+ /eval\s+\$\(/,
84
+ // eval $()
85
+ /eval\s+`/,
86
+ // eval backticks
87
+ /eval\s+"/,
88
+ // eval double quotes
89
+ /eval\s+'/,
90
+ // eval single quotes
91
+ // Permission changes
92
+ /chmod\s+777\s+\//,
93
+ // chmod 777 /
94
+ /chmod\s+777\s+\/\s*$/,
95
+ // chmod 777 / (end of line)
96
+ /chmod\s+-R\s+777\s+\//,
97
+ // chmod -R 777 /
98
+ /chown\s+-R\s+root\s+\//,
99
+ // chown -R root /
100
+ // Network operations
101
+ /nc\s+-l\s+-p\s+\d+/,
102
+ // netcat listener
103
+ /ncat\s+-l\s+-p\s+\d+/,
104
+ // ncat listener
105
+ /socat\s+.*LISTEN/,
106
+ // socat listener
107
+ // Process manipulation
108
+ /killall\s+-9/,
109
+ // killall -9
110
+ /pkill\s+-9/,
111
+ // pkill -9
112
+ /kill\s+-9\s+-1/,
113
+ // kill -9 -1 (kill all processes)
114
+ // System shutdown/reboot
115
+ /shutdown\s+now/,
116
+ // shutdown now
117
+ /reboot/,
118
+ // reboot
119
+ /halt/,
120
+ // halt
121
+ /poweroff/,
122
+ // poweroff
123
+ // Memory operations
124
+ /echo\s+3\s*>\s*\/proc\/sys\/vm\/drop_caches/,
125
+ // Clear page cache
126
+ /sync\s*;\s*echo\s+3\s*>\s*\/proc\/sys\/vm\/drop_caches/,
127
+ // Sync and clear cache
128
+ // Network interface manipulation
129
+ /ifconfig\s+.*down/,
130
+ // Bring interface down
131
+ /ip\s+link\s+set\s+.*down/,
132
+ // Bring interface down with ip
133
+ // Package manager operations
134
+ /apt\s+remove\s+--purge\s+.*/,
135
+ // Remove packages
136
+ /yum\s+remove\s+.*/,
137
+ // Remove packages
138
+ /dnf\s+remove\s+.*/,
139
+ // Remove packages
140
+ /pacman\s+-R\s+.*/
141
+ // Remove packages
142
+ ];
143
+ const INJECTION_PATTERNS = [
144
+ // Command chaining with dangerous commands using semicolon (more suspicious)
145
+ /;\s*rm\s+-rf/,
146
+ // ; rm -rf
147
+ /;\s*chmod\s+777/,
148
+ // ; chmod 777
149
+ /;\s*chown\s+root/,
150
+ // ; chown root
151
+ // Command substitution with dangerous commands
152
+ /`.*rm.*`/,
153
+ // backticks with rm
154
+ /\$\(.*rm.*\)/,
155
+ // $() with rm
156
+ /`.*chmod.*`/,
157
+ // backticks with chmod
158
+ /\$\(.*chmod.*\)/,
159
+ // $() with chmod
160
+ /`.*chown.*`/,
161
+ // backticks with chown
162
+ /\$\(.*chown.*\)/,
163
+ // $() with chown
164
+ // Multiple command separators
165
+ /;\s*;\s*/,
166
+ // Multiple semicolons
167
+ /&&\s*&&\s*/,
168
+ // Multiple && operators
169
+ /\|\|\s*\|\|\s*/,
170
+ // Multiple || operators
171
+ // Redirection with dangerous commands
172
+ /rm\s+.*>\s*\/dev\/null/,
173
+ // rm with output redirection
174
+ /chmod\s+.*>\s*\/dev\/null/,
175
+ // chmod with output redirection
176
+ /chown\s+.*>\s*\/dev\/null/,
177
+ // chown with output redirection
178
+ // Environment variable manipulation
179
+ /\$[A-Z_]+\s*=\s*.*rm/,
180
+ // Environment variable with rm
181
+ /\$[A-Z_]+\s*=\s*.*chmod/,
182
+ // Environment variable with chmod
183
+ /\$[A-Z_]+\s*=\s*.*chown/
184
+ // Environment variable with chown
185
+ ];
186
+ const REQUIRES_APPROVAL_PATTERNS = [
187
+ // File operations
188
+ /^rm\s+/,
189
+ // rm (removal)
190
+ /^mv\s+/,
191
+ // move files
192
+ /^cp\s+/,
193
+ // copy files
194
+ /^chmod\s+/,
195
+ // chmod
196
+ /^chown\s+/,
197
+ // chown
198
+ /^chgrp\s+/,
199
+ // chgrp
200
+ /^ln\s+/,
201
+ // create links
202
+ /^unlink\s+/,
203
+ // unlink files
204
+ // Git operations
205
+ /^git\s+push/,
206
+ // git push
207
+ /^git\s+commit/,
208
+ // git commit
209
+ /^git\s+reset/,
210
+ // git reset
211
+ /^git\s+rebase/,
212
+ // git rebase
213
+ /^git\s+merge/,
214
+ // git merge
215
+ /^git\s+checkout/,
216
+ // git checkout
217
+ /^git\s+branch/,
218
+ // git branch
219
+ /^git\s+tag/,
220
+ // git tag
221
+ // Package management
222
+ /^npm\s+publish/,
223
+ // npm publish
224
+ /^npm\s+uninstall/,
225
+ // npm uninstall
226
+ /^yarn\s+publish/,
227
+ // yarn publish
228
+ /^yarn\s+remove/,
229
+ // yarn remove
230
+ /^pip\s+install/,
231
+ // pip install
232
+ /^pip\s+uninstall/,
233
+ // pip uninstall
234
+ /^apt\s+install/,
235
+ // apt install
236
+ /^apt\s+remove/,
237
+ // apt remove
238
+ /^yum\s+install/,
239
+ // yum install
240
+ /^yum\s+remove/,
241
+ // yum remove
242
+ /^dnf\s+install/,
243
+ // dnf install
244
+ /^dnf\s+remove/,
245
+ // dnf remove
246
+ /^pacman\s+-S/,
247
+ // pacman install
248
+ /^pacman\s+-R/,
249
+ // pacman remove
250
+ // Container operations
251
+ /^docker\s+/,
252
+ // docker commands
253
+ /^podman\s+/,
254
+ // podman commands
255
+ /^kubectl\s+/,
256
+ // kubectl commands
257
+ // System operations
258
+ /^sudo\s+/,
259
+ // sudo commands
260
+ /^su\s+/,
261
+ // su commands
262
+ /^systemctl\s+/,
263
+ // systemctl commands
264
+ /^service\s+/,
265
+ // service commands
266
+ /^mount\s+/,
267
+ // mount commands
268
+ /^umount\s+/,
269
+ // umount commands
270
+ /^fdisk\s+/,
271
+ // fdisk commands
272
+ /^parted\s+/,
273
+ // parted commands
274
+ /^mkfs\s+/,
275
+ // mkfs commands
276
+ /^fsck\s+/,
277
+ // fsck commands
278
+ // Network operations
279
+ /^iptables\s+/,
280
+ // iptables commands
281
+ /^ufw\s+/,
282
+ // ufw commands
283
+ /^firewall-cmd\s+/,
284
+ // firewall-cmd commands
285
+ /^sshd\s+/,
286
+ // sshd commands
287
+ /^ssh\s+/,
288
+ // ssh commands
289
+ /^scp\s+/,
290
+ // scp commands
291
+ /^rsync\s+/,
292
+ // rsync commands
293
+ // Process management
294
+ /^kill\s+/,
295
+ // kill commands
296
+ /^killall\s+/,
297
+ // killall commands
298
+ /^pkill\s+/,
299
+ // pkill commands
300
+ /^nohup\s+/,
301
+ // nohup commands
302
+ /^screen\s+/,
303
+ // screen commands
304
+ /^tmux\s+/,
305
+ // tmux commands
306
+ // Database operations
307
+ /^mysql\s+/,
308
+ // mysql commands
309
+ /^psql\s+/,
310
+ // psql commands
311
+ /^sqlite3\s+/,
312
+ // sqlite3 commands
313
+ /^mongodb\s+/,
314
+ // mongodb commands
315
+ /^redis-cli\s+/
316
+ // redis-cli commands
317
+ ];
318
+ const SAFE_PATTERNS = [
319
+ // Directory navigation with commands
320
+ /^cd\s+.*&&\s+\w+/,
321
+ // cd && command
322
+ /^cd\s+.*;\s+\w+/,
323
+ // cd ; command
324
+ // Safe pipe operations
325
+ /\|\s*grep/,
326
+ // | grep
327
+ /\|\s*head/,
328
+ // | head
329
+ /\|\s*tail/,
330
+ // | tail
331
+ /\|\s*sort/,
332
+ // | sort
333
+ /\|\s*uniq/,
334
+ // | uniq
335
+ /\|\s*wc/,
336
+ // | wc
337
+ /\|\s*cat/,
338
+ // | cat
339
+ /\|\s*less/,
340
+ // | less
341
+ /\|\s*more/,
342
+ // | more
343
+ /\|\s*awk/,
344
+ // | awk
345
+ /\|\s*sed/,
346
+ // | sed
347
+ /\|\s*cut/,
348
+ // | cut
349
+ /\|\s*tr/,
350
+ // | tr
351
+ /\|\s*xargs/,
352
+ // | xargs
353
+ // Safe redirection
354
+ /^ls\s+.*>/,
355
+ // ls with output redirection
356
+ /^find\s+.*>/,
357
+ // find with output redirection
358
+ /^grep\s+.*>/,
359
+ // grep with output redirection
360
+ /^cat\s+.*>/
361
+ // cat with output redirection
362
+ ];
363
+ const WRITE_PATTERNS = [
364
+ // Output redirection
365
+ />/,
366
+ // output redirection
367
+ />>/,
368
+ // append redirection
369
+ /2>/,
370
+ // error redirection
371
+ /2>>/,
372
+ // error append redirection
373
+ /&>/,
374
+ // both output and error redirection
375
+ /&>>/,
376
+ // both output and error append redirection
377
+ // File operations
378
+ /tee\s+/,
379
+ // tee command
380
+ /touch\s+/,
381
+ // touch command
382
+ /mkdir\s+/,
383
+ // mkdir command
384
+ /rmdir\s+/,
385
+ // rmdir command
386
+ // Text editors
387
+ /vim\s+/,
388
+ // vim command
389
+ /nano\s+/,
390
+ // nano command
391
+ /emacs\s+/,
392
+ // emacs command
393
+ /code\s+/,
394
+ // code command (VS Code)
395
+ // File copying and moving
396
+ /cp\s+/,
397
+ // cp command
398
+ /mv\s+/,
399
+ // mv command
400
+ /scp\s+/,
401
+ // scp command
402
+ /rsync\s+/
403
+ // rsync command
404
+ ];
405
+ class CommandValidator {
406
+ config;
407
+ logger;
408
+ constructor(config, logger) {
409
+ this.config = config;
410
+ this.logger = logger;
411
+ this.logger.debug(
412
+ `CommandValidator initialized with security level: ${config.securityLevel}`
413
+ );
414
+ }
415
+ /**
416
+ * Validate a command for security and policy compliance
417
+ */
418
+ validateCommand(command) {
419
+ if (!command || command.trim() === "") {
420
+ return {
421
+ isValid: false,
422
+ error: "Command cannot be empty"
423
+ };
424
+ }
425
+ const trimmedCommand = command.trim();
426
+ if (/&\s*$/.test(trimmedCommand)) {
427
+ return {
428
+ isValid: false,
429
+ error: "Commands ending with & (shell backgrounding) are not allowed. Use run_in_background parameter instead for proper process management."
430
+ };
431
+ }
432
+ if (trimmedCommand.length > MAX_COMMAND_LENGTH) {
433
+ return {
434
+ isValid: false,
435
+ error: `Command too long: ${trimmedCommand.length} characters. Maximum: ${MAX_COMMAND_LENGTH}`
436
+ };
437
+ }
438
+ if (this.config.securityLevel !== "permissive") {
439
+ for (const pattern of DANGEROUS_PATTERNS) {
440
+ if (pattern.test(trimmedCommand)) {
441
+ return {
442
+ isValid: false,
443
+ error: `Command matches dangerous pattern: ${pattern.source}`
444
+ };
445
+ }
446
+ }
447
+ }
448
+ const injectionResult = this.detectInjection(trimmedCommand);
449
+ if (!injectionResult.isValid) {
450
+ return injectionResult;
451
+ }
452
+ for (const blockedPattern of this.config.blockedCommands) {
453
+ if (trimmedCommand.includes(blockedPattern)) {
454
+ return {
455
+ isValid: false,
456
+ error: `Command is blocked: matches "${blockedPattern}"`
457
+ };
458
+ }
459
+ }
460
+ if (this.config.allowedCommands.length > 0) {
461
+ const isAllowed = this.config.allowedCommands.some(
462
+ (allowedCmd) => trimmedCommand.startsWith(allowedCmd)
463
+ );
464
+ if (!isAllowed) {
465
+ return {
466
+ isValid: false,
467
+ error: `Command not in allowed list. Allowed: ${this.config.allowedCommands.join(", ")}`
468
+ };
469
+ }
470
+ }
471
+ const requiresApproval = this.determineApprovalRequirement(trimmedCommand);
472
+ return {
473
+ isValid: true,
474
+ normalizedCommand: trimmedCommand,
475
+ requiresApproval
476
+ };
477
+ }
478
+ /**
479
+ * Detect command injection attempts
480
+ */
481
+ detectInjection(command) {
482
+ for (const pattern of INJECTION_PATTERNS) {
483
+ if (pattern.test(command)) {
484
+ return {
485
+ isValid: false,
486
+ error: `Potential command injection detected: ${pattern.source}`
487
+ };
488
+ }
489
+ }
490
+ if (this.config.securityLevel === "strict") {
491
+ const hasMultipleCommands = /;|\|{1,2}|&&/.test(command);
492
+ if (hasMultipleCommands) {
493
+ const isSafe = SAFE_PATTERNS.some((pattern) => pattern.test(command));
494
+ if (!isSafe) {
495
+ return {
496
+ isValid: false,
497
+ error: "Multiple commands detected in strict mode. Use moderate or permissive mode if this is intentional."
498
+ };
499
+ }
500
+ }
501
+ }
502
+ return {
503
+ isValid: true
504
+ };
505
+ }
506
+ /**
507
+ * Determine if a command requires approval
508
+ * Handles compound commands (with &&, ||, ;) by checking each sub-command
509
+ */
510
+ determineApprovalRequirement(command) {
511
+ const subCommands = command.split(/\s*(?:&&|\|\||;)\s*/).map((cmd) => cmd.trim());
512
+ for (const subCmd of subCommands) {
513
+ if (!subCmd) continue;
514
+ const normalizedSubCmd = subCmd.replace(/^(?:then|do|else)\b\s*/, "").replace(/^\{\s*/, "").trim();
515
+ if (!normalizedSubCmd) continue;
516
+ for (const pattern of REQUIRES_APPROVAL_PATTERNS) {
517
+ if (pattern.test(normalizedSubCmd)) {
518
+ return true;
519
+ }
520
+ }
521
+ if (this.config.securityLevel === "strict") {
522
+ return true;
523
+ }
524
+ if (this.config.securityLevel === "moderate") {
525
+ if (WRITE_PATTERNS.some((pattern) => pattern.test(normalizedSubCmd))) {
526
+ return true;
527
+ }
528
+ }
529
+ }
530
+ return false;
531
+ }
532
+ /**
533
+ * Get list of blocked commands
534
+ */
535
+ getBlockedCommands() {
536
+ return [...this.config.blockedCommands];
537
+ }
538
+ /**
539
+ * Get list of allowed commands
540
+ */
541
+ getAllowedCommands() {
542
+ return [...this.config.allowedCommands];
543
+ }
544
+ /**
545
+ * Get security level
546
+ */
547
+ getSecurityLevel() {
548
+ return this.config.securityLevel;
549
+ }
550
+ }
551
+ // Annotate the CommonJS export names for ESM import in node:
552
+ 0 && (module.exports = {
553
+ CommandValidator
554
+ });
@@ -0,0 +1,52 @@
1
+ import { ProcessConfig, CommandValidation } from './types.cjs';
2
+ import { IDextoLogger } from '@dexto/core';
3
+
4
+ /**
5
+ * Command Validator
6
+ *
7
+ * Security-focused command validation for process execution
8
+ */
9
+
10
+ /**
11
+ * CommandValidator - Validates commands for security and policy compliance
12
+ *
13
+ * Security checks:
14
+ * 1. Command length limits
15
+ * 2. Dangerous command patterns
16
+ * 3. Command injection detection
17
+ * 4. Allowed/blocked command lists
18
+ * 5. Shell metacharacter analysis
19
+ * TODO: Add tests for this class
20
+ */
21
+ declare class CommandValidator {
22
+ private config;
23
+ private logger;
24
+ constructor(config: ProcessConfig, logger: IDextoLogger);
25
+ /**
26
+ * Validate a command for security and policy compliance
27
+ */
28
+ validateCommand(command: string): CommandValidation;
29
+ /**
30
+ * Detect command injection attempts
31
+ */
32
+ private detectInjection;
33
+ /**
34
+ * Determine if a command requires approval
35
+ * Handles compound commands (with &&, ||, ;) by checking each sub-command
36
+ */
37
+ private determineApprovalRequirement;
38
+ /**
39
+ * Get list of blocked commands
40
+ */
41
+ getBlockedCommands(): string[];
42
+ /**
43
+ * Get list of allowed commands
44
+ */
45
+ getAllowedCommands(): string[];
46
+ /**
47
+ * Get security level
48
+ */
49
+ getSecurityLevel(): string;
50
+ }
51
+
52
+ export { CommandValidator };
@@ -0,0 +1,52 @@
1
+ import { ProcessConfig, CommandValidation } from './types.js';
2
+ import { IDextoLogger } from '@dexto/core';
3
+
4
+ /**
5
+ * Command Validator
6
+ *
7
+ * Security-focused command validation for process execution
8
+ */
9
+
10
+ /**
11
+ * CommandValidator - Validates commands for security and policy compliance
12
+ *
13
+ * Security checks:
14
+ * 1. Command length limits
15
+ * 2. Dangerous command patterns
16
+ * 3. Command injection detection
17
+ * 4. Allowed/blocked command lists
18
+ * 5. Shell metacharacter analysis
19
+ * TODO: Add tests for this class
20
+ */
21
+ declare class CommandValidator {
22
+ private config;
23
+ private logger;
24
+ constructor(config: ProcessConfig, logger: IDextoLogger);
25
+ /**
26
+ * Validate a command for security and policy compliance
27
+ */
28
+ validateCommand(command: string): CommandValidation;
29
+ /**
30
+ * Detect command injection attempts
31
+ */
32
+ private detectInjection;
33
+ /**
34
+ * Determine if a command requires approval
35
+ * Handles compound commands (with &&, ||, ;) by checking each sub-command
36
+ */
37
+ private determineApprovalRequirement;
38
+ /**
39
+ * Get list of blocked commands
40
+ */
41
+ getBlockedCommands(): string[];
42
+ /**
43
+ * Get list of allowed commands
44
+ */
45
+ getAllowedCommands(): string[];
46
+ /**
47
+ * Get security level
48
+ */
49
+ getSecurityLevel(): string;
50
+ }
51
+
52
+ export { CommandValidator };