/** * Normalize OpenAI-style `*** Begin Patch` hunks for display. * * Problem: in the `Begin Patch` format the model often emits a hunk that * reproduces a whole block of a file with the old version as `-` lines and the * new version as `+` lines, even when most of those lines are identical. This is * the "contextless / loose hunk matching" behavior. A patch that effectively * only adds one line can therefore look like it deletes several existing rules. * * The naive per-line renderer (`diffLineStyle`) faithfully colors every `-` red * and every `+` green, which misleads the user. * * Fix: for each `*** Update File:` hunk we reconstruct the old side * (context + `-` lines) and the new side (context + `+` lines), compute a * minimal LCS line diff between them, and re-emit the hunk so that: * - lines present in both sides become plain context (no `-`), * - truly removed lines stay `-`, * - truly added lines stay `+`. * * This is a display-only transformation. Well-formed minimal hunks (and any * non-`Begin Patch` unified diffs) are left untouched. */ /** Re-emit a `*** Begin Patch` string with loose hunks re-minimized. */ export declare function normalizeBeginPatchForDisplay(patch: string): string;