export declare const MAX_CMD_RUNNER_OUTPUT_WAIT_TIMEOUT_MS: number;
export type CmdRunnerSpawnSpec = Readonly<{
    command: string;
    args: string[];
    shellLabel: string;
    windowsVerbatimArguments?: boolean;
}>;
export type CmdRunnerInitMessage = Readonly<{
    type: 'init';
    initialCommandLine: string;
    spawnSpec: CmdRunnerSpawnSpec;
    timeoutSeconds: number;
    scrollbackLines: number;
}>;
export type CmdRunnerInitialIpcMessage = Readonly<{
    type: 'completed';
    exitCode: number | null;
    exitSignal: string | null;
    stdout: CmdRunnerStreamSnapshot;
    stderr: CmdRunnerStreamSnapshot;
}> | Readonly<{
    type: 'daemonized';
    daemonPid: number;
    daemonCommandLine: string;
    endpoint: string;
    runnerPid: number;
    processGroupId?: number;
    shell: string;
    startTime: string;
}> | Readonly<{
    type: 'failed';
    errorText: string;
}>;
export type CmdRunnerRequest = Readonly<{
    type: 'ping';
}> | Readonly<{
    type: 'get_status';
}> | Readonly<{
    type: 'get_output';
    stdout: boolean;
    stderr: boolean;
    waitForNewOutput: boolean;
    timeoutMs?: number;
}> | Readonly<{
    type: 'stop';
    entirePg: boolean;
}>;
export type CmdRunnerStreamSnapshot = Readonly<{
    content: string;
    linesScrolledOut: number;
    version: number;
}>;
export type CmdRunnerOutputWaitStatus = 'output' | 'timeout' | 'exited';
export type CmdRunnerStatusPayload = Readonly<{
    daemonPid: number;
    daemonCommandLine: string;
    endpoint: string;
    runnerPid: number;
    processGroupId?: number;
    shell: string;
    startTime: string;
    isRunning: boolean;
    exitCode: number | null;
    exitSignal: string | null;
    stdout: CmdRunnerStreamSnapshot;
    stderr: CmdRunnerStreamSnapshot;
}>;
export type CmdRunnerResponse = (Readonly<{
    type: 'pong';
    ok: true;
}> & CmdRunnerStatusPayload) | (Readonly<{
    type: 'status';
    ok: true;
}> & CmdRunnerStatusPayload) | (Readonly<{
    type: 'output';
    ok: true;
    waitStatus?: CmdRunnerOutputWaitStatus;
}> & CmdRunnerStatusPayload) | (Readonly<{
    type: 'stop_result';
    ok: true;
}> & CmdRunnerStatusPayload) | Readonly<{
    type: 'error';
    ok: false;
    errorText: string;
    daemonPid?: number;
    daemonCommandLine?: string;
    endpoint?: string;
    runnerPid?: number;
    processGroupId?: number;
    shell?: string;
    startTime?: string;
    isRunning?: boolean;
    exitCode?: number | null;
    exitSignal?: string | null;
    stdout?: CmdRunnerStreamSnapshot;
    stderr?: CmdRunnerStreamSnapshot;
}>;
export declare function parseCmdRunnerInitMessage(raw: unknown): CmdRunnerInitMessage;
export declare function parseCmdRunnerInitialIpcMessage(raw: unknown): CmdRunnerInitialIpcMessage;
export declare function parseCmdRunnerRequestLine(line: string): CmdRunnerRequest;
export declare function parseCmdRunnerResponseLine(line: string): CmdRunnerResponse;
export declare function getCmdRunnerEndpointForDaemonPid(daemonPid: number): string;
