ui

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 31 Imported by: 0

Documentation

Overview

Package ui provides the Bubble Tea terminal user interface components. ABOUTME: Tool approval UI component for displaying and handling tool approval prompts ABOUTME: Shows formatted tool information with risk levels and interactive approval controls

Package ui provides the Bubble Tea terminal user interface components. ABOUTME: Bubbletea model for interactive chat UI ABOUTME: Manages state, messages, input, viewport, and streaming

Package ui provides Neo-Terminal rendering functions for sophisticated message display. ABOUTME: Neo-Terminal renderer - elegant bordered message containers with rich visual hierarchy ABOUTME: Implements Swiss typography meets cyberdeck aesthetic for terminal interfaces

Package ui provides overlay management for modal/popup interfaces

Package ui provides the Bubble Tea terminal user interface components. ABOUTME: Quick actions menu system for keyboard shortcuts ABOUTME: Provides fuzzy-searchable command palette for tools and actions

Package ui provides TUI components including the session picker for resuming conversations. ABOUTME: Shows list of recent conversations with title, time, and model info

Package ui provides the Bubble Tea terminal user interface components. ABOUTME: Spinner component for showing loading and tool execution states ABOUTME: Provides animated spinners with different styles for various operations

Package ui provides the Bubble Tea terminal user interface components. ABOUTME: Status bar component for displaying connection, token, and mode information ABOUTME: Provides comprehensive bottom status bar with color-coded indicators

Package ui provides the Bubble Tea terminal user interface components. ABOUTME: Streaming UI enhancements for displaying streaming responses ABOUTME: Provides token rate display, progressive rendering, and typewriter effects

Package ui provides the Bubble Tea terminal user interface components. ABOUTME: Tool output log functionality for displaying tool execution output ABOUTME: Collapsed 3-line view with Ctrl+O overlay for full log

Package ui provides the Bubble Tea terminal user interface components. ABOUTME: Bubbletea update function for handling events ABOUTME: Processes keyboard input, window resize, streaming chunks

Package ui provides the Bubble Tea terminal user interface components. ABOUTME: Bubbletea view function for rendering UI ABOUTME: Renders viewport with messages and input textarea

Index

Constants

View Source
const (
	FeedbackAccepted = suggestions.FeedbackAccepted
	FeedbackRejected = suggestions.FeedbackRejected
	FeedbackIgnored  = suggestions.FeedbackIgnored
)

Feedback constants

View Source
const MaxQueueSize = 100

MaxQueueSize is the maximum number of messages that can be queued

Variables

This section is empty.

Functions

func DetectProvider

func DetectProvider(input string) string

DetectProvider determines which provider to use based on input context

func ParseActionCommand

func ParseActionCommand(input string) (command, args string)

ParseActionCommand splits a command input into command and arguments

func ToolTimelineOverlayScrollToBottom added in v1.9.0

func ToolTimelineOverlayScrollToBottom(overlay *GenericFullscreenOverlay)

ToolTimelineOverlayScrollToBottom is a helper to scroll to bottom after creation Call this after OnPush to auto-scroll to most recent tools

Types

type ApprovalPrompt

type ApprovalPrompt struct {
	// contains filtered or unexported fields
}

ApprovalPrompt manages the tool approval UI

func NewApprovalPrompt

func NewApprovalPrompt(toolUse *core.ToolUse) *ApprovalPrompt

NewApprovalPrompt creates a new approval prompt for a tool use

func (*ApprovalPrompt) SetWidth

func (a *ApprovalPrompt) SetWidth(width int)

SetWidth sets the width of the approval prompt

func (*ApprovalPrompt) ToggleDetails

func (a *ApprovalPrompt) ToggleDetails()

ToggleDetails toggles the detailed view

func (*ApprovalPrompt) View

func (a *ApprovalPrompt) View() string

View renders the approval prompt

type ApprovalType added in v1.7.0

type ApprovalType int

ApprovalType represents how a tool was approved or denied

const (
	ApprovalPending ApprovalType = iota
	ApprovalManual
	ApprovalAlwaysAllow
	DenialManual
	DenialNeverAllow
)

type Autocomplete

type Autocomplete struct {
	// contains filtered or unexported fields
}

Autocomplete manages completion state and providers

func NewAutocomplete

func NewAutocomplete() *Autocomplete

NewAutocomplete creates a new autocomplete instance

func (*Autocomplete) GetCompletions

func (ac *Autocomplete) GetCompletions() []Completion

GetCompletions returns all current completions

func (*Autocomplete) GetProvider

func (ac *Autocomplete) GetProvider(name string) (CompletionProvider, bool)

GetProvider retrieves a registered provider by name

func (*Autocomplete) GetSelected

func (ac *Autocomplete) GetSelected() *Completion

GetSelected returns the currently selected completion

func (*Autocomplete) GetSelectedIndex

func (ac *Autocomplete) GetSelectedIndex() int

GetSelectedIndex returns the current selection index

func (*Autocomplete) Hide

func (ac *Autocomplete) Hide()

Hide deactivates autocomplete

func (*Autocomplete) IsActive

func (ac *Autocomplete) IsActive() bool

IsActive returns whether autocomplete is currently showing

func (*Autocomplete) Next

func (ac *Autocomplete) Next()

Next moves selection to next completion

func (*Autocomplete) Previous

func (ac *Autocomplete) Previous()

Previous moves selection to previous completion

func (*Autocomplete) RegisterProvider

func (ac *Autocomplete) RegisterProvider(name string, provider CompletionProvider)

RegisterProvider adds a completion provider

func (*Autocomplete) Show

func (ac *Autocomplete) Show(input string, providerName string)

Show activates autocomplete for the given input and provider

func (*Autocomplete) Update

func (ac *Autocomplete) Update(input string)

Update refreshes completions based on new input

type AutocompleteOverlay added in v1.7.0

type AutocompleteOverlay struct {
	*GenericBottomOverlay
	// contains filtered or unexported fields
}

AutocompleteOverlay wraps GenericBottomOverlay for autocomplete.

func NewAutocompleteOverlay added in v1.7.0

func NewAutocompleteOverlay(m *Model) *AutocompleteOverlay

NewAutocompleteOverlay creates a new autocomplete overlay

type AutocompleteProvider added in v1.9.0

type AutocompleteProvider struct {
	// contains filtered or unexported fields
}

AutocompleteProvider provides content for the autocomplete overlay. It implements BottomContentProvider, BottomKeyHandler, BottomActivationHandler, and BottomCancelHandler.

func (*AutocompleteProvider) Cancel added in v1.9.0

func (p *AutocompleteProvider) Cancel() tea.Cmd

Cancel implements BottomCancelHandler

func (*AutocompleteProvider) Content added in v1.9.0

func (p *AutocompleteProvider) Content() string

Content implements BottomContentProvider

func (*AutocompleteProvider) DesiredHeight added in v1.9.0

func (p *AutocompleteProvider) DesiredHeight() int

DesiredHeight implements BottomContentProvider

func (*AutocompleteProvider) Footer added in v1.9.0

