import type { AgentTool } from "@kolisachint/hoocode-agent-core"; import { type Static, Type } from "typebox"; import type { ToolDefinition } from "../extensions/types.js"; import { type TruncationResult } from "./truncate.js"; declare const bashSchema: Type.TObject<{ command: Type.TString; timeout: Type.TOptional; }>; export type BashToolInput = Static; export interface BashToolDetails { truncation?: TruncationResult; fullOutputPath?: string; } /** * Pluggable operations for the bash tool. * Override these to delegate command execution to remote systems (for example SSH). */ export interface BashOperations { /** * Execute a command and stream output. * @param command The command to execute * @param cwd Working directory * @param options Execution options * @returns Promise resolving to exit code (null if killed) */ exec: (command: string, cwd: string, options: { onData: (data: Buffer) => void; signal?: AbortSignal; timeout?: number; env?: NodeJS.ProcessEnv; }) => Promise<{ exitCode: number | null; }>; } /** * Create bash operations using hoocode's built-in local shell execution backend. * * This is useful for extensions that intercept user_bash and still want hoocode's * standard local shell behavior while wrapping or rewriting commands. */ export declare function createLocalBashOperations(options?: { shellPath?: string; }): BashOperations; export interface BashSpawnContext { command: string; cwd: string; env: NodeJS.ProcessEnv; } export type BashSpawnHook = (context: BashSpawnContext) => BashSpawnContext; export interface BashToolOptions { /** Custom operations for command execution. Default: local shell */ operations?: BashOperations; /** Command prefix prepended to every command (for example shell setup commands) */ commandPrefix?: string; /** Optional explicit shell path from settings */ shellPath?: string; /** Hook to adjust command, cwd, or env before execution */ spawnHook?: BashSpawnHook; /** * Regex patterns for allowed commands. When set, a command must match at least one * pattern to execute; non-matching commands are blocked before the shell is invoked. */ allowedCommands?: string[]; /** * Regex patterns for denied commands. A command matching any pattern is blocked * before the shell is invoked. Evaluated before allowedCommands. */ deniedCommands?: string[]; /** Byte cap on returned output before truncation (tail-kept). Default: DEFAULT_MAX_BYTES. */ maxOutputBytes?: number; /** Line cap on returned output before truncation (tail-kept). Default: DEFAULT_MAX_LINES. */ maxOutputLines?: number; } type BashRenderState = { startedAt: number | undefined; endedAt: number | undefined; interval: NodeJS.Timeout | undefined; }; export declare function createBashToolDefinition(cwd: string, options?: BashToolOptions): ToolDefinition; export declare function createBashTool(cwd: string, options?: BashToolOptions): AgentTool; export {}; //# sourceMappingURL=bash.d.ts.map