Documentation
¶
Index ¶
- Variables
- func AnimationCmd() tea.Cmd
- func ApplySyntaxHighlighting(content string) string
- func BatchStreamChunks(chunks []string) tea.Cmd
- func DefaultKeyMap() keyMap
- func ErrorIndicator(message string) string
- func ExtractFileName(uri string) string
- func ExtractFilePath(uri string) string
- func FadeInEffect(text string, step int, maxSteps int) string
- func FilterCompletionItems(items []lsp.CompletionItem, prefix string) []lsp.CompletionItem
- func FindReferences(ctx context.Context, m *Model, documentURI string, line, char int, ...) error
- func FormatAssistantMessage(content string) string
- func FormatError(err error) string
- func FormatHoverContent(content lsp.MarkupContent) string
- func FormatLocation(location lsp.Location) string
- func FormatSystemMessage(content string) string
- func FormatThinkingContent(content string, config ThinkingConfig) string
- func FormatUserMessage(content string) string
- func GetCollapsedIcon() string
- func GetCompletionKindIcon(kind lsp.CompletionItemKind) string
- func GetContextualHelp(mode string, streaming bool) []string
- func GetDepthColor(depth int) lipgloss.Color
- func GetDepthPrefix(depth int, isLast bool) string
- func GetExpandedIcon() string
- func GetThinkingIcon() string
- func GotoDefinition(ctx context.Context, m *Model, documentURI string, line, char int) error
- func HandleAPIError(err error) tea.Cmd
- func InsertCompletion(m *Model)
- func LoadingIndicator(message string) string
- func ProcessUserInput(input string, apiKey string) tea.Cmd
- func PulseAnimation(text string, tick int) string
- func RenderAllThinkingBlocks(state *ThinkingState, config ThinkingConfig) string
- func RenderCompletion(m *Model) string
- func RenderHover(m *Model) string
- func RenderInlineHelp(hints []string) string
- func RenderMinimalStatusBar(isStreaming bool, hasError bool) string
- func RenderNavigation(m *Model) string
- func RenderProgressBar(progress float64, width int) string
- func RenderThinkingBlock(block *ThinkingBlock, config ThinkingConfig) string
- func RenderThinkingHeader(state *ThinkingState) string
- func RenderThinkingSummary(state *ThinkingState) string
- func RenderThinkingToggleHint(showThinking bool) string
- func RequestCompletion(ctx context.Context, m *Model, params lsp.CompletionParams) ([]lsp.CompletionItem, error)
- func RequestDefinition(ctx context.Context, m *Model, params lsp.DefinitionParams) ([]lsp.Location, error)
- func RequestHover(ctx context.Context, m *Model, params lsp.HoverParams) (*lsp.Hover, error)
- func RequestReferences(ctx context.Context, m *Model, params lsp.ReferencesParams) ([]lsp.Location, error)
- func SendCollapseAllThinking() tea.Cmd
- func SendError(err error) tea.Cmd
- func SendExpandAllThinking() tea.Cmd
- func SendFeedbackPrompt(interactionID string) tea.Cmd
- func SendFeedbackSubmitted(interactionID string, rating int, comment string) tea.Cmd
- func SendImplicitFeedback(action string) tea.Cmd
- func SendReady() tea.Cmd
- func SendStreamChunk(content string) tea.Cmd
- func SendStreamDone() tea.Cmd
- func SendThinkingChunk(content string, depth int) tea.Cmd
- func SendThinkingDone() tea.Cmd
- func SendToggleThinking() tea.Cmd
- func SendUserInput(input string) tea.Cmd
- func SortCompletionItems(items []lsp.CompletionItem) []lsp.CompletionItem
- func StreamResponse(reader io.Reader) tea.Cmd
- func StreamingIndicator(tick int) string
- func SuccessIndicator(message string) string
- func ThinkingBorderStyle(depth int) lipgloss.Style
- func ThinkingIndentStyle(depth int) lipgloss.Style
- func ThinkingIndicator(tick int) string
- func TriggerCompletion(ctx context.Context, m *Model, documentURI string, line, char int) error
- func TriggerHover(ctx context.Context, m *Model, documentURI string, line, char int) error
- func TypewriterEffect(text string, position int) string
- func WaitForStream(done <-chan struct{}) tea.Cmd
- func WrapThinkingContent(content string, width int) string
- type AnimationState
- func (a *AnimationState) GetElapsedTime() time.Duration
- func (a *AnimationState) Render() string
- func (a *AnimationState) SetProgress(progress float64)
- func (a *AnimationState) StartAnimation(animType AnimationType, message string)
- func (a *AnimationState) StopAnimation()
- func (a *AnimationState) UpdateMessage(message string)
- type AnimationTickMsg
- type AnimationType
- type CodeBlock
- type HelpState
- type KeyBinding
- type Message
- type Model
- func (m *Model) AddMessage(role, content string)
- func (m *Model) AddThinking(content string, depth int)
- func (m *Model) AppendThinking(content string)
- func (m *Model) CaptureInteraction(prompt, response, modelID string)
- func (m *Model) ClearCompletion()
- func (m *Model) ClearError()
- func (m *Model) ClearHover()
- func (m *Model) ClearMessages()
- func (m *Model) ClearNavigation()
- func (m *Model) ClearThinking()
- func (m *Model) CollapseAllThinking()
- func (m *Model) DisableSyntaxHighlighting()
- func (m *Model) DismissFeedbackPrompt()
- func (m *Model) EnableSyntaxHighlighting()
- func (m *Model) ExpandAllThinking()
- func (m *Model) GetFeedbackPromptModel() *rlhf.FeedbackPromptModel
- func (m *Model) GetHoverInfo() *lsp.Hover
- func (m *Model) GetLSPClient() *lsp.Client
- func (m *Model) GetLSPStatus() lsp.ConnectionStatus
- func (m *Model) GetNavigationResult() []lsp.Location
- func (m *Model) GetSelectedCompletion() *lsp.CompletionItem
- func (m *Model) GetShowCompletion() bool
- func (m *Model) GetShowFeedbackPrompt() bool
- func (m *Model) GetShowHover() bool
- func (m *Model) GetShowNavigation() bool
- func (m *Model) GetSyntaxHighlighter() *syntax.Highlighter
- func (m *Model) GetThinkingConfig() ThinkingConfig
- func (m *Model) GetThinkingState() *ThinkingState
- func (m *Model) GetUserInput() string
- func (m Model) Init() tea.Cmd
- func (m *Model) IsLSPEnabled() bool
- func (m *Model) IsQuitting() bool
- func (m *Model) IsReady() bool
- func (m *Model) IsStreaming() bool
- func (m *Model) IsSyntaxHighlightingEnabled() bool
- func (m *Model) IsThinkingVisible() bool
- func (m *Model) NextCompletion()
- func (m *Model) PrevCompletion()
- func (m *Model) RecordExplicitFeedback(interactionID string, score float64, feedback string)
- func (m *Model) RecordImplicitFeedback(action rlhf.FeedbackAction)
- func (m *Model) SetCompletionItems(items []lsp.CompletionItem)
- func (m *Model) SetError(err error)
- func (m *Model) SetHoverInfo(hover *lsp.Hover)
- func (m *Model) SetNavigationResult(locations []lsp.Location)
- func (m *Model) SetQuitting(quitting bool)
- func (m *Model) SetRLHFCollector(collector *rlhf.Collector)
- func (m *Model) SetSize(width, height int)
- func (m *Model) SetStreaming(streaming bool)
- func (m *Model) SetThinkingConfig(config ThinkingConfig)
- func (m *Model) SetValue(value string)
- func (m *Model) ToggleThinkingDisplay()
- func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m Model) View() string
- type StatusBarState
- func (s *StatusBarState) AddTokens(tokens int)
- func (s *StatusBarState) ClearCustomMessage()
- func (s *StatusBarState) GetSessionDuration() time.Duration
- func (s *StatusBarState) IncrementAnimationTick()
- func (s *StatusBarState) RenderStatusBar(width int, isStreaming bool, hasError bool) string
- func (s *StatusBarState) SetConnectionStatus(ok bool)
- func (s *StatusBarState) SetCustomMessage(message string)
- func (s *StatusBarState) SetMode(mode string)
- func (s *StatusBarState) SetModel(model string)
- func (s *StatusBarState) SetProvider(provider string)
- func (s *StatusBarState) SetTokens(used, total int)
- func (s *StatusBarState) ToggleKeyHints()
- type ThinkingBlock
- type ThinkingConfig
- type ThinkingState
- func (ts *ThinkingState) AddThinkingBlock(content string, depth int) *ThinkingBlock
- func (ts *ThinkingState) AppendToCurrentBlock(content string)
- func (ts *ThinkingState) ClearBlocks()
- func (ts *ThinkingState) CollapseAll()
- func (ts *ThinkingState) ExpandAll()
- func (ts *ThinkingState) GetVisibleBlocks() []*ThinkingBlock
- func (ts *ThinkingState) ToggleAllBlocks(collapsed bool)
- func (ts *ThinkingState) ToggleBlock(blockID string)
- func (ts *ThinkingState) ToggleDisplay()
Constants ¶
This section is empty.
Variables ¶
var ( // Thinking block colors (depth-based) ThinkingColor0 = lipgloss.Color("141") // Light purple ThinkingColor1 = lipgloss.Color("105") // Medium purple ThinkingColor2 = lipgloss.Color("99") // Deep purple ThinkingColor3 = lipgloss.Color("63") // Dark purple // UI element colors ThinkingBorderColor = lipgloss.Color("240") // Gray border ThinkingHeaderColor = lipgloss.Color("13") // Magenta ThinkingTextColor = lipgloss.Color("252") // Light gray ThinkingMutedColor = lipgloss.Color("242") // Muted gray CollapsedIconColor = lipgloss.Color("11") // Yellow ExpandedIconColor = lipgloss.Color("10") // Green // Code highlighting colors CodeKeywordColor = lipgloss.Color("12") // Blue CodeStringColor = lipgloss.Color("10") // Green CodeCommentColor = lipgloss.Color("241") // Gray CodeNumberColor = lipgloss.Color("11") // Yellow CodeFunctionColor = lipgloss.Color("14") // Cyan )
Color palette for thinking visualization
var CodeBlockStyle = lipgloss.NewStyle(). Background(lipgloss.Color("235")). Foreground(lipgloss.Color("252")). Padding(1). MarginTop(1). MarginBottom(1)
CodeBlockStyle styles code blocks within thinking content
var CollapsedIndicatorStyle = lipgloss.NewStyle(). Foreground(CollapsedIconColor). Bold(true)
CollapsedIndicatorStyle styles the collapsed state indicator
var ExpandedIndicatorStyle = lipgloss.NewStyle(). Foreground(ExpandedIconColor). Bold(true)
ExpandedIndicatorStyle styles the expanded state indicator
var InlineCodeStyle = lipgloss.NewStyle(). Background(lipgloss.Color("236")). Foreground(CodeFunctionColor). Padding(0, 1)
InlineCodeStyle styles inline code snippets
var ThinkingContentStyle = lipgloss.NewStyle(). Foreground(ThinkingTextColor). PaddingLeft(2)
ThinkingContentStyle styles the thinking block content
var ThinkingHeaderStyle = lipgloss.NewStyle(). Foreground(ThinkingHeaderColor). Bold(true)
ThinkingHeaderStyle styles the thinking block header
var ThinkingLabelStyle = lipgloss.NewStyle(). Foreground(ThinkingMutedColor). Italic(true)
ThinkingLabelStyle styles the "Thinking" label
Functions ¶
func AnimationCmd ¶
AnimationCmd returns a command that sends animation ticks
func ApplySyntaxHighlighting ¶
ApplySyntaxHighlighting applies basic syntax highlighting to thinking content
func BatchStreamChunks ¶
BatchStreamChunks creates a command that batches multiple stream chunks This can improve performance for high-frequency streaming
func ErrorIndicator ¶
ErrorIndicator renders an error indicator
func ExtractFileName ¶
ExtractFileName extracts the file name from a URI
func ExtractFilePath ¶
ExtractFilePath extracts the full file path from a URI
func FadeInEffect ¶
FadeInEffect creates a fade-in effect using different brightness levels
func FilterCompletionItems ¶
func FilterCompletionItems(items []lsp.CompletionItem, prefix string) []lsp.CompletionItem
FilterCompletionItems filters completion items by prefix
func FindReferences ¶
func FindReferences(ctx context.Context, m *Model, documentURI string, line, char int, includeDeclaration bool) error
FindReferences finds all references to a symbol
func FormatAssistantMessage ¶
FormatAssistantMessage formats an assistant message for display
func FormatError ¶
FormatError formats an error message for display
func FormatHoverContent ¶
func FormatHoverContent(content lsp.MarkupContent) string
FormatHoverContent formats hover content based on its type
func FormatLocation ¶
FormatLocation formats a location for display
func FormatSystemMessage ¶
FormatSystemMessage formats a system message for display
func FormatThinkingContent ¶
func FormatThinkingContent(content string, config ThinkingConfig) string
FormatThinkingContent formats thinking content for display
func FormatUserMessage ¶
FormatUserMessage formats a user message for display
func GetCollapsedIcon ¶
func GetCollapsedIcon() string
GetCollapsedIcon returns the icon for collapsed state
func GetCompletionKindIcon ¶
func GetCompletionKindIcon(kind lsp.CompletionItemKind) string
GetCompletionKindIcon returns an icon for a completion item kind
func GetContextualHelp ¶
GetContextualHelp returns context-sensitive help text
func GetDepthColor ¶
GetDepthColor returns the color for a specific depth level
func GetDepthPrefix ¶
GetDepthPrefix returns the tree-style prefix for a depth level
func GetExpandedIcon ¶
func GetExpandedIcon() string
GetExpandedIcon returns the icon for expanded state
func GetThinkingIcon ¶
func GetThinkingIcon() string
GetThinkingIcon returns the icon for thinking blocks
func GotoDefinition ¶
GotoDefinition navigates to the definition of a symbol
func HandleAPIError ¶
HandleAPIError creates a command that handles API errors
func InsertCompletion ¶
func InsertCompletion(m *Model)
InsertCompletion inserts the selected completion into the input
func LoadingIndicator ¶
LoadingIndicator renders a simple loading indicator
func ProcessUserInput ¶
ProcessUserInput creates a command that processes user input and streams the response
func PulseAnimation ¶
PulseAnimation creates a pulsing effect for text
func RenderAllThinkingBlocks ¶
func RenderAllThinkingBlocks(state *ThinkingState, config ThinkingConfig) string
RenderAllThinkingBlocks renders all thinking blocks
func RenderCompletion ¶
RenderCompletion renders the completion popup
func RenderHover ¶
RenderHover renders the hover information popup
func RenderInlineHelp ¶
RenderInlineHelp renders a single-line help hint
func RenderMinimalStatusBar ¶
RenderMinimalStatusBar renders a minimal status bar (single line indicator)
func RenderNavigation ¶
RenderNavigation renders the navigation results popup
func RenderProgressBar ¶
RenderProgressBar renders a progress bar with the given completion percentage
func RenderThinkingBlock ¶
func RenderThinkingBlock(block *ThinkingBlock, config ThinkingConfig) string
RenderThinkingBlock renders a single thinking block with all styling
func RenderThinkingHeader ¶
func RenderThinkingHeader(state *ThinkingState) string
RenderThinkingHeader renders a header for the thinking section
func RenderThinkingSummary ¶
func RenderThinkingSummary(state *ThinkingState) string
RenderThinkingSummary renders a summary of thinking blocks
func RenderThinkingToggleHint ¶
RenderThinkingToggleHint renders a hint about the thinking toggle
func RequestCompletion ¶
func RequestCompletion(ctx context.Context, m *Model, params lsp.CompletionParams) ([]lsp.CompletionItem, error)
RequestCompletion requests completion items from LSP
func RequestDefinition ¶
func RequestDefinition(ctx context.Context, m *Model, params lsp.DefinitionParams) ([]lsp.Location, error)
RequestDefinition requests definition locations from LSP
func RequestHover ¶
RequestHover requests hover information from LSP
func RequestReferences ¶
func RequestReferences(ctx context.Context, m *Model, params lsp.ReferencesParams) ([]lsp.Location, error)
RequestReferences requests reference locations from LSP
func SendCollapseAllThinking ¶
SendCollapseAllThinking creates a command to collapse all thinking
func SendExpandAllThinking ¶
SendExpandAllThinking creates a command to expand all thinking
func SendFeedbackPrompt ¶
SendFeedbackPrompt creates a command to show feedback prompt
func SendFeedbackSubmitted ¶
SendFeedbackSubmitted creates a command for submitted feedback
func SendImplicitFeedback ¶
SendImplicitFeedback creates a command to record implicit feedback
func SendStreamChunk ¶
SendStreamChunk creates a command that sends a stream chunk
func SendStreamDone ¶
SendStreamDone creates a command that sends a stream done message
func SendThinkingChunk ¶
SendThinkingChunk creates a command that sends a thinking chunk
func SendThinkingDone ¶
SendThinkingDone creates a command that sends a thinking done message
func SendToggleThinking ¶
SendToggleThinking creates a command that toggles thinking display
func SendUserInput ¶
SendUserInput creates a command that sends user input
func SortCompletionItems ¶
func SortCompletionItems(items []lsp.CompletionItem) []lsp.CompletionItem
SortCompletionItems sorts completion items by relevance
func StreamResponse ¶
StreamResponse creates a command that streams API responses This is a more generic streaming handler that can be composed
func StreamingIndicator ¶
StreamingIndicator renders a streaming indicator
func SuccessIndicator ¶
SuccessIndicator renders a success indicator
func ThinkingBorderStyle ¶
ThinkingBorderStyle creates a border style for thinking blocks
func ThinkingIndentStyle ¶
ThinkingIndentStyle creates indentation for nested thinking
func ThinkingIndicator ¶
ThinkingIndicator renders a thinking indicator with animated dots
func TriggerCompletion ¶
TriggerCompletion triggers completion at the current cursor position
func TriggerHover ¶
TriggerHover triggers hover information at the current position
func TypewriterEffect ¶
TypewriterEffect simulates a typewriter effect for text
func WaitForStream ¶
WaitForStream creates a command that waits for streaming to complete This can be used for synchronization or timeout handling
func WrapThinkingContent ¶
WrapThinkingContent wraps thinking content to a specific width
Types ¶
type AnimationState ¶
type AnimationState struct {
Spinner spinner.Model
AnimationType AnimationType
Message string
Progress float64 // 0.0 to 1.0 for progress bars
StartTime time.Time
Visible bool
}
AnimationState manages all animation state
func NewAnimationState ¶
func NewAnimationState() *AnimationState
NewAnimationState creates a new animation state with default settings
func (*AnimationState) GetElapsedTime ¶
func (a *AnimationState) GetElapsedTime() time.Duration
GetElapsedTime returns the time elapsed since animation started
func (*AnimationState) Render ¶
func (a *AnimationState) Render() string
Render renders the animation based on current state
func (*AnimationState) SetProgress ¶
func (a *AnimationState) SetProgress(progress float64)
SetProgress updates the progress value (0.0 to 1.0)
func (*AnimationState) StartAnimation ¶
func (a *AnimationState) StartAnimation(animType AnimationType, message string)
StartAnimation starts an animation with the given type and message
func (*AnimationState) StopAnimation ¶
func (a *AnimationState) StopAnimation()
StopAnimation stops the current animation
func (*AnimationState) UpdateMessage ¶
func (a *AnimationState) UpdateMessage(message string)
UpdateMessage updates the animation message
type AnimationTickMsg ¶
AnimationTickMsg is sent to update animation state
type AnimationType ¶
type AnimationType int
AnimationType represents the type of animation to display
const ( AnimationNone AnimationType = iota AnimationLoading AnimationThinking AnimationProcessing AnimationSuccess AnimationError )
type CodeBlock ¶
CodeBlock represents a code block extracted from markdown
func ExtractCodeBlocks ¶
ExtractCodeBlocks extracts code blocks from markdown
type HelpState ¶
type HelpState struct {
Visible bool
FullHelp bool // false = compact, true = full
CurrentCategory string
HelpModel help.Model
}
HelpState manages the help overlay state
func (*HelpState) RenderHelp ¶
RenderHelp renders the help overlay
func (*HelpState) SetCategory ¶
SetCategory sets the current help category
func (*HelpState) ToggleFullHelp ¶
func (h *HelpState) ToggleFullHelp()
ToggleFullHelp toggles between compact and full help
type KeyBinding ¶
type KeyBinding struct {
Key string
Description string
Category string // "navigation", "editing", "view", "system"
}
KeyBinding represents a keyboard shortcut
func GetAllKeyBindings ¶
func GetAllKeyBindings() []KeyBinding
GetAllKeyBindings returns all available key bindings
func GetKeyBindingsByCategory ¶
func GetKeyBindingsByCategory(category string) []KeyBinding
GetKeyBindingsByCategory returns key bindings filtered by category
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model represents the TUI application state
func NewModelWithLSP ¶
NewModelWithLSP creates a new TUI model with LSP enabled
func (*Model) AddMessage ¶
AddMessage adds a new message to the conversation
func (*Model) AddThinking ¶
AddThinking adds a new thinking block
func (*Model) AppendThinking ¶
AppendThinking appends content to the current thinking block
func (*Model) CaptureInteraction ¶
CaptureInteraction captures an interaction for RLHF
func (*Model) ClearCompletion ¶
func (m *Model) ClearCompletion()
ClearCompletion clears the completion popup
func (*Model) ClearNavigation ¶
func (m *Model) ClearNavigation()
ClearNavigation clears the navigation result
func (*Model) ClearThinking ¶
func (m *Model) ClearThinking()
ClearThinking removes all thinking blocks
func (*Model) CollapseAllThinking ¶
func (m *Model) CollapseAllThinking()
CollapseAllThinking collapses all thinking blocks
func (*Model) DisableSyntaxHighlighting ¶
func (m *Model) DisableSyntaxHighlighting()
DisableSyntaxHighlighting disables syntax highlighting
func (*Model) DismissFeedbackPrompt ¶
func (m *Model) DismissFeedbackPrompt()
DismissFeedbackPrompt dismisses the feedback prompt
func (*Model) EnableSyntaxHighlighting ¶
func (m *Model) EnableSyntaxHighlighting()
EnableSyntaxHighlighting enables syntax highlighting
func (*Model) ExpandAllThinking ¶
func (m *Model) ExpandAllThinking()
ExpandAllThinking expands all thinking blocks
func (*Model) GetFeedbackPromptModel ¶
func (m *Model) GetFeedbackPromptModel() *rlhf.FeedbackPromptModel
GetFeedbackPromptModel returns the feedback prompt model
func (*Model) GetHoverInfo ¶
GetHoverInfo returns the hover information
func (*Model) GetLSPClient ¶
GetLSPClient returns the LSP client
func (*Model) GetLSPStatus ¶
func (m *Model) GetLSPStatus() lsp.ConnectionStatus
GetLSPStatus returns the LSP connection status
func (*Model) GetNavigationResult ¶
GetNavigationResult returns the navigation results
func (*Model) GetSelectedCompletion ¶
func (m *Model) GetSelectedCompletion() *lsp.CompletionItem
GetSelectedCompletion returns the currently selected completion item
func (*Model) GetShowCompletion ¶
GetShowCompletion returns whether the completion popup is shown
func (*Model) GetShowFeedbackPrompt ¶
GetShowFeedbackPrompt returns whether the feedback prompt should be shown
func (*Model) GetShowHover ¶
GetShowHover returns whether the hover popup is shown
func (*Model) GetShowNavigation ¶
GetShowNavigation returns whether the navigation popup is shown
func (*Model) GetSyntaxHighlighter ¶
func (m *Model) GetSyntaxHighlighter() *syntax.Highlighter
GetSyntaxHighlighter returns the syntax highlighter
func (*Model) GetThinkingConfig ¶
func (m *Model) GetThinkingConfig() ThinkingConfig
GetThinkingConfig returns the thinking configuration
func (*Model) GetThinkingState ¶
func (m *Model) GetThinkingState() *ThinkingState
GetThinkingState returns the thinking state
func (*Model) GetUserInput ¶
GetUserInput returns and clears the current input
func (Model) Init ¶
Init initializes the TUI and returns initial commands This function is called once when the Bubble Tea program starts
func (*Model) IsLSPEnabled ¶
IsLSPEnabled returns whether LSP is enabled
func (*Model) IsQuitting ¶
IsQuitting returns whether the TUI is quitting
func (*Model) IsStreaming ¶
IsStreaming returns whether a response is being streamed
func (*Model) IsSyntaxHighlightingEnabled ¶
IsSyntaxHighlightingEnabled returns whether syntax highlighting is enabled
func (*Model) IsThinkingVisible ¶
IsThinkingVisible returns whether thinking blocks are visible
func (*Model) NextCompletion ¶
func (m *Model) NextCompletion()
NextCompletion moves to the next completion item
func (*Model) PrevCompletion ¶
func (m *Model) PrevCompletion()
PrevCompletion moves to the previous completion item
func (*Model) RecordExplicitFeedback ¶
RecordExplicitFeedback records explicit user feedback
func (*Model) RecordImplicitFeedback ¶
func (m *Model) RecordImplicitFeedback(action rlhf.FeedbackAction)
RecordImplicitFeedback records an implicit feedback signal
func (*Model) SetCompletionItems ¶
func (m *Model) SetCompletionItems(items []lsp.CompletionItem)
SetCompletionItems sets the completion items
func (*Model) SetHoverInfo ¶
SetHoverInfo sets the hover information
func (*Model) SetNavigationResult ¶
SetNavigationResult sets the navigation result
func (*Model) SetQuitting ¶
SetQuitting sets the quitting state
func (*Model) SetRLHFCollector ¶
SetRLHFCollector sets the RLHF collector
func (*Model) SetStreaming ¶
SetStreaming sets the streaming state
func (*Model) SetThinkingConfig ¶
func (m *Model) SetThinkingConfig(config ThinkingConfig)
SetThinkingConfig sets the thinking configuration
func (*Model) ToggleThinkingDisplay ¶
func (m *Model) ToggleThinkingDisplay()
ToggleThinkingDisplay toggles the display of thinking blocks
type StatusBarState ¶
type StatusBarState struct {
Provider string
Model string
TokensUsed int
TokensTotal int
SessionStart time.Time
ConnectionOK bool
CurrentMode string // "chat", "help", "settings", etc.
CustomMessage string
ShowKeyHints bool
AnimationTick int // For animated elements
}
StatusBarState represents the state of the status bar
func NewStatusBarState ¶
func NewStatusBarState() *StatusBarState
NewStatusBarState creates a new status bar state with defaults
func (*StatusBarState) AddTokens ¶
func (s *StatusBarState) AddTokens(tokens int)
AddTokens adds to the token count
func (*StatusBarState) ClearCustomMessage ¶
func (s *StatusBarState) ClearCustomMessage()
ClearCustomMessage clears the custom message
func (*StatusBarState) GetSessionDuration ¶
func (s *StatusBarState) GetSessionDuration() time.Duration
GetSessionDuration returns the duration of the current session
func (*StatusBarState) IncrementAnimationTick ¶
func (s *StatusBarState) IncrementAnimationTick()
IncrementAnimationTick increments the animation tick counter
func (*StatusBarState) RenderStatusBar ¶
func (s *StatusBarState) RenderStatusBar(width int, isStreaming bool, hasError bool) string
RenderStatusBar renders the complete status bar
func (*StatusBarState) SetConnectionStatus ¶
func (s *StatusBarState) SetConnectionStatus(ok bool)
SetConnectionStatus sets the connection status
func (*StatusBarState) SetCustomMessage ¶
func (s *StatusBarState) SetCustomMessage(message string)
SetCustomMessage sets a custom message to display
func (*StatusBarState) SetMode ¶
func (s *StatusBarState) SetMode(mode string)
SetMode sets the current mode
func (*StatusBarState) SetModel ¶
func (s *StatusBarState) SetModel(model string)
SetModel sets the AI model name
func (*StatusBarState) SetProvider ¶
func (s *StatusBarState) SetProvider(provider string)
SetProvider sets the AI provider name
func (*StatusBarState) SetTokens ¶
func (s *StatusBarState) SetTokens(used, total int)
SetTokens sets the token usage
func (*StatusBarState) ToggleKeyHints ¶
func (s *StatusBarState) ToggleKeyHints()
ToggleKeyHints toggles the display of keyboard hints
type ThinkingBlock ¶
type ThinkingBlock struct {
ID string // Unique identifier
Content string // Thinking content
Depth int // Nesting depth (0 = root)
Collapsed bool // Whether the block is collapsed
Timestamp time.Time // When the thinking occurred
Children []*ThinkingBlock // Nested thinking blocks
}
ThinkingBlock represents a collapsible thinking content block
func (*ThinkingBlock) AddChild ¶
func (tb *ThinkingBlock) AddChild(child *ThinkingBlock)
AddChild adds a child thinking block
func (*ThinkingBlock) GetDepthIndicator ¶
func (tb *ThinkingBlock) GetDepthIndicator() string
GetDepthIndicator returns a visual indicator for the depth level
func (*ThinkingBlock) GetLineCount ¶
func (tb *ThinkingBlock) GetLineCount() int
GetLineCount returns the number of lines in the thinking content
func (*ThinkingBlock) GetPreview ¶
func (tb *ThinkingBlock) GetPreview(maxLength int) string
GetPreview returns a preview of the thinking content (first line)
func (*ThinkingBlock) HasChildren ¶
func (tb *ThinkingBlock) HasChildren() bool
HasChildren returns whether the block has nested children
func (*ThinkingBlock) IsCollapsed ¶
func (tb *ThinkingBlock) IsCollapsed() bool
IsCollapsed returns whether a block is collapsed
type ThinkingConfig ¶
type ThinkingConfig struct {
ShowThinking bool // Whether to show thinking blocks
CollapseByDefault bool // Whether new blocks start collapsed
MaxPreviewLength int // Maximum length of preview text
SyntaxHighlighting bool // Whether to apply syntax highlighting
ShowTimestamps bool // Whether to show timestamps
ShowDepthIndicator bool // Whether to show depth indicators
}
ThinkingConfig holds configuration for thinking visualization
func DefaultThinkingConfig ¶
func DefaultThinkingConfig() ThinkingConfig
DefaultThinkingConfig returns default configuration
type ThinkingState ¶
type ThinkingState struct {
Blocks []*ThinkingBlock // All thinking blocks in order
ShowThinking bool // Whether to show thinking blocks
CurrentBlock *ThinkingBlock // Currently active/focused block
BlocksByID map[string]*ThinkingBlock // Quick lookup by ID
// contains filtered or unexported fields
}
ThinkingState manages the state of all thinking blocks
func NewThinkingState ¶
func NewThinkingState() *ThinkingState
NewThinkingState creates a new thinking state manager
func (*ThinkingState) AddThinkingBlock ¶
func (ts *ThinkingState) AddThinkingBlock(content string, depth int) *ThinkingBlock
AddThinkingBlock creates and adds a new thinking block
func (*ThinkingState) AppendToCurrentBlock ¶
func (ts *ThinkingState) AppendToCurrentBlock(content string)
AppendToCurrentBlock appends content to the currently active block
func (*ThinkingState) ClearBlocks ¶
func (ts *ThinkingState) ClearBlocks()
ClearBlocks removes all thinking blocks
func (*ThinkingState) CollapseAll ¶
func (ts *ThinkingState) CollapseAll()
CollapseAll collapses all thinking blocks
func (*ThinkingState) ExpandAll ¶
func (ts *ThinkingState) ExpandAll()
ExpandAll expands all thinking blocks
func (*ThinkingState) GetVisibleBlocks ¶
func (ts *ThinkingState) GetVisibleBlocks() []*ThinkingBlock
GetVisibleBlocks returns blocks that should be displayed
func (*ThinkingState) ToggleAllBlocks ¶
func (ts *ThinkingState) ToggleAllBlocks(collapsed bool)
ToggleAllBlocks toggles all blocks to collapsed/expanded
func (*ThinkingState) ToggleBlock ¶
func (ts *ThinkingState) ToggleBlock(blockID string)
ToggleBlock toggles the collapsed state of a block by ID
func (*ThinkingState) ToggleDisplay ¶
func (ts *ThinkingState) ToggleDisplay()
ToggleDisplay toggles whether thinking blocks are shown