func (p *AutocompleteProvider) Footer() string

Footer implements BottomContentProvider

func (*AutocompleteProvider) HandleKey added in v1.9.0

func (p *AutocompleteProvider) HandleKey(msg tea.KeyMsg) (bool, tea.Cmd)

HandleKey implements BottomKeyHandler

func (*AutocompleteProvider) Header added in v1.9.0

func (p *AutocompleteProvider) Header() string

Header implements BottomContentProvider

func (*AutocompleteProvider) OnActivate added in v1.9.0

func (p *AutocompleteProvider) OnActivate(width, height int)

OnActivate implements BottomActivationHandler

func (*AutocompleteProvider) OnDeactivate added in v1.9.0

func (p *AutocompleteProvider) OnDeactivate()

OnDeactivate implements BottomActivationHandler

type BottomActivationHandler added in v1.9.0

type BottomActivationHandler interface {
	OnActivate(width, height int)
	OnDeactivate()
}

BottomActivationHandler is an optional interface for activation/deactivation callbacks.

type BottomCancelHandler added in v1.9.0

type BottomCancelHandler interface {
	Cancel() tea.Cmd
}

BottomCancelHandler is an optional interface for custom cancel behavior. If not implemented, Cancel() returns nil.

type BottomContentProvider added in v1.9.0

type BottomContentProvider interface {
	// Header returns the header text (e.g., "Tool Approval Required")
	Header() string

	// Content returns the main content body
	Content() string

	// Footer returns the footer text (e.g., navigation hints)
	Footer() string

	// DesiredHeight returns the desired height for this overlay
	DesiredHeight() int
}

BottomContentProvider defines the interface for providing content to a generic bottom overlay. Implementations should be minimal - just return strings. All rendering and lifecycle logic is handled by GenericBottomOverlay.

Required methods: Header, Content, Footer, DesiredHeight (4 methods)

type BottomKeyHandler added in v1.9.0

type BottomKeyHandler interface {
	HandleKey(msg tea.KeyMsg) (handled bool, cmd tea.Cmd)
}

BottomKeyHandler is an optional interface for custom key handling. If not implemented, default behavior (Escape and Ctrl+C close the overlay) is used.

type Completion

type Completion struct {
	// Value is the actual completion text
	Value string
	// Display is what gets shown in the UI (may include formatting)
	Display string
	// Description provides context about the completion
	Description string
	// Score is used for ranking (higher is better)
	Score int
}

Completion represents a single completion suggestion

type CompletionProvider

type CompletionProvider interface {
	// GetCompletions returns completion suggestions for the given input
	GetCompletions(input string) []Completion
}

CompletionProvider is an interface for providing completion suggestions

type ConnectionStatus

type ConnectionStatus int

ConnectionStatus represents API connection state

const (
	// ConnectionDisconnected indicates no active connection
	ConnectionDisconnected ConnectionStatus = iota
	// ConnectionConnected indicates an active connection
	ConnectionConnected
	// ConnectionStreaming indicates an active streaming connection
	ConnectionStreaming
	// ConnectionError indicates a connection error
	ConnectionError
)

type Delta

type Delta = core.Delta

Delta is an alias for core.Delta for use in UI

type FeedbackType

type FeedbackType = suggestions.FeedbackType

FeedbackType represents user feedback

type FileProvider

type FileProvider struct {
	// contains filtered or unexported fields
}

FileProvider provides file path completions

func NewFileProvider

func NewFileProvider() *FileProvider

NewFileProvider creates a new file completion provider

func (*FileProvider) GetCompletions

func (fp *FileProvider) GetCompletions(input string) []Completion

GetCompletions returns file path completions

func (*FileProvider) SetBasePath

func (fp *FileProvider) SetBasePath(path string)

SetBasePath updates the base directory for file searching

type FooterProvider added in v1.9.0

type FooterProvider interface {
	Footer() string
}

FooterProvider is an optional interface for custom footer text. If not implemented, the footer defaults to the close hint (e.g., "Ctrl+H or Esc to close").

type FullscreenContentProvider added in v1.9.0

type FullscreenContentProvider interface {
	// Header returns the header text (e.g., "Help & Keyboard Shortcuts")
	Header() string

	// Content returns the scrollable content body
	Content() string

	// ToggleKeys returns the list of keys that should toggle this overlay closed (e.g., KeyCtrlH)
	// The close hint in the header AND default footer are auto-generated from these keys.
	// Escape and Ctrl+C always close the overlay regardless of this list.
	ToggleKeys() []tea.KeyType
}

FullscreenContentProvider defines the interface for providing content to a generic fullscreen overlay. Implementations should be minimal - just return strings. All viewport and lifecycle logic is handled by GenericFullscreenOverlay.

Required methods: Header, Content, ToggleKeys (3 methods) Optional: implement FooterProvider interface for custom footer text

type FullscreenOverlay added in v1.7.0

type FullscreenOverlay interface {
	Scrollable
	SetHeight(height int)
	IsFullscreen() bool
}

FullscreenOverlay represents a fullscreen modal with viewport

type GenericBottomOverlay added in v1.9.0

type GenericBottomOverlay struct {
	// contains filtered or unexported fields
}

GenericBottomOverlay is a reusable bottom overlay that delegates content generation to a BottomContentProvider. It handles ALL rendering logic and implements the Overlay interface.

func NewGenericBottomOverlay added in v1.9.0

func NewGenericBottomOverlay(provider BottomContentProvider, thm *theme.Theme) *GenericBottomOverlay

NewGenericBottomOverlay creates a new generic bottom overlay with the given content provider

func (*GenericBottomOverlay) Cancel added in v1.9.0

func (o *GenericBottomOverlay) Cancel() tea.Cmd

Cancel dismisses the overlay

func (*GenericBottomOverlay) GetContent added in v1.9.0

func (o *GenericBottomOverlay) GetContent() string

GetContent delegates to provider

func (*GenericBottomOverlay) GetDesiredHeight added in v1.9.0

func (o *GenericBottomOverlay) GetDesiredHeight() int

GetDesiredHeight delegates to provider

func (*GenericBottomOverlay) GetFooter added in v1.9.0

func (o *GenericBottomOverlay) GetFooter() string

GetFooter delegates to provider

func (*GenericBottomOverlay) GetHeader added in v1.9.0

func (o *GenericBottomOverlay) GetHeader() string

GetHeader delegates to provider

func (*GenericBottomOverlay) HandleKey added in v1.9.0

func (o *GenericBottomOverlay) HandleKey(msg tea.KeyMsg) (bool, tea.Cmd)

HandleKey processes input

func (*GenericBottomOverlay) OnPop added in v1.9.0

func (o *GenericBottomOverlay) OnPop()

OnPop cleans up the overlay

func (*GenericBottomOverlay) OnPush added in v1.9.0

func (o *GenericBottomOverlay) OnPush(width, height int)

OnPush initializes the overlay

func (*GenericBottomOverlay) Render added in v1.9.0

func (o *GenericBottomOverlay) Render(width, height int) string

