diff options
| author | Olcan <[email protected]> | 2025-04-28 08:17:52 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-04-28 08:17:52 -0700 |
| commit | a8f679ccb55402215366cc86acfd5c221613b670 (patch) | |
| tree | c93ca4903a9d90473d070a76573dbe0394cda65b /packages/server/src/tools/shell.ts | |
| parent | a9dc2772dda8d6c814a8f151aeb1e4e796a797d7 (diff) | |
shell tool tweaks (#194)
Diffstat (limited to 'packages/server/src/tools/shell.ts')
| -rw-r--r-- | packages/server/src/tools/shell.ts | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/packages/server/src/tools/shell.ts b/packages/server/src/tools/shell.ts index e80c0c02..8066044f 100644 --- a/packages/server/src/tools/shell.ts +++ b/packages/server/src/tools/shell.ts @@ -43,13 +43,15 @@ export class ShellTool extends BaseTool<ShellToolParams, ToolResult> { getDescription(params: ShellToolParams): string { let description = `${params.command}`; + // append optional [./directory] + if (params.directory) { + description += ` [./${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) { - // replace any line breaks with spaces, in case instructions are not followed description += ` (${params.description.replace(/\n/g, ' ')})`; } - if (params.directory) { - description += ` @ ${params.directory}`; - } return description; } @@ -193,6 +195,7 @@ export class ShellTool extends BaseTool<ShellToolParams, ToolResult> { return { llmContent: [ `Command: ${params.command}`, + `Directory: ${params.directory || '(root)'}`, `Stdout: ${stdout || '(empty)'}`, `Stderr: ${stderr || '(empty)'}`, `Error: ${error ?? '(none)'}`, |
