Versions in this module Expand all Collapse all v0 v0.4.0 Sep 3, 2026 v0.3.0 Sep 2, 2026 Changes in this version + const CavemanDirective + const CavemanLiteDirective + const DefaultHeadroomKeep + const DefaultHeadroomReserve + const HeadLines + const MinCompressBytes + const ModeAggressive + const ModeAuto + const ModeBalanced + const ModeConservative + const ModeFull + const ModeLight + const ModeLite + const ModeStandard + const TailLines + func AutoCavemanDirective(body []byte) string + func AutoHeadroomProfile(estTokens, reserve int) (run bool, profile string) + func CompressReasoning(body []byte, effort string) ([]byte, int, bool) + func CompressToolResults(body []byte) ([]byte, int, bool) + func CompressToolResultsAuto(body []byte) ([]byte, int, bool) + func CompressToolResultsWith(body []byte, p RTKParams) ([]byte, int, bool) + func DecideHeadroom(global, model, vk *config.Optimization, header string) (bool, string, int, int) + func DirectiveFor(mode string) string + func EstimateTokens(body []byte) int + func HasToolTraffic(body []byte) bool + func InjectCavemanDirective(body []byte) ([]byte, bool, error) + func InjectCavemanDirectiveWith(body []byte, directive string) ([]byte, bool, error) + func PruneForHeadroom(body []byte, reserve int, keep int) ([]byte, int, bool) + func ShouldCaveman(global, model, vk *config.Optimization, header string) bool + func ShouldHeadroom(global, model, vk *config.Optimization, header string) (bool, int, int) + func ShouldRTK(global, model, vk *config.Optimization, header string) bool + type Decision struct + Mode string + Run bool + func DecideCaveman(global, model, vk *config.Optimization, header string) Decision + func DecideRTK(global, model, vk *config.Optimization, header string) Decision + type OptimizeOptions struct + Caveman bool + CavemanDirective string + CavemanMode string + Headroom bool + HeadroomKeep int + HeadroomReserve int + RTK bool + RTKAuto bool + RTKParams RTKParams + type OptimizeResult struct + CavemanInjected bool + CavemanMode string + Changed bool + HeadroomPruned bool + HeadroomSavedTokens int + RTKSavedBytes int + func OptimizeRequest(body []byte, o OptimizeOptions) ([]byte, OptimizeResult) + type ProfileParams struct + Keep int + Profile string + Reserve int + func HeadroomProfileParams(profile string, reserveOverride, keepOverride int) ProfileParams + type RTKParams struct + CommandAware bool + HeadLines int + MinBytes int + TailLines int + func AutoRTKParamsForBlock(blockLen int) RTKParams + func RTKParamsFor(mode string) RTKParams + func StandardRTKParams() RTKParams v0.2.0 Aug 20, 2026