Render returns the complete overlay rendering with theme-aware styling

type GenericFullscreenOverlay added in v1.9.0

type GenericFullscreenOverlay struct {
	// contains filtered or unexported fields
}

GenericFullscreenOverlay is a reusable fullscreen overlay that delegates content generation to a FullscreenContentProvider. It handles ALL viewport logic, rendering, and input handling.

func NewGenericFullscreenOverlay added in v1.9.0

func NewGenericFullscreenOverlay(provider FullscreenContentProvider) *GenericFullscreenOverlay

NewGenericFullscreenOverlay creates a new generic fullscreen overlay with the given content provider

func NewHelpOverlay added in v1.7.0

func NewHelpOverlay() *GenericFullscreenOverlay

NewHelpOverlay creates a new help overlay using the generic fullscreen wrapper

func NewHistoryOverlay added in v1.7.0

func NewHistoryOverlay(messages *[]Message) *GenericFullscreenOverlay

NewHistoryOverlay creates a new history overlay using the generic fullscreen wrapper

func NewToolTimelineOverlay added in v1.7.0

func NewToolTimelineOverlay(model *Model) *GenericFullscreenOverlay

NewToolTimelineOverlay creates a new tool timeline overlay using the generic fullscreen wrapper

func (*GenericFullscreenOverlay) Cancel added in v1.9.0

func (o *GenericFullscreenOverlay) Cancel() tea.Cmd

Cancel dismisses the overlay (no cleanup needed by default)

func (*GenericFullscreenOverlay) GetContent added in v1.9.0

func (o *GenericFullscreenOverlay) GetContent() string

GetContent delegates to provider

func (*GenericFullscreenOverlay) GetDesiredHeight added in v1.9.0

func (o *GenericFullscreenOverlay) GetDesiredHeight() int

GetDesiredHeight returns -1 (fullscreen)

func (*GenericFullscreenOverlay) GetFooter added in v1.9.0

func (o *GenericFullscreenOverlay) GetFooter() string

GetFooter returns custom footer if provider implements FooterProvider, otherwise returns the auto-generated close hint

func (*GenericFullscreenOverlay) GetHeader added in v1.9.0

func (o *GenericFullscreenOverlay) GetHeader() string

GetHeader delegates to provider

func (*GenericFullscreenOverlay) HandleKey added in v1.9.0

func (o *GenericFullscreenOverlay) HandleKey(msg tea.KeyMsg) (bool, tea.Cmd)

HandleKey processes input

func (*GenericFullscreenOverlay) IsFullscreen added in v1.9.0

func (o *GenericFullscreenOverlay) IsFullscreen() bool

IsFullscreen returns true

func (*GenericFullscreenOverlay) OnPop added in v1.9.0

func (o *GenericFullscreenOverlay) OnPop()

OnPop cleans up

func (*GenericFullscreenOverlay) OnPush added in v1.9.0

func (o *GenericFullscreenOverlay) OnPush(width, height int)

OnPush initializes viewport with content

func (*GenericFullscreenOverlay) Render added in v1.9.0

func (o *GenericFullscreenOverlay) Render(width, height int) string

Render returns the complete view with header, viewport content, and footer

func (*GenericFullscreenOverlay) SetHeight added in v1.9.0

func (o *GenericFullscreenOverlay) SetHeight(height int)

SetHeight updates viewport height

func (*GenericFullscreenOverlay) Update added in v1.9.0

func (o *GenericFullscreenOverlay) Update(msg tea.Msg) tea.Cmd

Update handles messages (viewport updates and window resize)

type HelpContentProvider added in v1.9.0

type HelpContentProvider struct{}

HelpContentProvider provides content for the help overlay

func (*HelpContentProvider) Content added in v1.9.0

func (p *HelpContentProvider) Content() string

Content returns the help text

func (*HelpContentProvider) Header added in v1.9.0

func (p *HelpContentProvider) Header() string

Header returns the help overlay header

func (*HelpContentProvider) ToggleKeys added in v1.9.0

func (p *HelpContentProvider) ToggleKeys() []tea.KeyType

ToggleKeys returns the keys that toggle the help overlay Both the header close hint AND footer are auto-generated from this

type HistoryContentProvider added in v1.9.0

type HistoryContentProvider struct {
	// contains filtered or unexported fields
}

HistoryContentProvider provides content for the conversation history overlay

func (*HistoryContentProvider) Content added in v1.9.0

func (p *HistoryContentProvider) Content() string

Content returns formatted message history

func (*HistoryContentProvider) Footer added in v1.9.0

func (p *HistoryContentProvider) Footer() string

Footer returns the custom footer with message count

func (*HistoryContentProvider) Header added in v1.9.0

func (p *HistoryContentProvider) Header() string

Header returns the history overlay header

func (*HistoryContentProvider) ToggleKeys added in v1.9.0

func (p *HistoryContentProvider) ToggleKeys() []tea.KeyType

ToggleKeys returns the keys that toggle the history overlay

type HistoryProvider

type HistoryProvider struct {
	// contains filtered or unexported fields
}

HistoryProvider provides command history completions

func NewHistoryProvider

func NewHistoryProvider() *HistoryProvider

NewHistoryProvider creates a new history completion provider

func (*HistoryProvider) AddToHistory

func (hp *HistoryProvider) AddToHistory(command string)

AddToHistory adds a command to history

func (*HistoryProvider) GetCompletions

func (hp *HistoryProvider) GetCompletions(input string) []Completion

GetCompletions returns history-based completions

type Message

type Message struct {
	Role         string
	Content      string
	ContentBlock []core.ContentBlock // For structured content like tool_result blocks
	Timestamp    time.Time           // When the message was created
	// contains filtered or unexported fields
}

Message represents a chat message in the UI

type Model

type Model struct {
	ConversationID string
	Model          string
	Messages       []Message
	Input          textarea.Model
	Viewport       viewport.Model
	Width          int
	Height         int
	Streaming      bool
	StreamingText  string
	Ready          bool
	ShowIntro      bool // Show intro screen in viewport initially

	// Task 5: Advanced UI Features
	CurrentView  ViewMode
	Status       Status
	ErrorMessage string
	TokensInput  int
	TokensOutput int
	SearchMode   bool
	SearchQuery  string

	// Phase 6C Task 5: Conversation Favorites
	IsFavorite bool // Track if current conversation is favorite
	// contains filtered or unexported fields
}

Model is the Bubbletea model for interactive mode

func NewModel

func NewModel(conversationID, model string) *Model

NewModel creates a new UI model

func (*Model) AcceptSuggestion

func (m *Model) AcceptSuggestion()

AcceptSuggestion accepts the top suggestion and applies it

func (*Model) AddMessage

func (m *Model) AddMessage(role, content string)

AddMessage adds a message to the conversation

func (*Model) AnalyzeSuggestions

func (m *Model) AnalyzeSuggestions()

AnalyzeSuggestions analyzes current input and updates suggestions

func (*Model) AppendStreamingText

func (m *Model) AppendStreamingText(chunk string)

AppendStreamingText adds a chunk to the streaming buffer and updates the last message in place

func (*Model) ClearContext added in v1.4.0

func (m *Model) ClearContext()

ClearContext resets the conversation context and UI state (for /clear command)

func (*Model) ClearConversation

func (m *Model) ClearConversation()

ClearConversation clears all messages

func (*Model) ClearScreen

func (m *Model) ClearScreen()

ClearScreen clears the viewport

func (*Model) ClearStreamingText

func (m *Model) ClearStreamingText()

ClearStreamingText discards streaming buffer (e.g., on error)

func (*Model) CommitStreamingText

func (m *Model) CommitStreamingText()

CommitStreamingText finalizes the streaming message The message is already in m.Messages (added as placeholder at stream start), so we just need to clear the streaming buffer

func (*Model) DismissSuggestions

func (m *Model) DismissSuggestions()

DismissSuggestions hides and clears suggestions

func (*Model) DrainQueue added in v1.11.0

func (m *Model) DrainQueue() []string

DrainQueue returns and clears all queued messages

func (*Model) EnterQuickActionsMode

func (m *Model) EnterQuickActionsMode()

EnterQuickActionsMode opens the quick actions menu

func (*Model) EnterSearchMode

func (m *Model) EnterSearchMode()

EnterSearchMode activates search mode

func (*Model) ExecuteQuickAction

func (m *Model) ExecuteQuickAction() error

ExecuteQuickAction executes the selected or first filtered action

func (*Model) ExitQuickActionsMode

func (m *Model) ExitQuickActionsMode()

ExitQuickActionsMode closes the quick actions menu

func (*Model) ExitSearchMode

func (m *Model) ExitSearchMode()

ExitSearchMode deactivates search mode

func (*Model) ExportConversation

func (m *Model) ExportConversation() string

ExportConversation exports the conversation to a string

func (*Model) GetAutocomplete

func (m *Model) GetAutocomplete() *Autocomplete

GetAutocomplete returns the autocomplete instance

func (*Model) GetPendingToolUses

func (m *Model) GetPendingToolUses() []*core.ToolUse

GetPendingToolUses returns the current pending tool uses for testing

func (*Model) GetPrunedMessages

func (m *Model) GetPrunedMessages() []core.Message

GetPrunedMessages returns messages pruned to fit context limit Filters out "tool" role messages (for UI display only) and includes ContentBlock for tool results

func (*Model) HandleToolDecision added in v1.7.0

func (m *Model) HandleToolDecision(decision int) tea.Cmd

HandleToolDecision processes the user's decision from the approval overlay

func (*Model) Init

func (m *Model) Init() tea.Cmd

Init initializes the model

func (*Model) IsToolApprovalOverlayActive added in v1.7.0

func (m *Model) IsToolApprovalOverlayActive() bool

IsToolApprovalOverlayActive returns true if the active overlay is a tool approval

func (*Model) LaunchQuickActionsForm

func (m *Model) LaunchQuickActionsForm() tea.Cmd

LaunchQuickActionsForm launches the quick actions form using huh

func (*Model) NextView

func (m *Model) NextView()

NextView cycles to the next view mode

func (*Model) PeekQueue added in v1.11.0

func (m *Model) PeekQueue() string

PeekQueue returns the first queued message without removing it

func (*Model) PopQueue added in v1.11.0

func (m *Model) PopQueue() string

PopQueue removes and returns the first queued message

func (*Model) ProcessNextTool added in v1.7.0

func (m *Model) ProcessNextTool() tea.Cmd

ProcessNextTool processes the next tool in the queue Returns a command to execute the tool or show an overlay

func (*Model) PushToolApprovalOverlays added in v1.7.0

func (m *Model) PushToolApprovalOverlays()

PushToolApprovalOverlays creates and pushes one overlay per pending tool. Overlays are pushed in reverse order so the first tool is on top of the stack.

func (*Model) QueueCount added in v1.11.0

func (m *Model) QueueCount() int

QueueCount returns the number of queued messages

func (*Model) QueueMessage added in v1.11.0

func (m *Model) QueueMessage(msg string) bool

QueueMessage adds a message to the queue for processing after current operation Returns false if the queue is full

func (*Model) RejectTopSuggestion

func (m *Model) RejectTopSuggestion()

RejectTopSuggestion explicitly rejects the top suggestion

func (*Model) RenderMessage

func (m *Model) RenderMessage(msg *Message) (string, error)

RenderMessage renders a message using glamour for assistant messages with caching

func (*Model) Requeue added in v1.11.0

func (m *Model) Requeue(messages []string)

Requeue adds messages back to the front of the queue

func (*Model) SaveConversation

func (m *Model) SaveConversation() error

SaveConversation saves the conversation (placeholder for future implementation)

func (*Model) SetAPIClient

func (m *Model) SetAPIClient(client *core.Client)

SetAPIClient sets the API client for streaming

func (*Model) SetContextManager

func (m *Model) SetContextManager(manager *ctxmgr.Manager)

SetContextManager sets the context manager and initializes context tracking

func (*Model) SetInputValue added in v1.7.0

func (m *Model) SetInputValue(value string)

SetInputValue sets the value of the input textarea (for testing)

func (*Model) SetServices added in v1.4.0

func (m *Model) SetServices(convSvc services.ConversationService, msgSvc services.MessageService, agentSvc services.AgentService)

SetServices sets the service layer dependencies

func (*Model) SetSlashCommands added in v1.7.0

func (m *Model) SetSlashCommands(commands []string, descriptions map[string]string)

SetSlashCommands sets the available slash commands for autocomplete

func (*Model) SetStatus

func (m *Model) SetStatus(status Status)

SetStatus sets the current UI status

func (*Model) SetSystemPrompt

func (m *Model) SetSystemPrompt(prompt string)

SetSystemPrompt sets the system prompt for this conversation

func (*Model) SetToolSystem

func (m *Model) SetToolSystem(registry *tools.Registry, executor *tools.Executor)

SetToolSystem sets the tool registry and executor

func (*Model) StartEventSubscriptions added in v1.4.0

func (m *Model) StartEventSubscriptions() tea.Cmd

StartEventSubscriptions initializes event subscriptions and returns commands to listen for events

func (*Model) ToggleFavorite

func (m *Model) ToggleFavorite() error

ToggleFavorite toggles the favorite status of the current conversation

func (*Model) ToggleHelp

func (m *Model) ToggleHelp()

ToggleHelp toggles the help display

func (*Model) ToggleTypewriter

func (m *Model) ToggleTypewriter()

ToggleTypewriter toggles typewriter mode

func (*Model) Update

func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles Bubbletea messages

func (*Model) UpdateQuickActionsInput

func (m *Model) UpdateQuickActionsInput(input string)

UpdateQuickActionsInput updates the search query and filters actions

func (*Model) UpdateSearchQuery

func (m *Model) UpdateSearchQuery(query string)

UpdateSearchQuery updates the search query

func (*Model) UpdateTokens

func (m *Model) UpdateTokens(input, output int)

