drop restriction on whitespace in bash commands (#272)
This commit is contained in:
parent
a588d5cd10
commit
5344853344
|
@ -1,7 +1,6 @@
|
||||||
This tool executes a given shell command as `bash -c <command>`.
|
This tool executes a given shell command as `bash -c <command>`.
|
||||||
Command can be any valid single-line Bash command.
|
|
||||||
Command can start background processes using `&`.
|
Command can start background processes using `&`.
|
||||||
Command is executed as a subprocess.
|
Command itself is executed as a subprocess.
|
||||||
|
|
||||||
The following information is returned:
|
The following information is returned:
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,6 @@ export class ShellTool extends BaseTool<ShellToolParams, ToolResult> {
|
||||||
description += ` [in ${params.directory}]`;
|
description += ` [in ${params.directory}]`;
|
||||||
}
|
}
|
||||||
// append optional (description), replacing any line breaks with spaces
|
// append optional (description), replacing any line breaks with spaces
|
||||||
// tool description/schema should specify a single line w/o line breaks
|
|
||||||
if (params.description) {
|
if (params.description) {
|
||||||
description += ` (${params.description.replace(/\n/g, ' ')})`;
|
description += ` (${params.description.replace(/\n/g, ' ')})`;
|
||||||
}
|
}
|
||||||
|
@ -77,9 +76,6 @@ export class ShellTool extends BaseTool<ShellToolParams, ToolResult> {
|
||||||
if (!params.command.trim()) {
|
if (!params.command.trim()) {
|
||||||
return 'Command cannot be empty.';
|
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)) {
|
if (!this.getCommandRoot(params.command)) {
|
||||||
return 'Could not identify command root to obtain permission from user.';
|
return 'Could not identify command root to obtain permission from user.';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue