export type DiffLineKind = "+" | "-" | " "; export interface DiffLine { kind: DiffLineKind; text: string; oldNo: number | null; newNo: number | null; } /** header: the "@@ -a,b +c,d @@ ctx" line */ export interface DiffHunk { header: string; lines: DiffLine[]; } export interface DiffFile { /** the new path (the old path for a deletion) */ path: string; /** set for a rename (or copy) */ oldPath?: string; status: "A" | "M" | "D" | "R"; binary: boolean; /** set when the file is too big to show: its text instead of hunks */ summary?: string; hunks: DiffHunk[]; } export interface TaskDiff { base: string; tip: string; files: DiffFile[]; truncated: boolean; } /** A file whose hunks exceed this many lines: summary only. */ export declare const DIFF_FILE_MAX_LINES = 2000; /** Or whose diff text exceeds this. */ export declare const DIFF_FILE_MAX_BYTES: number; /** The whole diff output read; beyond: truncated, later files dropped. */ export declare const DIFF_TOTAL_MAX_BYTES: number; /** A line's text is kept at most this many characters. */ export declare const DIFF_LINE_MAX = 2000; /** Parse the text of `git diff` into files. Never throws. */ export declare function parseUnifiedDiff(text: string): DiffFile[]; /** * Everything the task changed against where it branched: committed and uncommitted tracked changes, * plus untracked files. undefined when git cannot say (no such base, worktree gone). Read-only. */ export declare function taskDiff(path: string, baseRef: string): Promise;