UpdateTokens updates the token counters (cumulative across all messages in this session)

func (*Model) View

func (m *Model) View() string

View renders the UI

type Overlay added in v1.7.0

type Overlay interface {
	// Structured rendering
	GetHeader() string
	GetContent() string
	GetFooter() string
	Render(width, height int) string

	// Input handling
	HandleKey(msg tea.KeyMsg) (handled bool, cmd tea.Cmd)

	// Lifecycle
	OnPush(width, height int)
	OnPop()

	// Cancel is called when the overlay is dismissed via Escape/Ctrl+C.
	// Returns a command for any cleanup actions (e.g., sending denial to API).
	Cancel() tea.Cmd

	// Height management
	GetDesiredHeight() int
}

Overlay represents a modal interface that appears over the main content

type OverlayManager added in v1.7.0

type OverlayManager struct {
	// contains filtered or unexported fields
}

OverlayManager manages a stack of overlays

func NewOverlayManager added in v1.7.0

func NewOverlayManager() *OverlayManager

NewOverlayManager creates a new overlay manager

func (*OverlayManager) CancelAll added in v1.7.0

func (om *OverlayManager) CancelAll() tea.Cmd

CancelAll dismisses all active overlays, calling Cancel() on each Returns a batched command from all Cancel() calls

func (*OverlayManager) Clear added in v1.7.0

func (om *OverlayManager) Clear()

Clear removes all overlays from the stack

func (*OverlayManager) GetActive added in v1.7.0

func (om *OverlayManager) GetActive() Overlay

GetActive returns the top overlay on the stack, or nil if empty

func (*OverlayManager) HandleCtrlC added in v1.7.0

func (om *OverlayManager) HandleCtrlC() tea.Cmd

HandleCtrlC is deprecated - use HandleKey instead Kept for backward compatibility during migration

func (*OverlayManager) HandleEscape added in v1.7.0

func (om *OverlayManager) HandleEscape() tea.Cmd

HandleEscape is deprecated - use HandleKey instead Kept for backward compatibility during migration

func (*OverlayManager) HandleKey added in v1.7.0

func (om *OverlayManager) HandleKey(msg tea.KeyMsg) (bool, tea.Cmd)

HandleKey passes a key event to the active overlay Returns (true, cmd) if key was handled, (false, nil) if no active overlay

func (*OverlayManager) HasActive added in v1.7.0

func (om *OverlayManager) HasActive() bool

HasActive returns whether any overlay is currently active

func (*OverlayManager) IsFullscreen added in v1.7.0

func (om *OverlayManager) IsFullscreen() bool

IsFullscreen returns true if the active overlay is fullscreen

func (*OverlayManager) Peek added in v1.7.0

func (om *OverlayManager) Peek() Overlay

Peek returns the top overlay without removing it

func (*OverlayManager) Pop added in v1.7.0

func (om *OverlayManager) Pop() Overlay

Pop removes and returns the top overlay from the stack

func (*OverlayManager) Push added in v1.7.0

func (om *OverlayManager) Push(overlay Overlay, width, height int)

Push adds an overlay to the top of the stack and initializes it

func (*OverlayManager) Render added in v1.7.0

func (om *OverlayManager) Render(width, height int) string

Render returns the content of the top overlay Returns empty string if no active overlay

func (*OverlayManager) Size added in v1.7.0

func (om *OverlayManager) Size() int

Size returns the number of overlays on the stack

func (*OverlayManager) Version added in v1.7.0

func (om *OverlayManager) Version() int

Version returns a counter that increments on every Push/Pop. Used to detect if the stack was modified (even if size unchanged).

type ProgressIndicator

type ProgressIndicator struct {
	State   ProgressState
	Message string
}

ProgressIndicator represents different states of operation progress

func NewProgressIndicator

func NewProgressIndicator(state ProgressState, message string) *ProgressIndicator

NewProgressIndicator creates a new progress indicator

func (*ProgressIndicator) View

func (p *ProgressIndicator) View() string

View renders the progress indicator

type ProgressState

type ProgressState int

ProgressState represents the state of an operation

const (
	// StateQueued indicates a tool is waiting to execute
	StateQueued ProgressState = iota
	// StateRunning indicates a tool is currently executing
	StateRunning
	// StateCompleted indicates a tool has finished execution
	StateCompleted
	// StateFailed indicates a tool execution failed
	StateFailed
)

type ProgressiveMarkdownRenderer

type ProgressiveMarkdownRenderer struct {
	// contains filtered or unexported fields
}

ProgressiveMarkdownRenderer handles progressive rendering of markdown during streaming

func NewProgressiveMarkdownRenderer

func NewProgressiveMarkdownRenderer() *ProgressiveMarkdownRenderer

NewProgressiveMarkdownRenderer creates a new progressive markdown renderer

func (*ProgressiveMarkdownRenderer) Reset

func (r *ProgressiveMarkdownRenderer) Reset()

Reset resets the renderer state

func (*ProgressiveMarkdownRenderer) ShouldRender

func (r *ProgressiveMarkdownRenderer) ShouldRender(text string) bool

ShouldRender determines if we should re-render based on new content

func (*ProgressiveMarkdownRenderer) UpdateRendered

func (r *ProgressiveMarkdownRenderer) UpdateRendered(textLength int)

UpdateRendered updates the last rendered length

type QuickAction

type QuickAction struct {
	Name        string
	Description string
	Usage       string
	Handler     func(args string) error
}

QuickAction represents a single quick action

type QuickActionsRegistry

type QuickActionsRegistry struct {
	// contains filtered or unexported fields
}

QuickActionsRegistry manages quick actions

func NewQuickActionsRegistry

func NewQuickActionsRegistry() *QuickActionsRegistry

NewQuickActionsRegistry creates a new registry with built-in actions

func (*QuickActionsRegistry) Execute

func (r *QuickActionsRegistry) Execute(name, args string) error

Execute runs an action with the given arguments

func (*QuickActionsRegistry) FuzzySearch

func (r *QuickActionsRegistry) FuzzySearch(query string) []*QuickAction

FuzzySearch searches actions by name using fuzzy matching

func (*QuickActionsRegistry) GetAction

func (r *QuickActionsRegistry) GetAction(name string) (*QuickAction, error)

GetAction retrieves an action by name

func (*QuickActionsRegistry) ListActions

func (r *QuickActionsRegistry) ListActions() []*QuickAction

ListActions returns all registered actions

func (*QuickActionsRegistry) RegisterAction

func (r *QuickActionsRegistry) RegisterAction(name, description, usage string, handler func(string) error) error

RegisterAction adds a new quick action

type RiskLevel

type RiskLevel int

RiskLevel represents the risk level of a tool operation

const (
	// RiskSafe indicates a tool operation is safe and requires no approval
	RiskSafe RiskLevel = iota
	// RiskCaution indicates a tool operation should be reviewed before execution
	RiskCaution
	// RiskDanger indicates a tool operation is potentially dangerous
	RiskDanger
)

type Scrollable added in v1.7.0

