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