import type { MutationCheckpointContract, MutationCheckpointSnapshotEntryContract, MutationCheckpointPhase, MutationCheckpointRestoreAckContract, MutationCheckpointRestoreContract, MutationCheckpointRollbackResultContract } from "./checkpoint.js";
type MutationCheckpointStartParams = {
    runId: string;
    toolCallId: string;
    sessionId?: string;
    toolName: string;
    actionFingerprint?: string;
    args?: Record<string, unknown>;
};
type MutationCheckpointFinishParams = {
    runId: string;
    toolCallId: string;
    phase: Extract<MutationCheckpointPhase, "captured" | "failed" | "restored">;
    error?: string;
};
interface PersistedMutationCheckpointEntry {
    relativePath: string;
    kind: MutationCheckpointSnapshotEntryContract["kind"];
    sourcePath: string;
    snapshotPath?: string;
    snapshotSha256?: string;
}
interface PersistedMutationCheckpointRecord extends MutationCheckpointContract {
    workspaceRoot: string;
    snapshotDir: string;
    entries: PersistedMutationCheckpointEntry[];
    restoreHistory: MutationCheckpointRestoreContract[];
}
type MutationCheckpointRestoreOutcome = {
    restoreAck: MutationCheckpointRestoreAckContract;
    restored: MutationCheckpointRestoreContract;
    rollbackResult: MutationCheckpointRollbackResultContract;
};
type MutationCheckpointRuntimeRecord = Pick<PersistedMutationCheckpointRecord, "checkpointId" | "sessionId" | "workingDirectory" | "pathHints" | "snapshotSha256" | "snapshotEntryCount">;
export interface MutationCheckpointRuntimeManager {
    getCheckpointIdForToolCall(params: {
        runId: string;
        toolCallId: string;
    }): string | null;
    noteCheckpointStart(params: MutationCheckpointStartParams): Promise<MutationCheckpointContract>;
    noteCheckpointFinished(params: MutationCheckpointFinishParams): MutationCheckpointContract | null;
    restoreCheckpoint(params: {
        checkpointId: string;
        reason?: string;
        restoreId?: string;
    }): Promise<{
        record: MutationCheckpointRuntimeRecord | null;
        outcome: MutationCheckpointRestoreOutcome;
    } | null>;
}
export interface MutationCheckpointRuntimeManagerDeps {
    writeJsonAtomic: (filePath: string, data: unknown, options: {
        trailingNewline: boolean;
    }) => Promise<void>;
    resolveWorkspaceRoot: (workspaceDir?: string) => string;
    currentWorkingDirectory?: () => string;
    checkpointStateDir?: string;
    now?: () => number;
}
export declare function createMutationCheckpointRuntimeManager(deps: MutationCheckpointRuntimeManagerDeps): MutationCheckpointRuntimeManager;
export {};
