import { type SpawnOptions } from 'child_process';
import type { ChangeRequest } from '../types/change-request-types';
export declare const DEFAULT_AGENT_TIMEOUT_SECONDS = 900;
export type EmbeddedAgentKind = 'claude' | 'codex';
type AgentInputStream = {
    write: (chunk: string) => unknown;
    end: () => unknown;
    once?: (event: 'error', listener: (error: Error) => void) => unknown;
};
type AgentOutputStream = {
    on: (event: 'data', listener: (chunk: Buffer) => void) => unknown;
};
type AgentProcess = {
    stdin: AgentInputStream;
    stdout: AgentOutputStream;
    stderr: AgentOutputStream;
    kill: (signal?: string) => boolean;
    once: (event: 'close' | 'error', listener: ((code: number | null) => void) | ((error: Error) => void)) => unknown;
};
type SpawnProcess = (command: string, args: string[], options: SpawnOptions) => AgentProcess;
export type TerminalAgentRunnerOptions = {
    agent?: EmbeddedAgentKind;
    agentBin?: string;
    claudeBin?: string;
    model?: string;
    timeoutSeconds?: number;
    spawnProcess?: SpawnProcess;
};
export type TerminalAgentRunParams = {
    request: ChangeRequest;
    cwd: string;
    sessionId: string;
    resumeSession?: boolean;
    onFeedback: (message: string) => void;
};
export type TerminalAgentRunResult = {
    success: boolean;
    error?: string;
};
export declare class TerminalAgentRunner {
    private agent;
    private agentBin;
    private model?;
    private timeoutSeconds;
    private spawnProcess;
    private codexThreadIds;
    private activeProcesses;
    constructor(options?: TerminalAgentRunnerOptions);
    getDisplayName(): string;
    private getDefaultAgentBin;
    private buildClaudeArgs;
    private buildCodexArgs;
    private buildAgentArgs;
    private parseFeedback;
    /**
     * @effect Terminates all active child agents owned by this runner.
     */
    stopActiveRuns(signal?: string): number;
    /**
     * @effect Spawns the selected terminal agent, writes one Rivet change prompt to stdin, and streams progress from stdout.
     */
    runChangeRequest(params: TerminalAgentRunParams): Promise<TerminalAgentRunResult>;
}
export {};
//# sourceMappingURL=TerminalAgentRunner.d.ts.map