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 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 message types used for communication between components.
Package tui provides the interactive selector component.
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.
Index ¶
- Variables
- func ApplyCodeBlockCorruption(content string, typingPos int, corruptionIntensity float64) string
- func ClearChat() tea.Cmd
- 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 Error(err error) tea.Cmd
- func Exit() tea.Cmd
- func GetCodeBlockStyle() lipgloss.Style
- func GetLogPath() string
- func GetRandomCorruption() string
- func GetRandomCorruptionPlain() string
- func GetRandomPhrase(phrases []string) 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 RenderBox(content string, width int) string
- func RenderCorruptedBorder(content string, width int, frame int) string
- func RenderCorruptedSkill(name string) string
- func RenderGlassmorphicBox(content string, width int, borderColor lipgloss.Color) string
- func RenderGlowText(text string, primaryColor, glowColor lipgloss.Color) string
- func RenderHeader(title, info string, width int) string
- func RenderNeonText(text string, neonColor lipgloss.Color) string
- func RenderStatusBadge(text string, statusColor lipgloss.Color) 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 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) SetSessionManager(sm SessionManager, session Session) AppModel
- func (m AppModel) SetVersion(version, build string) AppModel
- func (m AppModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m AppModel) View() string
- func (m AppModel) WithEndpoint(endpoint string) AppModel
- func (m AppModel) WithMessages(messages []ChatMessage) AppModel
- 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) AddSystemMessage(content string) ChatModel
- func (m ChatModel) AddToolResult(toolCallID, name, result string) 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) 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 ClearChatMsg
- type CollectionsModel
- 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 ExitMsg
- type FunctionCall
- type GenerateMediaMsg
- 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) Blur() InputModel
- func (m InputModel) Clear() 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(value 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 MediaResultMsg
- type MenuItem
- type MenuModel
- type NSFWToggleMsg
- 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 SessionLoadedMsg
- type SessionManager
- type SessionMessage
- type SessionSummary
- type ShowSelectorMsg
- type SimulateTypingMsg
- type SimulatedTyping
- func (s *SimulatedTyping) Advance() int
- 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 SkillCallMsg
- type SkillDefinition
- type SkillResultMsg
- type SkillsBrowserModel
- type SkillsModel
- func (s SkillsModel) GetDefinitions() []SkillDefinition
- 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) SetMenuState(state string) SkillsModel
- func (s SkillsModel) SetSize(width, height int) SkillsModel
- func (s SkillsModel) 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 StatusMsg
- type StreamChunk
- type StreamChunkMsg
- type StreamDoneMsg
- type StreamErrorMsg
- type TickMsg
- type TokenUsage
- type ToolCallInfo
- type TypingTickMsg
- type VeniceConfigData
Constants ¶
This section is empty.
Variables ¶
var ( // Primary accent colors - magenta/pink corruption ColorAccent = lipgloss.Color("#d94f90") // Pink (signature) ColorAccentLight = lipgloss.Color("#e86ca8") // Light pink ColorAccentDark = lipgloss.Color("#b61b70") // Dark pink ColorAccentGlow = lipgloss.Color("#ff4da6") // Bright pink glow // Purple gradient - abyss/void aesthetic ColorPurple = lipgloss.Color("#8b5cf6") // Primary purple ColorPurpleLight = lipgloss.Color("#a78bfa") // Light purple ColorPurpleDark = lipgloss.Color("#7c3aed") // Dark 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 ColorBlueNeon = lipgloss.Color("#3b82f6") // Neon blue // Background colors - deep void ColorBg = lipgloss.Color("#0a0a0a") // Main background ColorBgSecondary = lipgloss.Color("#0f0f1a") // Secondary bg ColorBgTertiary = lipgloss.Color("#1a1a2e") // Tertiary bg ColorBgGlass = lipgloss.Color("#1a1a2e") // Glassmorphic layer ColorBgOverlay = lipgloss.Color("#0f0f1a") // Overlay // 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
var AnalyzingPhrases = struct { Standard string Data string Progress string Active string Analysis string }{ Standard: "分析 analyzing bunseki...", Data: "ana分lysing data...", Progress: "解析 kaiseki in progress...", Active: "分析中 bunseki-chū...", Analysis: "データ data 解析 analysis...", }
AnalyzingPhrases - Status messages for analysis states
var ConnectingPhrases = struct { Standard string Established string Active string Link string Network string }{ Standard: "接続 connecting setsuzoku...", Established: "con接nection established...", Active: "接続中 setsuzoku-chū...", Link: "link 接続 active...", Network: "ネットワーク network 接続...", }
ConnectingPhrases - Connection state messages
var CorruptingPhrases = struct { Standard string System string Active string Deep string }{ Standard: "壊れ corrupting kowarete...", System: "cor壊rupting system...", Active: "corruption 壊れ active...", Deep: "深淵 abyss 壊れ corruption...", }
CorruptingPhrases - Celeste-specific corruption messages
var DashboardHeaders = struct { Usage string Session string Stats string Token string Cost string Provider string }{ Usage: "👁️ USAGE 統計 ANALYTICS 👁️", Session: "👁️ SESSION データ MANAGER 👁️", Stats: "👁️ STATS 統計 DASHBOARD 👁️", Token: "👁️ TOKEN 使用 TRACKER 👁️", Cost: "👁️ COST 計算 CALCULATOR 👁️", Provider: "👁️ PROVIDER 分類 BREAKDOWN 👁️", }
DashboardHeaders - Main dashboard title headers
var DashboardSubtitles = struct { Corrupting string Processing string Analyzing string Watching string Generating string Loading string }{ Corrupting: "⟨ 壊れ corrupting kowarete from the 虚空 void... ⟩", Processing: "⟨ 処理 processing purosesu data 深淵 abyss... ⟩", Analyzing: "⟨ 分析 analyzing bunseki from 虚空 kokū... ⟩", Watching: "⟨ 監視 watching kanshi the 深淵 shinnen... ⟩", Generating: "⟨ 生成 generating seisei 統計 statistics... ⟩", Loading: "⟨ 読み込み loading yomikomi データ data... ⟩", }
DashboardSubtitles - Subtitle messages for dashboards
var DataLabels = struct { Session struct { Total string Active string Count string Number string Data string } Token struct { Total string Input string Output string Usage string Number string } Cost struct { Total string Estimated string PerSession string Calculated string Spending string } Message struct { Total string Number string Count string Data string Total2 string } Provider struct { Name string Statistics string API string Service string Stats string } }{ Session: struct { Total string Active string Count string Number string Data string }{ Total: "Total セッション", Active: "Active セッション", Count: "セッション count", Number: "session 数", Data: "セッション data", }, Token: struct { Total string Input string Output string Usage string Number string }{ Total: "Total トークン", Input: "Input トークン", Output: "Output トークン", Usage: "トークン usage", Number: "token 数", }, Cost: struct { Total string Estimated string PerSession string Calculated string Spending string }{ Total: "Total コスト", Estimated: "Estimated コスト", PerSession: "コスト per session", Calculated: "cost 計算", Spending: "spending 支出", }, Message: struct { Total string Number string Count string Data string Total2 string }{ Total: "Total メッセージ", Number: "Message 数", Count: "メッセージ count", Data: "msg データ", Total2: "messages 合計", }, Provider: struct { Name string Statistics string API string Service string Stats string }{ Name: "プロバイダー name", Statistics: "Provider 統計", API: "API endpoint", Service: "service 名", Stats: "プロバイダー stats", }, }
DataLabels - Labels for data display
Report struct { End string Complete string Ended string Stats string Analysis string } Void struct { Sinking string Returning string Consumed string Awaits string Back string } }{ Report: struct { End string Complete string Ended string Stats string Analysis string }{ End: "⟨ 終わり end of report owari... ⟩", Complete: "⟨ 完了 complete kanryō... ⟩", Ended: "⟨ レポート report 終了 ended... ⟩", Stats: "⟨ 統計 stats 終わり owari... ⟩", Analysis: "⟨ 分析 analysis 完了 complete... ⟩", }, Void: struct { Sinking string Returning string Consumed string Awaits string Back string }{ Sinking: "⟨ sinking into the 深淵 abyss shinnen... ⟩", Returning: "⟨ returning to the 虚空 void kokū... ⟩", Consumed: "⟨ consumed by 闇 darkness yami... ⟩", Awaits: "⟨ 深淵 shinnen awaits... ⟩", Back: "⟨ back to the 虚空 kokū... ⟩", }, }
FooterMessages - Footer/ending messages
var LoadingPhrases = struct { Standard string Data string Process string Progress string Waiting string }{ Standard: "ロード loading 読み込み中...", Data: "loaディング data...", Process: "読み込み yomikomi プロセス...", Progress: "ロード rōdo in progress...", Waiting: "待機 waiting taiki...", }
LoadingPhrases - Status messages for loading states
var ProcessingPhrases = struct { Standard string Request string Active string Process string Execute string }{ Standard: "処理 processing purosesu...", Request: "pro理cessing request...", Active: "処理中 shori-chū...", Process: "プロセス process active...", Execute: "実行 executing jikkō...", }
ProcessingPhrases - Status messages for processing states
var SectionHeaders = struct { Lifetime struct { Corruption string Usage string Data string Stats string Records string } Provider struct { Breakdown string Top string Usage string Statistics string Analysis string } Session struct { Data string Active string Recent string Current string History string } Token struct { Usage string Cost string Spending string Budget string Breakdown string } Time struct { Today string Week string Recent string Current string Latest string } }{ Lifetime: struct { Corruption string Usage string Data string Stats string Records string }{ Corruption: "█ LIFETIME 統計 CORRUPTION:", Usage: "█ TOTAL 使用 USAGE:", Data: "█ ALL-TIME データ DATA:", Stats: "█ CUMULATIVE 統計 STATS:", Records: "█ HISTORICAL 記録 RECORDS:", }, Provider: struct { Breakdown string Top string Usage string Statistics string Analysis string }{ Breakdown: "█ PROVIDER 分類 BREAKDOWN:", Top: "█ TOP プロバイダー PROVIDERS:", Usage: "█ ENDPOINT 使用 USAGE:", Statistics: "█ API 統計 STATISTICS:", Analysis: "█ SERVICE 分析 ANALYSIS:", }, Session: struct { Data string Active string Recent string Current string History string }{ Data: "█ SESSION データ DATA:", Active: "█ ACTIVE セッション SESSIONS:", Recent: "█ RECENT 活動 ACTIVITY:", Current: "█ CURRENT 状態 STATUS:", History: "█ HISTORY 履歴 RECORDS:", }, Token: struct { Usage string Cost string Spending string Budget string Breakdown string }{ Usage: "█ TOKEN 使用 USAGE:", Cost: "█ COST 計算 CALCULATION:", Spending: "█ SPENDING 支出 ANALYSIS:", Budget: "█ BUDGET 予算 TRACKER:", Breakdown: "█ EXPENSE 費用 BREAKDOWN:", }, Time: struct { Today string Week string Recent string Current string Latest string }{ Today: "█ TODAY 今日 ACTIVITY:", Week: "█ THIS WEEK 今週 STATS:", Recent: "█ RECENT 最近 USAGE:", Current: "█ CURRENT 現在 STATUS:", Latest: "█ LATEST 最新 DATA:", }, }
SectionHeaders - Section header titles
var StatusMessages = struct { Success struct { Complete string Success string Done string Ready string Saved string } Error struct { Detected string Failed string Occurred string Problem string Bug string } Warning struct { Warning string Caution string Alert string Attention string Detected string } Info struct { Info string Notice string Message string Notification string Information string } }{ Success: struct { Complete string Success string Done string Ready string Saved string }{ Complete: "完了 complete kanryō ✓", Success: "成功 success seikō ✓", Done: "Done 完了 done", Ready: "Ready 準備 junbi", Saved: "Saved 保存 hozon", }, Error: struct { Detected string Failed string Occurred string Problem string Bug string }{ Detected: "エラー error detected 検出", Failed: "Failed 失敗 shippai", Occurred: "Error エラー occurred", Problem: "問題 problem mondai", Bug: "不具合 bug fuguai", }, Warning: struct { Warning string Caution string Alert string Attention string Detected string }{ Warning: "警告 warning keikoku ⚠", Caution: "Caution 注意 chūi", Alert: "Alert 警報 keihou", Attention: "注意 attention required", Detected: "Warning 警告 detected", }, Info: struct { Info string Notice string Message string Notification string Information string }{ Info: "情報 info jōhō ℹ", Notice: "Notice 通知 tsūchi", Message: "Info 情報 message", Notification: "お知らせ notification", Information: "情報 information", }, }
StatusMessages - Success/error/warning/info messages
var ThematicPhrases = struct { Void struct { Deep string Void string Darkness string Connected string Corruption string From string Into string Consumed string } Corruption struct { Standard string System string Active string Active2 string Data string Deeply string } Eye struct { Watching string Watching2 string Observing string Under string Always string Celeste string } }{ Void: struct { Deep string Void string Darkness string Connected string Corruption string From string Into string Consumed string }{ Deep: "深淵 deep abyss shinnen", Void: "虚空 void kokū", Darkness: "闇 darkness yami", Connected: "深淵 shinnen 接続 connected", Corruption: "虚空 kokū corruption 壊れ", From: "from the 深淵 abyss...", Into: "into the 虚空 void...", Consumed: "consumed by 闇 yami...", }, Corruption: struct { Standard string System string Active string Active2 string Data string Deeply string }{ Standard: "壊れ corruption kowarete", System: "cor壊rupting system...", Active: "corruption 壊れ active", Active2: "壊れている kowarete-iru", Data: "data 壊れ corruption", Deeply: "deeply 壊れ corrupted", }, Eye: struct { Watching string Watching2 string Observing string Under string Always string Celeste string }{ Watching: "👁️ 監視 watching kanshi 👁️", Watching2: "👁️ 見ている miteiru 👁️", Observing: "👁️ 観察 observing kansatsu 👁️", Under: "under 監視 surveillance...", Always: "👁️ always watching...", Celeste: "Celeste 監視 is watching...", }, }
ThematicPhrases - Void/Abyss/Corruption themed phrases
var WatchingPhrases = struct { Standard string System string Active string Observing string Watching string }{ Standard: "👁️ 監視 watching kanshi 👁️", System: "wat監ching system...", Active: "監視中 kanshi-chū...", Observing: "観察 observing kansatsu...", Watching: "👁️ 見ている miteiru 👁️", }
WatchingPhrases - Celeste watching/observing messages
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 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 GetRandomPhrase ¶
Helper function to get a random phrase from a slice
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 RenderCorruptedBorder ¶
RenderCorruptedBorder creates a border with corruption effects.
func RenderCorruptedSkill ¶
RenderCorruptedSkill renders a skill name with corruption effect during execution. Uses the existing CorruptText function from streaming.go with 40% intensity.
func RenderGlassmorphicBox ¶
RenderGlassmorphicBox creates a glassmorphic bordered box with gradient accent.
func RenderGlowText ¶
RenderGlowText adds a glowing effect to text with secondary color.
func RenderHeader ¶
RenderHeader creates a styled header with title and info.
func RenderNeonText ¶
RenderNeonText renders text with neon glow effect.
func RenderStatusBadge ¶
RenderStatusBadge creates a styled status badge with glassmorphic bg.
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 AppModel ¶
type AppModel struct {
// contains filtered or unexported fields
}
AppModel is the root model for the Celeste TUI application.
func (AppModel) SetConfig ¶
SetConfig sets the configuration for accessing context limits and other settings.
func (AppModel) SetLLMClient ¶
SetLLMClient sets the LLM client.
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) WithEndpoint ¶
WithEndpoint restores the endpoint/provider from a loaded session.
func (AppModel) WithMessages ¶
func (m AppModel) WithMessages(messages []ChatMessage) AppModel
WithMessages restores chat history from session messages.
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
}
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) AddSystemMessage ¶
AddSystemMessage adds a system message to the chat.
func (ChatModel) AddToolResult ¶
AddToolResult adds a tool result message to the chat.
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) 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 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 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 represents the text input component.
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(value string) InputModel
SetValue sets the input value.
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 MediaResultMsg ¶
MediaResultMsg is sent when media generation completes.
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 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
}
Session interface for session data (avoid circular import). Uses interface{} for complex types to avoid circular dependencies.
type SessionLoadedMsg ¶
type SessionLoadedMsg struct {
Messages []ChatMessage
}
SessionLoadedMsg is sent when a session is loaded.
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 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) 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 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 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
}
SkillResultMsg is sent when a skill execution completes.
type SkillsBrowserModel ¶
type SkillsBrowserModel struct {
// contains filtered or unexported fields
}
SkillsBrowserModel is the TUI model for interactive skills browser
func NewSkillsBrowserModel ¶
func NewSkillsBrowserModel(skillsList []SkillDefinition) SkillsBrowserModel
NewSkillsBrowserModel creates a new skills model
func (SkillsBrowserModel) Init ¶
func (m SkillsBrowserModel) Init() tea.Cmd
Init initializes the model
type SkillsModel ¶
type SkillsModel struct{}
SkillsModel represents the skills panel (shows execution status, not browser) TODO: This is a stub - needs proper implementation for skills panel
func NewSkillsModel ¶
func NewSkillsModel() SkillsModel
func (SkillsModel) GetDefinitions ¶
func (s SkillsModel) GetDefinitions() []SkillDefinition
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) 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 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
}
StreamChunkMsg is sent when a new stream chunk arrives.
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 TokenUsage ¶
TokenUsage holds token usage information from API response
type ToolCallInfo ¶
ToolCallInfo represents a tool call in an assistant message.