/** * @license * Copyright 2025 Vybestack LLC * SPDX-License-Identifier: Apache-2.0 */ import { Config } from '../config/config.js'; import { BaseDeclarativeTool, BaseToolInvocation, type ToolInvocation, type ToolResult, ToolConfirmationOutcome, type ToolCallConfirmationDetails, type PolicyUpdateOptions } from './tools.js'; import type { MessageBus } from '../confirmation-bus/message-bus.js'; import type { AnsiOutput } from '../utils/terminalSerializer.js'; export declare const OUTPUT_UPDATE_INTERVAL_MS = 100; export interface ShellToolParams { /** * The shell command to execute */ command: string; /** * Optional description of what this command does, used for confirmation prompts */ description?: string; /** * Optional directory to execute the command in, relative to the target directory */ dir_path?: string; /** * Optional directory to execute the command in, relative to the target directory * @deprecated Use dir_path instead. Kept for backward compatibility. */ directory?: string; /** * Optional number of lines to show from the beginning of output */ head_lines?: number; /** * Optional number of lines to show from the end of output */ tail_lines?: number; /** * Optional grep pattern to filter output lines */ grep_pattern?: string; /** * Optional grep flags (e.g., -i for case-insensitive, -v for inverted) */ grep_flags?: string[]; /** * Optional timeout in seconds (-1 for unlimited). */ timeout_seconds?: number; } export declare class ShellToolInvocation extends BaseToolInvocation { private readonly config; private readonly allowlist; private readonly logger; constructor(config: Config, params: ShellToolParams, allowlist: Set, messageBus?: MessageBus); getToolName(): string; private getDirPath; getDescription(): string; protected getPolicyUpdateOptions(outcome: ToolConfirmationOutcome): PolicyUpdateOptions | undefined; shouldConfirmExecute(_abortSignal: AbortSignal): Promise; execute(signal: AbortSignal, updateOutput?: (output: string | AnsiOutput) => void, terminalColumns?: number, terminalRows?: number, setPidCallback?: (pid: number) => void): Promise; private resolveTimeoutSeconds; private isInvocationAllowlisted; } export declare class ShellTool extends BaseDeclarativeTool { private readonly config; static Name: string; private allowlist; constructor(config: Config, messageBus?: MessageBus); protected validateToolParamValues(params: ShellToolParams): string | null; protected createInvocation(params: ShellToolParams, messageBus?: MessageBus): ToolInvocation; }