components

package
v0.225.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: Apache-2.0 Imports: 69 Imported by: 0

Documentation

Index

Constants

View Source
const AutoCollapseDelay = 3 * time.Second

AutoCollapseDelay is the duration to wait before auto-collapsing after an update

View Source
const SpinnerFrameInterval = 2 * StreamFrameInterval

SpinnerFrameInterval is how long one spinner frame stays on screen. It is a whole number of stream frames, so the spinner turns evenly on either cadence.

View Source
const StreamFrameInterval = time.Second / 15

StreamFrameInterval is how often a streaming reply is repainted: 15fps reads as live and halves the viewport rebuilds of a 30fps tick.

Variables

This section is empty.

Functions

func AwaitingUserDecision added in v0.225.0

func AwaitingUserDecision(sm approvalOverlayReader) bool

AwaitingUserDecision reports whether an approval, plan-approval, or user-question overlay is blocked on the user.

func FormatAnnotations

func FormatAnnotations(root string, sels []SnippetSelection) string

FormatAnnotations builds an LLM-ready context block from a set of snippet selections. Selections are grouped by file (deduping file reads). Only the selected line ranges are emitted - never the whole file - each as a fenced block headed by `<file> (lines X-Y):`, optionally followed by a `note:` line when the user attached an instruction.

The output format is:

<file> (lines <start>-<end>):
```<ext>
<the selected lines, raw>
```
note: <annotation>   (only when an annotation was attached)

This is a pure function (no receiver state) so it is independently unit-testable.

func ScheduleAutoCollapse

func ScheduleAutoCollapse() tea.Cmd

ScheduleAutoCollapse returns a command that will send AutoCollapseTickMsg after the delay

Types

type AgentReadiness added in v0.207.0

type AgentReadiness interface {
	InitializeAgentReadiness(totalAgents int)
	UpdateAgentStatus(name string, state a2adomain.AgentState, message string, url string, image string)
	SetAgentError(name string, err error)
	GetAgentReadiness() *tui.AgentReadinessState
	AreAllAgentsReady() bool
	ClearAgentReadiness()
	RemoveAgent(name string)
}

InputStatusBar displays input status information like model, theme, agents AgentReadiness handles A2A agent readiness tracking

type AgentsView added in v0.214.0

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

