From 53448533447604ebfd8604cfcfcbba3e128a0c6a Mon Sep 17 00:00:00 2001 From: Olcan Date: Tue, 6 May 2025 23:38:36 -0700 Subject: [PATCH] drop restriction on whitespace in bash commands (#272) --- packages/server/src/tools/shell.md | 3 +-- packages/server/src/tools/shell.ts | 4 ---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/server/src/tools/shell.md b/packages/server/src/tools/shell.md index a9cae2de..069a76db 100644 --- a/packages/server/src/tools/shell.md +++ b/packages/server/src/tools/shell.md @@ -1,7 +1,6 @@ This tool executes a given shell command as `bash -c `. -Command can be any valid single-line Bash command. Command can start background processes using `&`. -Command is executed as a subprocess. +Command itself is executed as a subprocess. The following information is returned: diff --git a/packages/server/src/tools/shell.ts b/packages/server/src/tools/shell.ts index c7fd70ab..bf19b37c 100644 --- a/packages/server/src/tools/shell.ts +++ b/packages/server/src/tools/shell.ts @@ -49,7 +49,6 @@ export class ShellTool extends BaseTool { description += ` [in ${params.directory}]`; } // append optional (description), replacing any line breaks with spaces - // tool description/schema should specify a single line w/o line breaks if (params.description) { description += ` (${params.description.replace(/\n/g, ' ')})`; } @@ -77,9 +76,6 @@ export class ShellTool extends BaseTool { if (!params.command.trim()) { return 'Command cannot be empty.'; } - if (params.command.match(/[^\S ]/)) { - return 'Command cannot contain any whitespace other than plain spaces.'; - } if (!this.getCommandRoot(params.command)) { return 'Could not identify command root to obtain permission from user.'; }