type Scrollable interface {
	Overlay
	Update(msg tea.Msg) tea.Cmd
}

Scrollable adds viewport scrolling capability to any overlay

type SessionPicker

type SessionPicker struct {
	// contains filtered or unexported fields
}

SessionPicker is a TUI for selecting a conversation to resume

func NewSessionPicker

func NewSessionPicker(conversations []*services.Conversation) SessionPicker

NewSessionPicker creates a new session picker with conversations

func (SessionPicker) GetSelectedID

func (m SessionPicker) GetSelectedID() string

GetSelectedID returns the selected conversation ID (empty if cancelled)

func (SessionPicker) Init

func (m SessionPicker) Init() tea.Cmd

Init initializes the session picker (required by tea.Model interface)

func (SessionPicker) Update

func (m SessionPicker) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles messages for the session picker (required by tea.Model interface)

func (SessionPicker) View

func (m SessionPicker) View() string

View renders the session picker (required by tea.Model interface)

type SlashCommandProvider added in v1.7.0

type SlashCommandProvider struct {
	// contains filtered or unexported fields
}

SlashCommandProvider provides slash command completions

func NewSlashCommandProvider added in v1.7.0

func NewSlashCommandProvider() *SlashCommandProvider

NewSlashCommandProvider creates a new slash command completion provider

func (*SlashCommandProvider) GetCompletions added in v1.7.0

func (sp *SlashCommandProvider) GetCompletions(input string) []Completion

GetCompletions returns fuzzy-matched slash command completions

func (*SlashCommandProvider) SetCommands added in v1.7.0

func (sp *SlashCommandProvider) SetCommands(commands []string, descriptions map[string]string)

SetCommands updates the available slash commands

type SpinnerType

type SpinnerType int

SpinnerType represents different types of spinners

const (
	// SpinnerTypeDefault is the standard loading spinner
	SpinnerTypeDefault SpinnerType = iota
	// SpinnerTypeToolExecution is used when executing tools
	SpinnerTypeToolExecution
	// SpinnerTypeStreaming is used when streaming responses
	SpinnerTypeStreaming
	// SpinnerTypeLoading is used for general loading states
	SpinnerTypeLoading
)

type Status

type Status int

Status represents the current UI status

const (
	// StatusIdle indicates the assistant is not processing
	StatusIdle Status = iota
	// StatusTyping indicates the user is typing
	StatusTyping
	// StatusStreaming indicates the assistant is streaming a response
	StatusStreaming
	// StatusQueued indicates a message is queued while agent is busy
	StatusQueued
	// StatusError indicates an error occurred
	StatusError
)

type StatusBar

type StatusBar struct {
	// contains filtered or unexported fields
}

StatusBar manages the bottom status bar display

func NewStatusBar

func NewStatusBar(model string, width int) *StatusBar

NewStatusBar creates a new status bar

func (*StatusBar) ApplyUpdate

func (s *StatusBar) ApplyUpdate(update StatusBarUpdate)

ApplyUpdate applies a status bar update

func (*StatusBar) ClearCustomMessage

func (s *StatusBar) ClearCustomMessage()

ClearCustomMessage clears the custom message

func (*StatusBar) GetFullHelp

func (s *StatusBar) GetFullHelp() string

GetFullHelp returns full help text for display in a separate panel

func (*StatusBar) SetConnectionStatus

func (s *StatusBar) SetConnectionStatus(status ConnectionStatus)

SetConnectionStatus updates the connection status

func (*StatusBar) SetContextSize

func (s *StatusBar) SetContextSize(size int)

SetContextSize sets the context window size

func (*StatusBar) SetCustomMessage

func (s *StatusBar) SetCustomMessage(msg string)

SetCustomMessage sets a temporary custom message

func (*StatusBar) SetHelpVisible

func (s *StatusBar) SetHelpVisible(visible bool)

SetHelpVisible toggles help visibility

func (*StatusBar) SetMode

func (s *StatusBar) SetMode(mode string)

SetMode updates the current mode

func (*StatusBar) SetModel

func (s *StatusBar) SetModel(model string)

SetModel updates the model name

func (*StatusBar) SetTokens

func (s *StatusBar) SetTokens(input, output int)

SetTokens sets token counters (absolute values)

func (*StatusBar) SetWidth

func (s *StatusBar) SetWidth(width int)

SetWidth updates the status bar width

func (*StatusBar) UpdateTokens

func (s *StatusBar) UpdateTokens(input, output int)

UpdateTokens updates token counters

func (*StatusBar) View

func (s *StatusBar) View() string

View renders the status bar

type StatusBarUpdate

type StatusBarUpdate struct {
	Tokens     *TokenUpdate
	Connection *ConnectionStatus
	Mode       *string
	Message    *string
}

StatusBarUpdate represents an update to the status bar

type StreamChunk

type StreamChunk = core.StreamChunk

StreamChunk is an alias for core.StreamChunk for use in UI

type StreamChunkMsg

type StreamChunkMsg struct {
	Chunk *StreamChunk
	Error error
}

StreamChunkMsg is a Bubbletea message carrying a streaming chunk

type StreamingDisplay

type StreamingDisplay struct {
	// contains filtered or unexported fields
}

StreamingDisplay manages streaming text display with enhancements

func NewStreamingDisplay

func NewStreamingDisplay() *StreamingDisplay

NewStreamingDisplay creates a new streaming display manager

func (*StreamingDisplay) AdvanceTypewriter

func (s *StreamingDisplay) AdvanceTypewriter()

AdvanceTypewriter advances the typewriter position

func (*StreamingDisplay) AppendText

func (s *StreamingDisplay) AppendText(chunk string)

AppendText adds new text to the streaming buffer

func (*StreamingDisplay) AppendThinkingLine added in v1.11.0

func (s *StreamingDisplay) AppendThinkingLine(text string)

AppendThinkingLine adds a thinking line preserving order

func (*StreamingDisplay) AppendToolLine added in v1.11.0

func (s *StreamingDisplay) AppendToolLine(name, id string)

AppendToolLine adds a tool usage line preserving order

func (*StreamingDisplay) CompleteToolCall added in v1.4.0

func (s *StreamingDisplay) CompleteToolCall(id string)

CompleteToolCall marks a tool call as complete

func (*StreamingDisplay) GetElapsedTime

func (s *StreamingDisplay) GetElapsedTime() time.Duration

GetElapsedTime returns time since streaming started

func (*StreamingDisplay) GetFullText

func (s *StreamingDisplay) GetFullText() string

GetFullText returns all text regardless of typewriter position

func (*StreamingDisplay) GetOrderedText added in v1.11.0

func (s *StreamingDisplay) GetOrderedText() string

GetOrderedText returns all text from streaming lines combined

func (*StreamingDisplay) GetStats

func (s *StreamingDisplay) GetStats() StreamingStats

GetStats returns current streaming statistics

func (*StreamingDisplay) GetStreamingLines added in v1.11.0

func (s *StreamingDisplay) GetStreamingLines() []StreamingLine

GetStreamingLines returns all streaming lines in order

