diff --git a/packages/core/src/tools/shell.json b/packages/core/src/tools/shell.json deleted file mode 100644 index a4c018c7..00000000 --- a/packages/core/src/tools/shell.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type": "object", - "properties": { - "command": { - "description": "Exact bash command to execute as `bash -c `", - "type": "string" - }, - "description": { - "description": "Brief description of the command for the user. Be specific and concise. Ideally a single sentence. Can be up to 3 sentences for clarity. No line breaks.", - "type": "string" - }, - "directory": { - "description": "(OPTIONAL) Directory to run the command in, if not the project root directory. Must be relative to the project root directory and must already exist.", - "type": "string" - } - }, - "required": ["command"] -} diff --git a/packages/core/src/tools/shell.md b/packages/core/src/tools/shell.md deleted file mode 100644 index 17c39196..00000000 --- a/packages/core/src/tools/shell.md +++ /dev/null @@ -1,16 +0,0 @@ -This tool executes a given shell command as `bash -c `. -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`. - -The following information is returned: - -Command: Executed command. -Directory: Directory (relative to project root) where command was executed, or `(root)`. -Stdout: Output on stdout stream. Can be `(empty)` or partial on error and for any unwaited background processes. -Stderr: Output on stderr stream. Can be `(empty)` or partial on error and for any unwaited background processes. -Error: Error or `(none)` if no error was reported for the subprocess. -Exit Code: Exit code or `(none)` if terminated by signal. -Signal: Signal number or `(none)` if no signal was received. -Background PIDs: List of background processes started or `(none)`. -Process Group PGID: Process group started or `(none)` diff --git a/packages/core/src/tools/shell.ts b/packages/core/src/tools/shell.ts index 62dd8429..1ca90768 100644 --- a/packages/core/src/tools/shell.ts +++ b/packages/core/src/tools/shell.ts @@ -34,35 +34,42 @@ export class ShellTool extends BaseTool { private whitelist: Set = new Set(); constructor(private readonly config: Config) { - const toolDisplayName = 'Shell'; - - let toolDescription: string; - let toolParameterSchema: Record; - - try { - const descriptionUrl = new URL('shell.md', import.meta.url); - toolDescription = fs.readFileSync(descriptionUrl, 'utf-8'); - const schemaUrl = new URL('shell.json', import.meta.url); - toolParameterSchema = JSON.parse(fs.readFileSync(schemaUrl, 'utf-8')); - } catch { - // Fallback with minimal descriptions for tests when file reading fails - toolDescription = 'Execute shell commands'; - toolParameterSchema = { - type: 'object', - properties: { - command: { type: 'string', description: 'Command to execute' }, - description: { type: 'string', description: 'Command description' }, - directory: { type: 'string', description: 'Working directory' }, - }, - required: ['command'], - }; - } - super( ShellTool.Name, - toolDisplayName, - toolDescription, - toolParameterSchema, + 'Shell', + `This tool executes a given shell command as \`bash -c \`. 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\`. + +The following information is returned: + +Command: Executed command. +Directory: Directory (relative to project root) where command was executed, or \`(root)\`. +Stdout: Output on stdout stream. Can be \`(empty)\` or partial on error and for any unwaited background processes. +Stderr: Output on stderr stream. Can be \`(empty)\` or partial on error and for any unwaited background processes. +Error: Error or \`(none)\` if no error was reported for the subprocess. +Exit Code: Exit code or \`(none)\` if terminated by signal. +Signal: Signal number or \`(none)\` if no signal was received. +Background PIDs: List of background processes started or \`(none)\`. +Process Group PGID: Process group started or \`(none)\``, + { + type: 'object', + properties: { + command: { + type: 'string', + description: 'Exact bash command to execute as `bash -c `', + }, + description: { + type: 'string', + description: + 'Brief description of the command for the user. Be specific and concise. Ideally a single sentence. Can be up to 3 sentences for clarity. No line breaks.', + }, + directory: { + type: 'string', + description: + '(OPTIONAL) Directory to run the command in, if not the project root directory. Must be relative to the project root directory and must already exist.', + }, + }, + required: ['command'], + }, false, // output is not markdown true, // output can be updated ); diff --git a/scripts/copy_bundle_assets.js b/scripts/copy_bundle_assets.js index e37e1700..5a3af3e9 100644 --- a/scripts/copy_bundle_assets.js +++ b/scripts/copy_bundle_assets.js @@ -31,16 +31,6 @@ if (!existsSync(bundleDir)) { mkdirSync(bundleDir); } -// Copy specific shell files to the root of the bundle directory -copyFileSync( - join(root, 'packages/core/src/tools/shell.md'), - join(bundleDir, 'shell.md'), -); -copyFileSync( - join(root, 'packages/core/src/tools/shell.json'), - join(bundleDir, 'shell.json'), -); - // Find and copy all .sb files from packages to the root of the bundle directory const sbFiles = glob.sync('packages/**/*.sb', { cwd: root }); for (const file of sbFiles) {