import { SpawnOptions } from 'child_process'; export interface RunResult { stdout: string; stderr: string; exitCode: number; } /** * Run a command and capture its output (non-interactive) * * @param command - The command to run * @param args - Array of arguments * @param options - Spawn options (cwd, env, etc.) * @param input - Optional input to write to stdin (for passing prompts on Windows) */ export declare function runCommand(command: string, args: string[], options?: SpawnOptions, input?: string): Promise; export interface PtyRunResult { output: string; exitCode: number; } /** * Run a command interactively using a PTY (pseudo-terminal) * - Preserves colors and formatting * - Allows user interaction (approve commands, answer prompts) * - Streams output in real-time * - Captures output for forwarding */ export declare function runCommandPty(command: string, args: string[], options?: { cwd?: string; keepStdinOpen?: boolean; initialInput?: string; }): Promise; /** * Check if a command exists in PATH * Uses 'where' on Windows, 'which' on Unix-like systems */ export declare function commandExists(command: string): Promise; /** * Resolve the absolute path of a command * Returns null if not found */ export declare function resolveCommandPath(command: string): Promise; /** * Strip ANSI escape codes from a string */ export declare function stripAnsi(str: string): string; /** * Truncate text to a maximum length with ellipsis */ export declare function truncate(text: string, maxLength: number): string; /** * Format a tool response for display */ export declare function formatResponse(toolName: string, response: string): string; /** * Get the version of a CLI tool asynchronously * Uses runCommand to avoid blocking the main thread */ export declare function getToolVersionAsync(command: string): Promise; //# sourceMappingURL=utils.d.ts.map