import type { RuntimeTaskImage, RuntimeTaskSessionMode, RuntimeTaskSessionSummary, RuntimeTaskTurnCheckpoint } from "../core/api-contract.js";
import { type ClineMessageRepository } from "./cline-message-repository.js";
import { type ClineRuntimeSetup } from "./cline-runtime-setup.js";
import { type ClineSessionRuntime, type CreateInMemoryClineSessionRuntimeOptions } from "./cline-session-runtime.js";
import { type ClineTaskMessage } from "./cline-session-state.js";
export type { ClineTaskMessage } from "./cline-session-state.js";
export interface StartClineTaskSessionRequest {
    taskId: string;
    cwd: string;
    prompt: string;
    images?: RuntimeTaskImage[];
    resumeFromTrash?: boolean;
    providerId?: string | null;
    modelId?: string | null;
    mode?: RuntimeTaskSessionMode;
    apiKey?: string | null;
    baseUrl?: string | null;
}
export interface ClineTaskSessionService {
    onSummary(listener: (summary: RuntimeTaskSessionSummary) => void): () => void;
    onMessage(listener: (taskId: string, message: ClineTaskMessage) => void): () => void;
    startTaskSession(request: StartClineTaskSessionRequest): Promise<RuntimeTaskSessionSummary>;
    stopTaskSession(taskId: string): Promise<RuntimeTaskSessionSummary | null>;
    abortTaskSession(taskId: string): Promise<RuntimeTaskSessionSummary | null>;
    cancelTaskTurn(taskId: string): Promise<RuntimeTaskSessionSummary | null>;
    sendTaskSessionInput(taskId: string, text: string, mode?: RuntimeTaskSessionMode, images?: RuntimeTaskImage[]): Promise<RuntimeTaskSessionSummary | null>;
    rebindPersistedTaskSession(taskId: string): Promise<RuntimeTaskSessionSummary | null>;
    getSummary(taskId: string): RuntimeTaskSessionSummary | null;
    listSummaries(): RuntimeTaskSessionSummary[];
    listMessages(taskId: string): ClineTaskMessage[];
    loadTaskSessionMessages(taskId: string): Promise<ClineTaskMessage[]>;
    applyTurnCheckpoint(taskId: string, checkpoint: RuntimeTaskTurnCheckpoint): RuntimeTaskSessionSummary | null;
    dispose(): Promise<void>;
}
export interface CreateInMemoryClineTaskSessionServiceOptions {
    createSessionRuntime?: (options: CreateInMemoryClineSessionRuntimeOptions) => ClineSessionRuntime;
    createMessageRepository?: () => ClineMessageRepository;
    createRuntimeSetup?: (workspacePath: string) => Promise<ClineRuntimeSetup>;
}
export declare class InMemoryClineTaskSessionService implements ClineTaskSessionService {
    private readonly pendingTurnCancelTaskIds;
    private readonly sessionRuntime;
    private readonly messageRepository;
    private readonly createRuntimeSetup;
    private readonly runtimeSetupByWorkspacePath;
    constructor(options?: CreateInMemoryClineTaskSessionServiceOptions);
    onSummary(listener: (summary: RuntimeTaskSessionSummary) => void): () => void;
    onMessage(listener: (taskId: string, message: ClineTaskMessage) => void): () => void;
    private emitTaskFailure;
    private dispatchResolvedTaskInput;
    startTaskSession(request: StartClineTaskSessionRequest): Promise<RuntimeTaskSessionSummary>;
    stopTaskSession(taskId: string): Promise<RuntimeTaskSessionSummary | null>;
    abortTaskSession(taskId: string): Promise<RuntimeTaskSessionSummary | null>;
    cancelTaskTurn(taskId: string): Promise<RuntimeTaskSessionSummary | null>;
    sendTaskSessionInput(taskId: string, text: string, mode?: RuntimeTaskSessionMode, images?: RuntimeTaskImage[]): Promise<RuntimeTaskSessionSummary | null>;
    rebindPersistedTaskSession(taskId: string): Promise<RuntimeTaskSessionSummary | null>;
    getSummary(taskId: string): RuntimeTaskSessionSummary | null;
    listSummaries(): RuntimeTaskSessionSummary[];
    listMessages(taskId: string): ClineTaskMessage[];
    loadTaskSessionMessages(taskId: string): Promise<ClineTaskMessage[]>;
    applyTurnCheckpoint(taskId: string, checkpoint: RuntimeTaskTurnCheckpoint): RuntimeTaskSessionSummary | null;
    dispose(): Promise<void>;
    private emitSummary;
    private emitMessage;
    private shouldCaptureReviewCheckpoint;
    private captureReviewCheckpoint;
    private ensureRuntimeSetup;
    private handleTaskEvent;
}
export declare function createInMemoryClineTaskSessionService(options?: CreateInMemoryClineTaskSessionServiceOptions): ClineTaskSessionService;
//# sourceMappingURL=cline-task-session-service.d.ts.map