import type { RuntimeTaskHookActivity, RuntimeTaskImage, RuntimeTaskSessionReviewReason, RuntimeTaskSessionSummary, RuntimeTaskTurnCheckpoint } from "../core/api-contract.js";
import { type AgentAdapterLaunchInput } from "./agent-session-adapters.js";
import type { TerminalSessionListener, TerminalSessionService } from "./terminal-session-service.js";
export interface StartTaskSessionRequest {
    taskId: string;
    agentId: AgentAdapterLaunchInput["agentId"];
    binary: string;
    args: string[];
    autonomousModeEnabled?: boolean;
    cwd: string;
    prompt: string;
    images?: RuntimeTaskImage[];
    startInPlanMode?: boolean;
    resumeFromTrash?: boolean;
    cols?: number;
    rows?: number;
    env?: Record<string, string | undefined>;
    workspaceId?: string;
}
export interface StartShellSessionRequest {
    taskId: string;
    cwd: string;
    cols?: number;
    rows?: number;
    binary: string;
    args?: string[];
    env?: Record<string, string | undefined>;
}
export declare class TerminalSessionManager implements TerminalSessionService {
    private readonly entries;
    private readonly summaryListeners;
    onSummary(listener: (summary: RuntimeTaskSessionSummary) => void): () => void;
    hydrateFromRecord(record: Record<string, RuntimeTaskSessionSummary>): void;
    getSummary(taskId: string): RuntimeTaskSessionSummary | null;
    listSummaries(): RuntimeTaskSessionSummary[];
    attach(taskId: string, listener: TerminalSessionListener): (() => void) | null;
    startTaskSession(request: StartTaskSessionRequest): Promise<RuntimeTaskSessionSummary>;
    startShellSession(request: StartShellSessionRequest): Promise<RuntimeTaskSessionSummary>;
    recoverStaleSession(taskId: string): RuntimeTaskSessionSummary | null;
    writeInput(taskId: string, data: Buffer): RuntimeTaskSessionSummary | null;
    resize(taskId: string, cols: number, rows: number, pixelWidth?: number, pixelHeight?: number): boolean;
    pauseOutput(taskId: string): boolean;
    resumeOutput(taskId: string): boolean;
    transitionToReview(taskId: string, reason: RuntimeTaskSessionReviewReason): RuntimeTaskSessionSummary | null;
    applyHookActivity(taskId: string, activity: Partial<RuntimeTaskHookActivity>): RuntimeTaskSessionSummary | null;
    transitionToRunning(taskId: string): RuntimeTaskSessionSummary | null;
    applyTurnCheckpoint(taskId: string, checkpoint: RuntimeTaskTurnCheckpoint): RuntimeTaskSessionSummary | null;
    stopTaskSession(taskId: string): RuntimeTaskSessionSummary | null;
    markInterruptedAndStopAll(): RuntimeTaskSessionSummary[];
    private applySessionEvent;
    private ensureEntry;
    private shouldAutoRestart;
    private scheduleAutoRestart;
    private emitSummary;
}
//# sourceMappingURL=session-manager.d.ts.map