Versions in this module Expand all Collapse all v0 v0.1.0 Jan 13, 2026 Changes in this version + var ModelLimits = map[string]int + func EstimateConversationTokens(messages []provider.Message) int + func EstimateMessageTokens(msg provider.Message) int + func EstimateTokens(text string) int + func GetModelLimit(model string) int + func SummarizeOldMessages(messages []provider.Message, keepRecent int) string + type CompactionResult struct + CompactedTokens int + MessagesRemoved int + OriginalTokens int + Summary string + type Manager struct + func NewManager(maxTokens int) *Manager + func NewManagerForModel(model string) *Manager + func (m *Manager) GetStatus(messages []provider.Message) Status + func (m *Manager) ShouldCompact(messages []provider.Message) bool + func (m *Manager) SimpleCompact(messages []provider.Message, keepCount int) ([]provider.Message, CompactionResult) + func (m *Manager) WithCompactThreshold(threshold float64) *Manager + func (m *Manager) WithWarningThreshold(threshold float64) *Manager + type Status struct + EstimatedTokens int + MaxTokens int + NeedsCompaction bool + UsagePercent float64 + WarningThreshold bool + type TokenBudget struct + CurrentTurn int + History int + Reserved int + System int + Total int + func NewTokenBudget(maxTokens int) TokenBudget + func (b TokenBudget) RemainingHistory(used int) int