func (*StreamingDisplay) GetText

func (s *StreamingDisplay) GetText() string

GetText returns the current text (respecting typewriter mode)

func (*StreamingDisplay) GetTokenCount

func (s *StreamingDisplay) GetTokenCount() int

GetTokenCount returns total tokens received

func (*StreamingDisplay) GetTokenRate

func (s *StreamingDisplay) GetTokenRate() float64

GetTokenRate returns the current token rate (tokens/second)

func (*StreamingDisplay) GetWorkDisplay added in v1.4.0

func (s *StreamingDisplay) GetWorkDisplay() string

GetWorkDisplay returns the current work display (tool calls, thinking)

func (*StreamingDisplay) IsTypewriterMode

func (s *StreamingDisplay) IsTypewriterMode() bool

IsTypewriterMode returns whether typewriter mode is active

func (*StreamingDisplay) IsWaitingForTokens

func (s *StreamingDisplay) IsWaitingForTokens() bool

IsWaitingForTokens returns whether we're still waiting for the first token

func (*StreamingDisplay) RenderOrderedContent added in v1.11.0

func (s *StreamingDisplay) RenderOrderedContent() string

RenderOrderedContent renders streaming lines in order with styles

func (*StreamingDisplay) RenderStreamingIndicator

func (s *StreamingDisplay) RenderStreamingIndicator() string

RenderStreamingIndicator renders the streaming status indicator

func (*StreamingDisplay) RenderWithCursor

func (s *StreamingDisplay) RenderWithCursor(text string) string

RenderWithCursor renders text with a typewriter cursor if in typewriter mode

func (*StreamingDisplay) Reset

func (s *StreamingDisplay) Reset()

Reset clears the streaming display

func (*StreamingDisplay) SetThinking added in v1.4.0

func (s *StreamingDisplay) SetThinking(active bool, text string)

SetThinking sets the thinking state and text

func (*StreamingDisplay) SetTypewriterMode

func (s *StreamingDisplay) SetTypewriterMode(enabled bool)

SetTypewriterMode enables or disables typewriter effect

func (*StreamingDisplay) StartToolCall added in v1.4.0

func (s *StreamingDisplay) StartToolCall(id, name string)

StartToolCall marks a tool call as started

func (*StreamingDisplay) ToggleTypewriterMode

func (s *StreamingDisplay) ToggleTypewriterMode()

ToggleTypewriterMode toggles typewriter mode on/off

type StreamingLine added in v1.11.0

type StreamingLine struct {
	Type    StreamingLineType
	Content string
	ToolID  string // For tool lines, the tool ID
}

StreamingLine represents a single line/chunk of streaming content with order preserved

type StreamingLineType added in v1.11.0

type StreamingLineType int

StreamingLineType identifies what kind of streaming content this is

const (
	// StreamingLineThinking represents thinking/reasoning content
	StreamingLineThinking StreamingLineType = iota
	// StreamingLineTool represents tool call content
	StreamingLineTool
	// StreamingLineText represents regular text content
	StreamingLineText
)

type StreamingStats

type StreamingStats struct {
	TotalTokens   int
	AverageRate   float64
	CurrentRate   float64
	Duration      time.Duration
	TypewriterPos int
	TotalChars    int
}

StreamingStats provides statistics about the streaming session

type Suggestion

type Suggestion = suggestions.Suggestion

Suggestion is an alias for suggestions.Suggestion

type SuggestionDetector

type SuggestionDetector = suggestions.Detector

SuggestionDetector is an alias for suggestions.Detector

func NewSuggestionDetector

func NewSuggestionDetector() *SuggestionDetector

NewSuggestionDetector creates a new detector

type SuggestionLearner

type SuggestionLearner = suggestions.Learner

SuggestionLearner is an alias for suggestions.Learner

func NewSuggestionLearner

func NewSuggestionLearner() *SuggestionLearner

NewSuggestionLearner creates a new learner

type TokenUpdate

type TokenUpdate struct {
	Input  int
	Output int
}

TokenUpdate represents a token count update

type ToolAction added in v1.7.0

type ToolAction int

ToolAction represents how a tool should be handled

const (
	ActionNeedsApproval ToolAction = iota
	ActionAutoApprove
	ActionAutoDeny
)

type ToolApprovalOverlay added in v1.7.0

type ToolApprovalOverlay struct {
	*GenericBottomOverlay
	// contains filtered or unexported fields
}

ToolApprovalOverlay wraps GenericBottomOverlay for tool approval. It provides access to the underlying provider for querying state.

func NewToolApprovalOverlay added in v1.7.0

func NewToolApprovalOverlay(m *Model, tool *core.ToolUse, remaining int) *ToolApprovalOverlay

NewToolApprovalOverlay creates a new tool approval overlay for a specific tool

func NewToolApprovalOverlayFromQueue added in v1.7.0

func NewToolApprovalOverlayFromQueue(m *Model, item *ToolDisposition) *ToolApprovalOverlay

NewToolApprovalOverlayFromQueue creates an overlay from a ToolDisposition in the queue

func (*ToolApprovalOverlay) GetSelectedOption added in v1.7.0

func (o *ToolApprovalOverlay) GetSelectedOption() int

GetSelectedOption returns the currently selected option (0-3)

func (*ToolApprovalOverlay) GetTool added in v1.7.0

func (o *ToolApprovalOverlay) GetTool() *core.ToolUse

GetTool returns the tool this overlay is for

type ToolApprovalProvider added in v1.9.0

type ToolApprovalProvider struct {
	// contains filtered or unexported fields
}

ToolApprovalProvider provides content for the tool approval overlay. It implements BottomContentProvider, BottomKeyHandler, and BottomCancelHandler.

func (*ToolApprovalProvider) Cancel added in v1.9.0

func (p *ToolApprovalProvider) Cancel() tea.Cmd

Cancel implements BottomCancelHandler

func (*ToolApprovalProvider) Content added in v1.9.0

func (p *ToolApprovalProvider) Content() string

Content implements BottomContentProvider

func (*ToolApprovalProvider) DesiredHeight added in v1.9.0

func (p *ToolApprovalProvider) DesiredHeight() int

DesiredHeight implements BottomContentProvider

func (*ToolApprovalProvider) Footer added in v1.9.0

func (p *ToolApprovalProvider) Footer() string

Footer implements BottomContentProvider

func (*ToolApprovalProvider) HandleKey added in v1.9.0

func (p *ToolApprovalProvider) HandleKey(msg tea.KeyMsg) (bool, tea.Cmd)

HandleKey implements BottomKeyHandler

func (*ToolApprovalProvider) Header added in v1.9.0

func (p *ToolApprovalProvider) Header() string

Header implements BottomContentProvider

type ToolCallProgress added in v1.4.0

type ToolCallProgress struct {
	Name       string
	ID         string
	InProgress bool
	Complete   bool
}

ToolCallProgress tracks a tool call in progress

type ToolDecisionMsg added in v1.7.0

type ToolDecisionMsg struct {
	Decision int // 0=approve, 1=deny, 2=always allow, 3=never allow
}

