Versions in this module Expand all Collapse all v0 v0.3.0 May 26, 2026 v0.2.1 May 26, 2026 Changes in this version + const DefaultMaxAge + const DefaultMaxEntries + func EstimateTokenSavings(original, formatted string) int + func FixCodeFences(text string) string + func FixMarkdown(text string) string + func FormatChanges(result *FormattedResponse) string + func HashPrompt(prompt string) string + func NormalizeLists(text string) string + func RemoveFluff(text string) string + func ShouldCache(prompt string) bool + type CacheEntry struct + CreatedAt time.Time + HitCount int + Key string + LastHit time.Time + Model string + Prompt string + Response string + Similarity float64 + Tokens int + type CacheStats struct + Entries int + HitCount int64 + HitRate float64 + MissCount int64 + SavedCostUSD float64 + SavedTokens int64 + type FormatRule struct + Enabled bool + Fix func(string) string + Name string + Pattern *regexp.Regexp + type FormattedResponse struct + Changes []string + Formatted string + Original string + TokensDiff int + type ResponseCache struct + Entries map[string]*CacheEntry + HitCount int64 + MaxAge time.Duration + MaxEntries int + MissCount int64 + func NewResponseCache(maxEntries int, maxAge time.Duration) *ResponseCache + func (rc *ResponseCache) EvictLRU() + func (rc *ResponseCache) Export() ([]byte, error) + func (rc *ResponseCache) FormatStats() string + func (rc *ResponseCache) Get(prompt, model string) (*CacheEntry, bool) + func (rc *ResponseCache) Import(data []byte) error + func (rc *ResponseCache) Invalidate(pattern string) + func (rc *ResponseCache) InvalidateByAge(maxAge time.Duration) + func (rc *ResponseCache) Set(prompt, response, model string, tokens int) + func (rc *ResponseCache) SimilarityMatch(prompt string, threshold float64) (*CacheEntry, float64) + func (rc *ResponseCache) Stats() CacheStats + type ResponseFormatter struct + Rules []FormatRule + func NewResponseFormatter() *ResponseFormatter + func (rf *ResponseFormatter) AddRule(rule FormatRule) + func (rf *ResponseFormatter) DisableRule(name string) + func (rf *ResponseFormatter) EnableRule(name string) + func (rf *ResponseFormatter) Format(response string) *FormattedResponse + type SteeringMessage struct + Content string + Priority int + type SteeringQueue struct + func NewSteeringQueue() *SteeringQueue + func (sq *SteeringQueue) Clear() + func (sq *SteeringQueue) Drain() []SteeringMessage + func (sq *SteeringQueue) Enqueue(msg SteeringMessage) + func (sq *SteeringQueue) HasPending() bool + func (sq *SteeringQueue) Notify() <-chan struct{} + type StreamOptimizer struct + BufferSize int + DeduplicateRepeats bool + MinFlushInterval time.Duration + ProgressiveRender bool + func NewStreamOptimizer() *StreamOptimizer + func (s *StreamOptimizer) DetectIncomplete(buffer string) (complete, remainder string) + func (s *StreamOptimizer) DetectStutter(buffer string) string + func (s *StreamOptimizer) OptimizeToolOutput(output string) string + func (s *StreamOptimizer) Process(ch <-chan string) <-chan string + func (s *StreamOptimizer) ProgressIndicator(elapsed time.Duration, charsReceived int) string + func (s *StreamOptimizer) Reset() + func (s *StreamOptimizer) ShouldFlush() bool + func (s *StreamOptimizer) Stats() StreamStats + func (s *StreamOptimizer) WordWrap(text string, width int) string + type StreamStats struct + AvgFlushSize int + BufferedChars int + CharsPerSecond float64 + DeduplicatedChars int + Duration time.Duration + FlushCount int + TotalChars int + type ThinkingPhase string + const PhaseExecute + const PhasePlan + const PhaseReflect + const PhaseUnderstand + const PhaseVerify + type ThinkingProtocol struct + CurrentPhase ThinkingPhase + Enabled bool + Steps []ThinkingStep + Visible bool + func NewThinkingProtocol() *ThinkingProtocol + func (tp *ThinkingProtocol) AddAlternative(thought, alternative string) + func (tp *ThinkingProtocol) AddThought(content string, confidence float64) + func (tp *ThinkingProtocol) BuildThinkingPrompt(task string) string + func (tp *ThinkingProtocol) FormatThinking(steps []ThinkingStep) string + func (tp *ThinkingProtocol) GetPhaseHistory() map[ThinkingPhase][]ThinkingStep + func (tp *ThinkingProtocol) ParseThinking(response string) []ThinkingStep + func (tp *ThinkingProtocol) ResetForNewTask() + func (tp *ThinkingProtocol) ShouldThinkFirst(task string) bool + func (tp *ThinkingProtocol) StartPhase(phase ThinkingPhase) + func (tp *ThinkingProtocol) SummarizeThinking() string + type ThinkingStep struct + Alternatives []string + Confidence float64 + Content string + Duration time.Duration + Phase ThinkingPhase + Timestamp time.Time