import type { FileReadCache } from "../edit/file-read-cache"; import type { HashlineApplyOptions, HashlineEdit } from "./types"; export interface HashlineRecoveryArgs { cache: FileReadCache; absolutePath: string; currentText: string; edits: HashlineEdit[]; options: HashlineApplyOptions; } export interface HashlineRecoveryResult { lines: string; firstChangedLine: number | undefined; warnings: string[]; } /** * Attempt to recover from a `HashlineMismatchError` by replaying the edits * against a cached pre-edit snapshot of the file and 3-way-merging the result * onto the current on-disk content. Returns `null` when no recovery is * possible — callers should propagate the original mismatch error in that * case. * * Recovery is gated on a strict precondition: every line the model anchored * MUST be present in the cached snapshot AND its content MUST hash to the * model-supplied hash. This prevents 3-way merges from silently sliding onto * the wrong site when only tangential parts of the file went stale. */ export declare function tryRecoverHashlineWithCache(args: HashlineRecoveryArgs): HashlineRecoveryResult | null;