ToolDecisionMsg is sent when user makes a decision on a tool approval overlay

type ToolDisposition added in v1.7.0

type ToolDisposition struct {
	Tool    *core.ToolUse
	Action  ToolAction  // initial classification
	Outcome ToolOutcome // filled in after processed
	Reason  string      // "bypass mode", "always_allow rule", "no rule", etc.
}

ToolDisposition represents a tool and how it should be/was handled

type ToolOutcome added in v1.7.0

type ToolOutcome int

ToolOutcome represents what happened to a tool after processing

const (
	OutcomePending ToolOutcome = iota
	OutcomeApproved
	OutcomeDenied
)

type ToolProvider

type ToolProvider struct {
	// contains filtered or unexported fields
}

ToolProvider provides tool name completions

func NewToolProvider

func NewToolProvider(tools []string) *ToolProvider

NewToolProvider creates a new tool completion provider

func (*ToolProvider) GetCompletions

func (tp *ToolProvider) GetCompletions(input string) []Completion

GetCompletions returns fuzzy-matched tool completions

func (*ToolProvider) SetTools

func (tp *ToolProvider) SetTools(tools []string)

SetTools updates the available tools

type ToolQueue added in v1.7.0

type ToolQueue struct {
	// contains filtered or unexported fields
}

ToolQueue manages sequential processing of tool approvals

func NewToolQueue added in v1.7.0

func NewToolQueue(tools []*core.ToolUse, rules *approval.Rules, permissionMode string) *ToolQueue

NewToolQueue creates a queue from pending tools, classifying each upfront

func (*ToolQueue) AddResult added in v1.7.0

func (q *ToolQueue) AddResult(result ToolResult)

AddResult adds a tool result to the accumulated results

func (*ToolQueue) Advance added in v1.7.0

func (q *ToolQueue) Advance()

Advance moves to the next tool in the queue

func (*ToolQueue) CountByAction added in v1.7.0

func (q *ToolQueue) CountByAction() (needsApproval, autoApprove, autoDeny int)

CountByAction returns counts of each action type in remaining (unprocessed) items

func (*ToolQueue) Current added in v1.7.0

func (q *ToolQueue) Current() *ToolDisposition

Current returns the current tool disposition, or nil if done

func (*ToolQueue) IsDone added in v1.7.0

func (q *ToolQueue) IsDone() bool

IsDone returns true if all tools have been processed

func (*ToolQueue) Len added in v1.7.0

func (q *ToolQueue) Len() int

Len returns the total number of tools in the queue

func (*ToolQueue) ProgressHint added in v1.7.0

func (q *ToolQueue) ProgressHint() string

ProgressHint returns a compact string showing queue status Example: "[●✓✗?]" = "you are here, then approve, deny, ask" Example: "[✓✓✗●]" = "approved, approved, denied, you are here" The current position "●" gets a subtle background highlight

func (*ToolQueue) Remaining added in v1.7.0

func (q *ToolQueue) Remaining() int

Remaining returns the number of tools after the current one

func (*ToolQueue) Results added in v1.7.0

func (q *ToolQueue) Results() []ToolResult

Results returns all accumulated results

type ToolResult

type ToolResult struct {
	ToolUseID    string
	Result       *tools.Result
	ApprovalType ApprovalType
}

ToolResult represents a tool execution result for the API

type ToolSpinner

type ToolSpinner struct {
	// contains filtered or unexported fields
}

ToolSpinner manages spinner state for tool execution

func NewToolSpinner

func NewToolSpinner() *ToolSpinner

NewToolSpinner creates a new spinner for tool execution

func (*ToolSpinner) GetElapsed

func (s *ToolSpinner) GetElapsed() time.Duration

GetElapsed returns the elapsed time since spinner started

func (*ToolSpinner) IsActive

func (s *ToolSpinner) IsActive() bool

IsActive returns whether the spinner is currently active

func (*ToolSpinner) Start

func (s *ToolSpinner) Start(spinnerType SpinnerType, message string) tea.Cmd

Start activates the spinner with a message

func (*ToolSpinner) Stop

func (s *ToolSpinner) Stop()

Stop deactivates the spinner

func (*ToolSpinner) Update

func (s *ToolSpinner) Update(msg tea.Msg) tea.Cmd

Update processes spinner tick messages

func (*ToolSpinner) UpdateTokens

func (s *ToolSpinner) UpdateTokens(count int)

UpdateTokens updates token count and calculates rate (for streaming)

func (*ToolSpinner) View

func (s *ToolSpinner) View() string

View renders the spinner

type ToolTimelineContentProvider added in v1.9.0

type ToolTimelineContentProvider struct {
	// contains filtered or unexported fields
}

ToolTimelineContentProvider provides content for the tool timeline overlay

func (*ToolTimelineContentProvider) Content added in v1.9.0

func (p *ToolTimelineContentProvider) Content() string

Content returns the timeline of all tool calls in the conversation

func (*ToolTimelineContentProvider) Footer added in v1.9.0

func (p *ToolTimelineContentProvider) Footer() string

Footer returns the custom footer with tool count

func (*ToolTimelineContentProvider) Header added in v1.9.0

func (p *ToolTimelineContentProvider) Header() string

Header returns the tool timeline header

func (*ToolTimelineContentProvider) ToggleKeys added in v1.9.0

func (p *ToolTimelineContentProvider) ToggleKeys() []tea.KeyType

ToggleKeys returns the keys that toggle the tool timeline overlay

type Usage

type Usage = core.Usage

Usage is an alias for core.Usage for use in UI

type ViewMode

type ViewMode int

ViewMode represents different view modes in the UI

const (
	// ViewModeIntro is the startup welcome screen
	ViewModeIntro ViewMode = iota
	// ViewModeChat is the main chat interface view
	ViewModeChat
	// ViewModeHistory displays conversation history
	ViewModeHistory
	// ViewModeTools shows available tools and their status
	ViewModeTools
)

Directories

Path Synopsis
Package animations provides gradient generation and color interpolation for visual polish.
Package animations provides gradient generation and color interpolation for visual polish.
Package browser provides conversation browsing and search interfaces for the TUI.
Package browser provides conversation browsing and search interfaces for the TUI.
Package components provides reusable Bubbles components with Dracula theme styling.
Package components provides reusable Bubbles components with Dracula theme styling.
Package dashboard provides status dashboards for plugins and MCP servers.
Package dashboard provides status dashboards for plugins and MCP servers.
Package forms provides beautiful huh-based forms for the hex TUI.
Package forms provides beautiful huh-based forms for the hex TUI.
Package layout provides consistent border styles and spacing utilities for TUI layout.
Package layout provides consistent border styles and spacing utilities for TUI layout.
Package theme provides Dracula color palette and lipgloss styles for the hex TUI.
Package theme provides Dracula color palette and lipgloss styles for the hex TUI.
Package visualization provides real-time visualization of token usage and context windows.
Package visualization provides real-time visualization of token usage and context windows.

Jump to

Keyboard shortcuts

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