Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FileDiff ¶
type FileDiff struct {
Path string `json:"path"`
OldPath string `json:"old_path,omitempty"`
AddedCount int `json:"added_count"`
DeletedCount int `json:"deleted_count"`
Hunks []Hunk `json:"hunks"`
}
FileDiff represents compressed changes for one file.
type Hunk ¶
type Hunk struct {
Header string `json:"header"`
EnclosingSymbol string `json:"enclosing_symbol,omitempty"`
Lines []string `json:"lines"`
}
Hunk represents a single compressed change block within a file diff.
type Report ¶
type Report struct {
Files []FileDiff `json:"files"`
OriginalBytes int `json:"original_bytes"`
CompressedBytes int `json:"compressed_bytes"`
SavedTokensPct float64 `json:"saved_tokens_pct"`
EstimatedTokens int `json:"estimated_tokens"`
}
Report aggregates compressed diff metrics for token budgeting.
func ParseAndCompress ¶
ParseAndCompress parses a unified diff and extracts compressed hunks and metrics.
func (*Report) FormatText ¶
FormatText renders the compressed diff into a compact string suitable for agent prompts.