export type ReplPhase = 'idle' | 'composing' | 'awaiting_model' | 'tool_execution' | 'interrupted' | 'failed' | 'completed';
export interface ReplTaskState {
    taskId: number;
    phase: Exclude<ReplPhase, 'idle' | 'composing'>;
    aborted: boolean;
    completed: boolean;
    outputGateToken: number;
    startedAt: number;
    activeToolName?: string;
}
export interface ReplRuntimeState {
    phase: ReplPhase;
    nextTaskId: number;
    nextOutputGateToken: number;
    activeTask: ReplTaskState | null;
}
export type ReplInterruptAction = 'interrupt_task' | 'cancel_multiline' | 'exit';
export declare function createReplRuntimeState(): ReplRuntimeState;
export declare function startReplTask(runtime: ReplRuntimeState): ReplTaskState;
export declare function setReplTaskPhase(runtime: ReplRuntimeState, task: ReplTaskState, phase: ReplTaskState['phase'], activeToolName?: string): void;
export declare function interruptReplTask(runtime: ReplRuntimeState): ReplTaskState | null;
export declare function finishReplTask(runtime: ReplRuntimeState, task: ReplTaskState, phase: 'interrupted' | 'failed' | 'completed'): void;
export declare function setReplComposing(runtime: ReplRuntimeState, composing: boolean): void;
export declare function resetReplToIdle(runtime: ReplRuntimeState): void;
export declare function canWriteTaskOutput(runtime: ReplRuntimeState, task: ReplTaskState): boolean;
export declare function getVisibleReplPhase(runtime: ReplRuntimeState): string | undefined;
export declare function decideInterruptAction(runtime: ReplRuntimeState, inMultiline: boolean): ReplInterruptAction;
