tui

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 16 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
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

View Source
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

View Source
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

View Source
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

View Source
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

View Source
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

View Source
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

View Source
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

View Source
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

View Source
var FooterMessages = struct {
	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

View Source
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

View Source
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

View Source
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

View Source
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

View Source
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

View Source
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

func ApplyCodeBlockCorruption(content string, typingPos int, corruptionIntensity float64) string

ApplyCodeBlockCorruption detects code blocks (```) and applies corruption styling Used during typing animation to give code blocks a corrupted-typing effect

func ClearChat

func ClearChat() tea.Cmd

ClearChat returns a command that clears the chat.

func CloseLogging

func CloseLogging()

CloseLogging closes the log file.

func CorruptCodeLine

func CorruptCodeLine(codeLine string, intensity float64) string

CorruptCodeLine applies corruption effects specifically for code Uses block characters and glitch symbols for a "corrupted terminal" aesthetic

func CorruptText

func CorruptText(text string, intensity float64) string

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

func CorruptTextJapanese(text string, intensity float64) string

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

func DetectDump(firstChunkSize, totalSize int, elapsed time.Duration) bool

DetectDump checks if response appears to be a "dump" (all at once) rather than true streaming. Used to decide if simulation is needed.

func Error

func Error(err error) tea.Cmd

Error returns a command that sends an error message.

func Exit

func Exit() tea.Cmd

Exit returns a command that exits the application.

func GetCodeBlockStyle

func GetCodeBlockStyle() lipgloss.Style

GetCodeBlockStyle returns a lipgloss style for code blocks in corrupted theme

func GetLogPath

func GetLogPath() string

GetLogPath returns the current log file path.

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

func GetRandomPhrase(phrases []string) string

Helper function to get a random phrase from a slice

func InitLogging

func InitLogging() error

InitLogging initializes the skill call log file.

func LogInfo

func LogInfo(msg string)

LogInfo logs an informational message.

func LogLLMRequest

func LogLLMRequest(messageCount int, toolCount int)

LogLLMRequest logs an LLM request.

func LogLLMResponse

func LogLLMResponse(contentLen int, hasToolCalls bool)

LogLLMResponse logs an LLM response.

func LogSkillCall

func LogSkillCall(name string, args map[string]any)

LogSkillCall logs when a skill/function is called by the LLM.

func LogSkillResult

func LogSkillResult(name string, result string, err error)

LogSkillResult logs the result of a skill execution.

func MessageRoleStyle

func MessageRoleStyle(role string) lipgloss.Style

MessageRoleStyle returns the appropriate style for a message role.

func RenderBox

func RenderBox(content string, width int) string

RenderBox creates a bordered box with the given content and width.

func RenderCorruptedBorder

func RenderCorruptedBorder(content string, width int, frame int) string

RenderCorruptedBorder creates a border with corruption effects.

func RenderCorruptedSkill

func RenderCorruptedSkill(name string) string

RenderCorruptedSkill renders a skill name with corruption effect during execution. Uses the existing CorruptText function from streaming.go with 40% intensity.

func RenderGlassmorphicBox

func RenderGlassmorphicBox(content string, width int, borderColor lipgloss.Color) string

RenderGlassmorphicBox creates a glassmorphic bordered box with gradient accent.

func RenderGlowText

func RenderGlowText(text string, primaryColor, glowColor lipgloss.Color) string

RenderGlowText adds a glowing effect to text with secondary color.

func RenderHeader

func RenderHeader(title, info string, width int) string

RenderHeader creates a styled header with title and info.

func RenderNeonText

func RenderNeonText(text string, neonColor lipgloss.Color) string

RenderNeonText renders text with neon glow effect.

func RenderStatusBadge

func RenderStatusBadge(text string, statusColor lipgloss.Color) string

RenderStatusBadge creates a styled status badge with glassmorphic bg.

func Run

func Run(llmClient LLMClient) error

Run starts the TUI application.

func SendMessage

func SendMessage(content string) tea.Cmd

SendMessage returns a command that sends a message to the LLM.

func SkillStatusStyle

func SkillStatusStyle(status string) lipgloss.Style

SkillStatusStyle returns the appropriate style for a skill execution status.

func StreamingSpinner

func StreamingSpinner(frame int) string

StreamingSpinner returns an animated spinner for streaming.

func ThinkingAnimation

func ThinkingAnimation(frame int) string

ThinkingAnimation returns animated "thinking" text with corruption.

func Tick

func Tick(d time.Duration) tea.Cmd

Tick returns a command that sends a tick message after a delay.

func TypingTickCmd

func TypingTickCmd() tea.Cmd

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 NewApp

func NewApp(llmClient LLMClient) AppModel

NewApp creates a new TUI application model.

func (AppModel) Init

func (m AppModel) Init() tea.Cmd

Init implements tea.Model.

func (AppModel) SetConfig

func (m AppModel) SetConfig(cfg *config.Config) AppModel

SetConfig sets the configuration for accessing context limits and other settings.

func (AppModel) SetLLMClient

func (m AppModel) SetLLMClient(client LLMClient) AppModel

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

func (m AppModel) SetVersion(version, build string) AppModel

SetVersion sets the application version and build information.

func (AppModel) Update

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

Update implements tea.Model.

func (AppModel) View

func (m AppModel) View() string

View implements tea.Model.

func (AppModel) WithEndpoint

func (m AppModel) WithEndpoint(endpoint string) AppModel

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 NewChatModel

func NewChatModel() ChatModel

NewChatModel creates a new chat model.

func (ChatModel) AddAssistantMessage

func (m ChatModel) AddAssistantMessage(content string) ChatModel

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

func (m ChatModel) AddSystemMessage(content string) ChatModel

AddSystemMessage adds a system message to the chat.

func (ChatModel) AddToolResult

func (m ChatModel) AddToolResult(toolCallID, name, result string) ChatModel

AddToolResult adds a tool result message to the chat.

func (ChatModel) AddUserMessage

func (m ChatModel) AddUserMessage(content string) ChatModel

AddUserMessage adds a user message to the chat.

func (ChatModel) AppendToLastAssistant

func (m ChatModel) AppendToLastAssistant(content string) ChatModel

AppendToLastAssistant appends content to the last assistant message.

func (ChatModel) Clear

func (m ChatModel) Clear() ChatModel

Clear clears all messages and function calls.

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) Init

func (m ChatModel) Init() tea.Cmd

Init implements the Init method for ChatModel (partial tea.Model).

func (ChatModel) SetLastAssistantContent

func (m ChatModel) SetLastAssistantContent(content string) ChatModel

SetLastAssistantContent sets the content of the last assistant message.

func (ChatModel) SetSize

func (m ChatModel) SetSize(width, height int) ChatModel

SetSize sets the chat panel size.

func (ChatModel) ToggleSkillCalls

func (m ChatModel) ToggleSkillCalls() ChatModel

ToggleSkillCalls toggles the visibility of skill call logs.

func (ChatModel) Update

func (m ChatModel) Update(msg tea.Msg) (ChatModel, tea.Cmd)

Update handles messages for the chat panel.

func (ChatModel) UpdateFunctionResult

func (m ChatModel) UpdateFunctionResult(name, result string) ChatModel

UpdateFunctionResult updates the result of a function call.

func (ChatModel) View

func (m ChatModel) View() string

View renders the chat panel.

type ClearChatMsg

type ClearChatMsg struct{}

ClearChatMsg is sent to clear the chat history.

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

func (CollectionsModel) Init

func (m CollectionsModel) Init() tea.Cmd

Init initializes the model

func (CollectionsModel) Update

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

Update handles messages

func (CollectionsModel) View

func (m CollectionsModel) View() string

View renders the 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 ErrorMsg

type ErrorMsg struct {
	Err error
}

ErrorMsg is sent when an error occurs.

type ExitMsg

type ExitMsg struct{}

ExitMsg is sent to exit the application.

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 NewHeaderModel

func NewHeaderModel() HeaderModel

NewHeaderModel creates a new header model.

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.

func (HeaderModel) View

func (m HeaderModel) View() string

View renders the header.

type InputModel

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

InputModel represents the text input component.

func NewInputModel

func NewInputModel() InputModel

NewInputModel creates a new input model.

func (InputModel) Blur

func (m InputModel) Blur() InputModel

Blur removes focus from the input.

func (InputModel) Clear

func (m InputModel) Clear() InputModel

Clear clears the input.

func (InputModel) Focus

func (m InputModel) Focus() InputModel

Focus focuses the input.

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.

func (InputModel) Value

func (m InputModel) Value() string

Value returns the current input value.

func (InputModel) View

func (m InputModel) View() string

View renders 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

type MediaResultMsg struct {
	Success   bool
	URL       string
	Path      string
	Error     string
	MediaType string
}

MediaResultMsg is sent when media generation completes.

type MenuItem struct {
	Name        string
	Description string
}

MenuItem represents a command in the menu

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

MenuModel is the TUI model for interactive command menu

func NewMenuModel

func NewMenuModel() MenuModel

NewMenuModel creates a new menu model

func (m MenuModel) Init() tea.Cmd

Init initializes the model

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

Update handles messages

func (m MenuModel) View() string

View renders the model

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) Init

func (m SelectorModel) Init() tea.Cmd

Init implements tea.Model.

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.

func (SelectorModel) View

func (m SelectorModel) View() string

View 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

type SessionMessage struct {
	Role      string
	Content   string
	Timestamp time.Time
}

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

func (SkillsBrowserModel) Update

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

Update handles messages

func (SkillsBrowserModel) View

func (m SkillsBrowserModel) View() string

View renders 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 NewStatusModel

func NewStatusModel() StatusModel

NewStatusModel creates a new status model.

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.

func (StatusModel) View

func (m StatusModel) View() string

View renders the status bar.

type StatusMsg

type StatusMsg struct {
	Text string
}

StatusMsg is sent to update the status bar.

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 TickMsg

type TickMsg struct {
	Time time.Time
}

TickMsg is sent for timer-based updates (animations, etc).

type TokenUsage

type TokenUsage struct {
	PromptTokens     int
	CompletionTokens int
	TotalTokens      int
}

TokenUsage holds token usage information from API response

type ToolCallInfo

type ToolCallInfo struct {
	ID        string
	Name      string
	Arguments string
}

ToolCallInfo represents a tool call in an assistant message.

type TypingTickMsg

type TypingTickMsg struct{}

TypingTickMsg is sent for typing animation ticks.

type VeniceConfigData

type VeniceConfigData struct {
	APIKey     string
	BaseURL    string
	Model      string // Chat model
	ImageModel string // Image generation model
}

VeniceConfigData holds Venice.ai configuration from skills.json.

Jump to

Keyboard shortcuts

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