/** * 4-hex-char anchor for a line. Position is folded into the hash so anchors are * UNIQUE by construction (blank lines and repeated lines no longer collide). * Resolution stays O(1) via a lookup map. `index` is the 0-based line index. */ export declare function lineHash(line: string, index: number): string; /** File rendered with `anchor│line` prefixes for the model to read. */ export declare function renderWithAnchors(file: string): string; export interface AnchoredFile { /** File rendered with `anchor│line` prefixes for the model to read. */ rendered: string; /** anchor → line index (0-based). Only UNIQUE anchors are resolvable. */ anchorToIndex: Map; /** anchors that collided (ambiguous → unresolvable, like a stale-file reject). */ ambiguous: Set; lines: string[]; } export declare function anchorFile(file: string): AnchoredFile; /** * True when the line at `index` (0-based) still hashes to `hash`. Out-of-range * indices return false. This is the staleness gate the edit tool uses. */ export declare function verifyAnchor(lines: string[], index: number, hash: string): boolean; /** Optional per-edit anchor guard: pin both endpoints of an edit by line+hash. */ export interface EditAnchor { /** 1-based line number of the first line of the edited span. */ start_line: number; /** Content anchor of the first line (from a `read` with `anchors: true`). */ start_hash: string; /** 1-based line number of the last line of the edited span. */ end_line: number; /** Content anchor of the last line. */ end_hash: string; } export type AnchorFailure = "out_of_range" | "hash_mismatch" | "reversed"; export interface AnchorResolution { ok: boolean; /** 0-based index of the first line (only when ok). */ startIndex?: number; /** 0-based index of the last line (only when ok). */ endIndex?: number; reason?: AnchorFailure; } /** * Resolve an anchor against the current file lines (0-based). Rejects the edit * if either endpoint is out of range, the range is reversed, or either hash no * longer matches — the corruption-avoidance property. */ export declare function resolveAnchoredEdit(lines: string[], anchor: EditAnchor): AnchorResolution; //# sourceMappingURL=hashline.d.ts.map