Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DarkTheme = Theme{
Primary: "205",
Secondary: "62",
Success: "82",
Warning: "214",
Error: "196",
Muted: "240",
Subtle: "238",
UserLabel: "33",
AssistantLabel: "82",
ToolRunning: "214",
ToolDone: "240",
ToolFailed: "196",
InputPrompt: "33",
SelectedItem: "170",
UnselectedItem: "252",
}
DarkTheme is the default color scheme for dark-background terminals.
var LightTheme = Theme{
Primary: "125",
Secondary: "61",
Success: "28",
Warning: "130",
Error: "160",
Muted: "246",
Subtle: "250",
UserLabel: "25",
AssistantLabel: "28",
ToolRunning: "130",
ToolDone: "246",
ToolFailed: "160",
InputPrompt: "25",
SelectedItem: "125",
UnselectedItem: "236",
}
LightTheme is a color scheme for light-background terminals.
Functions ¶
func RenderLogo ¶
RenderLogo returns a styled splash block: ASCII mascot + app name + tagline. Injected into the viewport on startup; scrolls away naturally as the conversation grows.
Types ¶
type ColorTheme ¶
type ColorTheme struct {
Heading lipgloss.AdaptiveColor
Emphasis lipgloss.AdaptiveColor
Strong lipgloss.AdaptiveColor
InlineCode lipgloss.AdaptiveColor
Link lipgloss.AdaptiveColor
Quote lipgloss.AdaptiveColor
TableBorder lipgloss.AdaptiveColor
CodeBlockBorder lipgloss.AdaptiveColor
SpinnerActive lipgloss.AdaptiveColor
SpinnerDone lipgloss.AdaptiveColor
SpinnerFailed lipgloss.AdaptiveColor
}
ColorTheme holds colors for terminal markdown rendering.
func DefaultColorTheme ¶
func DefaultColorTheme() ColorTheme
DefaultColorTheme returns the default markdown color theme.
type MarkdownRenderer ¶
type MarkdownRenderer struct {
// contains filtered or unexported fields
}
MarkdownRenderer renders markdown text with ANSI terminal styling. It uses lipgloss for styling (GO_ONLY) rather than syntect/chroma. Includes language-aware syntax highlighting for code blocks. Implements the Renderer interface.
func NewMarkdownRenderer ¶
func NewMarkdownRenderer() *MarkdownRenderer
NewMarkdownRenderer creates a renderer with the default color theme and syntax highlighting enabled.
func NewMarkdownRendererWithTheme ¶
func NewMarkdownRendererWithTheme(theme ColorTheme) *MarkdownRenderer
NewMarkdownRendererWithTheme creates a renderer with a custom color theme and syntax highlighting enabled.
func (*MarkdownRenderer) MarkdownToANSI ¶
func (r *MarkdownRenderer) MarkdownToANSI(markdown string) string
MarkdownToANSI is an alias for RenderMarkdown.
func (*MarkdownRenderer) RenderMarkdown ¶
func (r *MarkdownRenderer) RenderMarkdown(markdown string) string
RenderMarkdown converts markdown text to ANSI-styled terminal output.
type MarkdownStreamState ¶
type MarkdownStreamState struct {
// contains filtered or unexported fields
}
MarkdownStreamState tracks the state of incrementally rendered markdown across SSE delta chunks. It buffers content until a safe boundary is found.
func NewMarkdownStreamState ¶
func NewMarkdownStreamState() *MarkdownStreamState
NewMarkdownStreamState creates a new streaming state.
func (*MarkdownStreamState) Flush ¶
func (s *MarkdownStreamState) Flush(renderer *MarkdownRenderer) (string, bool)
Flush renders and returns any remaining buffered content.
func (*MarkdownStreamState) Push ¶
func (s *MarkdownStreamState) Push(renderer *MarkdownRenderer, delta string) (string, bool)
Push appends a delta chunk and returns rendered markdown if a safe boundary (end of paragraph or closed code fence) was found.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the Bubble Tea application model.
func NewModel ¶
func NewModel(cfg *runtime.Config, loop *runtime.ConversationLoop) Model
NewModel creates a new TUI model.
type Renderer ¶
type Renderer interface {
// RenderMarkdown converts markdown text to styled terminal output.
RenderMarkdown(markdown string) string
}
Renderer is the interface for markdown rendering backends. This allows Bubble Tea, lipgloss, and plain output to coexist without duplicating markdown parsing logic.
type SyntaxHighlighter ¶
type SyntaxHighlighter struct {
// contains filtered or unexported fields
}
SyntaxHighlighter provides language-aware code block colorization.
func NewSyntaxHighlighter ¶
func NewSyntaxHighlighter() *SyntaxHighlighter
NewSyntaxHighlighter creates a highlighter with the default theme.
func NewSyntaxHighlighterWithTheme ¶
func NewSyntaxHighlighterWithTheme(theme SyntaxTheme) *SyntaxHighlighter
NewSyntaxHighlighterWithTheme creates a highlighter with a custom theme.
func (*SyntaxHighlighter) Highlight ¶
func (h *SyntaxHighlighter) Highlight(code, language string) string
Highlight applies syntax highlighting to a code block. language is the fence info string (e.g. "go", "rust", "python"). Returns the highlighted text or the original if the language is unknown.
type SyntaxTheme ¶
type SyntaxTheme struct {
Keyword lipgloss.AdaptiveColor
String lipgloss.AdaptiveColor
Comment lipgloss.AdaptiveColor
Number lipgloss.AdaptiveColor
Type lipgloss.AdaptiveColor
Function lipgloss.AdaptiveColor
Operator lipgloss.AdaptiveColor
}
SyntaxTheme holds colors for language-aware code highlighting. This is a Go-only feature replacing Rust's syntect integration, implemented without external deps (chroma/v2 would add ~3MB).
func DefaultSyntaxTheme ¶
func DefaultSyntaxTheme() SyntaxTheme
DefaultSyntaxTheme returns a terminal-friendly syntax theme.
type Theme ¶
type Theme struct {
Primary lipgloss.Color // app accent (header, spinner)
Secondary lipgloss.Color // secondary accent (overlay borders)
Success lipgloss.Color // positive outcomes
Warning lipgloss.Color // advisory messages
Error lipgloss.Color // error messages
Muted lipgloss.Color // de-emphasized text (status bar)
Subtle lipgloss.Color // very subtle (dividers)
UserLabel lipgloss.Color // "You:" label
AssistantLabel lipgloss.Color // "Claude:" label
ToolRunning lipgloss.Color // in-progress tool indicator
ToolDone lipgloss.Color // completed tool indicator
ToolFailed lipgloss.Color // failed tool indicator
InputPrompt lipgloss.Color // ">" prompt glyph
SelectedItem lipgloss.Color // highlighted item in pickers
UnselectedItem lipgloss.Color // unselected item in pickers
}
Theme defines the named color tokens used throughout the TUI. All lipgloss styles are derived from the active theme.