@mako10k/shell-server 0.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 (175) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +114 -0
  3. package/dist/backoffice/index.d.ts +2 -0
  4. package/dist/backoffice/index.d.ts.map +1 -0
  5. package/dist/backoffice/index.js +47 -0
  6. package/dist/backoffice/index.js.map +1 -0
  7. package/dist/backoffice/server.d.ts +45 -0
  8. package/dist/backoffice/server.d.ts.map +1 -0
  9. package/dist/backoffice/server.js +610 -0
  10. package/dist/backoffice/server.js.map +1 -0
  11. package/dist/cli.d.ts +3 -0
  12. package/dist/cli.d.ts.map +1 -0
  13. package/dist/cli.js +525 -0
  14. package/dist/cli.js.map +1 -0
  15. package/dist/core/config-manager.d.ts +80 -0
  16. package/dist/core/config-manager.d.ts.map +1 -0
  17. package/dist/core/config-manager.js +218 -0
  18. package/dist/core/config-manager.js.map +1 -0
  19. package/dist/core/enhanced-history-manager.d.ts +84 -0
  20. package/dist/core/enhanced-history-manager.d.ts.map +1 -0
  21. package/dist/core/enhanced-history-manager.js +319 -0
  22. package/dist/core/enhanced-history-manager.js.map +1 -0
  23. package/dist/core/file-manager.d.ts +79 -0
  24. package/dist/core/file-manager.d.ts.map +1 -0
  25. package/dist/core/file-manager.js +338 -0
  26. package/dist/core/file-manager.js.map +1 -0
  27. package/dist/core/file-storage-subscriber.d.ts +38 -0
  28. package/dist/core/file-storage-subscriber.d.ts.map +1 -0
  29. package/dist/core/file-storage-subscriber.js +132 -0
  30. package/dist/core/file-storage-subscriber.js.map +1 -0
  31. package/dist/core/monitoring-manager.d.ts +32 -0
  32. package/dist/core/monitoring-manager.d.ts.map +1 -0
  33. package/dist/core/monitoring-manager.js +296 -0
  34. package/dist/core/monitoring-manager.js.map +1 -0
  35. package/dist/core/process-manager.d.ts +105 -0
  36. package/dist/core/process-manager.d.ts.map +1 -0
  37. package/dist/core/process-manager.js +1374 -0
  38. package/dist/core/process-manager.js.map +1 -0
  39. package/dist/core/realtime-stream-subscriber.d.ts +93 -0
  40. package/dist/core/realtime-stream-subscriber.d.ts.map +1 -0
  41. package/dist/core/realtime-stream-subscriber.js +200 -0
  42. package/dist/core/realtime-stream-subscriber.js.map +1 -0
  43. package/dist/core/remote-http-client.d.ts +15 -0
  44. package/dist/core/remote-http-client.d.ts.map +1 -0
  45. package/dist/core/remote-http-client.js +60 -0
  46. package/dist/core/remote-http-client.js.map +1 -0
  47. package/dist/core/remote-process-service.d.ts +50 -0
  48. package/dist/core/remote-process-service.d.ts.map +1 -0
  49. package/dist/core/remote-process-service.js +20 -0
  50. package/dist/core/remote-process-service.js.map +1 -0
  51. package/dist/core/server-manager.d.ts +71 -0
  52. package/dist/core/server-manager.d.ts.map +1 -0
  53. package/dist/core/server-manager.js +680 -0
  54. package/dist/core/server-manager.js.map +1 -0
  55. package/dist/core/stream-publisher.d.ts +75 -0
  56. package/dist/core/stream-publisher.d.ts.map +1 -0
  57. package/dist/core/stream-publisher.js +127 -0
  58. package/dist/core/stream-publisher.js.map +1 -0
  59. package/dist/core/streaming-pipeline-reader.d.ts +67 -0
  60. package/dist/core/streaming-pipeline-reader.d.ts.map +1 -0
  61. package/dist/core/streaming-pipeline-reader.js +191 -0
  62. package/dist/core/streaming-pipeline-reader.js.map +1 -0
  63. package/dist/core/terminal-manager.d.ts +96 -0
  64. package/dist/core/terminal-manager.d.ts.map +1 -0
  65. package/dist/core/terminal-manager.js +515 -0
  66. package/dist/core/terminal-manager.js.map +1 -0
  67. package/dist/daemon/server.d.ts +8 -0
  68. package/dist/daemon/server.d.ts.map +1 -0
  69. package/dist/daemon/server.js +416 -0
  70. package/dist/daemon/server.js.map +1 -0
  71. package/dist/daemon/uds-transport.d.ts +31 -0
  72. package/dist/daemon/uds-transport.d.ts.map +1 -0
  73. package/dist/daemon/uds-transport.js +149 -0
  74. package/dist/daemon/uds-transport.js.map +1 -0
  75. package/dist/executor/server.d.ts +20 -0
  76. package/dist/executor/server.d.ts.map +1 -0
  77. package/dist/executor/server.js +375 -0
  78. package/dist/executor/server.js.map +1 -0
  79. package/dist/index.d.ts +2 -0
  80. package/dist/index.d.ts.map +1 -0
  81. package/dist/index.js +73 -0
  82. package/dist/index.js.map +1 -0
  83. package/dist/runtime/daemon-runtime.d.ts +4 -0
  84. package/dist/runtime/daemon-runtime.d.ts.map +1 -0
  85. package/dist/runtime/daemon-runtime.js +4 -0
  86. package/dist/runtime/daemon-runtime.js.map +1 -0
  87. package/dist/runtime/index.d.ts +3 -0
  88. package/dist/runtime/index.d.ts.map +1 -0
  89. package/dist/runtime/index.js +3 -0
  90. package/dist/runtime/index.js.map +1 -0
  91. package/dist/runtime/tool-runtime.d.ts +52 -0
  92. package/dist/runtime/tool-runtime.d.ts.map +1 -0
  93. package/dist/runtime/tool-runtime.js +161 -0
  94. package/dist/runtime/tool-runtime.js.map +1 -0
  95. package/dist/security/chat-completion-adapter.d.ts +443 -0
  96. package/dist/security/chat-completion-adapter.d.ts.map +1 -0
  97. package/dist/security/chat-completion-adapter.js +475 -0
  98. package/dist/security/chat-completion-adapter.js.map +1 -0
  99. package/dist/security/enhanced-evaluator.d.ts +139 -0
  100. package/dist/security/enhanced-evaluator.d.ts.map +1 -0
  101. package/dist/security/enhanced-evaluator.js +1208 -0
  102. package/dist/security/enhanced-evaluator.js.map +1 -0
  103. package/dist/security/evaluator-types.d.ts +614 -0
  104. package/dist/security/evaluator-types.d.ts.map +1 -0
  105. package/dist/security/evaluator-types.js +124 -0
  106. package/dist/security/evaluator-types.js.map +1 -0
  107. package/dist/security/manager.d.ts +76 -0
  108. package/dist/security/manager.d.ts.map +1 -0
  109. package/dist/security/manager.js +445 -0
  110. package/dist/security/manager.js.map +1 -0
  111. package/dist/security/security-llm-prompt-generator.d.ts +105 -0
  112. package/dist/security/security-llm-prompt-generator.d.ts.map +1 -0
  113. package/dist/security/security-llm-prompt-generator.js +323 -0
  114. package/dist/security/security-llm-prompt-generator.js.map +1 -0
  115. package/dist/security/security-tools.d.ts +174 -0
  116. package/dist/security/security-tools.d.ts.map +1 -0
  117. package/dist/security/security-tools.js +159 -0
  118. package/dist/security/security-tools.js.map +1 -0
  119. package/dist/security/validator-criteria-manager.d.ts +47 -0
  120. package/dist/security/validator-criteria-manager.d.ts.map +1 -0
  121. package/dist/security/validator-criteria-manager.js +169 -0
  122. package/dist/security/validator-criteria-manager.js.map +1 -0
  123. package/dist/tools/shell-tools.d.ts +474 -0
  124. package/dist/tools/shell-tools.d.ts.map +1 -0
  125. package/dist/tools/shell-tools.js +861 -0
  126. package/dist/tools/shell-tools.js.map +1 -0
  127. package/dist/types/enhanced-security.d.ts +529 -0
  128. package/dist/types/enhanced-security.d.ts.map +1 -0
  129. package/dist/types/enhanced-security.js +286 -0
  130. package/dist/types/enhanced-security.js.map +1 -0
  131. package/dist/types/index.d.ts +282 -0
  132. package/dist/types/index.d.ts.map +1 -0
  133. package/dist/types/index.js +158 -0
  134. package/dist/types/index.js.map +1 -0
  135. package/dist/types/quick-schemas.d.ts +177 -0
  136. package/dist/types/quick-schemas.d.ts.map +1 -0
  137. package/dist/types/quick-schemas.js +113 -0
  138. package/dist/types/quick-schemas.js.map +1 -0
  139. package/dist/types/response-schemas.d.ts +41 -0
  140. package/dist/types/response-schemas.d.ts.map +1 -0
  141. package/dist/types/response-schemas.js +41 -0
  142. package/dist/types/response-schemas.js.map +1 -0
  143. package/dist/types/schemas.d.ts +578 -0
  144. package/dist/types/schemas.d.ts.map +1 -0
  145. package/dist/types/schemas.js +498 -0
  146. package/dist/types/schemas.js.map +1 -0
  147. package/dist/utils/criteria-manager.d.ts +47 -0
  148. package/dist/utils/criteria-manager.d.ts.map +1 -0
  149. package/dist/utils/criteria-manager.js +228 -0
  150. package/dist/utils/criteria-manager.js.map +1 -0
  151. package/dist/utils/errors.d.ts +27 -0
  152. package/dist/utils/errors.d.ts.map +1 -0
  153. package/dist/utils/errors.js +67 -0
  154. package/dist/utils/errors.js.map +1 -0
  155. package/dist/utils/helpers.d.ts +85 -0
  156. package/dist/utils/helpers.d.ts.map +1 -0
  157. package/dist/utils/helpers.js +400 -0
  158. package/dist/utils/helpers.js.map +1 -0
  159. package/dist/utils/json-repair.d.ts +23 -0
  160. package/dist/utils/json-repair.d.ts.map +1 -0
  161. package/dist/utils/json-repair.js +208 -0
  162. package/dist/utils/json-repair.js.map +1 -0
  163. package/dist/utils/process-utils.d.ts +31 -0
  164. package/dist/utils/process-utils.d.ts.map +1 -0
  165. package/dist/utils/process-utils.js +217 -0
  166. package/dist/utils/process-utils.js.map +1 -0
  167. package/dist/utils/server-helpers.d.ts +4 -0
  168. package/dist/utils/server-helpers.d.ts.map +1 -0
  169. package/dist/utils/server-helpers.js +10 -0
  170. package/dist/utils/server-helpers.js.map +1 -0
  171. package/dist/utils/sse.d.ts +2 -0
  172. package/dist/utils/sse.d.ts.map +1 -0
  173. package/dist/utils/sse.js +6 -0
  174. package/dist/utils/sse.js.map +1 -0
  175. package/package.json +47 -0