AgentsView is a read-only, filterable list of every agent the chat can use: remote A2A agents on top, then the local Markdown presets (.infer/agents/*.md), each in its own section of the same view.

func NewAgentsView added in v0.214.0

func NewAgentsView(readiness AgentReadiness, catalog SubagentCatalog, styleProvider *styles.Provider) *AgentsView

NewAgentsView creates the agents list view. Items are populated by Reset on every entry because readiness changes while agents start up.

func (*AgentsView) Init added in v0.214.0

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

func (*AgentsView) IsCancelled added in v0.214.0

func (m *AgentsView) IsCancelled() bool

IsCancelled returns true once the user has dismissed the view.

func (*AgentsView) Reset added in v0.214.0

func (m *AgentsView) Reset()

Reset returns the view to its initial state and rebuilds the items.

func (*AgentsView) SetHeight added in v0.214.0

func (m *AgentsView) SetHeight(height int)

SetHeight sets the height of the agents view.

func (*AgentsView) SetWidth added in v0.214.0

func (m *AgentsView) SetWidth(width int)

SetWidth sets the width of the agents view.

func (*AgentsView) Update added in v0.214.0

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

func (*AgentsView) View added in v0.214.0

func (m *AgentsView) View() tea.View

type ApplicationViewRenderer

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

ApplicationViewRenderer handles rendering of different application views

func NewApplicationViewRenderer

func NewApplicationViewRenderer(styleProvider *styles.Provider) *ApplicationViewRenderer

NewApplicationViewRenderer creates a new application view renderer

func (*ApplicationViewRenderer) ConversationHeight added in v0.222.1

func (r *ApplicationViewRenderer) ConversationHeight() int

ConversationHeight returns the transcript height set by the last Layout call.

func (*ApplicationViewRenderer) Layout added in v0.193.0

func (r *ApplicationViewRenderer) Layout(
	data ChatInterfaceData,
	conversationView tui.ConversationRenderer,
	inputView tui.InputComponent,
	autocomplete tui.AutocompleteComponent,
	inputStatusBar tui.InputStatusBarComponent,
	statusView tui.StatusComponent,
	modeIndicator *ModeIndicator,
	helpBar tui.HelpBarComponent,
	queueBoxView *QueueBoxView,
	todoBoxView *TodoBoxView,
	approvalBoxView *ApprovalBoxView,
	questionFormView *QuestionFormView,
	snippetAttachments *SnippetAttachmentsView,
	historySearch *HistorySearchView,
	subagentList *SubagentList,
)

Layout sizes the chat components for the current state. Call it from Update (not View) whenever state changes. The transcript gets every row the measured chrome leaves, so the frame always fills the terminal.

func (*ApplicationViewRenderer) RenderChatInterface

func (r *ApplicationViewRenderer) RenderChatInterface(
	data ChatInterfaceData,
	conversationView tui.ConversationRenderer,
	inputView tui.InputComponent,
	autocomplete tui.AutocompleteComponent,
	inputStatusBar tui.InputStatusBarComponent,
	subagentList *SubagentList,
	statusView tui.StatusComponent,
	modeIndicator *ModeIndicator,
	helpBar tui.HelpBarComponent,
	queueBoxView *QueueBoxView,
	todoBoxView *TodoBoxView,
	approvalBoxView *ApprovalBoxView,
	questionFormView *QuestionFormView,
	snippetAttachments *SnippetAttachmentsView,
	historySearch *HistorySearchView,
) string

RenderChatInterface renders the main chat interface using the sizes set by the last Layout call.

type ApprovalBoxView

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

func NewApprovalBoxView

func NewApprovalBoxView(styleProvider *styles.Provider, stateManager tui.ApprovalPrompt, toolFormatter tui.ToolFormatter) *ApprovalBoxView

func (*ApprovalBoxView) Begin

func (av *ApprovalBoxView) Begin() tea.Cmd

Begin builds the action select for the approval currently in the state store. Call it when a ToolApprovalRequestedEvent has set up the state.

func (*ApprovalBoxView) Forward

func (av *ApprovalBoxView) Forward(msg tea.Msg) tea.Cmd

Forward delegates a message to the action select. On completion it emits the ToolApprovalResponseEvent that the approval coordinator consumes.

func (*ApprovalBoxView) Init

func (av *ApprovalBoxView) Init() tea.Cmd

func (*ApprovalBoxView) IsActive

func (av *ApprovalBoxView) IsActive() bool

IsActive reports whether an approval is *currently* being shown, so the caller can route ctrl+o to this box instead of the conversation. It consults the live state store (like Render does) rather than trusting av.active/av.form alone: those fields are only reset by the form's own completion, so after an approval is cleared externally (rejection resolved, timeout) they can linger — and a stale true here would swallow ctrl+o from the rejected result the user is trying to expand.

func (*ApprovalBoxView) IsExpanded

func (av *ApprovalBoxView) IsExpanded() bool

IsExpanded reports whether the diff is in the scrollable expanded view, so the caller can route up/down to scroll it instead of the conversation.

func (*ApprovalBoxView) Render

func (av *ApprovalBoxView) Render() string

func (*ApprovalBoxView) ScrollDiff

func (av *ApprovalBoxView) ScrollDiff(delta int)

ScrollDiff moves the expanded diff window by delta lines (up/down). It is a no-op unless the diff is expanded; the top is clamped here and the bottom at render time (which is where the window height is known).

func (*ApprovalBoxView) SetHeight

func (av *ApprovalBoxView) SetHeight(height int)

func (*ApprovalBoxView) SetKeyHintFormatter

func (av *ApprovalBoxView) SetKeyHintFormatter(formatter *hints.Formatter)

func (*ApprovalBoxView) SetWidth

func (av *ApprovalBoxView) SetWidth(width int)

func (*ApprovalBoxView) ToggleExpanded

func (av *ApprovalBoxView) ToggleExpanded()

ToggleExpanded flips between the capped diff preview and the scrollable full-diff window, matching the ctrl+o tool-result expansion in the conversation view.

func (*ApprovalBoxView) Update

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

func (*ApprovalBoxView) View

func (av *ApprovalBoxView) View() tea.View

type AutoCollapseTickMsg

type AutoCollapseTickMsg struct{}

AutoCollapseTickMsg is sent to trigger auto-collapse check

type ChatInterfaceData

type ChatInterfaceData struct {
	Width          int
	Height         int
	ToolExecution  *tui.ToolExecutionSession
	QueuedMessages []convdomain.QueuedMessage
}

ChatInterfaceData holds the data needed to render the chat interface

type ConversationLineFormatter added in v0.207.0

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

ConversationLineFormatter converts conversation entries to text lines

func NewConversationLineFormatter added in v0.207.0

func NewConversationLineFormatter(width int, toolFormatter tui.ToolFormatter) *ConversationLineFormatter

NewConversationLineFormatter creates a new conversation line formatter

func (*ConversationLineFormatter) FormatConversationToLines added in v0.207.0

func (f *ConversationLineFormatter) FormatConversationToLines(conversation []convdomain.ConversationEntry) []string

FormatConversationToLines converts conversation entries to plain text lines

func (*ConversationLineFormatter) SetWidth added in v0.207.0

func (f *ConversationLineFormatter) SetWidth(width int)

SetWidth updates the formatter width

type ConversationSelector added in v0.207.0

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

ConversationSelector implements conversation selection UI

func NewConversationSelector

func NewConversationSelector(repo convdomain.PersistentConversationRepository, styleProvider *styles.Provider) *ConversationSelector

NewConversationSelector creates a new conversation selector

func (*ConversationSelector) GetSelected added in v0.207.0

GetSelected returns the selected conversation

func (*ConversationSelector) Init added in v0.207.0

func (c *ConversationSelector) Init() tea.Cmd

func (*ConversationSelector) IsCancelled added in v0.207.0

func (c *ConversationSelector) IsCancelled() bool

IsCancelled returns true if selection was cancelled

func (*ConversationSelector) IsSelected added in v0.207.0

func (c *ConversationSelector) IsSelected() bool

IsSelected returns true if a conversation was selected

func (*ConversationSelector) NeedsInitialization added in v0.207.0

func (c *ConversationSelector) NeedsInitialization() bool

NeedsInitialization returns true if the component needs to load data

func (*ConversationSelector) Reset added in v0.207.0

func (c *ConversationSelector) Reset()

Reset resets the conversation selector state for reuse

func (*ConversationSelector) SetHeight added in v0.207.0

func (c *ConversationSelector) SetHeight(height int)

SetHeight sets the height of the conversation selector

func (*ConversationSelector) SetWidth added in v0.207.0

func (c *ConversationSelector) SetWidth(width int)

SetWidth sets the width of the conversation selector

func (*ConversationSelector) Update added in v0.207.0

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

func (*ConversationSelector) View added in v0.207.0

func (c *ConversationSelector) View() tea.View

type ConversationView

type ConversationView struct {
	Viewport viewport.Model
	// contains filtered or unexported fields
}

ConversationView handles the chat conversation display. It is confined to the Bubble Tea event loop: all state is read and written from Update/View only, so it holds no locks. Off-loop producers must go through Program.Send.

func NewConversationView

func NewConversationView(styleProvider *styles.Provider) *ConversationView

func (*ConversationView) CanScrollDown

func (cv *ConversationView) CanScrollDown() bool

func (*ConversationView) CanScrollUp

func (cv *ConversationView) CanScrollUp() bool

func (*ConversationView) EnterMessageHistoryMode

func (cv *ConversationView) EnterMessageHistoryMode(snapshots []tui.MessageSnapshot)

EnterMessageHistoryMode switches the conversation view to message history navigation mode

func (*ConversationView) ExitMessageHistoryMode

func (cv *ConversationView) ExitMessageHistoryMode()

ExitMessageHistoryMode returns the conversation view to normal mode

func (*ConversationView) GetPlainTextLines

func (cv *ConversationView) GetPlainTextLines() []string

GetPlainTextLines returns the conversation as plain text lines for selection mode This returns the actual rendered content that was displayed in the viewport, preserving the same text wrapping and formatting

func (*ConversationView) GetScrollOffset

func (cv *ConversationView) GetScrollOffset() int

func (*ConversationView) GetSelectedMessageIndex

func (cv *ConversationView) GetSelectedMessageIndex() int

GetSelectedMessageIndex returns the conversation index of the selected message

func (*ConversationView) GetSelectedMessageSnapshot

func (cv *ConversationView) GetSelectedMessageSnapshot() *tui.MessageSnapshot

GetSelectedMessageSnapshot returns the full snapshot of the selected message

func (*ConversationView) Init

func (cv *ConversationView) Init() tea.Cmd

Bubble Tea interface

func (*ConversationView) IsInMessageHistoryMode

func (cv *ConversationView) IsInMessageHistoryMode() bool

IsInMessageHistoryMode returns true if currently in message history navigation mode

func (*ConversationView) IsRawFormat

func (cv *ConversationView) IsRawFormat() bool

IsRawFormat returns true if raw format (no markdown rendering) is enabled

func (*ConversationView) IsStreaming added in v0.225.0

func (cv *ConversationView) IsStreaming() bool

IsStreaming reports whether a reply is streaming into the view, which is when the chat's live clock ticks at the stream cadence.

func (*ConversationView) IsThinkingExpanded

func (cv *ConversationView) IsThinkingExpanded(index int) bool

func (*ConversationView) IsToolResultExpanded

func (cv *ConversationView) IsToolResultExpanded(index int) bool

IsToolResultExpanded returns the effective expansion of a tool result: an explicit user choice (set via ctrl+o or a per-entry toggle) if present, otherwise the per-tool default from defaultExpandedTools.

func (*ConversationView) NavigateHistoryDown

func (cv *ConversationView) NavigateHistoryDown()

NavigateHistoryDown moves the selection down in message history

func (*ConversationView) NavigateHistoryUp

func (cv *ConversationView) NavigateHistoryUp()

NavigateHistoryUp moves the selection up in message history

func (*ConversationView) RefreshTheme

func (cv *ConversationView) RefreshTheme()

RefreshTheme rebuilds the markdown renderer with current theme colors

func (*ConversationView) Render

func (cv *ConversationView) Render() string

Render returns the viewport with a two-space left gutter. It never mutates the viewport; sizing and content updates happen in Update/SetWidth/SetHeight.

func (*ConversationView) ResetUserScroll

func (cv *ConversationView) ResetUserScroll()

ResetUserScroll pins the viewport to the tail so it follows new content. Call this when a new message is sent to ensure the user sees the latest response.

func (*ConversationView) SetConfigPath

func (cv *ConversationView) SetConfigPath(configPath string)

SetConfigPath sets the config path for the welcome message

func (*ConversationView) SetConversation

func (cv *ConversationView) SetConversation(conversation []convdomain.ConversationEntry)

func (*ConversationView) SetDefaultExpandedTools

func (cv *ConversationView) SetDefaultExpandedTools(names map[string]bool)

SetDefaultExpandedTools overrides which tool names render expanded by default.

func (*ConversationView) SetHeight

func (cv *ConversationView) SetHeight(height int)

SetHeight resizes the view; a no-op when unchanged. Follow state is read before the resize: shrinking (e.g. the approval box opening) raises the max offset, so AtBottom() is already false by the time rebuild() checks it.

func (*ConversationView) SetKeyHintFormatter

func (cv *ConversationView) SetKeyHintFormatter(formatter *hints.Formatter)

SetKeyHintFormatter sets the key hint formatter for displaying keybinding hints

func (*ConversationView) SetStateManager

func (cv *ConversationView) SetStateManager(stateManager tui.PlanApprovalPrompt)

SetStateManager sets the state manager for accessing plan approval state

func (*ConversationView) SetToolCallRenderer

func (cv *ConversationView) SetToolCallRenderer(renderer *ToolCallRenderer)

SetToolCallRenderer sets the tool call renderer for displaying real-time tool execution status

func (*ConversationView) SetToolFormatter

func (cv *ConversationView) SetToolFormatter(formatter tui.ToolFormatter)

SetToolFormatter sets the tool formatter for this conversation view

func (*ConversationView) SetVersionInfo

func (cv *ConversationView) SetVersionInfo(info tui.VersionInfo)

SetVersionInfo sets the version information for the welcome message

func (*ConversationView) SetWidth

func (cv *ConversationView) SetWidth(width int)

SetWidth resizes the view and rewraps content; a no-op when unchanged.

func (*ConversationView) ToggleAllThinkingExpansion

func (cv *ConversationView) ToggleAllThinkingExpansion()

func (*ConversationView) ToggleAllToolResultsExpansion

func (cv *ConversationView) ToggleAllToolResultsExpansion()

func (*ConversationView) ToggleRawFormat

func (cv *ConversationView) ToggleRawFormat()

ToggleRawFormat toggles between raw and rendered markdown display

func (*ConversationView) ToggleToolResultExpansion

func (cv *ConversationView) ToggleToolResultExpansion(index int)

func (*ConversationView) Update

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

func (*ConversationView) View

func (cv *ConversationView) View() tea.View

type DiffViewer added in v0.207.0

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

DiffViewer is the VS Code-style "Changes" side panel: a left tree of changed files (grouped Staged/Changes → folder → file) plus a scrollable diff pane for the selected file. It owns its full [sidebar | divider | diff] region; the chat input row is composed beneath the diff pane by the caller.

func NewDiffViewer

func NewDiffViewer(source gitdiff.Source, styleProvider *styles.Provider, themeService tui.ThemeService, kb config.KeybindingsConfig) *DiffViewer

NewDiffViewer creates a changes panel backed by the given git source.

func (*DiffViewer) FooterBar added in v0.207.0

func (t *DiffViewer) FooterBar(width int) string

FooterBar renders the per-mode keybinding legend shown beneath the diff pane, greedy-wrapped to width so no binding is truncated.

func (*DiffViewer) HintText added in v0.207.0

func (t *DiffViewer) HintText() string

HintText returns the footer hint for the current mode (tree vs patch).

func (*DiffViewer) Init added in v0.207.0

func (t *DiffViewer) Init() tea.Cmd

Init loads the current diff once. It refreshes thereafter on view-entry (reopen re-runs this), on in-loop tool/bash completion events, on git stage/unstage/discard actions, and on the manual refresh key - no polling tick.

func (*DiffViewer) IsCancelled added in v0.207.0

func (t *DiffViewer) IsCancelled() bool

func (*DiffViewer) IsDone added in v0.207.0

func (t *DiffViewer) IsDone() bool

func (*DiffViewer) PaneWidth added in v0.207.0

func (t *DiffViewer) PaneWidth() int

PaneWidth returns the current diff-pane width (after SetWidth), so the caller can size the input row that sits beneath the diff pane.

func (*DiffViewer) Render added in v0.207.0

func (t *DiffViewer) Render(inputRow string) string

Render lays out the full region: a full-height sidebar and divider on the left, and on the right the diff pane with the (already-rendered) input row stacked beneath it - so the input visibly shifts right of the sidebar. Pass "" for inputRow to render the diff pane at full height (no input).

func (*DiffViewer) Reset added in v0.207.0

func (t *DiffViewer) Reset()

Reset clears state so the panel can be reused on a later open.

func (*DiffViewer) SetHeight added in v0.207.0

func (t *DiffViewer) SetHeight(h int)

func (*DiffViewer) SetWidth added in v0.207.0

func (t *DiffViewer) SetWidth(w int)

func (*DiffViewer) Update added in v0.207.0

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

func (*DiffViewer) View added in v0.207.0

func (t *DiffViewer) View() tea.View

View satisfies tea.Model. The app composes the real layout via Render (which stacks the input beneath the diff pane); this is a standalone fallback.

type FileExplorer added in v0.207.0

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

FileExplorer is the VS Code-style file explorer side panel: a left tree of the working directory (lazy, collapsible, .gitignore-aware) plus a scrollable, syntax-highlighted preview of the selected file. A `/` fuzzy finder jumps to any file; `v` opens the selection in the user's real editor. It owns its full [sidebar | divider | pane] region; the chat input is composed beneath the pane.

func NewFileExplorer

func NewFileExplorer(root string, styleProvider *styles.Provider, themeService tui.ThemeService, kb config.KeybindingsConfig) *FileExplorer

NewFileExplorer creates an explorer rooted at the given working directory.

func (*FileExplorer) HintText added in v0.207.0

func (t *FileExplorer) HintText() string

HintText returns the footer hint for the current mode.

func (*FileExplorer) Init added in v0.207.0

func (t *FileExplorer) Init() tea.Cmd

Init does no work: the constructor and Reset already seed the root, and the tree refreshes on view-entry (reopen re-runs this), on in-loop tool/bash completion events, and on the manual refresh key - no polling tick.

func (*FileExplorer) IsCancelled added in v0.207.0

func (t *FileExplorer) IsCancelled() bool

func (*FileExplorer) IsDone added in v0.207.0

func (t *FileExplorer) IsDone() bool

func (*FileExplorer) PaneWidth added in v0.207.0

func (t *FileExplorer) PaneWidth() int

PaneWidth returns the current preview-pane width so the caller can size the input row that sits beneath the pane.

func (*FileExplorer) Render added in v0.207.0

func (t *FileExplorer) Render(inputRow string) string

Render lays out the full region: a full-height sidebar and divider on the left, and on the right the preview pane with the (already-rendered) input row stacked beneath it. Pass "" for inputRow to render the pane at full height.

func (*FileExplorer) Reset added in v0.207.0

func (t *FileExplorer) Reset()

Reset clears state so the panel can be reused on a later open.

func (*FileExplorer) Selections added in v0.207.0

func (t *FileExplorer) Selections() []SnippetSelection

Selections returns the annotated line ranges captured during select mode. The app reads this when the explorer closes (IsDone) and carries them into chat as attachments sent with the next message.

func (*FileExplorer) SetHeight added in v0.207.0

func (t *FileExplorer) SetHeight(h int)

func (*FileExplorer) SetWidth added in v0.207.0

func (t *FileExplorer) SetWidth(w int)

func (*FileExplorer) Update added in v0.207.0

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

func (*FileExplorer) View added in v0.207.0

func (t *FileExplorer) View() tea.View

View satisfies tea.Model. The app composes the real layout via Render.

type HelpBar

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

HelpBar displays keyboard shortcuts at the bottom of the screen

func NewHelpBar

func NewHelpBar(styleProvider *styles.Provider) *HelpBar

func (*HelpBar) Init

func (hb *HelpBar) Init() tea.Cmd

Bubble Tea interface

func (*HelpBar) IsEnabled

func (hb *HelpBar) IsEnabled() bool

func (*HelpBar) Render

func (hb *HelpBar) Render() string

Render draws the shortcuts as a multi-column cheat sheet using bubbles/v2/help, which handles column layout, key/description alignment, and width-aware truncation. Colours follow the active theme.

func (*HelpBar) SetEnabled

func (hb *HelpBar) SetEnabled(enabled bool)

func (*HelpBar) SetHeight

func (hb *HelpBar) SetHeight(height int)

func (*HelpBar) SetShortcuts

func (hb *HelpBar) SetShortcuts(shortcuts []key.Binding)

func (*HelpBar) SetWidth

func (hb *HelpBar) SetWidth(width int)

func (*HelpBar) Update

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

func (*HelpBar) View

func (hb *HelpBar) View() tea.View

type HelpCommand

type HelpCommand struct {
	Name        string
	Description string
}

HelpCommand is a single slash-command row in the help overlay.

type HelpView added in v0.207.0

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

HelpView is a full-screen, scrollable overlay documenting every available slash command and keybinding in two lipgloss tables. Both tables are sized to the terminal width - long descriptions wrap rather than truncate - and the whole view lives inside a viewport, so every row stays reachable even on a narrow or short terminal. It is read-only: esc/q returns to the chat.

func NewHelpView

func NewHelpView(themeService tui.ThemeService, styleProvider *styles.Provider) *HelpView

NewHelpView creates a new help overlay component.

func (*HelpView) Init added in v0.207.0

func (h *HelpView) Init() tea.Cmd

func (*HelpView) IsCancelled added in v0.207.0

func (h *HelpView) IsCancelled() bool

IsCancelled reports whether the user dismissed the help overlay.

func (*HelpView) Reset added in v0.207.0

func (h *HelpView) Reset()

Reset clears the cancelled flag and scroll position for reuse.

func (*HelpView) SetContent added in v0.207.0

func (h *HelpView) SetContent(commands []HelpCommand, keybindings []tui.KeyShortcut)

SetContent loads the rows to display, rebuilds the rendered tables and resets the scroll position to the top.

func (*HelpView) SetHeight added in v0.207.0

func (h *HelpView) SetHeight(height int)

SetHeight sets the overlay height, reserving the bottom two lines for the footer hint. The rendered tables depend only on width, so changing the height just resizes the viewport window - no rebuild required.

func (*HelpView) SetWidth added in v0.207.0

func (h *HelpView) SetWidth(width int)

SetWidth sets the overlay width and rebuilds the tables to fit. Rebuilding is skipped when the width is unchanged so steady-state renders stay cheap.

func (*HelpView) Update added in v0.207.0

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

func (*HelpView) View added in v0.207.0

func (h *HelpView) View() tea.View

type HistorySearchOutcome added in v0.219.0

type HistorySearchOutcome int

HistorySearchOutcome reports how a key press handled by the history search overlay affected the chat.

const (
	// HistorySearchUnhandledKey was consumed by the overlay, with no external effect.
	HistorySearchUnhandledKey HistorySearchOutcome = iota
	// HistorySearchAccepted selects the highlighted prompt for the input.
	HistorySearchAccepted
	// HistorySearchClosed closes the overlay, leaving the input untouched.
	HistorySearchClosed
)

type HistorySearchView added in v0.219.0

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

HistorySearchView is the Ctrl+R fuzzy prompt-history search overlay: a query line plus the matching prompts, newest first, duplicates collapsed. It is a modal component driven by ChatApplication, which routes keys into it while it holds focus and renders it above the input.

func NewHistorySearchView added in v0.219.0

func NewHistorySearchView(styleProvider *styles.Provider) *HistorySearchView

NewHistorySearchView creates an overlay ready to be opened over a history.

func (*HistorySearchView) Close added in v0.219.0

func (v *HistorySearchView) Close()

Close dismisses the overlay; the caller keeps the input exactly as it was.

func (*HistorySearchView) GetHeight added in v0.219.0

func (v *HistorySearchView) GetHeight() int

GetHeight returns the rendered line count including the border, 0 when closed.

func (*HistorySearchView) HandleKey added in v0.219.0

HandleKey processes one key while the overlay is open. It returns the outcome and, for HistorySearchAccepted, the original prompt (with its original newlines) to load into the input without sending it.

func (*HistorySearchView) IsVisible added in v0.219.0

func (v *HistorySearchView) IsVisible() bool

IsVisible reports whether the overlay is open.

func (*HistorySearchView) Open added in v0.219.0

func (v *HistorySearchView) Open(history []string)

Open starts a search over the project prompt history: duplicates collapse to their most recent occurrence and the newest prompt lists first.

func (*HistorySearchView) Query added in v0.219.0

func (v *HistorySearchView) Query() string

Query returns the current search query.

func (*HistorySearchView) Render added in v0.219.0

func (v *HistorySearchView) Render() string

Render returns the framed overlay, or "" when closed.

func (*HistorySearchView) SetWidth added in v0.219.0

func (v *HistorySearchView) SetWidth(width int)

SetWidth sets the overlay width.

type InputStatusBar

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

func NewInputStatusBar

func NewInputStatusBar(styleProvider *styles.Provider) *InputStatusBar

NewInputStatusBar creates a new input status bar

func (*InputStatusBar) Blur

func (isb *InputStatusBar) Blur()

Blur returns the indicator row to its passive display-only state.

func (*InputStatusBar) Focus

func (isb *InputStatusBar) Focus() bool

Focus moves keyboard focus onto the indicator row, selecting the first actionable indicator. Reports false when nothing is actionable so the caller can keep focus in the input.

func (*InputStatusBar) Init

func (isb *InputStatusBar) Init() tea.Cmd

Bubble Tea interface

func (*InputStatusBar) IsFocused

func (isb *InputStatusBar) IsFocused() bool

IsFocused reports whether the indicator row holds keyboard focus.

func (*InputStatusBar) Render

func (isb *InputStatusBar) Render() string

func (*InputStatusBar) SelectNext

func (isb *InputStatusBar) SelectNext()

SelectNext moves the selection to the next actionable indicator, wrapping.

func (*InputStatusBar) SelectPrev

func (isb *InputStatusBar) SelectPrev()

SelectPrev moves the selection to the previous actionable indicator, wrapping.

func (*InputStatusBar) SelectedAction

func (isb *InputStatusBar) SelectedAction() tui.StatusIndicatorAction

SelectedAction returns the action of the selected indicator, clamping the selection when indicators disappeared since it was set (e.g. jobs finished).

func (*InputStatusBar) SetBackgroundShellService

func (isb *InputStatusBar) SetBackgroundShellService(service scheddomain.BackgroundShellService)

SetBackgroundShellService sets the background shell service

func (*InputStatusBar) SetBackgroundTaskService

func (isb *InputStatusBar) SetBackgroundTaskService(service a2adomain.BackgroundTaskService)

SetBackgroundTaskService sets the background task service

func (*InputStatusBar) SetBrowserConnected added in v0.182.0

func (isb *InputStatusBar) SetBrowserConnected(connected bool)

SetBrowserConnected toggles the browser-extension indicator.

func (*InputStatusBar) SetConfig

func (isb *InputStatusBar) SetConfig(cfg *config.Config)

SetConfig sets the config for the status bar

func (*InputStatusBar) SetConversationRepo

func (isb *InputStatusBar) SetConversationRepo(repo convdomain.ConversationRepository)

SetConversationRepo sets the conversation repository

func (*InputStatusBar) SetEffortSource

func (isb *InputStatusBar) SetEffortSource(src effortSource)

SetEffortSource sets the source of the runtime reasoning effort level.

func (*InputStatusBar) SetHeight

func (isb *InputStatusBar) SetHeight(height int)

func (*InputStatusBar) SetInputText

func (isb *InputStatusBar) SetInputText(text string)

SetInputText sets the current input text for mode detection

func (*InputStatusBar) SetMessageQueue added in v0.213.0

func (isb *InputStatusBar) SetMessageQueue(mq convdomain.MessageQueue)

SetMessageQueue sets the shared message queue so the bar can show what is waiting while the agent is busy. Read live at render time, so enqueues and drains show up on the next render without extra event plumbing.

func (*InputStatusBar) SetModelService

func (isb *InputStatusBar) SetModelService(modelService convdomain.ModelService)

SetModelService sets the model service

func (*InputStatusBar) SetScreenRecording added in v0.208.0

func (isb *InputStatusBar) SetScreenRecording(active bool)

SetScreenRecording toggles the REC badge shown while a RecordStart screen recording runs.

func (*InputStatusBar) SetStateManager

func (isb *InputStatusBar) SetStateManager(stateManager statusBarState)

SetStateManager sets the state manager

func (*InputStatusBar) SetThemeService

func (isb *InputStatusBar) SetThemeService(themeService tui.ThemeService)

SetThemeService sets the theme service

func (*InputStatusBar) SetTokenEstimator

func (isb *InputStatusBar) SetTokenEstimator(estimator convdomain.TokenEstimator)

SetTokenEstimator sets the token estimator

func (*InputStatusBar) SetToolService

func (isb *InputStatusBar) SetToolService(toolService agentdomain.ToolService)

SetToolService sets the tool service

func (*InputStatusBar) SetVersionInfo added in v0.187.0

func (isb *InputStatusBar) SetVersionInfo(info tui.VersionInfo)

SetVersionInfo sets the CLI and gateway versions shown right-aligned in the bar.

func (*InputStatusBar) SetWidth

func (isb *InputStatusBar) SetWidth(width int)

func (*InputStatusBar) Update

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

func (*InputStatusBar) UpdateMCPStatus

func (isb *InputStatusBar) UpdateMCPStatus(status *mcpdomain.ServerStatus)

UpdateMCPStatus updates the MCP server status (called by event handler)

func (*InputStatusBar) View

func (isb *InputStatusBar) View() tea.View

type InputView

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

InputView handles user input with history, delegating text editing to charm.land/bubbles/v2/textarea.

func NewInputView

func NewInputView(modelService convdomain.ModelService) *InputView

func NewInputViewWithName

func NewInputViewWithName(modelService convdomain.ModelService, baseDir, name string, store storage.ShellHistoryStorage) *InputView

NewInputViewWithName creates the input view. The main agent's history (name == "") goes through the storage backend when a store is provided; named subagent histories and the no-store fallback stay file-based under the given dir's history/ (the TUI passes the per-project runtime dir, ~/.infer/projects/<project-slug>/).

func (*InputView) AcceptHistorySuggestion

func (iv *InputView) AcceptHistorySuggestion() bool

AcceptHistorySuggestion applies the current suggestion to the input

func (*InputView) AddImageAttachment

func (iv *InputView) AddImageAttachment(image agentdomain.ImageAttachment)

AddImageAttachment adds an image attachment to the pending list

func (*InputView) AddToHistory

func (iv *InputView) AddToHistory(text string) error

AddToHistory adds the current input to the history

func (*InputView) CanHandle

func (iv *InputView) CanHandle(key tea.KeyPressMsg) bool

func (*InputView) ClearCustomHint

func (iv *InputView) ClearCustomHint()

ClearCustomHint clears the custom hint Note: The input is re-enabled separately by handleViewSpecificMessages when exiting navigation mode

func (*InputView) ClearImageAttachments

func (iv *InputView) ClearImageAttachments()

ClearImageAttachments clears all pending image attachments

func (*InputView) ClearInput

func (iv *InputView) ClearInput()

func (*InputView) GetCursor

func (iv *InputView) GetCursor() int

GetCursor returns the cursor position as a byte offset into GetInput(). The textarea reports a rune column, so the current line's rune prefix is converted back to bytes before adding it to the preceding lines' lengths.

func (*InputView) GetHistoryManager

func (iv *InputView) GetHistoryManager() *history.Store

GetHistoryManager returns the history manager for external use

func (*InputView) GetImageAttachments

func (iv *InputView) GetImageAttachments() []agentdomain.ImageAttachment

GetImageAttachments returns the list of pending image attachments

func (*InputView) GetInput

func (iv *InputView) GetInput() string

func (*InputView) GetUsageHint

func (iv *InputView) GetUsageHint() string

GetUsageHint returns the current usage hint

func (*InputView) HandleKey

func (iv *InputView) HandleKey(k tea.KeyPressMsg) (tea.Model, tea.Cmd)

func (*InputView) HasHistorySuggestion

func (iv *InputView) HasHistorySuggestion() bool

HasHistorySuggestion returns true if there's a history suggestion available

func (*InputView) Init

func (iv *InputView) Init() tea.Cmd

Bubble Tea interface

func (*InputView) InvalidateGitBranchCache

func (iv *InputView) InvalidateGitBranchCache()

InvalidateGitBranchCache clears the git branch cache to force a refresh.

func (*InputView) IsDisabled

func (iv *InputView) IsDisabled() bool

IsDisabled returns whether the input is disabled

func (*InputView) IsNavigatingHistory

func (iv *InputView) IsNavigatingHistory() bool

IsNavigatingHistory reports whether input-history navigation is active, i.e. whether arrow-down still has an entry to return to

func (*InputView) NavigateHistoryDown

func (iv *InputView) NavigateHistoryDown()

NavigateHistoryDown moves down in history (to newer messages) - public method for interface

func (*InputView) NavigateHistoryUp

func (iv *InputView) NavigateHistoryUp()

NavigateHistoryUp moves up in history (to older messages) - public method for interface

func (*InputView) Render

func (iv *InputView) Render() string

func (*InputView) SetConfig

func (iv *InputView) SetConfig(cfg *config.Config)

SetConfig sets the config for this input view

func (*InputView) SetConversationRepo

func (iv *InputView) SetConversationRepo(repo convdomain.ConversationRepository)

SetConversationRepo sets the conversation repository for context usage display

func (*InputView) SetCursor

func (iv *InputView) SetCursor(position int)

SetCursor moves the cursor to the given byte offset into GetInput().

func (*InputView) SetCustomHint

func (iv *InputView) SetCustomHint(hint string)

SetCustomHint sets a custom hint Note: The input is disabled separately by handleViewSpecificMessages based on navigation mode

func (*InputView) SetDisabled

func (iv *InputView) SetDisabled(disabled bool)

SetDisabled sets whether the input is disabled (prevents typing) When disabling, saves the current text and clears the input When re-enabling, restores the saved text

func (*InputView) SetFileService

func (iv *InputView) SetFileService(fileService agentdomain.FileService)

SetFileService sets the file service so "@<path>" references to real files can be highlighted in the input.

func (*InputView) SetGitHubIssueService

func (iv *InputView) SetGitHubIssueService(s agentdomain.GitHubIssueService)

SetGitHubIssueService enables "#<number>" highlighting in the input. The validator only checks the digit shape - resolution against actual repo issues happens at submit time in the expansion path.

func (*InputView) SetHeight

func (iv *InputView) SetHeight(height int)

func (*InputView) SetImageService

func (iv *InputView) SetImageService(imageService agentdomain.ImageService)

SetImageService sets the image service for this input view

func (*InputView) SetMessageQueue

func (iv *InputView) SetMessageQueue(mq convdomain.MessageQueue)

SetMessageQueue sets the message queue so arrow-up can restore queued message content into the input field instead of navigating history.

func (*InputView) SetPlaceholder

func (iv *InputView) SetPlaceholder(text string)

func (*InputView) SetShortcutRegistry

func (iv *InputView) SetShortcutRegistry(registry *shortcuts.Registry)

SetShortcutRegistry sets the shortcut registry so "/<shortcut>" tokens can be highlighted in the input.

func (*InputView) SetSkillsService

func (iv *InputView) SetSkillsService(skillsService agentdomain.SkillsService)

SetSkillsService sets the skills service so "/<skill>" tokens can be highlighted in the input to signal they route to the agent.

func (*InputView) SetStateManager

func (iv *InputView) SetStateManager(stateManager inputViewState)

SetStateManager sets the state manager for this input view

func (*InputView) SetText

func (iv *InputView) SetText(text string)

func (*InputView) SetThemeService

func (iv *InputView) SetThemeService(themeService tui.ThemeService)

SetThemeService sets the theme service for this input view

func (*InputView) SetUsageHint

func (iv *InputView) SetUsageHint(hint string)

SetUsageHint sets the usage hint for ghost text display

func (*InputView) SetWidth

func (iv *InputView) SetWidth(width int)

func (*InputView) TryHandleHistorySuggestionTab

func (iv *InputView) TryHandleHistorySuggestionTab() bool

TryHandleHistorySuggestionTab handles Tab key for history suggestions Returns true if handled (either cycled or accepted), false if no suggestion available

func (*InputView) Update

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

func (*InputView) View

func (iv *InputView) View() tea.View

type InstallOpentaskView added in v0.182.0

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

InstallOpentaskView drives the GitHub App setup wizard with huh forms. The flow is split across two forms so that the browser can be opened between the "create a new app?" answer and the App ID prompt: confirm -> (open browser when creating new) -> App ID -> private key (skipped when org secrets already exist for that App ID).

func NewInstallOpentaskView added in v0.182.0

func NewInstallOpentaskView(styleProvider *styles.Provider) *InstallOpentaskView

NewInstallOpentaskView creates a new GitHub App setup wizard.

func (*InstallOpentaskView) GetInstallationURL added in v0.182.0

func (v *InstallOpentaskView) GetInstallationURL(repoOwner, repoName string) string

GetInstallationURL returns the URL to install the GitHub App on a repository

func (*InstallOpentaskView) GetResult added in v0.182.0

func (v *InstallOpentaskView) GetResult() (appID, privateKeyPath string, err error)

GetResult returns the wizard result.

func (*InstallOpentaskView) Init added in v0.182.0

func (v *InstallOpentaskView) Init() tea.Cmd

func (*InstallOpentaskView) IsCancelled added in v0.182.0

func (v *InstallOpentaskView) IsCancelled() bool

IsCancelled returns whether the wizard was cancelled.

func (*InstallOpentaskView) IsDone added in v0.182.0

func (v *InstallOpentaskView) IsDone() bool

IsDone returns whether the wizard is complete.

func (*InstallOpentaskView) Reset added in v0.182.0

func (v *InstallOpentaskView) Reset()

Reset resets the view state for reuse.

func (*InstallOpentaskView) SetHeight added in v0.182.0

func (v *InstallOpentaskView) SetHeight(height int)

SetHeight sets the height of the view.

func (*InstallOpentaskView) SetRepositoryInfo added in v0.182.0

func (v *InstallOpentaskView) SetRepositoryInfo(owner string, isOrg bool)

SetRepositoryInfo sets the repository owner and whether it's an org.

func (*InstallOpentaskView) SetSecretsExistChecker added in v0.182.0

func (v *InstallOpentaskView) SetSecretsExistChecker(checker func(appID string) bool)

SetSecretsExistChecker sets the callback to check if org secrets exist.

func (*InstallOpentaskView) SetWidth added in v0.182.0

func (v *InstallOpentaskView) SetWidth(width int)

SetWidth sets the width of the view.

func (*InstallOpentaskView) Update added in v0.182.0

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

func (*InstallOpentaskView) View added in v0.182.0

func (v *InstallOpentaskView) View() tea.View

type KeyHintFormatter

type KeyHintFormatter interface {
	GetKeyHint(actionID, defaultLabel string) string
}

KeyHintFormatter provides formatted key hints for actions

type ModeIndicator

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

ModeIndicator names the current agent mode (PLAN/AUTO/JUDGE) as a label the application view lays out on the right of the status row.

func NewModeIndicator

func NewModeIndicator(styleProvider *styles.Provider) *ModeIndicator

NewModeIndicator creates a new mode indicator

func (*ModeIndicator) SetJudgeModelFn added in v0.188.0

func (mi *ModeIndicator) SetJudgeModelFn(fn func() string)

SetJudgeModelFn names the model that approves tool calls in Auto+Judge mode so the indicator shows who the judge is; resolved at render time so it follows a model switched during the session.

func (*ModeIndicator) SetStateManager

func (mi *ModeIndicator) SetStateManager(stateManager agentdomain.AgentModeState)

SetStateManager sets the state manager

func (*ModeIndicator) Text added in v0.210.0

func (mi *ModeIndicator) Text() string

Text returns the styled mode label, empty while the default mode is active.

type ModelCapabilityFilter added in v0.189.0

type ModelCapabilityFilter int

ModelCapabilityFilter narrows the list by input modality, ANDed with the pricing tab. Only chat-capable models are listed at all, so "text" is not a filter; the dimensions are the extra input modalities a chat model accepts.

const (
	CapabilityAny ModelCapabilityFilter = iota
	CapabilityVision
	CapabilityAudio
	CapabilityVideo
)

type ModelSelector added in v0.207.0

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

ModelSelector implements model selection UI as a huh select with the pricing tabs (keys 1-4) layered on top: switching a tab rebuilds the form with that tab's option set. Search is a dedicated textinput (entered with `/`) filtering on the model name; huh's built-in filter is disabled since it renders the query into the select's title line instead of a real input.

func NewModelSelector

func NewModelSelector(models []string, modelService convdomain.ModelService, pricingService convdomain.PricingService, cfg *config.Config, styleProvider *styles.Provider) *ModelSelector

NewModelSelector creates a new model selector

func (*ModelSelector) GetSelected added in v0.207.0

func (m *ModelSelector) GetSelected() string

GetSelected returns the selected model

func (*ModelSelector) Init added in v0.207.0

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

func (*ModelSelector) IsCancelled added in v0.207.0

func (m *ModelSelector) IsCancelled() bool

IsCancelled returns true if selection was cancelled

func (*ModelSelector) IsSelected added in v0.207.0

func (m *ModelSelector) IsSelected() bool

IsSelected returns true if a model was selected

func (*ModelSelector) Reset added in v0.207.0

func (m *ModelSelector) Reset()

Reset clears the done/cancelled flags and rebuilds the form so the selector can be re-entered after a previous selection.

func (*ModelSelector) SetHeight added in v0.207.0

func (m *ModelSelector) SetHeight(height int)

SetHeight sets the height of the model selector

func (*ModelSelector) SetWidth added in v0.207.0

func (m *ModelSelector) SetWidth(width int)

SetWidth sets the width of the model selector

func (*ModelSelector) Update added in v0.207.0

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

func (*ModelSelector) View added in v0.207.0

func (m *ModelSelector) View() tea.View

type ModelViewMode

type ModelViewMode int

ModelViewMode defines the different filter modes for models

const (
	ModelViewAll ModelViewMode = iota
	ModelViewFree
	ModelViewPayAsYouGo
	ModelViewSubscription
)
type NavigationMode int

NavigationMode represents the current navigation state of the conversation view

const (
	// NavigationModeNormal is the default mode for displaying conversation
	NavigationModeNormal NavigationMode = iota
	// NavigationModeMessageHistory is the mode for navigating message history
	NavigationModeMessageHistory
)

type QuestionFormView

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

QuestionFormView drives the interactive AskUserQuestion form as a bordered box floating above the input (mirroring ApprovalBoxView). It owns the answer-in-progress state as one huh form per question; the state store only carries the questions, the overlay-active flag, and the response channel. The agent loop is blocked in the tool goroutine until the answers are sent on the channel (or it is closed, signalling cancellation).

func NewQuestionFormView

func NewQuestionFormView(styleProvider *styles.Provider, stateManager tui.UserQuestionPrompt) *QuestionFormView

func (*QuestionFormView) Begin

func (qv *QuestionFormView) Begin() tea.Cmd

Begin starts a new form for the questions currently in the state store. Call it when a UserQuestionRequestedEvent has set up the state.

func (*QuestionFormView) Forward

func (qv *QuestionFormView) Forward(msg tea.Msg) tea.Cmd

Forward delegates a message to the active form and reacts to completion or abort. All messages (keys and huh's internal command messages) must be routed here while the form is up, or group/field navigation breaks.

func (*QuestionFormView) Init

func (qv *QuestionFormView) Init() tea.Cmd

func (*QuestionFormView) Render

func (qv *QuestionFormView) Render() string

func (*QuestionFormView) SetHeight

func (qv *QuestionFormView) SetHeight(height int)

func (*QuestionFormView) SetWidth

func (qv *QuestionFormView) SetWidth(width int)

func (*QuestionFormView) Update

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

func (*QuestionFormView) View

func (qv *QuestionFormView) View() tea.View

type QueueBoxView

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

func NewQueueBoxView

func NewQueueBoxView(styleProvider *styles.Provider) *QueueBoxView

func (*QueueBoxView) Init

func (qv *QueueBoxView) Init() tea.Cmd

func (*QueueBoxView) Render

func (qv *QueueBoxView) Render(queuedMessages []convdomain.QueuedMessage) string

func (*QueueBoxView) SetHeight

func (qv *QueueBoxView) SetHeight(height int)

func (*QueueBoxView) SetToolFormatter

func (qv *QueueBoxView) SetToolFormatter(f tui.ToolFormatter)

SetToolFormatter wires the shared tool formatter so queued tool calls show their width-aware argument preview instead of a bare "Name(...)".

func (*QueueBoxView) SetWidth

func (qv *QueueBoxView) SetWidth(width int)

func (*QueueBoxView) Update

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

func (*QueueBoxView) View

func (qv *QueueBoxView) View() tea.View

type SnippetAttachmentsView

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

SnippetAttachmentsView renders the pending snippet attachments as a small tree below the chat input: one parent row per file, one indented child row per captured line range. It is a passive renderer driven by ChatApplication (mirroring TodoBoxView) - focus, cursor and the snippet list are pushed in before each render. The selected content is sent with the next chat message.

func NewSnippetAttachmentsView

func NewSnippetAttachmentsView(styleProvider *styles.Provider) *SnippetAttachmentsView

NewSnippetAttachmentsView creates an empty attachments view.

func (*SnippetAttachmentsView) Blur

func (v *SnippetAttachmentsView) Blur()

Blur removes key focus from the tree.

func (*SnippetAttachmentsView) Count

func (v *SnippetAttachmentsView) Count() int

Count returns the number of attached snippets.

func (*SnippetAttachmentsView) Focus

func (v *SnippetAttachmentsView) Focus()

Focus gives the tree key focus, clamping the cursor into range.

func (*SnippetAttachmentsView) GetHeight

func (v *SnippetAttachmentsView) GetHeight() int

GetHeight returns the rendered line count (0 when there is nothing to show).

func (*SnippetAttachmentsView) IsFocused

func (v *SnippetAttachmentsView) IsFocused() bool

IsFocused reports whether the tree currently has key focus.

func (*SnippetAttachmentsView) MoveCursor

func (v *SnippetAttachmentsView) MoveCursor(delta int)

MoveCursor moves the selection by delta rows, clamping to the list bounds.

func (*SnippetAttachmentsView) Render

func (v *SnippetAttachmentsView) Render() string

Render returns the framed tree, or "" when there are no attachments.

func (*SnippetAttachmentsView) SelectedIndex

func (v *SnippetAttachmentsView) SelectedIndex() int

SelectedIndex returns the index into the app's pending list for the focused row, or -1 when empty.

func (*SnippetAttachmentsView) SetData

func (v *SnippetAttachmentsView) SetData(sels []SnippetSelection)

SetData stores a copy of the pending selections and recomputes display order.

func (*SnippetAttachmentsView) SetFocusHint

func (v *SnippetAttachmentsView) SetFocusHint(key string)

SetFocusHint sets the key label shown in the unfocused header.

func (*SnippetAttachmentsView) SetWidth

func (v *SnippetAttachmentsView) SetWidth(width int)

SetWidth sets the component width.

type SnippetSelection

type SnippetSelection struct {
	File       string
	StartLine  int
	EndLine    int
	Annotation string
}

SnippetSelection is one annotated line range captured in explorer select mode. Line numbers are 1-indexed and inclusive. The Annotation is the natural-language instruction the user attached to the highlighted range.

type StatusState

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

StatusState represents a saved status state

type StatusView

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

StatusView handles status messages, errors, and loading spinners

func NewStatusView

func NewStatusView(styleProvider *styles.Provider) *StatusView

func (*StatusView) ClearStatus

func (sv *StatusView) ClearStatus()

func (*StatusView) HasSavedState

func (sv *StatusView) HasSavedState() bool

HasSavedState returns true if there's a saved state that can be restored

func (*StatusView) Init

func (sv *StatusView) Init() tea.Cmd

Bubble Tea interface

func (*StatusView) IsShowingError

func (sv *StatusView) IsShowingError() bool

func (*StatusView) IsShowingSpinner

func (sv *StatusView) IsShowingSpinner() bool

func (*StatusView) Render

func (sv *StatusView) Render() string

func (*StatusView) RestoreSavedState

func (sv *StatusView) RestoreSavedState()

RestoreSavedState restores the previously saved status state

func (*StatusView) SaveCurrentState

func (sv *StatusView) SaveCurrentState()

SaveCurrentState saves the current status state for later restoration

func (*StatusView) SetHeight

func (sv *StatusView) SetHeight(height int)

func (*StatusView) SetKeyHintFormatter

func (sv *StatusView) SetKeyHintFormatter(formatter *hints.Formatter)

SetKeyHintFormatter sets the key hint formatter for displaying keybinding hints

func (*StatusView) SetStateManager

func (sv *StatusView) SetStateManager(stateManager statusViewState)

SetStateManager wires the state manager so the spinner line can reflect connection health (retries and stalled streams) while waiting for chunks.

func (*StatusView) SetWidth

func (sv *StatusView) SetWidth(width int)

func (*StatusView) ShowError

func (sv *StatusView) ShowError(message string)

func (*StatusView) ShowSpinner

func (sv *StatusView) ShowSpinner(message string)

func (*StatusView) ShowSpinnerWithType

func (sv *StatusView) ShowSpinnerWithType(message string, statusType tui.StatusType, progress *tui.StatusProgress)

func (*StatusView) ShowStatus

func (sv *StatusView) ShowStatus(message string)

func (*StatusView) ShowStatusWithType

func (sv *StatusView) ShowStatusWithType(message string, statusType tui.StatusType, progress *tui.StatusProgress)

func (*StatusView) Update

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

func (*StatusView) UpdateSpinnerMessage

func (sv *StatusView) UpdateSpinnerMessage(message string, statusType tui.StatusType)

func (*StatusView) View

func (sv *StatusView) View() tea.View

type SubagentCatalog added in v0.214.0

type SubagentCatalog interface {
	ListMarkdownSubagents() []agentdomain.SubagentInfo
}

SubagentCatalog supplies the Markdown-defined subagent presets (.infer/agents/*.md) for the agents listing.

type SubagentList added in v0.219.0

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

SubagentList renders the stacked list below the composer stretched across its width: one row per background job (sub-agent, A2A task, shell, recording) with its label, its kind and a live elapsed counter. Finished jobs linger with their outcome.

func NewSubagentList added in v0.219.0

func NewSubagentList(styleProvider *styles.Provider) *SubagentList

NewSubagentList creates the sub-agent indicator list.

func (*SubagentList) Blur added in v0.220.0

func (l *SubagentList) Blur()

Blur returns the list to display only and stops pinning a viewed row.

func (*SubagentList) CanWrapUp added in v0.225.0

func (l *SubagentList) CanWrapUp() bool

CanWrapUp reports whether the selected job can be asked to finish and report.

func (*SubagentList) Focus added in v0.220.0

func (l *SubagentList) Focus() bool

Focus gives the list the keyboard selection on its newest row. It reports false when there is no row to select.

func (*SubagentList) HasRows added in v0.225.0

func (l *SubagentList) HasRows() bool

HasRows reports whether any row, running or lingering, is on screen. The chat's live clock ticks once a second while it holds, which advances the elapsed column and drops rows whose linger ran out.

func (*SubagentList) Init added in v0.219.0

func (l *SubagentList) Init() tea.Cmd

Init implements tea.Model.

func (*SubagentList) IsFocused added in v0.220.0

func (l *SubagentList) IsFocused() bool

IsFocused reports whether the list holds the keyboard selection.

func (*SubagentList) Job added in v0.220.0

Job returns the tracked job with the given ID, false when it was reaped.

func (*SubagentList) Render added in v0.219.0

func (l *SubagentList) Render() string

Render draws the rows stretched across the composer's width, flush with the version column edge. Every row spans the same columns so the tree connector never drifts when durations gain digits. Empty output when nothing runs or lingers reserves no lines.

func (*SubagentList) SelectNext added in v0.220.0

func (l *SubagentList) SelectNext() bool

SelectNext moves the selection one row down. It reports false on the last row.

func (*SubagentList) SelectPrev added in v0.220.0

func (l *SubagentList) SelectPrev() bool

SelectPrev moves the selection one row up. It reports false on the first row.

func (*SubagentList) SelectedJob added in v0.220.0

func (l *SubagentList) SelectedJob() (scheddomain.TrackedJob, bool)

SelectedJob returns the job under the selection, false when it is gone.

func (*SubagentList) SetConfig added in v0.219.0

func (l *SubagentList) SetConfig(cfg *config.Config)

SetConfig wires the config so the indicator toggle and linger delay are read live at render time.

func (*SubagentList) SetNote added in v0.225.0

func (l *SubagentList) SetNote(jobID, note string)

SetNote leaves a one-line note on a job, shown in place of the key legend while that job stays selected.

func (*SubagentList) SetRegistry added in v0.219.0

func (l *SubagentList) SetRegistry(registry scheddomain.BackgroundTaskRegistry)

SetRegistry wires the shared background task registry, the data source for every tracked sub-agent.

func (*SubagentList) SetViewing added in v0.220.0

func (l *SubagentList) SetViewing(id string)

SetViewing marks the job whose transcript is on screen, which pins its row past the linger window. An empty ID clears it.

func (*SubagentList) Update added in v0.219.0

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

func (*SubagentList) View added in v0.219.0

func (l *SubagentList) View() tea.View

View renders the list wrapped in a tea.View.

type TaskInfo

type TaskInfo struct {
	a2adomain.TaskPollingState
	Status      string
	ElapsedTime time.Duration
	TaskRef     *a2adomain.TaskInfo
	Kind        scheddomain.JobKind
	Label       string
	Detail      string
	Output      string
	SessionID   string
	Stats       *scheddomain.SubagentRunStats
}

TaskInfo extends TaskPollingState with additional metadata for UI display. Kind/Label/Detail carry the background-work kind (A2A task, shell, subagent) and its kind-specific columns so the view can render one table per kind from a single flat, selectable list. A2A rows keep using the embedded TaskPollingState/TaskRef; shell and subagent rows populate Kind/Label/Detail. Output carries the job's captured output (shell stdout/stderr or subagent result) for the detail panel. SessionID and Stats are a subagent's stored conversation and run stats.

type TaskView added in v0.207.0

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

TaskView implements task management UI similar to conversation selection

func NewTaskView added in v0.207.0

func NewTaskView(
	themeService tui.ThemeService,
	styleProvider *styles.Provider,
	taskRetentionService a2adomain.TaskRetentionService,
	backgroundTaskService a2adomain.BackgroundTaskService,
) *TaskView

NewTaskView creates a new task manager UI component

func (*TaskView) GetSelectedTask added in v0.207.0

func (t *TaskView) GetSelectedTask() *TaskInfo

GetSelectedTask returns the currently selected task (used by parent components)

func (*TaskView) Init added in v0.207.0

func (t *TaskView) Init() tea.Cmd

func (*TaskView) IsCancelled added in v0.207.0

func (t *TaskView) IsCancelled() bool

IsCancelled returns true if the user cancelled the task manager

func (*TaskView) IsDone added in v0.207.0

func (t *TaskView) IsDone() bool

IsDone returns true if the user has finished with the task manager

func (*TaskView) Reset added in v0.207.0

func (t *TaskView) Reset()

Reset resets the task manager state for reuse

func (*TaskView) SetBackgroundTaskRegistry added in v0.207.0

func (t *TaskView) SetBackgroundTaskRegistry(registry scheddomain.BackgroundTaskRegistry)

SetBackgroundTaskRegistry wires the unified registry so the view can show live counts of every background-work kind (A2A tasks, shells, subagents), not just the A2A tasks listed in the table below.

func (*TaskView) SetHeight added in v0.207.0

func (t *TaskView) SetHeight(height int)

SetHeight sets the height of the task manager

func (*TaskView) SetTranscriptLoader added in v0.220.0

func (t *TaskView) SetTranscriptLoader(load func(sessionID string) []convdomain.ConversationEntry)

SetTranscriptLoader wires how a subagent's stored conversation is read. The loader returns nil when there is none, and the panel shows the final answer.

func (*TaskView) SetWidth added in v0.207.0

func (t *TaskView) SetWidth(width int)

SetWidth sets the width of the task manager

func (*TaskView) Update added in v0.207.0

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

func (*TaskView) View added in v0.207.0

func (t *TaskView) View() tea.View

type TaskViewMode

type TaskViewMode int
const (
	TaskViewAll TaskViewMode = iota
	TaskViewActive
	TaskViewInputRequired
	TaskViewCompleted
	TaskViewCanceled
)

type ThemeSelector added in v0.207.0

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

ThemeSelector implements theme selection UI on top of bubbles/v2/list, which provides cursor movement, fuzzy filtering (press /), pagination and help for free.

func NewThemeSelector

func NewThemeSelector(themeService tui.ThemeService, styleProvider *styles.Provider) *ThemeSelector

NewThemeSelector creates a new theme selector.

func (*ThemeSelector) GetSelected added in v0.207.0

func (m *ThemeSelector) GetSelected() string

GetSelected returns the selected theme.

func (*ThemeSelector) Init added in v0.207.0

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

func (*ThemeSelector) IsCancelled added in v0.207.0

func (m *ThemeSelector) IsCancelled() bool

IsCancelled returns true if selection was cancelled.

func (*ThemeSelector) IsSelected added in v0.207.0

func (m *ThemeSelector) IsSelected() bool

IsSelected returns true if a theme was selected.

func (*ThemeSelector) Reset added in v0.207.0

func (m *ThemeSelector) Reset()

Reset returns the selector to its initial state, rebuilding the items so the active-theme marker reflects any theme change since it was last shown.

func (*ThemeSelector) SetHeight added in v0.207.0

func (m *ThemeSelector) SetHeight(height int)

SetHeight sets the height of the theme selector.

func (*ThemeSelector) SetWidth added in v0.207.0

func (m *ThemeSelector) SetWidth(width int)

SetWidth sets the width of the theme selector.

func (*ThemeSelector) Update added in v0.207.0

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

func (*ThemeSelector) View added in v0.207.0

func (m *ThemeSelector) View() tea.View

type TodoBoxView

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

TodoBoxView displays a collapsible todo list component

func NewTodoBoxView

func NewTodoBoxView(styleProvider *styles.Provider) *TodoBoxView

NewTodoBoxView creates a new todo box view

func (*TodoBoxView) AutoCollapse

func (tv *TodoBoxView) AutoCollapse() bool

AutoCollapse collapses if auto-expanded and delay has passed

func (*TodoBoxView) GetHeight

func (tv *TodoBoxView) GetHeight() int

GetHeight returns the height of the rendered component

func (*TodoBoxView) GetTodos

func (tv *TodoBoxView) GetTodos() []agentdomain.TodoItem

GetTodos returns the current todos

func (*TodoBoxView) HasTodos

func (tv *TodoBoxView) HasTodos() bool

HasTodos returns whether there are any todos

func (*TodoBoxView) Init

func (tv *TodoBoxView) Init() tea.Cmd

Init initializes the component

func (*TodoBoxView) IsExpanded

func (tv *TodoBoxView) IsExpanded() bool

IsExpanded returns whether the component is expanded

func (*TodoBoxView) Render

func (tv *TodoBoxView) Render() string

Render renders the todo box

func (*TodoBoxView) SetExpanded

func (tv *TodoBoxView) SetExpanded(expanded bool)

SetExpanded sets the expanded state (user action)

func (*TodoBoxView) SetHeight

func (tv *TodoBoxView) SetHeight(height int)

SetHeight sets the component height

func (*TodoBoxView) SetTodos

func (tv *TodoBoxView) SetTodos(todos []agentdomain.TodoItem)

SetTodos updates the todo list and triggers auto-expand

func (*TodoBoxView) SetWidth

func (tv *TodoBoxView) SetWidth(width int)

SetWidth sets the component width

func (*TodoBoxView) ShouldAutoCollapse

func (tv *TodoBoxView) ShouldAutoCollapse() bool

ShouldAutoCollapse returns true if the component should auto-collapse

func (*TodoBoxView) Toggle

func (tv *TodoBoxView) Toggle()

Toggle toggles the expanded state

func (*TodoBoxView) Update

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

Update handles messages

func (*TodoBoxView) View

func (tv *TodoBoxView) View() tea.View

View returns the rendered view

type ToolCallInfo

type ToolCallInfo struct {
	Name string
	Args map[string]any
}

type ToolCallRenderer

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

func NewToolCallRenderer

func NewToolCallRenderer(styleProvider *styles.Provider) *ToolCallRenderer

func (*ToolCallRenderer) ClearPreviews

func (r *ToolCallRenderer) ClearPreviews()

func (*ToolCallRenderer) HasActivePreviews

func (r *ToolCallRenderer) HasActivePreviews() bool

func (*ToolCallRenderer) Init

func (r *ToolCallRenderer) Init() tea.Cmd

func (*ToolCallRenderer) RenderPreviews

func (r *ToolCallRenderer) RenderPreviews() string

func (*ToolCallRenderer) SetKeyHintFormatter

func (r *ToolCallRenderer) SetKeyHintFormatter(formatter KeyHintFormatter)

SetKeyHintFormatter sets the key hint formatter for dynamic keybinding hints

func (*ToolCallRenderer) SetStateManager

func (r *ToolCallRenderer) SetStateManager(stateManager approvalOverlayReader)

SetStateManager wires the state manager so running-tool timers can pause while an approval or question overlay is blocked on the user.

func (*ToolCallRenderer) SetToolFormatter

func (r *ToolCallRenderer) SetToolFormatter(f tui.ToolFormatter)

SetToolFormatter wires the shared tool formatter so live previews render the same width-aware "<icon> Name(args) <status>" summary as the collapsed results, instead of a byte-truncated raw-JSON preview.

func (*ToolCallRenderer) SetWidth

func (r *ToolCallRenderer) SetWidth(width int)

func (*ToolCallRenderer) Update

func (r *ToolCallRenderer) Update(msg tea.Msg) (*ToolCallRenderer, tea.Cmd)

type ToolRenderState

type ToolRenderState struct {
	CallID           string
	ToolName         string
	Status           string
	Arguments        string
	StartTime        time.Time
	EndTime          *time.Time
	LastUpdate       time.Time
	OutputBuffer     []string
	TotalOutputLines int
	IsComplete       bool
	IsExpanded       bool
}

ToolRenderState represents the unified rendering state for all tool executions

type ToolsView added in v0.207.0

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

ToolsView is a read-only, filterable list of the tools currently available to the agent. It reuses the bubbles/v2 list plumbing from the theme selector; enter deliberately does nothing yet - selecting a tool to inspect or execute it is future work.

func NewToolsView

func NewToolsView(toolService agentdomain.ToolService, stateManager agentdomain.AgentModeState, styleProvider *styles.Provider) *ToolsView

NewToolsView creates the tools list view. Items are populated by Reset on every entry because the tool set changes with the agent mode and with async MCP tool registration.

func (*ToolsView) Init added in v0.207.0

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

func (*ToolsView) IsCancelled added in v0.207.0

func (m *ToolsView) IsCancelled() bool

IsCancelled returns true once the user has dismissed the view.

func (*ToolsView) Reset added in v0.207.0

func (m *ToolsView) Reset()

Reset returns the view to its initial state and rebuilds the items so the list reflects the current agent mode and any MCP tools registered since it was last shown. The delegate and title styles are rebuilt too so a theme switch is picked up on re-entry.

func (*ToolsView) SetHeight added in v0.207.0

func (m *ToolsView) SetHeight(height int)

SetHeight sets the height of the tools view.

func (*ToolsView) SetWidth added in v0.207.0

func (m *ToolsView) SetWidth(width int)

SetWidth sets the width of the tools view.

func (*ToolsView) Update added in v0.207.0

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

func (*ToolsView) View added in v0.207.0

func (m *ToolsView) View() tea.View

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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