| 295 | } |
| 296 | |
| 297 | function getShellToolDescription(): string { |
| 298 | const returnedInfo = ` |
| 299 | |
| 300 | The following information is returned: |
| 301 | |
| 302 | Command: Executed command. |
| 303 | Directory: Directory (relative to project root) where command was executed, or \`(root)\`. |
| 304 | Stdout: Output on stdout stream. Can be \`(empty)\` or partial on error and for any unwaited background processes. |
| 305 | Stderr: Output on stderr stream. Can be \`(empty)\` or partial on error and for any unwaited background processes. |
| 306 | Error: Error or \`(none)\` if no error was reported for the subprocess. |
| 307 | Exit Code: Exit code or \`(none)\` if terminated by signal. |
| 308 | Signal: Signal number or \`(none)\` if no signal was received. |
| 309 | Background PIDs: List of background processes started or \`(none)\`. |
| 310 | Process Group PGID: Process group started or \`(none)\``; |
| 311 | |
| 312 | if (os.platform() === 'win32') { |
| 313 | return `This tool executes a given shell command as \`cmd.exe /c <command>\`. Command can start background processes using \`start /b\`.${returnedInfo}`; |
| 314 | } else { |
| 315 | return `This tool executes a given shell command as \`bash -c <command>\`. Command can start background processes using \`&\`. Command is executed as a subprocess that leads its own process group. Command process group can be terminated as \`kill -- -PGID\` or signaled as \`kill -s SIGNAL -- -PGID\`.${returnedInfo}`; |
| 316 | } |
| 317 | } |
| 318 | |
| 319 | function getCommandDescription(): string { |
| 320 | if (os.platform() === 'win32') { |