Documentation
¶
Overview ¶
Package tui provides the Bubble Tea-based terminal UI for Celeste CLI. This file contains the main application model and layout logic.
Package tui provides the Bubble Tea-based terminal UI for Celeste CLI. This file contains the chat panel component with scrollable viewport.
Package tui provides the Bubble Tea-based terminal UI for Celeste CLI. This file contains the context budget bar that displays token usage.
Package tui provides the Bubble Tea-based terminal UI for Celeste CLI. This file implements an interactive code graph browser for the code graph.
Package tui provides the Bubble Tea-based terminal UI for Celeste CLI. This file contains the input component with command history.
Package tui provides the Bubble Tea-based terminal UI for Celeste CLI. This file contains logging functionality for debugging skill calls.
Package tui provides the Bubble Tea-based terminal UI for Celeste CLI. This file contains the MCP server status panel, accessed via /mcp command.
Package tui provides the Bubble Tea-based terminal UI for Celeste CLI. This file contains message types used for communication between components.
Package tui provides the Bubble Tea-based terminal UI for Celeste CLI. This file contains the permission prompt dialog for tool execution approval.
TUI panel for the /persona command — personality slider controls.
Displays 4 sliders (flirt, warmth, register, lewdness) + the R18 toggle. Users navigate with arrow keys (up/down to select slider, left/right to adjust value) and press Enter to confirm or Esc to cancel. Changes are persisted to ~/.celeste/slider.json on confirm.
The panel also supports preset save/load and reset-to-default.
Package tui provides the interactive selector component.
Session picker panel — browsable list of saved sessions. Replaces the text-dump /session list with an interactive UI.
Package tui — statusline.go holds the segmented bottom status line (git, project, model, effort, permission mode, session), its git poll plumbing, and the contextual key-hint row.
Package tui provides the Bubble Tea-based terminal UI for Celeste CLI. This file contains the simulated streaming/typing effect with corruption.
Package tui provides the Bubble Tea-based terminal UI for Celeste CLI. This file contains Lip Gloss styles using the corrupted-theme color palette.
Package tui provides the Bubble Tea-based terminal UI for Celeste CLI. This file contains the tool progress component that tracks active tool executions.
Index ¶
- Variables
- func ApplyCodeBlockCorruption(content string, typingPos int, corruptionIntensity float64) string
- func CloseLogging()
- func CorruptCodeLine(codeLine string, intensity float64) string
- func CorruptText(text string, intensity float64) string
- func CorruptTextJapanese(text string, intensity float64) string
- func DetectDump(firstChunkSize, totalSize int, elapsed time.Duration) bool
- func GetCodeBlockStyle() lipgloss.Style
- func GetFixedWidthCorruption(width int) string
- func GetLogPath() string
- func GetRandomCorruption() string
- func GetRandomCorruptionPlain() string
- func InitLogging() error
- func LogInfo(msg string)
- func LogLLMRequest(messageCount int, toolCount int)
- func LogLLMResponse(contentLen int, hasToolCalls bool)
- func LogSkillCall(name string, args map[string]any)
- func LogSkillResult(name string, result string, err error)
- func MessageRoleStyle(role string) lipgloss.Style
- func RenderCodeGraphConstellation(indexer *codegraph.Indexer, width int) string
- func Run(llmClient LLMClient) error
- func SendMessage(content string) tea.Cmd
- func SkillStatusStyle(status string) lipgloss.Style
- func StreamingSpinner(frame int) string
- func ThinkingAnimation(frame int) string
- func Tick(d time.Duration) tea.Cmd
- func TypingTickCmd() tea.Cmd
- type AgentCommandResultMsg
- type AgentCommandRunner
- type AgentProgressKind
- type AgentProgressMsg
- type AppModel
- func (m AppModel) Init() tea.Cmd
- func (m AppModel) SetConfig(cfg *config.Config) AppModel
- func (m AppModel) SetLLMClient(client LLMClient) AppModel
- func (m AppModel) SetMCPManager(manager *mcp.Manager, configs map[string]mcp.ServerConfig) AppModel
- func (m AppModel) SetPermissionChecker(c *permissions.Checker) AppModel
- func (m AppModel) SetSessionManager(sm SessionManager, session Session) AppModel
- func (m AppModel) SetVersion(version, build string) AppModel
- func (m AppModel) SetWorkDir(dir string) AppModel
- func (m AppModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m AppModel) View() string
- func (m AppModel) WithCodeGraphIndexer(indexer *codegraph.Indexer) AppModel
- func (m AppModel) WithCodeGraphSummary(summary string) AppModel
- func (m AppModel) WithCommandHistory(history []string) AppModel
- func (m AppModel) WithEndpoint(endpoint string) AppModel
- func (m AppModel) WithGrimoireContent(content string) AppModel
- func (m AppModel) WithMessages(messages []ChatMessage) AppModel
- type AskOption
- type AskPromptModel
- type AskRequestMsg
- type AskResponseMsg
- type ChatMessage
- type ChatModel
- func (m ChatModel) AddAssistantMessage(content string) ChatModel
- func (m ChatModel) AddAssistantMessageWithToolCalls(content string, toolCalls []ToolCallInfo) ChatModel
- func (m ChatModel) AddFunctionCall(call FunctionCall) ChatModel
- func (m ChatModel) AddHiddenUserMessage(content string) ChatModel
- func (m ChatModel) AddSystemMessage(content string) ChatModel
- func (m ChatModel) AddToolResult(toolCallID, name, result string, metadata ...map[string]any) ChatModel
- func (m ChatModel) AddUserMessage(content string) ChatModel
- func (m ChatModel) AppendToLastAssistant(content string) ChatModel
- func (m ChatModel) Clear() ChatModel
- func (m ChatModel) GetLLMMessages() []ChatMessage
- func (m ChatModel) GetMessages() []ChatMessage
- func (m ChatModel) Init() tea.Cmd
- func (m ChatModel) SetLastAssistantContent(content string) ChatModel
- func (m ChatModel) SetSize(width, height int) ChatModel
- func (m ChatModel) SetTypingActive(active bool) ChatModel
- func (m ChatModel) ShowingSkillCalls() bool
- func (m ChatModel) ToggleSkillCalls() ChatModel
- func (m ChatModel) Update(msg tea.Msg) (ChatModel, tea.Cmd)
- func (m ChatModel) UpdateFunctionResult(name, result string) ChatModel
- func (m ChatModel) View() string
- type CollectionsModel
- type ContextBarModel
- type ContextBudgetMsg
- type ContextIndicator
- func (ci ContextIndicator) GetUsageInfo() string
- func (ci ContextIndicator) GetWarningLevel() string
- func (ci ContextIndicator) GetWarningMessage() string
- func (ci ContextIndicator) SetShowPercentage(show bool) ContextIndicator
- func (ci ContextIndicator) SetShowProgressBar(show bool) ContextIndicator
- func (ci ContextIndicator) SetUsage(current, max int) ContextIndicator
- func (ci ContextIndicator) SetWarningLevel(level string) ContextIndicator
- func (ci ContextIndicator) SetWidth(width int) ContextIndicator
- func (ci ContextIndicator) ShouldShowWarning() bool
- func (ci ContextIndicator) View() string
- func (ci ContextIndicator) ViewCompact() string
- type EndpointSwitcher
- type ErrorMsg
- type FunctionCall
- type GenerateMediaMsg
- type GitStatusMsg
- type GraphModel
- type HeaderModel
- func (m HeaderModel) GetContextWarningLevel() string
- func (m HeaderModel) SetAutoRouted(routed bool) HeaderModel
- func (m HeaderModel) SetContextUsage(current, max int) HeaderModel
- func (m HeaderModel) SetEndpoint(endpoint string) HeaderModel
- func (m HeaderModel) SetImageModel(model string) HeaderModel
- func (m HeaderModel) SetModel(model string) HeaderModel
- func (m HeaderModel) SetNSFWMode(enabled bool) HeaderModel
- func (m HeaderModel) SetShowContext(show bool) HeaderModel
- func (m HeaderModel) SetSkillsEnabled(enabled bool) HeaderModel
- func (m HeaderModel) SetWidth(width int) HeaderModel
- func (m HeaderModel) View() string
- type InputModel
- func (m InputModel) Focus() InputModel
- func (m InputModel) GetHistory() []string
- func (m InputModel) Init() tea.Cmd
- func (m InputModel) SetHistory(history []string) InputModel
- func (m InputModel) SetValue(s string) InputModel
- func (m InputModel) SetWidth(width int) InputModel
- func (m InputModel) Update(msg tea.Msg) (InputModel, tea.Cmd)
- func (m InputModel) Value() string
- func (m InputModel) View() string
- type LLMClient
- type MCPConnectResultMsg
- type MCPPanelModel
- func (m MCPPanelModel) Active() bool
- func (m MCPPanelModel) Init() tea.Cmd
- func (m MCPPanelModel) RefreshServers() MCPPanelModel
- func (m *MCPPanelModel) SetManager(manager *mcp.Manager, configs map[string]mcp.ServerConfig)
- func (m *MCPPanelModel) SetSize(width, height int)
- func (m *MCPPanelModel) Show()
- func (m MCPPanelModel) Update(msg tea.Msg) (MCPPanelModel, tea.Cmd)
- func (m MCPPanelModel) View() string
- type MCPServerInfo
- type MCPStatusMsg
- type MediaResultMsg
- type MemoryManagerModel
- type MenuItem
- type MenuModel
- type NSFWToggleMsg
- type OrchestratorCommandRunner
- type OrchestratorEventMsg
- type PermissionPromptModel
- type PermissionRequestMsg
- type PermissionResponse
- type PersonaPanelModel
- func (m PersonaPanelModel) Modified() bool
- func (m *PersonaPanelModel) Save() error
- func (m PersonaPanelModel) SetWidth(w int) PersonaPanelModel
- func (m PersonaPanelModel) Sliders() *config.SliderConfig
- func (m PersonaPanelModel) Update(msg tea.Msg) (PersonaPanelModel, tea.Cmd)
- func (m PersonaPanelModel) View() string
- type PromptRefresher
- type SelectorItem
- type SelectorModel
- func (m SelectorModel) GetSelected() *SelectorItem
- func (m SelectorModel) Init() tea.Cmd
- func (m SelectorModel) IsActive() bool
- func (m SelectorModel) SetHeight(height int) SelectorModel
- func (m SelectorModel) SetWidth(width int) SelectorModel
- func (m SelectorModel) Update(msg tea.Msg) (SelectorModel, tea.Cmd)
- func (m SelectorModel) View() string
- type SelectorResultMsg
- type SendMessageMsg
- type Session
- type SessionEntry
- type SessionManager
- type SessionMessage
- type SessionPanelModel
- func (m SessionPanelModel) Deleted() string
- func (m SessionPanelModel) Selected() string
- func (m SessionPanelModel) SetHeight(h int) SessionPanelModel
- func (m SessionPanelModel) SetWidth(w int) SessionPanelModel
- func (m SessionPanelModel) Update(msg tea.Msg) (SessionPanelModel, tea.Cmd)
- func (m SessionPanelModel) View() string
- type SessionSummary
- type ShowSelectorMsg
- type SimulateTypingMsg
- type SimulatedTyping
- func (s *SimulatedTyping) Advance() int
- func (s *SimulatedTyping) Extend(additional string)
- func (s *SimulatedTyping) GetDisplayed() string
- func (s *SimulatedTyping) GetDisplayedWithCorruption() string
- func (s *SimulatedTyping) IsDone() bool
- func (s *SimulatedTyping) IsEnabled() bool
- func (s *SimulatedTyping) Reset(content string)
- func (s *SimulatedTyping) SetEnabled(enabled bool)
- type SkillCallBatchMsg
- type SkillCallMsg
- type SkillCallRequest
- type SkillDefinition
- type SkillResultMsg
- type SkillsBrowserModel
- type SkillsModel
- func (s SkillsModel) Count() int
- func (s SkillsModel) Enabled() bool
- func (s SkillsModel) SetCompleted(name string) SkillsModel
- func (s SkillsModel) SetConfig(endpoint, model string, enabled bool, nsfw bool, count int, reason string) SkillsModel
- func (s SkillsModel) SetCurrentInput(input string) SkillsModel
- func (s SkillsModel) SetError(name string, err error) SkillsModel
- func (s SkillsModel) SetExecuting(name string) SkillsModel
- func (s SkillsModel) SetExpanded(e bool) SkillsModel
- func (s SkillsModel) SetMenuState(state string) SkillsModel
- func (s SkillsModel) SetSize(width, height int) SkillsModel
- func (s SkillsModel) View() string
- type SplitPanel
- func (s *SplitPanel) Actions() []string
- func (s *SplitPanel) AddAction(text string)
- func (s *SplitPanel) AppendOutput(text string)
- func (s *SplitPanel) AtBottom() bool
- func (s *SplitPanel) DiffContent() string
- func (s *SplitPanel) DiffFile() string
- func (s *SplitPanel) Resize(width, height int)
- func (s *SplitPanel) ScrollDown(lines int)
- func (s *SplitPanel) ScrollRightDown(lines int)
- func (s *SplitPanel) ScrollRightUp(lines int)
- func (s *SplitPanel) ScrollUp(lines int)
- func (s *SplitPanel) SetDiff(file, diff string)
- func (s *SplitPanel) SetOutput(text string)
- func (s *SplitPanel) SetVerdict(text string)
- func (s *SplitPanel) View() string
- type StatusLineModel
- func (m StatusLineModel) SetEffort(effort string) StatusLineModel
- func (m StatusLineModel) SetGit(branch string, dirty, ahead, behind int) StatusLineModel
- func (m StatusLineModel) SetModel(model string) StatusLineModel
- func (m StatusLineModel) SetPermMode(mode string) StatusLineModel
- func (m StatusLineModel) SetProject(p string) StatusLineModel
- func (m StatusLineModel) SetSession(name string) StatusLineModel
- func (m StatusLineModel) SetSkills(enabled bool, count int) StatusLineModel
- func (m StatusLineModel) SetWidth(w int) StatusLineModel
- func (m StatusLineModel) View() string
- type StatusModel
- func (m StatusModel) ClearContextWarning() StatusModel
- func (m StatusModel) SetStreaming(streaming bool) StatusModel
- func (m StatusModel) SetText(text string) StatusModel
- func (m StatusModel) SetWidth(width int) StatusModel
- func (m StatusModel) ShowContextWarning(level string, message string) StatusModel
- func (m StatusModel) Update(msg tea.Msg) (StatusModel, tea.Cmd)
- func (m StatusModel) View() string
- type StreamChunk
- type StreamChunkMsg
- type StreamDoneMsg
- type StreamErrorMsg
- type StreamStartMsg
- type SubagentInfo
- type SubagentKiller
- type SubagentLister
- type SubagentResumer
- type ThinkingConfigSetter
- type TickMsg
- type TokenUsage
- type ToolCallInfo
- type ToolProgressModel
- type ToolProgressMsg
- type TypingTickMsg
- type VeniceConfigData
Constants ¶
This section is empty.
Variables ¶
var ( // Primary accent colors - magenta/pink corruption ColorAccent = lipgloss.Color("#d94f90") // Pink (signature) ColorAccentGlow = lipgloss.Color("#ff4da6") // Bright pink glow // Purple gradient - abyss/void aesthetic ColorPurple = lipgloss.Color("#8b5cf6") // Primary purple ColorPurpleNeon = lipgloss.Color("#c084fc") // Neon purple ColorPurpleDeep = lipgloss.Color("#6b21a8") // Deep void purple // Cyan/blue accents - digital/glitch ColorCyan = lipgloss.Color("#00d4ff") // Bright cyan ColorCyanLight = lipgloss.Color("#67e8f9") // Light cyan // Background colors - deep void ColorBg = lipgloss.Color("#0a0a0a") // Main background ColorBgTertiary = lipgloss.Color("#1a1a2e") // Tertiary bg ColorBgGlass = lipgloss.Color("#1a1a2e") // Glassmorphic layer // Text colors - high contrast ColorText = lipgloss.Color("#f5f1f8") // Primary text (bright) ColorTextSecondary = lipgloss.Color("#b8afc8") // Secondary text ColorTextMuted = lipgloss.Color("#7a7085") // Muted text ColorTextGlow = lipgloss.Color("#ffffff") // Glowing text // Border colors - glassmorphic gradients ColorBorder = lipgloss.Color("#3a2555") // Primary border ColorBorderLight = lipgloss.Color("#5a4575") // Light border ColorBorderGlow = lipgloss.Color("#d94f90") // Glowing border ColorBorderPurple = lipgloss.Color("#8b5cf6") // Purple border ColorBorderCyan = lipgloss.Color("#00d4ff") // Cyan border // Status colors ColorSuccess = lipgloss.Color("#22c55e") // Green ColorError = lipgloss.Color("#ef4444") // Red ColorWarning = lipgloss.Color("#eab308") // Yellow ColorInfo = lipgloss.Color("#06b6d4") // Cyan // Corruption/glitch colors ColorCorrupt1 = lipgloss.Color("#ff4757") // Red corruption ColorCorrupt2 = lipgloss.Color("#ff6b9d") // Pink corruption ColorCorrupt3 = lipgloss.Color("#c084fc") // Purple corruption ColorCorrupt4 = lipgloss.Color("#00d4ff") // Cyan glitch )
Corrupted Theme Colors - Celeste Brand Identity Aligned with whykusanagi.xyz corrupted voidpunk aesthetic
var ( // Base container style BaseStyle = lipgloss.NewStyle(). Background(ColorBg) // Border styles BorderStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(ColorBorder) // Text styles TextStyle = lipgloss.NewStyle(). Foreground(ColorText) TextMutedStyle = lipgloss.NewStyle(). Foreground(ColorTextMuted) TextSecondaryStyle = lipgloss.NewStyle(). Foreground(ColorTextSecondary) // Accent text AccentStyle = lipgloss.NewStyle(). Foreground(ColorAccent). Bold(true) PurpleStyle = lipgloss.NewStyle(). Foreground(ColorPurple) )
Base styles - reusable building blocks
var ( // Header styles - glassmorphic bar with gradient accent HeaderStyle = lipgloss.NewStyle(). Bold(true). Foreground(ColorText). Background(ColorBgGlass). BorderStyle(lipgloss.NormalBorder()). BorderBottom(true). BorderForeground(ColorBorderGlow). Padding(0, 1) HeaderTitleStyle = lipgloss.NewStyle(). Foreground(ColorAccentGlow). Bold(true) HeaderInfoStyle = lipgloss.NewStyle(). Foreground(ColorTextSecondary) // Chat panel styles - no border, just padding ChatPanelStyle = lipgloss.NewStyle(). Padding(0, 1) // Message styles - enhanced with glow effects UserMessageStyle = lipgloss.NewStyle(). Foreground(ColorCyanLight). Bold(false) AssistantMessageStyle = lipgloss.NewStyle(). Foreground(ColorAccentGlow) SystemMessageStyle = lipgloss.NewStyle(). Foreground(ColorPurpleNeon). Italic(true) TimestampStyle = lipgloss.NewStyle(). Foreground(ColorTextMuted). Width(6) // Input panel styles - glassmorphic with gradient border InputPanelStyle = lipgloss.NewStyle(). Foreground(ColorText). Background(ColorBgGlass). BorderStyle(lipgloss.NormalBorder()). BorderTop(true). BorderForeground(ColorBorderPurple). Padding(0, 1) InputPromptStyle = lipgloss.NewStyle(). Foreground(ColorAccentGlow). Bold(true) InputTextStyle = lipgloss.NewStyle(). Foreground(ColorTextGlow) InputPlaceholderStyle = lipgloss.NewStyle(). Foreground(ColorTextMuted). Italic(true) // Skills panel styles - enhanced with glassmorphism SkillsPanelStyle = lipgloss.NewStyle(). Foreground(ColorTextMuted). Background(ColorBgGlass). BorderStyle(lipgloss.RoundedBorder()). BorderForeground(ColorBorderLight). Padding(1, 2). MarginTop(1) SkillNameStyle = lipgloss.NewStyle(). Foreground(ColorAccentGlow). Bold(true) SkillDescStyle = lipgloss.NewStyle(). Foreground(ColorTextSecondary) SkillExecutingStyle = lipgloss.NewStyle(). Foreground(ColorWarning). Bold(true) SkillCompletedStyle = lipgloss.NewStyle(). Foreground(ColorSuccess). Bold(true) SkillErrorStyle = lipgloss.NewStyle(). Foreground(ColorError). Bold(true) // Status bar styles - minimal StatusBarStyle = lipgloss.NewStyle(). Foreground(ColorTextMuted) StatusActiveStyle = lipgloss.NewStyle(). Foreground(ColorSuccess) StatusStreamingStyle = lipgloss.NewStyle(). Foreground(ColorWarning) // NSFW indicator - bold glowing effect NSFWStyle = lipgloss.NewStyle(). Foreground(ColorCorrupt1). Background(ColorBgTertiary). Bold(true). Padding(0, 1) // Endpoint indicator - purple neon EndpointStyle = lipgloss.NewStyle(). Foreground(ColorPurpleNeon). Bold(true) // Model indicator - cyan glow ModelStyle = lipgloss.NewStyle(). Foreground(ColorCyanLight) // Function call display - minimal FunctionCallStyle = lipgloss.NewStyle(). Foreground(ColorPurple). MarginLeft(2) FunctionNameStyle = lipgloss.NewStyle(). Foreground(ColorPurple). Bold(true) FunctionArgsStyle = lipgloss.NewStyle(). Foreground(ColorTextMuted) FunctionResultStyle = lipgloss.NewStyle(). Foreground(ColorTextSecondary) // Corruption/glitch effect styles (for streaming) CorruptedStyle = lipgloss.NewStyle(). Foreground(ColorAccent) GlitchStyle = lipgloss.NewStyle(). Foreground(ColorPurple) )
Component-specific styles with glassmorphism
Functions ¶
func ApplyCodeBlockCorruption ¶
ApplyCodeBlockCorruption detects code blocks (```) and applies corruption styling Used during typing animation to give code blocks a corrupted-typing effect
func CorruptCodeLine ¶
CorruptCodeLine applies corruption effects specifically for code Uses block characters and glitch symbols for a "corrupted terminal" aesthetic
func CorruptText ¶
CorruptText adds block character corruption effects to a string. Used for loading states and other animated text. For character-level Japanese mixing, use CorruptTextJapanese instead.
func CorruptTextJapanese ¶
CorruptTextJapanese mixes Japanese characters INTO English words This creates the classic translation-failure aesthetic: "loaディング", "pro理cessing" Use this for dashboard titles and headers where you want readable corruption.
func DetectDump ¶
DetectDump checks if response appears to be a "dump" (all at once) rather than true streaming. Used to decide if simulation is needed.
func GetCodeBlockStyle ¶
GetCodeBlockStyle returns a lipgloss style for code blocks in corrupted theme
func GetFixedWidthCorruption ¶ added in v1.10.0
GetFixedWidthCorruption returns a corruption buffer padded/truncated to exactly `width` visible characters, styled with ANSI color. This mirrors the JS TypingTextReveal "buffer window" pattern: the corruption phrase flickers at a fixed width so the viewport layout never reflows. The caller MUST skip Glamour rendering for the message containing this string — the ANSI codes will break markdown parsing.
func GetRandomCorruption ¶
func GetRandomCorruption() string
GetRandomCorruption returns a random colored corruption string.
func GetRandomCorruptionPlain ¶
func GetRandomCorruptionPlain() string
GetRandomCorruptionPlain returns corruption without color (for status bar).
func LogLLMRequest ¶
LogLLMRequest logs an LLM request.
func LogLLMResponse ¶
LogLLMResponse logs an LLM response.
func LogSkillCall ¶
LogSkillCall logs when a skill/function is called by the LLM.
func LogSkillResult ¶
LogSkillResult logs the result of a skill execution.
func MessageRoleStyle ¶
MessageRoleStyle returns the appropriate style for a message role.
func RenderCodeGraphConstellation ¶ added in v1.8.3
RenderCodeGraphConstellation produces a structured dependency tree visualization of the code graph using the corrupted theme palette.
func SendMessage ¶
SendMessage returns a command that sends a message to the LLM.
func SkillStatusStyle ¶
SkillStatusStyle returns the appropriate style for a skill execution status.
func StreamingSpinner ¶
StreamingSpinner returns an animated spinner for streaming.
func ThinkingAnimation ¶
ThinkingAnimation returns animated "thinking" text with corruption.
func TypingTickCmd ¶
TickCmd returns a command that sends a typing tick.
Types ¶
type AgentCommandResultMsg ¶ added in v1.7.0
AgentCommandResultMsg is sent when a TUI /agent command completes.
type AgentCommandRunner ¶ added in v1.7.0
AgentCommandRunner is an optional extension for handling /agent from TUI.
type AgentProgressKind ¶ added in v1.7.0
type AgentProgressKind int
AgentProgressKind identifies the type of an AgentProgressMsg.
const ( AgentProgressTurnStart AgentProgressKind = iota // a new turn has started AgentProgressToolCall // agent called a tool AgentProgressStepDone // a plan step was marked done AgentProgressResponse // final assistant response text AgentProgressComplete // run finished successfully AgentProgressError // run failed )
type AgentProgressMsg ¶ added in v1.7.0
type AgentProgressMsg struct {
RunID string
Kind AgentProgressKind
Text string
Turn int
MaxTurns int
// Per-turn stats — populated on ProgressResponse and ProgressComplete kinds.
InputTokens int
OutputTokens int
Duration time.Duration
Ch <-chan AgentProgressMsg
}
AgentProgressMsg is sent incrementally during an agent run. Ch is a channel of further progress messages; nil on terminal kinds (Complete/Error).
func (AgentProgressMsg) ReadNext ¶ added in v1.7.0
func (m AgentProgressMsg) ReadNext() tea.Cmd
ReadNext returns a tea.Cmd that reads the next AgentProgressMsg from Ch. Returns nil when Ch is nil or closed — no command to schedule.
type AppModel ¶
type AppModel struct {
// contains filtered or unexported fields
}
AppModel is the root model for the Celeste TUI application.
func (AppModel) SetLLMClient ¶
SetLLMClient sets the LLM client.
func (AppModel) SetMCPManager ¶ added in v1.13.0
SetMCPManager wires the MCP manager and discovered configs into the /mcp panel so it can connect/disconnect/toggle servers at runtime.
func (AppModel) SetPermissionChecker ¶ added in v1.13.0
func (m AppModel) SetPermissionChecker(c *permissions.Checker) AppModel
SetPermissionChecker injects the permission checker so the status line can display the current mode.
func (AppModel) SetSessionManager ¶
func (m AppModel) SetSessionManager(sm SessionManager, session Session) AppModel
SetSessionManager sets the session manager for persistence.
func (AppModel) SetVersion ¶
SetVersion sets the application version and build information.
func (AppModel) SetWorkDir ¶ added in v1.13.0
SetWorkDir sets the working directory used for git polling and the project segment.
func (AppModel) WithCodeGraphIndexer ¶ added in v1.8.3
WithCodeGraphIndexer sets the code graph indexer for /graph visualization.
func (AppModel) WithCodeGraphSummary ¶ added in v1.8.3
WithCodeGraphSummary sets the code graph summary for /index display.
func (AppModel) WithCommandHistory ¶ added in v1.7.0
WithCommandHistory restores the command history from a saved session.
func (AppModel) WithEndpoint ¶
WithEndpoint restores the endpoint/provider from a loaded session.
func (AppModel) WithGrimoireContent ¶ added in v1.8.3
SetConfig sets the configuration for accessing context limits and other settings. WithGrimoireContent sets the grimoire content for /grimoire display.
func (AppModel) WithMessages ¶
func (m AppModel) WithMessages(messages []ChatMessage) AppModel
WithMessages restores chat history from session messages.
type AskPromptModel ¶ added in v1.13.0
type AskPromptModel struct {
// contains filtered or unexported fields
}
AskPromptModel renders a structured question with selectable options and sends the user's answer back over the request's Response channel. It mirrors PermissionPromptModel: it stores the reply channel and pushes the result on a keypress.
func NewAskPromptModel ¶ added in v1.13.0
func NewAskPromptModel() AskPromptModel
NewAskPromptModel creates an inactive ask prompt.
func (AskPromptModel) Active ¶ added in v1.13.0
func (m AskPromptModel) Active() bool
Active reports whether a question is awaiting an answer.
func (*AskPromptModel) SetSize ¶ added in v1.13.0
func (m *AskPromptModel) SetSize(w, _ int)
SetSize sets the render width.
func (AskPromptModel) Update ¶ added in v1.13.0
func (m AskPromptModel) Update(msg tea.Msg) (AskPromptModel, tea.Cmd)
func (AskPromptModel) View ¶ added in v1.13.0
func (m AskPromptModel) View() string
type AskRequestMsg ¶ added in v1.13.0
type AskRequestMsg struct {
Question string
Options []AskOption
MultiSelect bool
Response chan AskResponseMsg
}
AskRequestMsg asks the user a structured question. Response carries the reply channel the ask bridge blocks on (mirrors PermissionRequestMsg).
type AskResponseMsg ¶ added in v1.13.0
AskResponseMsg is the user's answer to an AskRequestMsg.
type ChatMessage ¶
type ChatMessage struct {
Role string // "user", "assistant", "system", "tool"
Content string // Message content
ToolCallID string // For tool messages, the tool call ID
Name string // For tool messages, the function name
ToolCalls []ToolCallInfo // For assistant messages, the tool calls that were made
Timestamp time.Time // When the message was created
Metadata map[string]any // Optional metadata (e.g. image data from tool results)
}
ChatMessage represents a message in the conversation.
type ChatModel ¶
type ChatModel struct {
// contains filtered or unexported fields
}
ChatModel represents the chat panel with scrollable messages.
func (ChatModel) AddAssistantMessage ¶
AddAssistantMessage adds an assistant message to the chat.
func (ChatModel) AddAssistantMessageWithToolCalls ¶
func (m ChatModel) AddAssistantMessageWithToolCalls(content string, toolCalls []ToolCallInfo) ChatModel
AddAssistantMessageWithToolCalls adds an assistant message with tool calls to the chat.
func (ChatModel) AddFunctionCall ¶
func (m ChatModel) AddFunctionCall(call FunctionCall) ChatModel
AddFunctionCall adds a function call display to the chat.
func (ChatModel) AddHiddenUserMessage ¶ added in v1.10.0
AddHiddenUserMessage adds a user-role message that the LLM sees but the chat UI does not render. Used for directives like identity changes.
func (ChatModel) AddSystemMessage ¶
AddSystemMessage adds a system message to the chat.
func (ChatModel) AddToolResult ¶
func (m ChatModel) AddToolResult(toolCallID, name, result string, metadata ...map[string]any) ChatModel
AddToolResult adds a tool result message to the chat. Optional metadata maps can be passed to attach extra data (e.g. image base64).
func (ChatModel) AddUserMessage ¶
AddUserMessage adds a user message to the chat.
func (ChatModel) AppendToLastAssistant ¶
AppendToLastAssistant appends content to the last assistant message.
func (ChatModel) GetLLMMessages ¶ added in v1.5.2
func (m ChatModel) GetLLMMessages() []ChatMessage
GetLLMMessages returns only messages that should be sent to the LLM, filtering out UI-only system messages (notifications, command results, etc.).
func (ChatModel) GetMessages ¶
func (m ChatModel) GetMessages() []ChatMessage
GetMessages returns all chat messages (including UI-only system messages).
func (ChatModel) SetLastAssistantContent ¶
SetLastAssistantContent sets the content of the last assistant message.
func (ChatModel) SetTypingActive ¶ added in v1.10.0
SetTypingActive marks whether the typing animation is running. When true, the last assistant message skips Glamour markdown rendering so that ANSI-styled corruption glyphs at the cursor don't break the layout.
func (ChatModel) ShowingSkillCalls ¶ added in v1.10.0
ShowingSkillCalls returns whether skill call logs are currently visible.
func (ChatModel) ToggleSkillCalls ¶
ToggleSkillCalls toggles the visibility of skill call logs.
func (ChatModel) UpdateFunctionResult ¶
UpdateFunctionResult updates the result of a function call.
type CollectionsModel ¶
type CollectionsModel struct {
// contains filtered or unexported fields
}
CollectionsModel is the TUI model for collections management
func NewCollectionsModel ¶
func NewCollectionsModel(manager *collections.Manager) CollectionsModel
NewCollectionsModel creates a new collections model
type ContextBarModel ¶ added in v1.7.0
type ContextBarModel struct {
// contains filtered or unexported fields
}
ContextBarModel renders a thin status bar showing token budget usage.
func NewContextBarModel ¶ added in v1.7.0
func NewContextBarModel() ContextBarModel
NewContextBarModel creates a new context bar model.
func (ContextBarModel) Init ¶ added in v1.7.0
func (m ContextBarModel) Init() tea.Cmd
Init initializes the model (no-op).
func (*ContextBarModel) SetSize ¶ added in v1.7.0
func (m *ContextBarModel) SetSize(width, _ int)
SetSize updates the component width.
func (ContextBarModel) Update ¶ added in v1.7.0
func (m ContextBarModel) Update(msg tea.Msg) (ContextBarModel, tea.Cmd)
Update handles messages for the context bar.
func (ContextBarModel) View ¶ added in v1.7.0
func (m ContextBarModel) View() string
View renders the context budget bar.
type ContextBudgetMsg ¶ added in v1.7.0
type ContextBudgetMsg struct {
UsedTokens int
MaxTokens int
UsagePercent float64
CompactCount int
TurnCount int
}
ContextBudgetMsg updates the context budget display.
type ContextIndicator ¶
type ContextIndicator struct {
// contains filtered or unexported fields
}
ContextIndicator displays token usage with visual progress bar and color coding
func NewContextIndicator ¶
func NewContextIndicator() ContextIndicator
NewContextIndicator creates a new context indicator
func (ContextIndicator) GetUsageInfo ¶
func (ci ContextIndicator) GetUsageInfo() string
GetUsageInfo returns formatted usage information
func (ContextIndicator) GetWarningLevel ¶
func (ci ContextIndicator) GetWarningLevel() string
GetWarningLevel returns the current warning level
func (ContextIndicator) GetWarningMessage ¶
func (ci ContextIndicator) GetWarningMessage() string
GetWarningMessage returns a user-friendly warning message
func (ContextIndicator) SetShowPercentage ¶
func (ci ContextIndicator) SetShowPercentage(show bool) ContextIndicator
SetShowPercentage controls percentage display
func (ContextIndicator) SetShowProgressBar ¶
func (ci ContextIndicator) SetShowProgressBar(show bool) ContextIndicator
SetShowProgressBar controls progress bar display
func (ContextIndicator) SetUsage ¶
func (ci ContextIndicator) SetUsage(current, max int) ContextIndicator
SetUsage updates the current token usage
func (ContextIndicator) SetWarningLevel ¶
func (ci ContextIndicator) SetWarningLevel(level string) ContextIndicator
SetWarningLevel explicitly sets the warning level
func (ContextIndicator) SetWidth ¶
func (ci ContextIndicator) SetWidth(width int) ContextIndicator
SetWidth sets the indicator width
func (ContextIndicator) ShouldShowWarning ¶
func (ci ContextIndicator) ShouldShowWarning() bool
ShouldShowWarning returns true if a warning should be displayed
func (ContextIndicator) View ¶
func (ci ContextIndicator) View() string
View renders the context indicator
func (ContextIndicator) ViewCompact ¶
func (ci ContextIndicator) ViewCompact() string
ViewCompact renders a compact version (for header use)
type EndpointSwitcher ¶
type EndpointSwitcher interface {
SwitchEndpoint(endpoint string) error
ChangeModel(model string) error
}
EndpointSwitcher interface for clients that support dynamic endpoint switching.
type FunctionCall ¶
type FunctionCall struct {
Name string // Function name
Arguments map[string]any // Arguments passed to the function
Result string // Result of the function call
Status string // "executing", "completed", "error"
Timestamp time.Time // When the call was initiated
}
FunctionCall represents a tool/function call from the LLM.
type GenerateMediaMsg ¶
type GenerateMediaMsg struct {
MediaType string
Prompt string
Params map[string]interface{}
ImageModel string // Override image model (if set)
}
GenerateMediaMsg is sent to generate media (image/video/etc) via Venice.ai.
type GitStatusMsg ¶ added in v1.13.0
GitStatusMsg carries a refreshed git snapshot into the Update loop.
type GraphModel ¶ added in v1.8.3
type GraphModel struct {
// contains filtered or unexported fields
}
GraphModel is the TUI model for the interactive code graph viewer.
func NewGraphModel ¶ added in v1.8.3
func NewGraphModel(indexer *codegraph.Indexer) GraphModel
NewGraphModel creates a graph view from the code graph indexer.
func (GraphModel) Init ¶ added in v1.8.3
func (m GraphModel) Init() tea.Cmd
Init initializes the graph model.
func (GraphModel) View ¶ added in v1.8.3
func (m GraphModel) View() string
View renders the graph visualization.
type HeaderModel ¶
type HeaderModel struct {
// contains filtered or unexported fields
}
HeaderModel represents the header bar.
func (HeaderModel) GetContextWarningLevel ¶
func (m HeaderModel) GetContextWarningLevel() string
GetContextWarningLevel returns the current context warning level.
func (HeaderModel) SetAutoRouted ¶
func (m HeaderModel) SetAutoRouted(routed bool) HeaderModel
SetAutoRouted sets whether auto-routing occurred.
func (HeaderModel) SetContextUsage ¶
func (m HeaderModel) SetContextUsage(current, max int) HeaderModel
SetContextUsage updates the context usage display.
func (HeaderModel) SetEndpoint ¶
func (m HeaderModel) SetEndpoint(endpoint string) HeaderModel
SetEndpoint sets the current endpoint.
func (HeaderModel) SetImageModel ¶
func (m HeaderModel) SetImageModel(model string) HeaderModel
SetImageModel sets the current image generation model.
func (HeaderModel) SetModel ¶
func (m HeaderModel) SetModel(model string) HeaderModel
SetModel sets the current model.
func (HeaderModel) SetNSFWMode ¶
func (m HeaderModel) SetNSFWMode(enabled bool) HeaderModel
SetNSFWMode sets the NSFW mode indicator.
func (HeaderModel) SetShowContext ¶
func (m HeaderModel) SetShowContext(show bool) HeaderModel
SetShowContext controls whether context usage is displayed.
func (HeaderModel) SetSkillsEnabled ¶
func (m HeaderModel) SetSkillsEnabled(enabled bool) HeaderModel
SetSkillsEnabled sets whether skills/function calling is available.
func (HeaderModel) SetWidth ¶
func (m HeaderModel) SetWidth(width int) HeaderModel
SetWidth sets the header width.
type InputModel ¶
type InputModel struct {
// contains filtered or unexported fields
}
InputModel wraps a textarea for multi-line input with word wrap, command history, and slash-command typeahead.
func NewInputModel ¶
func NewInputModel() InputModel
NewInputModel creates a new input model using textarea for word-wrap support.
func (InputModel) GetHistory ¶
func (m InputModel) GetHistory() []string
GetHistory returns the command history.
func (InputModel) Init ¶
func (m InputModel) Init() tea.Cmd
Init implements the init method for InputModel.
func (InputModel) SetHistory ¶
func (m InputModel) SetHistory(history []string) InputModel
SetHistory sets the command history.
func (InputModel) SetValue ¶
func (m InputModel) SetValue(s string) InputModel
SetValue sets the input text.
func (InputModel) SetWidth ¶
func (m InputModel) SetWidth(width int) InputModel
SetWidth sets the input width.
func (InputModel) Update ¶
func (m InputModel) Update(msg tea.Msg) (InputModel, tea.Cmd)
Update handles messages for the input component.
type LLMClient ¶
type LLMClient interface {
SendMessage(messages []ChatMessage, tools []SkillDefinition) tea.Cmd
GetSkills() []SkillDefinition
ExecuteSkill(name string, args map[string]any, toolCallID string) tea.Cmd
}
LLMClient interface for sending messages to the LLM.
type MCPConnectResultMsg ¶ added in v1.13.0
MCPConnectResultMsg reports the outcome of an async connect/disconnect/toggle.
type MCPPanelModel ¶ added in v1.7.0
type MCPPanelModel struct {
// contains filtered or unexported fields
}
MCPPanelModel displays MCP server connection status and tool counts, and dispatches runtime connect/disconnect/toggle actions.
func NewMCPPanelModel ¶ added in v1.7.0
func NewMCPPanelModel() MCPPanelModel
NewMCPPanelModel creates a new MCP panel model.
func (MCPPanelModel) Active ¶ added in v1.7.0
func (m MCPPanelModel) Active() bool
Active returns whether the MCP panel is currently displayed.
func (MCPPanelModel) Init ¶ added in v1.7.0
func (m MCPPanelModel) Init() tea.Cmd
Init initializes the model (no-op).
func (MCPPanelModel) RefreshServers ¶ added in v1.13.0
func (m MCPPanelModel) RefreshServers() MCPPanelModel
RefreshServers rebuilds the panel rows from current manager state.
func (*MCPPanelModel) SetManager ¶ added in v1.13.0
func (m *MCPPanelModel) SetManager(manager *mcp.Manager, configs map[string]mcp.ServerConfig)
SetManager injects the MCP manager and discovered configs so the panel can connect/disconnect servers and toggle their enabled flag at runtime.
func (*MCPPanelModel) SetSize ¶ added in v1.7.0
func (m *MCPPanelModel) SetSize(width, height int)
SetSize updates the component dimensions.
func (*MCPPanelModel) Show ¶ added in v1.7.0
func (m *MCPPanelModel) Show()
Show activates the MCP panel and refreshes its rows from live state.
func (MCPPanelModel) Update ¶ added in v1.7.0
func (m MCPPanelModel) Update(msg tea.Msg) (MCPPanelModel, tea.Cmd)
Update handles messages for the MCP panel.
func (MCPPanelModel) View ¶ added in v1.7.0
func (m MCPPanelModel) View() string
View renders the MCP panel.
type MCPServerInfo ¶ added in v1.7.0
type MCPServerInfo struct {
Name string
Transport string
Connected bool
ToolCount int
Enabled bool // configured enabled flag (may differ from Connected)
Origin string // config file the server was declared in (for enable toggle)
}
MCPServerInfo describes the status of a single MCP server.
type MCPStatusMsg ¶ added in v1.7.0
type MCPStatusMsg struct {
Servers []MCPServerInfo
}
MCPStatusMsg updates the MCP server status display.
type MediaResultMsg ¶
MediaResultMsg is sent when media generation completes.
type MemoryManagerModel ¶ added in v1.8.3
type MemoryManagerModel struct {
// contains filtered or unexported fields
}
MemoryManagerModel is the interactive TUI for managing project memories.
func NewMemoryManagerModel ¶ added in v1.8.3
func NewMemoryManagerModel(workspace string) MemoryManagerModel
NewMemoryManagerModel creates a memory manager for the current project.
func (MemoryManagerModel) Init ¶ added in v1.8.3
func (m MemoryManagerModel) Init() tea.Cmd
func (MemoryManagerModel) View ¶ added in v1.8.3
func (m MemoryManagerModel) View() string
type MenuModel ¶
type MenuModel struct {
// contains filtered or unexported fields
}
MenuModel is the TUI model for interactive command menu
type NSFWToggleMsg ¶
type NSFWToggleMsg struct {
Enabled bool
}
NSFWToggleMsg is sent when NSFW mode is toggled.
type OrchestratorCommandRunner ¶ added in v1.7.0
OrchestratorCommandRunner is an optional extension for handling /orchestrate from TUI.
type OrchestratorEventMsg ¶ added in v1.7.0
type OrchestratorEventMsg struct {
Kind int // cast from orchestrator.EventKind
Lane string // cast from orchestrator.TaskLane
Text string
Model string // model name where role matters (primary/reviewer)
Duration time.Duration
InputTokens int
OutputTokens int
Response string // full assistant response text for live code output panel
FilePath string
Diff string
Score float64
Ch <-chan OrchestratorEventMsg // nil on terminal events
}
OrchestratorEventMsg wraps an orchestrator.OrchestratorEvent for delivery to the TUI. Defined here to avoid an import cycle (tui → orchestrator is fine; orchestrator must not → tui).
func (OrchestratorEventMsg) ReadNext ¶ added in v1.7.0
func (m OrchestratorEventMsg) ReadNext() tea.Cmd
ReadNext returns a cmd to read the next OrchestratorEventMsg.
type PermissionPromptModel ¶ added in v1.7.0
type PermissionPromptModel struct {
// contains filtered or unexported fields
}
PermissionPromptModel renders an inline permission dialog.
func NewPermissionPromptModel ¶ added in v1.7.0
func NewPermissionPromptModel() PermissionPromptModel
NewPermissionPromptModel creates a new permission prompt model.
func (PermissionPromptModel) Active ¶ added in v1.7.0
func (m PermissionPromptModel) Active() bool
Active returns whether the permission prompt is currently displayed.
func (PermissionPromptModel) Init ¶ added in v1.7.0
func (m PermissionPromptModel) Init() tea.Cmd
Init initializes the model (no-op).
func (*PermissionPromptModel) SetSize ¶ added in v1.7.0
func (m *PermissionPromptModel) SetSize(width, _ int)
SetSize updates the component width.
func (PermissionPromptModel) Update ¶ added in v1.7.0
func (m PermissionPromptModel) Update(msg tea.Msg) (PermissionPromptModel, tea.Cmd)
Update handles messages for the permission prompt.
func (PermissionPromptModel) View ¶ added in v1.7.0
func (m PermissionPromptModel) View() string
View renders the permission prompt dialog.
type PermissionRequestMsg ¶ added in v1.7.0
type PermissionRequestMsg struct {
ToolCallID string
ToolName string
InputSummary string // short description of what the tool wants to do
RiskLevel string // "read", "write", "destructive"
Response chan PermissionResponse
}
PermissionRequestMsg asks the user for permission to run a tool.
type PermissionResponse ¶ added in v1.7.0
type PermissionResponse struct {
Decision string // "allow_once", "always_allow", "deny", "always_deny"
Pattern string // rule pattern for "always" decisions
}
PermissionResponse is the user's answer to a permission request.
type PersonaPanelModel ¶ added in v1.10.0
type PersonaPanelModel struct {
// contains filtered or unexported fields
}
PersonaPanelModel is the bubbletea model for the /persona panel.
func NewPersonaPanelModel ¶ added in v1.10.0
func NewPersonaPanelModel() PersonaPanelModel
NewPersonaPanelModel creates a new persona panel loaded from disk.
func (PersonaPanelModel) Modified ¶ added in v1.10.0
func (m PersonaPanelModel) Modified() bool
Modified returns true if sliders were changed since panel opened.
func (*PersonaPanelModel) Save ¶ added in v1.10.0
func (m *PersonaPanelModel) Save() error
Save persists the slider config to disk.
func (PersonaPanelModel) SetWidth ¶ added in v1.10.0
func (m PersonaPanelModel) SetWidth(w int) PersonaPanelModel
SetWidth sets the panel width for rendering.
func (PersonaPanelModel) Sliders ¶ added in v1.10.0
func (m PersonaPanelModel) Sliders() *config.SliderConfig
Sliders returns the current slider config (for prompt composition).
func (PersonaPanelModel) Update ¶ added in v1.10.0
func (m PersonaPanelModel) Update(msg tea.Msg) (PersonaPanelModel, tea.Cmd)
Update handles key events for the persona panel.
func (PersonaPanelModel) View ¶ added in v1.10.0
func (m PersonaPanelModel) View() string
View renders the persona panel.
type PromptRefresher ¶ added in v1.10.0
type PromptRefresher interface {
RefreshSystemPrompt()
}
PromptRefresher is an optional extension to reload the system prompt mid-session (after /confirm, /user, or other prompt-affecting changes).
type SelectorItem ¶
type SelectorItem struct {
ID string // Model ID or config name
DisplayName string // Human-readable name
Description string // Additional info
Badge string // Optional badge (✓ for tool support, etc.)
}
SelectorItem represents an item in the selector.
type SelectorModel ¶
type SelectorModel struct {
// contains filtered or unexported fields
}
SelectorModel is a Bubble Tea component for arrow-key navigation.
func NewSelectorModel ¶
func NewSelectorModel(title string, items []SelectorItem) SelectorModel
NewSelectorModel creates a new selector component.
func (SelectorModel) GetSelected ¶
func (m SelectorModel) GetSelected() *SelectorItem
GetSelected returns the currently selected item (nil if none).
func (SelectorModel) IsActive ¶
func (m SelectorModel) IsActive() bool
IsActive returns whether the selector is currently active.
func (SelectorModel) SetHeight ¶
func (m SelectorModel) SetHeight(height int) SelectorModel
SetHeight sets the visible height of the selector.
func (SelectorModel) SetWidth ¶
func (m SelectorModel) SetWidth(width int) SelectorModel
SetWidth sets the width of the selector.
func (SelectorModel) Update ¶
func (m SelectorModel) Update(msg tea.Msg) (SelectorModel, tea.Cmd)
Update implements tea.Model.
type SelectorResultMsg ¶
type SelectorResultMsg struct {
Selected *SelectorItem // nil if cancelled
Cancelled bool
}
SelectorResultMsg is sent when the selector completes.
type SendMessageMsg ¶
type SendMessageMsg struct {
Content string
}
SendMessageMsg is sent when the user submits a message.
type Session ¶
type Session interface {
SetEndpoint(endpoint string)
GetEndpoint() string
SetModel(model string)
GetModel() string
SetNSFWMode(enabled bool)
GetNSFWMode() bool
SetName(name string)
ClearMessages()
GetMessagesRaw() interface{} // Returns []SessionMessage
SetMessagesRaw(msgs interface{}) // Accepts []SessionMessage
SummarizeRaw() interface{} // Returns SessionSummary
SetCommandHistory(history []string)
GetCommandHistory() []string
}
Session interface for session data (avoid circular import). Uses interface{} for complex types to avoid circular dependencies.
type SessionEntry ¶ added in v1.10.0
type SessionEntry struct {
ID string
Preview string // first user message, truncated
MessageCount int
CreatedAt time.Time
UpdatedAt time.Time
}
SessionEntry is a display-ready session summary.
type SessionManager ¶
type SessionManager interface {
NewSession() interface{}
Save(session interface{}) error
Load(id string) (interface{}, error)
List() ([]interface{}, error)
Delete(id string) error
MergeSessions(session1, session2 interface{}) interface{}
}
SessionManager interface for session persistence (avoid circular import). Uses interface{} for return types to avoid circular dependencies.
type SessionMessage ¶
SessionMessage represents a message stored in session (matches config.SessionMessage).
type SessionPanelModel ¶ added in v1.10.0
type SessionPanelModel struct {
// contains filtered or unexported fields
}
SessionPanelModel is the interactive session picker.
func NewSessionPanelModel ¶ added in v1.10.0
func NewSessionPanelModel() SessionPanelModel
NewSessionPanelModel loads sessions and creates the picker.
func (SessionPanelModel) Deleted ¶ added in v1.10.0
func (m SessionPanelModel) Deleted() string
Deleted returns the ID of a session the user deleted (empty if none).
func (SessionPanelModel) Selected ¶ added in v1.10.0
func (m SessionPanelModel) Selected() string
Selected returns the ID of the session the user chose (empty if none).
func (SessionPanelModel) SetHeight ¶ added in v1.10.0
func (m SessionPanelModel) SetHeight(h int) SessionPanelModel
SetHeight updates the panel height.
func (SessionPanelModel) SetWidth ¶ added in v1.10.0
func (m SessionPanelModel) SetWidth(w int) SessionPanelModel
SetWidth updates the panel width.
func (SessionPanelModel) Update ¶ added in v1.10.0
func (m SessionPanelModel) Update(msg tea.Msg) (SessionPanelModel, tea.Cmd)
Update handles input for the session picker.
func (SessionPanelModel) View ¶ added in v1.10.0
func (m SessionPanelModel) View() string
View renders the session picker.
type SessionSummary ¶
type SessionSummary struct {
ID string
Name string
MessageCount int
CreatedAt time.Time
UpdatedAt time.Time
FirstMessage string
Metadata map[string]interface{}
}
SessionSummary represents session metadata (matches config.SessionSummary). Duplicated here to avoid circular import with config package.
type ShowSelectorMsg ¶
type ShowSelectorMsg struct {
Title string
Items []SelectorItem
}
ShowSelectorMsg triggers the interactive selector.
type SimulateTypingMsg ¶
type SimulateTypingMsg struct {
Content string // Full content to simulate typing
CharsToShow int // How many characters to show now
}
SimulateTypingMsg is sent to simulate typing effect.
type SimulatedTyping ¶
type SimulatedTyping struct {
// contains filtered or unexported fields
}
SimulatedTyping handles simulated typing effect for non-streaming responses.
func NewSimulatedTyping ¶
func NewSimulatedTyping(content string, typingSpeed int, glitchChance float64) *SimulatedTyping
NewSimulatedTyping creates a new simulated typing effect.
func (*SimulatedTyping) Advance ¶
func (s *SimulatedTyping) Advance() int
Advance advances the typing simulation by one tick. Returns the number of characters advanced.
func (*SimulatedTyping) Extend ¶ added in v1.8.3
func (s *SimulatedTyping) Extend(additional string)
Extend appends new content to the typing buffer without resetting position. Used for real streaming: new chunks extend the content while the typing animation continues revealing characters at the current position.
func (*SimulatedTyping) GetDisplayed ¶
func (s *SimulatedTyping) GetDisplayed() string
GetDisplayed returns the currently displayed content.
func (*SimulatedTyping) GetDisplayedWithCorruption ¶
func (s *SimulatedTyping) GetDisplayedWithCorruption() string
GetDisplayedWithCorruption returns displayed content with potential corruption.
func (*SimulatedTyping) IsDone ¶
func (s *SimulatedTyping) IsDone() bool
IsDone returns whether typing simulation is complete.
func (*SimulatedTyping) IsEnabled ¶
func (s *SimulatedTyping) IsEnabled() bool
IsEnabled returns whether simulated typing is enabled.
func (*SimulatedTyping) Reset ¶
func (s *SimulatedTyping) Reset(content string)
Reset resets the typing simulation.
func (*SimulatedTyping) SetEnabled ¶
func (s *SimulatedTyping) SetEnabled(enabled bool)
SetEnabled enables or disables simulated typing.
type SkillCallBatchMsg ¶ added in v1.7.0
type SkillCallBatchMsg struct {
Calls []SkillCallRequest
AssistantContent string // Assistant message content (may be empty if only tool calls)
ToolCalls []ToolCallInfo // Raw tool call payloads from assistant message
}
SkillCallBatchMsg is sent when the LLM requests one or more skill/function calls.
type SkillCallMsg ¶
type SkillCallMsg struct {
Call FunctionCall
ToolCallID string // OpenAI tool call ID for sending result back
AssistantContent string // The assistant message content (may be empty if only tool calls)
ToolCalls []ToolCallInfo // All tool calls from the assistant message
}
SkillCallMsg is sent when the LLM wants to call a skill/function.
type SkillCallRequest ¶ added in v1.7.0
type SkillCallRequest struct {
Call FunctionCall
ToolCallID string // OpenAI tool call ID for sending result back
ParseError string // Non-empty when arguments failed to parse
}
SkillCallRequest represents one tool call request in a batch.
type SkillDefinition ¶
type SkillDefinition struct {
Name string `json:"name"`
Description string `json:"description"`
Parameters map[string]any `json:"parameters"`
}
SkillDefinition represents a skill/function that can be called.
type SkillResultMsg ¶
type SkillResultMsg struct {
Name string
Result string
Err error
ToolCallID string // OpenAI tool call ID for sending result back
Metadata map[string]any // Optional metadata (e.g. image base64 from read_file)
}
SkillResultMsg is sent when a skill execution completes.
type SkillsBrowserModel ¶
type SkillsBrowserModel struct {
// contains filtered or unexported fields
}
SkillsBrowserModel is the TUI model for the interactive skills browser. It type-ahead filters (BM25-ranked, same index as find_tools) and paginates, so a large tool list stays navigable instead of scrolling forever.
func NewSkillsBrowserModel ¶
func NewSkillsBrowserModel(skillsList []SkillDefinition) SkillsBrowserModel
NewSkillsBrowserModel creates the browser, sorted by name.
func (SkillsBrowserModel) Init ¶
func (m SkillsBrowserModel) Init() tea.Cmd
Init initializes the model (no-op).
func (SkillsBrowserModel) View ¶
func (m SkillsBrowserModel) View() string
View renders the browser.
type SkillsModel ¶
type SkillsModel struct {
// contains filtered or unexported fields
}
SkillsModel renders lightweight runtime status for skill/tool usage in chat view.
func NewSkillsModel ¶
func NewSkillsModel() SkillsModel
func (SkillsModel) Count ¶ added in v1.13.0
func (s SkillsModel) Count() int
Count reports the loaded-skill count (surfaced in the status line).
func (SkillsModel) Enabled ¶ added in v1.13.0
func (s SkillsModel) Enabled() bool
Enabled reports whether skills are enabled (surfaced in the status line).
func (SkillsModel) SetCompleted ¶
func (s SkillsModel) SetCompleted(name string) SkillsModel
func (SkillsModel) SetConfig ¶
func (s SkillsModel) SetConfig(endpoint, model string, enabled bool, nsfw bool, count int, reason string) SkillsModel
func (SkillsModel) SetCurrentInput ¶
func (s SkillsModel) SetCurrentInput(input string) SkillsModel
func (SkillsModel) SetError ¶
func (s SkillsModel) SetError(name string, err error) SkillsModel
func (SkillsModel) SetExecuting ¶
func (s SkillsModel) SetExecuting(name string) SkillsModel
func (SkillsModel) SetExpanded ¶ added in v1.13.0
func (s SkillsModel) SetExpanded(e bool) SkillsModel
SetExpanded toggles the full panel. Collapsed (default) renders only active signal in chat — the skill count + model/mode moved to the status line and the nav keys to the single hints row.
func (SkillsModel) SetMenuState ¶
func (s SkillsModel) SetMenuState(state string) SkillsModel
func (SkillsModel) SetSize ¶
func (s SkillsModel) SetSize(width, height int) SkillsModel
func (SkillsModel) View ¶
func (s SkillsModel) View() string
type SplitPanel ¶ added in v1.7.0
type SplitPanel struct {
// contains filtered or unexported fields
}
SplitPanel renders a two-column layout:
Left — agent action feed (scrollable log) Right — live code output / file diff / verdict
func NewSplitPanel ¶ added in v1.7.0
func NewSplitPanel(width, height int) *SplitPanel
NewSplitPanel creates a SplitPanel sized to the given terminal dimensions.
func (*SplitPanel) Actions ¶ added in v1.7.0
func (s *SplitPanel) Actions() []string
Actions returns the current action feed entries.
func (*SplitPanel) AddAction ¶ added in v1.7.0
func (s *SplitPanel) AddAction(text string)
AddAction appends an entry to the left action feed. When the user has scrolled up (scrollOffset > 0), the view is pinned by incrementing the offset so the same lines stay visible.
func (*SplitPanel) AppendOutput ¶ added in v1.7.0
func (s *SplitPanel) AppendOutput(text string)
AppendOutput appends text to the right panel without resetting scroll. Used for incremental updates (e.g., tool calls building up during review).
func (*SplitPanel) AtBottom ¶ added in v1.7.0
func (s *SplitPanel) AtBottom() bool
AtBottom reports whether the left panel is auto-following the latest entry.
func (*SplitPanel) DiffContent ¶ added in v1.7.0
func (s *SplitPanel) DiffContent() string
DiffContent returns the diff currently shown in the right panel.
func (*SplitPanel) DiffFile ¶ added in v1.7.0
func (s *SplitPanel) DiffFile() string
DiffFile returns the file name currently shown in the right panel.
func (*SplitPanel) Resize ¶ added in v1.7.0
func (s *SplitPanel) Resize(width, height int)
Resize updates the panel dimensions (call on tea.WindowSizeMsg).
func (*SplitPanel) ScrollDown ¶ added in v1.7.0
func (s *SplitPanel) ScrollDown(lines int)
ScrollDown scrolls toward the latest entries. Reaching 0 resumes auto-follow.
func (*SplitPanel) ScrollRightDown ¶ added in v1.7.0
func (s *SplitPanel) ScrollRightDown(lines int)
ScrollRightDown scrolls the right artifact panel down.
func (*SplitPanel) ScrollRightUp ¶ added in v1.7.0
func (s *SplitPanel) ScrollRightUp(lines int)
ScrollRightUp scrolls the right artifact panel up.
func (*SplitPanel) ScrollUp ¶ added in v1.7.0
func (s *SplitPanel) ScrollUp(lines int)
ScrollUp scrolls the left action feed toward older entries (up = back in time).
func (*SplitPanel) SetDiff ¶ added in v1.7.0
func (s *SplitPanel) SetDiff(file, diff string)
SetDiff updates the right panel with a file diff.
func (*SplitPanel) SetOutput ¶ added in v1.7.0
func (s *SplitPanel) SetOutput(text string)
SetOutput updates the live response text shown in the right panel. Called after each agent turn to display what the model responded.
func (*SplitPanel) SetVerdict ¶ added in v1.7.0
func (s *SplitPanel) SetVerdict(text string)
SetVerdict replaces the right panel with a verdict report.
func (*SplitPanel) View ¶ added in v1.7.0
func (s *SplitPanel) View() string
View renders the split panel as a string for Bubble Tea.
type StatusLineModel ¶ added in v1.13.0
type StatusLineModel struct {
// contains filtered or unexported fields
}
StatusLineModel renders a single-line segmented status bar. All fields are pushed in via setters; View() never performs I/O.
func NewStatusLineModel ¶ added in v1.13.0
func NewStatusLineModel() StatusLineModel
NewStatusLineModel creates an empty status line.
func (StatusLineModel) SetEffort ¶ added in v1.13.0
func (m StatusLineModel) SetEffort(effort string) StatusLineModel
SetEffort sets the reasoning-effort segment ("off" hides it).
func (StatusLineModel) SetGit ¶ added in v1.13.0
func (m StatusLineModel) SetGit(branch string, dirty, ahead, behind int) StatusLineModel
SetGit sets the git segment values.
func (StatusLineModel) SetModel ¶ added in v1.13.0
func (m StatusLineModel) SetModel(model string) StatusLineModel
SetModel sets the active model segment.
func (StatusLineModel) SetPermMode ¶ added in v1.13.0
func (m StatusLineModel) SetPermMode(mode string) StatusLineModel
SetPermMode sets the permission-mode segment ("default"/"strict"/"trust").
func (StatusLineModel) SetProject ¶ added in v1.13.0
func (m StatusLineModel) SetProject(p string) StatusLineModel
SetProject sets the project/directory segment.
func (StatusLineModel) SetSession ¶ added in v1.13.0
func (m StatusLineModel) SetSession(name string) StatusLineModel
SetSession sets the session-name segment.
func (StatusLineModel) SetSkills ¶ added in v1.13.0
func (m StatusLineModel) SetSkills(enabled bool, count int) StatusLineModel
SetSkills sets the skills segment ("⚙ N" enabled, "⚙ off" disabled). This replaces the old always-on skills panel's count line.
func (StatusLineModel) SetWidth ¶ added in v1.13.0
func (m StatusLineModel) SetWidth(w int) StatusLineModel
SetWidth sets the render width.
func (StatusLineModel) View ¶ added in v1.13.0
func (m StatusLineModel) View() string
View renders the segmented status line. Below 80 columns it keeps only the git and model segments so the bar never wraps.
type StatusModel ¶
type StatusModel struct {
// contains filtered or unexported fields
}
StatusModel represents the status bar.
func (StatusModel) ClearContextWarning ¶
func (m StatusModel) ClearContextWarning() StatusModel
ClearContextWarning clears the context warning.
func (StatusModel) SetStreaming ¶
func (m StatusModel) SetStreaming(streaming bool) StatusModel
SetStreaming sets the streaming indicator.
func (StatusModel) SetText ¶
func (m StatusModel) SetText(text string) StatusModel
SetText sets the status text.
func (StatusModel) SetWidth ¶
func (m StatusModel) SetWidth(width int) StatusModel
SetWidth sets the status bar width.
func (StatusModel) ShowContextWarning ¶
func (m StatusModel) ShowContextWarning(level string, message string) StatusModel
ShowContextWarning displays a context warning message.
func (StatusModel) Update ¶
func (m StatusModel) Update(msg tea.Msg) (StatusModel, tea.Cmd)
Update handles tick messages for animation.
type StreamChunk ¶
type StreamChunk struct {
Content string // Content delta
IsFirst bool // Is this the first chunk?
IsFinal bool // Is this the last chunk?
FinishReason string // Reason for finishing (if final)
}
StreamChunk represents a piece of streamed response.
type StreamChunkMsg ¶
type StreamChunkMsg struct {
Chunk StreamChunk
Next tea.Cmd // Cmd that reads the next chunk from the stream channel
}
StreamChunkMsg is sent when a new stream chunk arrives from the LLM. Next is the Cmd to call to get the next chunk (channel read pattern).
type StreamDoneMsg ¶
type StreamDoneMsg struct {
FullContent string
FinishReason string
Usage *TokenUsage // Token usage from API (if available)
}
StreamDoneMsg is sent when streaming is complete.
type StreamErrorMsg ¶
type StreamErrorMsg struct {
Err error
}
StreamErrorMsg is sent when streaming encounters an error.
type StreamStartMsg ¶ added in v1.8.0
type StreamStartMsg struct {
Cancel context.CancelFunc
}
StreamStartMsg carries the context cancel function so the TUI can cancel an in-progress LLM request on Ctrl+C.
type SubagentInfo ¶ added in v1.10.0
type SubagentInfo struct {
ID string
TaskID string
Name string
Element string
Status string // "waiting", "running", "completed", "failed"
Turns int
Elapsed time.Duration
}
SubagentInfo is a TUI-facing view of a subagent run.
type SubagentKiller ¶ added in v1.10.0
SubagentKiller is an optional extension for /agents kill <id>. It cancels a specific in-flight subagent (task 6ffb5a7c).
type SubagentLister ¶ added in v1.10.0
type SubagentLister interface {
ListSubagents() []SubagentInfo
}
SubagentLister is an optional extension for /agents command.
type SubagentResumer ¶ added in v1.10.0
type SubagentResumer interface {
ResumeSubagent(ctx context.Context, checkpointID string) (string, error)
}
SubagentResumer is an optional extension for /agents resume <id>.
type ThinkingConfigSetter ¶ added in v1.8.0
type ThinkingConfigSetter interface {
SetThinkingLevel(level string)
}
ThinkingConfigSetter interface for clients that support extended thinking / reasoning effort.
type TokenUsage ¶
TokenUsage holds token usage information from API response
type ToolCallInfo ¶
ToolCallInfo represents a tool call in an assistant message.
type ToolProgressModel ¶ added in v1.7.0
type ToolProgressModel struct {
// contains filtered or unexported fields
}
ToolProgressModel displays stacked tool execution cards. Entries auto-clear when the user sends a new message.
func NewToolProgressModel ¶ added in v1.7.0
func NewToolProgressModel() ToolProgressModel
NewToolProgressModel creates a new tool progress model.
func (*ToolProgressModel) ClearCompleted ¶ added in v1.8.3
func (m *ToolProgressModel) ClearCompleted()
ClearCompleted removes all non-executing entries. Called when the user sends a new message so old results don't accumulate.
func (ToolProgressModel) HasActive ¶ added in v1.7.0
func (m ToolProgressModel) HasActive() bool
HasActive returns true if there are any entries to display.
func (ToolProgressModel) Init ¶ added in v1.7.0
func (m ToolProgressModel) Init() tea.Cmd
Init initializes the model (no-op).
func (*ToolProgressModel) SetSize ¶ added in v1.7.0
func (m *ToolProgressModel) SetSize(width, _ int)
SetSize updates the component width.
func (ToolProgressModel) Update ¶ added in v1.7.0
func (m ToolProgressModel) Update(msg tea.Msg) (ToolProgressModel, tea.Cmd)
Update handles messages for the tool progress component.
func (ToolProgressModel) View ¶ added in v1.7.0
func (m ToolProgressModel) View() string
View renders the tool progress cards.
type ToolProgressMsg ¶ added in v1.7.0
type ToolProgressMsg struct {
ToolCallID string
ToolName string
DisplayName string // optional override (e.g., "〔火 hi〕" for element-named subagents)
Element string // element type for color/animation (earth/fire/water/light/dark/wind)
State string // "executing", "done", "failed", "aborted"
Message string // progress message
SubMessage string // nested status line (e.g., subagent turn/tool activity)
Elapsed time.Duration
}
ToolProgressMsg reports real-time tool execution status.
Source Files
¶
- app.go
- ask_prompt.go
- chat.go
- collections.go
- context.go
- context_bar.go
- graph.go
- graph_render.go
- input.go
- logging.go
- markdown.go
- mcp_panel.go
- memory_manager.go
- menu.go
- messages.go
- permission_prompt.go
- persona_panel.go
- selector.go
- session_panel.go
- skills.go
- skills_panel.go
- split_panel.go
- statusline.go
- streaming.go
- styles.go
- tool_progress.go