@@ -0,0 +1,498 @@
1
+ import { z } from 'zod';
2
+ import { ExecutionModeSchema, ShellTypeSchema, ProcessSignalSchema, OutputTypeSchema, SecurityModeSchema, DimensionsSchema, EnvironmentVariablesSchema, } from './index.js';
3
+ // Shell Operations
4
+ export const ShellExecuteParamsSchema = z
5
+ .object({
6
+ command: z
7
+ .string()
8
+ .min(1)
9
+ .describe('Shell command to execute (e.g., "ls -la", "npm install", "python script.py"). Command will be validated against security restrictions. NOTE: This is MCP Shell Server - do NOT use VS Code internal run_in_terminal parameters like "explanation".'),
10
+ comment: z
11
+ .string()
12
+ .optional()
13
+ .describe('Optional comment from the LLM client explaining the intent or context behind this command execution. This helps the safety evaluator understand the broader context, but will be treated as advisory only and not blindly trusted.'),
14
+ execution_mode: ExecutionModeSchema.default('adaptive').describe('How the command should be executed: "foreground" (wait for completion), "background" (run async), "detached" (fire-and-forget), "adaptive" (start foreground, switch to background for long-running commands)'),
15
+ working_directory: z
16
+ .string()
17
+ .optional()
18
+ .describe('Directory where the command should be executed. If not specified, uses the default working directory set by shell_set_default_workdir or the initial server directory.'),
19
+ environment_variables: EnvironmentVariablesSchema.optional().describe('Environment variables to set for this command execution. These are added to or override the current environment.'),
20
+ input_data: z
21
+ .string()
22
+ .optional()
23
+ .describe('Standard input data to provide to the command. Useful for commands that read from stdin.'),
24
+ input_output_id: z
25
+ .string()
26
+ .optional()
27
+ .describe('Output ID from previous command execution to use as input. Alternative to input_data for pipeline operations.'),
28
+ timeout_seconds: z
29
+ .number()
30
+ .int()
31
+ .min(1)
32
+ .max(3600)
33
+ .default(60)
34
+ .describe('Global timeout (1-3600s). Default: 60s.\n'
35
+ + 'Per execution_mode (effective limits before execution starts):\n'
36
+ + '• foreground: Schema allows 1-3600s, but the default security policy caps runs at 300s. Setting timeout_seconds above 300s raises TIMEOUT_LIMIT_EXCEEDED unless max_execution_time is increased via security_set_restrictions.\n'
37
+ + '• background: 1-3600s. Intended for >300s runs; still subject to the same security cap (300s by default) unless raised.\n'
38
+ + '• detached: 1-3600s. Shares the security cap behavior with background.\n'
39
+ + '• adaptive: 1-3600s total cap. The initial foreground phase also respects foreground_timeout_seconds (≤300s) and the security cap.\n'
40
+ + 'Guidance: For long-running tasks (>300s), raise max_execution_time or use background/adaptive modes.'),
41
+ foreground_timeout_seconds: z
42
+ .number()
43
+ .int()
44
+ .min(1)
45
+ .max(300)
46
+ .default(15)
47
+ .describe('Initial foreground window for adaptive mode (1-300s).\n'
48
+ + 'Behavior by execution_mode:\n'
49
+ + '• adaptive: Duration to remain in foreground before automatically switching to background if the command is still running. Must be ≤ timeout_seconds.\n'
50
+ + '• foreground: Does not trigger background switching (value is effectively unused for switching). Use background/adaptive for >300s scenarios.\n'
51
+ + '• background/detached: Ignored.'),
52
+ return_partial_on_timeout: z
53
+ .boolean()
54
+ .default(true)
55
+ .describe('When timeout occurs, return partial output collected so far instead of an error. Useful for monitoring long-running commands.'),
56
+ max_output_size: z
57
+ .number()
58
+ .int()
59
+ .min(1024)
60
+ .max(100 * 1024 * 1024)
61
+ .default(5 * 1024 * 1024)
62
+ .describe('Maximum output size in bytes (1KB-100MB). Output will be truncated if it exceeds this limit. Default: 5MB.'),
63
+ capture_stderr: z
64
+ .boolean()
65
+ .default(true)
66
+ .describe('Whether to capture standard error output in addition to stdout. When false, stderr is discarded.'),
67
+ session_id: z
68
+ .string()
69
+ .optional()
70
+ .describe('Session ID for grouping related command executions. Used for process management and filtering in process_list.'),
71
+ create_terminal: z
72
+ .boolean()
73
+ .default(false)
74
+ .describe('Create a new interactive terminal session instead of running command directly. Use for commands requiring interactive input/output.'),
75
+ terminal_shell: ShellTypeSchema.optional().describe('Shell type for the new terminal (bash, zsh, fish, cmd, powershell). Only used when create_terminal is true.'),
76
+ terminal_dimensions: DimensionsSchema.optional().describe('Terminal dimensions in characters (width x height). Only used when create_terminal is true. Default: 120x30.'),
77
+ force_user_confirm: z
78
+ .boolean()
79
+ .default(false)
80
+ .describe('Force user confirmation regardless of LLM evaluation result. Use this to test ELICITATION functionality or when you want direct user confirmation even for safe commands.'),
81
+ })
82
+ .strict()
83
+ // Cross-field validations for timeout relationships
84
+ .refine((data) => data.execution_mode !== 'adaptive' || (data.foreground_timeout_seconds ?? 15) <= (data.timeout_seconds ?? 60), {
85
+ message: 'foreground_timeout_seconds must be less than or equal to timeout_seconds in adaptive mode.',
86
+ path: ['foreground_timeout_seconds'],
87
+ })
88
+ .refine((data) => !(data.input_data && data.input_output_id), {
89
+ message: 'input_data and input_output_id cannot be specified simultaneously.',
90
+ path: ['input_data', 'input_output_id'],
91
+ });
92
+ export const ShellGetExecutionParamsSchema = z.object({
93
+ execution_id: z
94
+ .string()
95
+ .min(1)
96
+ .describe('Unique execution ID returned by shell_execute. Use this to retrieve detailed information about a specific command execution.'),
97
+ });
98
+ // Process Management
99
+ export const ProcessListParamsSchema = z.object({
100
+ status_filter: z
101
+ .enum(['running', 'completed', 'failed', 'all'])
102
+ .optional()
103
+ .describe('Filter processes by their current status: "running" (active), "completed" (finished successfully), "failed" (terminated with error), or "all" (no filter)'),
104
+ command_pattern: z
105
+ .string()
106
+ .optional()
107
+ .describe('Filter processes by command text using substring match (case-insensitive). E.g., "python" will match all Python scripts.'),
108
+ session_id: z
109
+ .string()
110
+ .optional()
111
+ .describe('Filter processes by session ID. Use the same session_id provided in shell_execute to group related commands.'),
112
+ limit: z
113
+ .number()
114
+ .int()
115
+ .min(1)
116
+ .max(500)
117
+ .default(50)
118
+ .describe('Maximum number of results to return (1-500). Use for pagination with offset parameter.'),
119
+ offset: z
120
+ .number()
121
+ .int()
122
+ .min(0)
123
+ .default(0)
124
+ .describe('Number of results to skip for pagination. Combine with limit for paging through large result sets.'),
125
+ });
126
+ export const ProcessKillParamsSchema = z.object({
127
+ process_id: z
128
+ .number()
129
+ .int()
130
+ .min(1)
131
+ .describe('Process ID (PID) of the process to terminate. Get this from process_list results.'),
132
+ signal: ProcessSignalSchema.default('TERM').describe('Signal to send to the process: "TERM" (graceful), "KILL" (immediate), "INT" (interrupt), "HUP" (hangup), "USR1", "USR2"'),
133
+ force: z
134
+ .boolean()
135
+ .default(false)
136
+ .describe('Force immediate termination if true. Bypasses graceful shutdown and sends KILL signal regardless of signal parameter.'),
137
+ });
138
+ export const ProcessMonitorParamsSchema = z.object({
139
+ process_id: z
140
+ .number()
141
+ .int()
142
+ .min(1)
143
+ .describe('Process ID (PID) to monitor. Get this from process_list results. Process must be currently running.'),
144
+ monitor_interval_ms: z
145
+ .number()
146
+ .int()
147
+ .min(100)
148
+ .max(60000)
149
+ .default(1000)
150
+ .describe('Monitoring interval in milliseconds (100ms-60s). Higher frequency provides more detailed data but uses more resources.'),
151
+ include_metrics: z
152
+ .array(z.enum(['cpu', 'memory', 'io', 'network']))
153
+ .optional()
154
+ .describe('Specific metrics to collect: "cpu" (usage %), "memory" (RAM/swap), "io" (disk reads/writes), "network" (bytes sent/received)'),
155
+ });
156
+ // Server Management
157
+ export const ServerCurrentParamsSchema = z.object({}).strict();
158
+ export const ServerListAttachableParamsSchema = z.object({
159
+ cwd: z
160
+ .string()
161
+ .min(1)
162
+ .describe('Working directory used to discover attachable servers.'),
163
+ });
164
+ export const ServerStartParamsSchema = z.object({
165
+ cwd: z.string().min(1).describe('Working directory for the server.'),
166
+ socket_path: z
167
+ .string()
168
+ .optional()
169
+ .describe('Optional explicit socket path override.'),
170
+ allow_existing: z
171
+ .boolean()
172
+ .default(false)
173
+ .describe('Allow reuse when a server is already running.'),
174
+ });
175
+ export const ServerStopParamsSchema = z.object({
176
+ server_id: z.string().min(1).describe('Server ID to stop.'),
177
+ force: z
178
+ .boolean()
179
+ .default(false)
180
+ .describe('Force stop even if clients are attached.'),
181
+ });
182
+ export const ServerGetParamsSchema = z.object({
183
+ server_id: z.string().min(1).describe('Server ID to fetch.'),
184
+ });
185
+ export const ServerDetachParamsSchema = z.object({
186
+ server_id: z.string().min(1).describe('Server ID to detach from.'),
187
+ });
188
+ export const ServerReattachParamsSchema = z.object({
189
+ server_id: z.string().min(1).describe('Server ID to attach to.'),
190
+ });
191
+ // File Operations
192
+ export const FileListParamsSchema = z.object({
193
+ output_type: OutputTypeSchema.optional().describe('Filter by output type: "stdout" (standard output), "stderr" (error output), "combined" (both), "log" (execution logs), or "all" (no filter)'),
194
+ execution_id: z
195
+ .string()
196
+ .optional()
197
+ .describe('Filter files by the execution that created them. Use execution_id from shell_execute results.'),
198
+ name_pattern: z
199
+ .string()
200
+ .optional()
201
+ .describe('Filter by filename using substring match (case-insensitive). E.g., ".log" will match all log files.'),
202
+ limit: z
203
+ .number()
204
+ .int()
205
+ .min(1)
206
+ .max(1000)
207
+ .default(100)
208
+ .describe('Maximum number of files to return (1-1000). Use for pagination through large file lists.'),
209
+ });
210
+ export const FileReadParamsSchema = z.object({
211
+ output_id: z
212
+ .string()
213
+ .min(1)
214
+ .describe('Unique output file ID from list_execution_outputs. Use this to read a specific output file generated by command execution.'),
215
+ offset: z
216
+ .number()
217
+ .int()
218
+ .min(0)
219
+ .default(0)
220
+ .describe('Byte offset to start reading from (0-based). Use for reading large files in chunks or continuing from previous read.'),
221
+ size: z
222
+ .number()
223
+ .int()
224
+ .min(1)
225
+ .max(10 * 1024 * 1024)
226
+ .default(8192)
227
+ .describe('Number of bytes to read (1B-10MB). Larger sizes may improve efficiency but use more memory. Default: 8KB.'),
228
+ encoding: z
229
+ .string()
230
+ .default('utf-8')
231
+ .describe('Character encoding for text files (utf-8, ascii, latin1, etc.). Use "binary" for non-text files.'),
232
+ });
233
+ export const FileDeleteParamsSchema = z.object({
234
+ output_ids: z
235
+ .array(z.string().min(1))
236
+ .min(1)
237
+ .describe('List of output file IDs to delete. Get these from list_execution_outputs. All specified files will be permanently removed.'),
238
+ confirm: z
239
+ .boolean()
240
+ .describe('Deletion confirmation flag. Must be set to true to proceed with deletion. Required to prevent accidental data loss.'),
241
+ });
242
+ // Terminal Management
243
+ export const TerminalCreateParamsSchema = z.object({
244
+ session_name: z
245
+ .string()
246
+ .optional()
247
+ .describe('Human-readable name for the terminal session. If not provided, a unique name will be generated. Useful for identifying terminals in terminal_list.'),
248
+ shell_type: ShellTypeSchema.default('bash').describe('Shell to use for the terminal: "bash" (default), "zsh", "fish", "cmd" (Windows), "powershell" (Windows)'),
249
+ dimensions: DimensionsSchema.default({ width: 120, height: 30 }).describe('Terminal size in characters (width x height). Standard terminal sizes: 80x24 (classic), 120x30 (wide), 132x43 (large)'),
250
+ working_directory: z
251
+ .string()
252
+ .optional()
253
+ .describe('Initial working directory for the terminal session. If not specified, uses the default working directory.'),
254
+ environment_variables: EnvironmentVariablesSchema.optional().describe('Environment variables to set for the terminal session. These persist for the lifetime of the terminal.'),
255
+ auto_save_history: z
256
+ .boolean()
257
+ .default(true)
258
+ .describe('Whether to automatically save command history when the terminal is closed. Useful for session continuity.'),
259
+ });
260
+ export const TerminalListParamsSchema = z.object({
261
+ session_name_pattern: z
262
+ .string()
263
+ .optional()
264
+ .describe('Filter terminals by session name using substring match (case-insensitive). E.g., "dev" will match "development", "devtools", etc.'),
265
+ status_filter: z
266
+ .enum(['active', 'idle', 'all'])
267
+ .optional()
268
+ .describe('Filter by terminal status: "active" (currently running commands), "idle" (waiting for input), "all" (no filter)'),
269
+ limit: z
270
+ .number()
271
+ .int()
272
+ .min(1)
273
+ .max(200)
274
+ .default(50)
275
+ .describe('Maximum number of terminals to return (1-200). Use for pagination through large terminal lists.'),
276
+ });
277
+ export const TerminalGetParamsSchema = z.object({
278
+ terminal_id: z
279
+ .string()
280
+ .min(1)
281
+ .describe('Unique terminal ID from terminal_create or terminal_list. Use this to get detailed information about a specific terminal session.'),
282
+ });
283
+ export const TerminalInputParamsSchema = z.object({
284
+ terminal_id: z
285
+ .string()
286
+ .min(1)
287
+ .describe('Unique terminal ID from terminal_create or terminal_list. The terminal must be active to receive input.'),
288
+ input: z
289
+ .string()
290
+ .describe('Text input to send to the terminal. Can be commands, text, or control sequences depending on the control_codes flag.'),
291
+ execute: z
292
+ .boolean()
293
+ .default(false)
294
+ .describe('Whether to automatically press Enter after sending the input. Set to true for command execution, false for partial input.'),
295
+ control_codes: z
296
+ .boolean()
297
+ .default(false)
298
+ .describe('Whether to interpret the input as control codes and escape sequences (e.g., "\\n", "\\t", "\\x03" for Ctrl+C). Use for special key combinations.'),
299
+ raw_bytes: z
300
+ .boolean()
301
+ .default(false)
302
+ .describe('Whether to send input as raw bytes using hex string format (e.g., "48656c6c6f" for "Hello"). Advanced feature for binary data.'),
303
+ send_to: z
304
+ .string()
305
+ .optional()
306
+ .describe('Program guard target to ensure input is sent to the correct process. Can be process name, path, "pid:12345", "sessionleader:", or "*" for any process.'),
307
+ });
308
+ export const TerminalOutputParamsSchema = z.object({
309
+ terminal_id: z
310
+ .string()
311
+ .min(1)
312
+ .describe('Unique terminal ID from terminal_create or terminal_list. The terminal must exist to retrieve output.'),
313
+ start_line: z
314
+ .number()
315
+ .int()
316
+ .min(0)
317
+ .optional()
318
+ .describe('Starting line number to read from (0-based). If not specified, continues from the last read position for this terminal. Use for reading specific portions of terminal history.'),
319
+ line_count: z
320
+ .number()
321
+ .int()
322
+ .min(1)
323
+ .max(10000)
324
+ .default(50)
325
+ .describe('Number of lines to retrieve (1-10000). Balance between getting enough context and response size.'),
326
+ include_ansi: z
327
+ .boolean()
328
+ .default(false)
329
+ .describe('Whether to include ANSI control codes for colors and formatting. Set to true if you need to preserve terminal appearance.'),
330
+ include_foreground_process: z
331
+ .boolean()
332
+ .default(false)
333
+ .describe('Whether to include information about the currently running foreground process in the terminal.'),
334
+ });
335
+ export const TerminalResizeParamsSchema = z.object({
336
+ terminal_id: z
337
+ .string()
338
+ .min(1)
339
+ .describe('Unique terminal ID from terminal_create or terminal_list. The terminal must be active to be resized.'),
340
+ dimensions: DimensionsSchema.describe('New terminal dimensions in characters (width x height). Should match the display environment for proper formatting.'),
341
+ });
342
+ export const TerminalCloseParamsSchema = z.object({
343
+ terminal_id: z
344
+ .string()
345
+ .min(1)
346
+ .describe('Unique terminal ID from terminal_create or terminal_list. All processes in this terminal will be terminated.'),
347
+ save_history: z
348
+ .boolean()
349
+ .default(true)
350
+ .describe('Whether to save the command history before closing. History can be restored when creating future terminals.'),
351
+ });
352
+ // Security & Monitoring
353
+ export const SecuritySetRestrictionsParamsSchema = z.object({
354
+ security_mode: SecurityModeSchema.optional().describe('Security preset: "permissive" (basic safety only), "restrictive" (read-only commands only), or "custom" (use detailed configuration below)'),
355
+ // customモード時のみ有効 - 他のモードでは無視される
356
+ allowed_commands: z
357
+ .array(z.string())
358
+ .optional()
359
+ .describe('Whitelist of allowed commands (custom mode only). Commands not in this list will be blocked. Use command names like ["ls", "cat", "python"] or patterns.'),
360
+ blocked_commands: z
361
+ .array(z.string())
362
+ .optional()
363
+ .describe('Blacklist of forbidden commands (custom mode only). These commands will be blocked even if in allowed_commands. Takes precedence over allowed_commands.'),
364
+ allowed_directories: z
365
+ .array(z.string())
366
+ .optional()
367
+ .describe('List of allowed directories (custom mode only). Commands cannot access files outside these directories. Use absolute paths like ["/home/user", "/tmp"].'),
368
+ // 全モード共通設定
369
+ max_execution_time: z
370
+ .number()
371
+ .int()
372
+ .min(1)
373
+ .max(86400)
374
+ .optional()
375
+ .describe('Maximum execution time in seconds for any command (1s-24h). Commands exceeding this limit will be terminated.'),
376
+ max_memory_mb: z
377
+ .number()
378
+ .int()
379
+ .min(1)
380
+ .max(32768)
381
+ .optional()
382
+ .describe('Maximum memory usage in MB for command execution (1MB-32GB). Commands exceeding this limit will be terminated.'),
383
+ enable_network: z
384
+ .boolean()
385
+ .default(true)
386
+ .describe('Whether to allow network access for executed commands. Disable for security in untrusted environments.'),
387
+ });
388
+ export const MonitoringGetStatsParamsSchema = z.object({
389
+ include_metrics: z
390
+ .array(z.enum(['processes', 'terminals', 'files', 'system']))
391
+ .optional()
392
+ .describe('Types of statistics to include: "processes" (execution counts), "terminals" (session info), "files" (output stats), "system" (resource usage)'),
393
+ time_range_minutes: z
394
+ .number()
395
+ .int()
396
+ .min(1)
397
+ .max(1440)
398
+ .default(60)
399
+ .describe('Time range in minutes for statistics collection (1min-24h). Longer ranges provide more historical data but may be slower.'),
400
+ });
401
+ // New working directory setting schema
402
+ export const ShellSetDefaultWorkdirParamsSchema = z.object({
403
+ working_directory: z
404
+ .string()
405
+ .describe('Absolute path to set as the default working directory for all subsequent command executions. Must be an existing, accessible directory.'),
406
+ });
407
+ // Issue #15: クリーンアップ機能のスキーマ
408
+ export const CleanupSuggestionsParamsSchema = z.object({
409
+ max_size_mb: z
410
+ .number()
411
+ .positive()
412
+ .optional()
413
+ .describe('Size threshold in MB for cleanup warnings. Default: 50MB.'),
414
+ max_age_hours: z
415
+ .number()
416
+ .positive()
417
+ .optional()
418
+ .describe('Age threshold in hours for cleanup candidates. Default: 24 hours.'),
419
+ include_warnings: z
420
+ .boolean()
421
+ .optional()
422
+ .describe('Whether to include cleanup recommendations. Default: true.'),
423
+ });
424
+ export const AutoCleanupParamsSchema = z.object({
425
+ max_age_hours: z
426
+ .number()
427
+ .positive()
428
+ .optional()
429
+ .describe('Files older than this (in hours) will be deleted. Default: 24 hours.'),
430
+ dry_run: z
431
+ .boolean()
432
+ .optional()
433
+ .describe('If true, simulate cleanup without deleting files. Default: true for safety.'),
434
+ preserve_recent: z
435
+ .number()
436
+ .int()
437
+ .positive()
438
+ .optional()
439
+ .describe('Number of most recent files to preserve regardless of age. Default: 10.'),
440
+ });
441
+ // Command History Management
442
+ export const CommandHistoryQueryParamsSchema = z.object({
443
+ // Pagination
444
+ page: z.number().int().min(1).default(1).describe('Page number for pagination (1-based)'),
445
+ page_size: z
446
+ .number()
447
+ .int()
448
+ .min(1)
449
+ .max(100)
450
+ .default(20)
451
+ .describe('Number of entries per page (1-100)'),
452
+ // Search and filtering
453
+ query: z
454
+ .string()
455
+ .optional()
456
+ .describe('Search term to filter commands (case-insensitive partial match)'),
457
+ command_pattern: z
458
+ .string()
459
+ .optional()
460
+ .describe('Filter by command using substring match (case-insensitive)'),
461
+ working_directory: z.string().optional().describe('Filter by working directory'),
462
+ safety_classification: z
463
+ .enum(['basic_safe', 'llm_required'])
464
+ .optional()
465
+ .describe('Filter by safety classification'),
466
+ was_executed: z.boolean().optional().describe('Filter by execution status'),
467
+ // Date filtering
468
+ date_from: z.string().optional().describe('Filter entries from this date (ISO string)'),
469
+ date_to: z.string().optional().describe('Filter entries to this date (ISO string)'),
470
+ // Individual entry reference
471
+ entry_id: z.string().optional().describe('Get specific entry by execution_id'),
472
+ // Analytics
473
+ analytics_type: z
474
+ .enum(['stats', 'patterns', 'top_commands'])
475
+ .optional()
476
+ .describe('Type of analytics to return: "stats" (general statistics), "patterns" (user confirmation patterns), "top_commands" (most frequent commands)'),
477
+ // Result format
478
+ include_full_details: z
479
+ .boolean()
480
+ .default(false)
481
+ .describe('Include full entry details or just metadata with IDs'),
482
+ });
483
+ // Dynamic Security Criteria Adjustment
484
+ export const AdjustCriteriaParamsSchema = z.object({
485
+ criteria_text: z
486
+ .string()
487
+ .min(1)
488
+ .describe('New criteria content to apply for security evaluation'),
489
+ append_mode: z
490
+ .boolean()
491
+ .default(false)
492
+ .describe('If true, append to existing criteria; if false, overwrite existing criteria'),
493
+ backup_existing: z
494
+ .boolean()
495
+ .default(true)
496
+ .describe('Create timestamped backup of current criteria before modification'),
497
+ });
498
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/types/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,0BAA0B,GAC3B,MAAM,YAAY,CAAC;AAEpB,mBAAmB;AACnB,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC;KACtC,MAAM,CAAC;IACN,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,oPAAoP,CACrP;IACH,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,oOAAoO,CACrO;IACH,cAAc,EAAE,mBAAmB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,QAAQ,CAC9D,+MAA+M,CAChN;IACD,iBAAiB,EAAE,CAAC;SACjB,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,wKAAwK,CACzK;IACH,qBAAqB,EAAE,0BAA0B,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACnE,kHAAkH,CACnH;IACD,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,0FAA0F,CAC3F;IACH,eAAe,EAAE,CAAC;SACf,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,+GAA+G,CAChH;IACH,eAAe,EAAE,CAAC;SACf,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC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C,CAAC;IAEnF,6BAA6B;IAC7B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;IAE9E,YAAY;IACZ,cAAc,EAAE,CAAC;SACd,IAAI,CAAC,CAAC,OAAO,EAAE,UAAU,EAAE,cAAc,CAAC,CAAC;SAC3C,QAAQ,EAAE;SACV,QAAQ,CACP,6IAA6I,CAC9I;IAEH,gBAAgB;IAChB,oBAAoB,EAAE,CAAC;SACpB,OAAO,EAAE;SACT,OAAO,CAAC,KAAK,CAAC;SACd,QAAQ,CAAC,sDAAsD,CAAC;CACpE,CAAC,CAAC;AAEH,uCAAuC;AACvC,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,aAAa,EAAE,CAAC;SACb,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,uDAAuD,CAAC;IACpE,WAAW,EAAE,CAAC;SACX,OAAO,EAAE;SACT,OAAO,CAAC,KAAK,CAAC;SACd,QAAQ,CAAC,6EAA6E,CAAC;IAC1F,eAAe,EAAE,CAAC;SACf,OAAO,EAAE;SACT,OAAO,CAAC,IAAI,CAAC;SACb,QAAQ,CAAC,mEAAmE,CAAC;CACjF,CAAC,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Configuration for criteria file management
3
+ */
4
+ export interface CriteriaConfig {
5
+ filePath: string;
6
+ backupDir: string;
7
+ defaultContent: string;
8
+ }
9
+ /**
10
+ * Get criteria file configuration from environment or defaults
11
+ */
12
+ export declare function getCriteriaConfig(): CriteriaConfig;
13
+ /**
14
+ * Load security criteria from file
15
+ */
16
+ export declare function loadCriteria(): Promise<string>;
17
+ /**
18
+ * Save security criteria to file
19
+ */
20
+ export declare function saveCriteria(criteriaText: string, appendMode?: boolean, backupExisting?: boolean): Promise<{
21
+ backupPath: string | null;
22
+ criteriaPath: string;
23
+ }>;
24
+ /**
25
+ * Check if criteria file was modified since last read
26
+ */
27
+ export declare function isCriteriaModified(lastModified: Date): Promise<boolean>;
28
+ /**
29
+ * Get criteria file status information
30
+ */
31
+ export declare function getCriteriaStatus(): Promise<{
32
+ exists: boolean;
33
+ path: string;
34
+ lastModified?: Date;
35
+ size?: number;
36
+ }>;
37
+ /**
38
+ * Adjust security evaluation criteria dynamically
39
+ * Used by both MCP tools and internal validator functions
40
+ */
41
+ export declare function adjustCriteria(criteriaText: string, appendMode?: boolean, backupExisting?: boolean): Promise<{
42
+ success: boolean;
43
+ message: string;
44
+ backupPath?: string;
45
+ criteriaPath: string;
46
+ }>;
47
+ //# sourceMappingURL=criteria-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"criteria-manager.d.ts","sourceRoot":"","sources":["../../src/utils/criteria-manager.ts"],"names":[],"mappings":"AA6BA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,cAAc,CASlD;AAmCD;;GAEG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,CAapD;AAED;;GAEG;AACH,wBAAsB,YAAY,CAChC,YAAY,EAAE,MAAM,EACpB,UAAU,UAAQ,EAClB,cAAc,UAAO,GACpB,OAAO,CAAC;IAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC,CA2C9D;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,YAAY,EAAE,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAY7E;AAED;;GAEG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC;IACjD,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC,CAoBD;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAClC,YAAY,EAAE,MAAM,EACpB,UAAU,GAAE,OAAe,EAC3B,cAAc,GAAE,OAAc,GAC7B,OAAO,CAAC;IACT,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC,CAoDD"}