import type { DiffHunk, DiffSummary, DiffOutput, DiffOutputShape, DiffGranularity } from '../types.js'; /** * Line cap above which LCS is skipped and the envelope falls back to a * summary-only shape with `truncated: true`. Mirrors `MAX_DIFF_LINES` in * `diff-summary.ts` so the two modules degrade in lock-step. A unit test * pins them equal — if you tune one, tune the other. */ export declare const DIFF_LINE_CAP = 5000; /** * Token cap for word-granularity LCS. The LCS DP table is O(m*n) — at * 5000-line cap a page averaging ~25 tokens/line could reach ~125k tokens * per side, producing a ~15.6-billion-cell table (~62 GB at 4 bytes/cell) * that crashes the MCP server outright. PR #89 sec+perf reviewers flagged * this as HIGH. At 50k tokens per side the table is ~10 GB-virtual / * realistic-sparse-write — still a lot, but inside what V8 can lazily * back. Inputs over the cap fall back to line-granularity hunks and the * envelope carries `truncated: true` so callers see the degrade. */ export declare const DIFF_TOKEN_CAP = 50000; export interface UnifiedDiffResult { diff: string; truncated: boolean; summary: DiffSummary; } export declare function computeUnifiedDiff(oldText: string, newText: string): UnifiedDiffResult; /** * Cheaper alternative to `computeUnifiedDiff` for callers (the section walker) * that only need the summary counts. Runs LCS once via `buildEditScript` * and computes counts + char totals without rendering the unified patch * or normalizing edit order. */ export declare function computeDiffSummaryOnly(oldText: string, newText: string): UnifiedDiffResult; export interface HunksResult { hunks: DiffHunk[]; truncated: boolean; summary: DiffSummary; } export declare function computeHunks(oldText: string, newText: string, granularity: DiffGranularity): HunksResult; export interface DiffEnvelopeInput { oldMarkdown: string; newMarkdown: string; output: DiffOutputShape; granularity: DiffGranularity; } export declare function computeDiffEnvelope(input: DiffEnvelopeInput): DiffOutput; //# sourceMappingURL=diff-engine.d.ts.map