import type * as LlmsProviders from "@cline/llms"; import type { CheckpointEntry, CheckpointMetadata } from "../hooks/checkpoint-hooks"; import type { SessionRecord } from "../types/sessions"; export interface CheckpointRestorePlan { checkpoint: CheckpointEntry; messages?: LlmsProviders.Message[]; cwd: string; } export interface WorktreeRestoreTransaction { commit(): Promise; rollback(): Promise; } /** * Captures the current worktree before a destructive checkpoint restore. * * `git stash create` omits untracked files, but checkpoint restoration runs * `git clean -fd`. Use a short-lived `stash push --include-untracked`, move * its object behind a private ref, and immediately remove it from the user's * visible stash list. The private ref remains only until commit or rollback. */ export declare function beginWorktreeRestoreTransaction(cwd: string): Promise; export declare function readSessionCheckpointHistory(session: Pick | undefined): CheckpointEntry[]; export declare function createRestoredCheckpointMetadata(session: Pick | undefined, runCount: number): CheckpointMetadata | undefined; export declare function findCheckpointForRun(history: readonly CheckpointEntry[], runCount: number): CheckpointEntry | undefined; export declare function trimMessagesToCheckpoint(messages: LlmsProviders.Message[], runCount: number): LlmsProviders.Message[]; export declare function trimMessagesBeforeUserRun(messages: LlmsProviders.Message[], runCount: number): LlmsProviders.Message[]; export declare function createCheckpointRestorePlan(input: { session: SessionRecord; messages?: LlmsProviders.Message[]; checkpointRunCount: number; cwd?: string; restoreMessages?: boolean; }): CheckpointRestorePlan; export declare function applyCheckpointToWorktree(cwd: string, checkpoint: CheckpointEntry): Promise;