Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Unified ¶
Unified produces a standard unified diff (3 context lines) of two file bodies for the agent harness’s edit/write tools. The output round-trips through Parse so the existing renderDiffBlock pipeline renders agent edits exactly like any other diff block. Returns "" when the bodies are identical. No ---/+++ file header is emitted: toolDiffMsg carries the path separately and Parse drops pre-@@ lines anyway.
Types ¶
type Hunk ¶
Hunk represents a unified diff hunk.
func Parse ¶
Parse turns a unified diff string into a slice of Hunks. Lines whose first character is neither space, +, -, nor \ are kept verbatim (no prefix re-writing) so renderDiffBlock’s existing prefix-based styling applies. Lines before the first `@@` (file headers like "--- a/f") are dropped — we already know the path from the FileUpdateChange record.