import { spawnSync } from "node:child_process";
export interface BackgroundProcess {
    id: string;
    pid: number;
    command: string;
    logFile: string;
    startedAt: number;
    exitCode: number | null;
    lastReadOffset: number;
}
export interface StartResult {
    id: string;
    pid: number;
    logFile: string;
}
export interface ReadOutputResult {
    id: string;
    isRunning: boolean;
    exitCode: number | null;
    output: string;
}
export interface ProcessManagerOps {
    platform?: NodeJS.Platform;
    kill?: typeof process.kill;
    killProcessTree?: (pid: number) => void;
    spawnSync?: typeof spawnSync;
}
export declare class ProcessManager {
    private readonly ops;
    private processes;
    private children;
    constructor(ops?: ProcessManagerOps);
    start(command: string, cwd: string): Promise<StartResult>;
    readOutput(id: string, fromStart?: boolean): Promise<ReadOutputResult>;
    /**
     * Write input to a running background process's stdin, enabling interactive
     * control (answer prompts, drive a REPL, feed a scaffolder). By default a
     * newline is appended (as if the user pressed Enter). Set `eof` to close
     * stdin afterwards, signalling end-of-input (Ctrl-D) to the program.
     */
    sendInput(id: string, input: string, opts?: {
        enter?: boolean;
        eof?: boolean;
    }): Promise<string>;
    stop(id: string): Promise<string>;
    list(): BackgroundProcess[];
    shutdownAll(): void;
}
//# sourceMappingURL=process-manager.d.ts.map