compressor

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2026 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompressDiff

func CompressDiff(diff string) string

CompressDiff reduces a raw diff to the changed lines that carry information, dropping blank/context lines, import-only churn, and diff headers. It applies a per-file line cap and a total line cap, and truncates over-long lines.

func CompressNotes

func CompressNotes(content string) string

CompressNotes caps notes content so an unbounded notes file cannot bloat a prompt. Notes are appended chronologically, so the newest entries are at the end; keep the tail rather than the stale head.

func CompressPlan

func CompressPlan(content string) string

CompressPlan strips completed checkboxes, deduplicates lines, retains headings, truncates long lines, and caps the result at maxPlanLines.

func EstimateTokens

func EstimateTokens(s string) int

EstimateTokens is a rough token estimate (characters / 4), the same heuristic the dry-run output has always used, centralised so it is consistent everywhere.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL