diff options
| author | Dax Raad <[email protected]> | 2025-05-21 10:30:39 -0400 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2025-05-26 12:40:17 -0400 |
| commit | e01afb407c4b3eb50e85e7356b0be9489fb26eba (patch) | |
| tree | d2aef91ec1894376c4d5a99ea2d11f6ad32b68de /js/src/tool/bash.ts | |
| parent | f0f55bc75ff2bbc6690ae61c771a46de7c2bb17d (diff) | |
| download | opencode-e01afb407c4b3eb50e85e7356b0be9489fb26eba.tar.gz opencode-e01afb407c4b3eb50e85e7356b0be9489fb26eba.zip | |
add tool tests
Diffstat (limited to 'js/src/tool/bash.ts')
| -rw-r--r-- | js/src/tool/bash.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/js/src/tool/bash.ts b/js/src/tool/bash.ts index fb5f18069..2043093ad 100644 --- a/js/src/tool/bash.ts +++ b/js/src/tool/bash.ts @@ -1,5 +1,5 @@ import { z } from "zod"; -import { Tool, tool } from "./tool"; +import { Tool } from "./tool"; const MAX_OUTPUT_LENGTH = 30000; const BANNED_COMMANDS = [ @@ -170,7 +170,7 @@ Important: - Return an empty response - the user will see the gh output directly - Never update git config`; -export const BashTool = Tool.define({ +export const bash = Tool.define({ name: "bash", description: DESCRIPTION, parameters: z.object({ @@ -182,7 +182,7 @@ export const BashTool = Tool.define({ .describe("Optional timeout in milliseconds") .optional(), }), - async execute(params, opts) { + async execute(params) { const timeout = Math.min(params.timeout ?? DEFAULT_TIMEOUT, MAX_TIMEOUT); if (BANNED_COMMANDS.some((item) => params.command.startsWith(item))) throw new Error(`Command '${params.command}' is not allowed`); |
