import { EventEmitter } from 'events'; /** * Log entry type for storing command output */ export interface LogEntry { timestamp: number; content: string; type: 'stdout' | 'stderr' | 'system'; } /** * Process status type */ export declare enum ProcessStatus { RUNNING = "running", STOPPED = "stopped", ERROR = "error" } /** * Events emitted by the CommandRunner */ export interface CommandRunnerEvents { log: (entry: LogEntry) => void; exit: (code: number, signal?: string) => void; error: (error: Error) => void; statusChange: (status: ProcessStatus) => void; } /** * CommandRunner options */ export interface CommandRunnerOptions { command: string; args?: string[]; cwd?: string; env?: NodeJS.ProcessEnv; logBufferSize?: number; } /** * Class that runs a command in a pseudo-terminal and captures output */ export declare class CommandRunner extends EventEmitter { private process; private logBuffer; private status; private readonly command; private readonly args; private readonly cwd; private readonly env; /** * Create a new CommandRunner */ constructor(options: CommandRunnerOptions); /** * Start the command process */ start(): void; /** * Stop the command process */ stop(): void; /** * Send data (key presses) to the process */ write(data: string): void; /** * Get all log entries */ getLogs(): LogEntry[]; /** * Get current process status */ getStatus(): ProcessStatus; /** * Add a log entry to the buffer and emit a log event */ private addLogEntry; /** * Set the process status and emit a status change event */ private setStatus; }