diff options
| author | Wanlin Du <[email protected]> | 2025-08-11 16:12:41 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-11 23:12:41 +0000 |
| commit | d9fb08c9da3d2e8c501ec9badb2e2bd79eb15b93 (patch) | |
| tree | 7d07e1586b736c1b6c44e28828aa29205af335ac /packages/core/src/tools/shell.ts | |
| parent | f52d073dfbfa4d5091a74bf33ac1c66e51265247 (diff) | |
feat: migrate tools to use parametersJsonSchema. (#5330)
Diffstat (limited to 'packages/core/src/tools/shell.ts')
| -rw-r--r-- | packages/core/src/tools/shell.ts | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/packages/core/src/tools/shell.ts b/packages/core/src/tools/shell.ts index 6106c0cd..de9b7c2f 100644 --- a/packages/core/src/tools/shell.ts +++ b/packages/core/src/tools/shell.ts @@ -18,7 +18,6 @@ import { Icon, } from './tools.js'; import { ToolErrorType } from './tool-error.js'; -import { Type } from '@google/genai'; import { SchemaValidator } from '../utils/schemaValidator.js'; import { getErrorMessage } from '../utils/errors.js'; import { summarizeToolOutput } from '../utils/summarizer.js'; @@ -64,19 +63,19 @@ export class ShellTool extends BaseTool<ShellToolParams, ToolResult> { Process Group PGID: Process group started or \`(none)\``, Icon.Terminal, { - type: Type.OBJECT, + type: 'object', properties: { command: { - type: Type.STRING, + type: 'string', description: 'Exact bash command to execute as `bash -c <command>`', }, description: { - type: Type.STRING, + 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: Type.STRING, + 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.', }, @@ -113,7 +112,10 @@ export class ShellTool extends BaseTool<ShellToolParams, ToolResult> { } return commandCheck.reason; } - const errors = SchemaValidator.validate(this.schema.parameters, params); + const errors = SchemaValidator.validate( + this.schema.parametersJsonSchema, + params, + ); if (errors) { return errors; } |
