/** * Diff formatting and truncation logic * Provides intelligent diff rendering with context and truncation */ export interface DiffLine { type: "addition" | "deletion" | "unchanged" | "context"; content: string; lineNumber?: number; } export interface DiffBlock { lines: DiffLine[]; startLine: number; endLine: number; } export interface TruncationOptions { maxLines?: number; contextLines?: number; collapseThreshold?: number; } /** * Parse a unified diff string into structured diff lines */ export declare function parseDiff(diff: string): DiffLine[]; /** * Apply intelligent truncation to a diff * Shows changed lines + context, collapses large unchanged sections */ export declare function truncateDiff(lines: DiffLine[], options?: TruncationOptions): DiffLine[]; /** * Format diff lines back to a unified diff string */ export declare function formatDiff(lines: DiffLine[]): string; /** * Smart diff rendering: parse, truncate, and format */ export declare function renderDiff(diff: string, options?: TruncationOptions): string; /** * Extract diff statistics (additions, deletions, unchanged) */ export interface DiffStats { additions: number; deletions: number; unchanged: number; total: number; } export declare function getDiffStats(diff: string): DiffStats;