Documentation
¶
Index ¶
- Variables
- func ClearMessages(d state.Dispatcher)
- func ElementViewport(width, height int) viewport.Model
- func NewMessage(d state.Dispatcher, provider llm.Provider, role state.Role, content string) error
- type BaseTheme
- type ChangeProviderAction
- type ChatCompletionCompletedAction
- type ChatCompletionStartedAction
- type ChatInput
- type ClearMessagesAction
- type DarkTheme
- func (t *DarkTheme) Accent() lipgloss.Color
- func (t *DarkTheme) Background() lipgloss.Color
- func (t *DarkTheme) Border() lipgloss.Color
- func (t *DarkTheme) Error() lipgloss.Color
- func (t *DarkTheme) Highlight() lipgloss.Color
- func (t *DarkTheme) Info() lipgloss.Color
- func (t *DarkTheme) Primary() lipgloss.Color
- func (t *DarkTheme) Secondary() lipgloss.Color
- func (t *DarkTheme) Selection() lipgloss.Color
- func (t *DarkTheme) Success() lipgloss.Color
- func (t *DarkTheme) Surface() lipgloss.Color
- func (t *DarkTheme) Text() lipgloss.Color
- func (t *DarkTheme) TextSubtle() lipgloss.Color
- func (t *DarkTheme) Warning() lipgloss.Color
- type LightTheme
- func (t *LightTheme) Accent() lipgloss.Color
- func (t *LightTheme) Background() lipgloss.Color
- func (t *LightTheme) Border() lipgloss.Color
- func (t *LightTheme) Error() lipgloss.Color
- func (t *LightTheme) Highlight() lipgloss.Color
- func (t *LightTheme) Info() lipgloss.Color
- func (t *LightTheme) Primary() lipgloss.Color
- func (t *LightTheme) Secondary() lipgloss.Color
- func (t *LightTheme) Selection() lipgloss.Color
- func (t *LightTheme) Success() lipgloss.Color
- func (t *LightTheme) Surface() lipgloss.Color
- func (t *LightTheme) Text() lipgloss.Color
- func (t *LightTheme) TextSubtle() lipgloss.Color
- func (t *LightTheme) Warning() lipgloss.Color
- type MessageAction
- type MessageChunkAction
- type REPLScreen
- type RetroTheme
- func (t *RetroTheme) Accent() lipgloss.Color
- func (t *RetroTheme) Background() lipgloss.Color
- func (t *RetroTheme) Border() lipgloss.Color
- func (t *RetroTheme) Error() lipgloss.Color
- func (t *RetroTheme) Highlight() lipgloss.Color
- func (t *RetroTheme) Info() lipgloss.Color
- func (t *RetroTheme) Primary() lipgloss.Color
- func (t *RetroTheme) Secondary() lipgloss.Color
- func (t *RetroTheme) Selection() lipgloss.Color
- func (t *RetroTheme) Success() lipgloss.Color
- func (t *RetroTheme) Surface() lipgloss.Color
- func (t *RetroTheme) Text() lipgloss.Color
- func (t *RetroTheme) TextSubtle() lipgloss.Color
- func (t *RetroTheme) Warning() lipgloss.Color
- type Screen
- type ScreenStack
- type Stack
- type SwitchThemeAction
- type Theme
- type ThemeManager
- type ThemeStyles
Constants ¶
This section is empty.
Variables ¶
var ( RoleStyle = lipgloss.NewStyle().Bold(true).Foreground(CurrentTheme().Text()) DimStyle = CurrentTheme().Styles().Subtle )
var ThemeManagerInstance = NewThemeManager()
Global theme manager instance
Functions ¶
func ClearMessages ¶
func ClearMessages(d state.Dispatcher)
func ElementViewport ¶
func NewMessage ¶
Types ¶
type BaseTheme ¶
type BaseTheme struct {
// contains filtered or unexported fields
}
BaseTheme provides common functionality for all themes
func (*BaseTheme) Styles ¶
func (t *BaseTheme) Styles() *ThemeStyles
type ChangeProviderAction ¶
type ChatCompletionCompletedAction ¶
type ChatCompletionCompletedAction struct{}
type ChatCompletionStartedAction ¶
type ChatCompletionStartedAction struct{}
type ChatInput ¶
func ElementInput ¶
type ClearMessagesAction ¶
type ClearMessagesAction struct{}
type DarkTheme ¶
type DarkTheme struct {
BaseTheme
}
DarkTheme implements a dark purple theme
func (*DarkTheme) Background ¶
func (*DarkTheme) TextSubtle ¶
type LightTheme ¶
type LightTheme struct {
BaseTheme
}
LightTheme implements Solarized Light color scheme
func (*LightTheme) Accent ¶
func (t *LightTheme) Accent() lipgloss.Color
func (*LightTheme) Background ¶
func (t *LightTheme) Background() lipgloss.Color
func (*LightTheme) Border ¶
func (t *LightTheme) Border() lipgloss.Color
func (*LightTheme) Error ¶
func (t *LightTheme) Error() lipgloss.Color
func (*LightTheme) Highlight ¶
func (t *LightTheme) Highlight() lipgloss.Color
func (*LightTheme) Info ¶
func (t *LightTheme) Info() lipgloss.Color
func (*LightTheme) Primary ¶
func (t *LightTheme) Primary() lipgloss.Color
func (*LightTheme) Secondary ¶
func (t *LightTheme) Secondary() lipgloss.Color
func (*LightTheme) Selection ¶
func (t *LightTheme) Selection() lipgloss.Color
func (*LightTheme) Success ¶
func (t *LightTheme) Success() lipgloss.Color
func (*LightTheme) Surface ¶
func (t *LightTheme) Surface() lipgloss.Color
func (*LightTheme) Text ¶
func (t *LightTheme) Text() lipgloss.Color
func (*LightTheme) TextSubtle ¶
func (t *LightTheme) TextSubtle() lipgloss.Color
func (*LightTheme) Warning ¶
func (t *LightTheme) Warning() lipgloss.Color
type MessageAction ¶
type MessageChunkAction ¶
type REPLScreen ¶
type REPLScreen struct {
state.Dispatcher
llm.Provider
// contains filtered or unexported fields
}
REPLScreen represents the REPLScreen UI model
func NewREPL ¶
func NewREPL(d state.Dispatcher, p llm.Provider) *REPLScreen
NewREPL creates a new REPL instance
func (*REPLScreen) OnStateChange ¶
type RetroTheme ¶
type RetroTheme struct {
BaseTheme
}
RetroTheme implements the original retro color scheme
func (*RetroTheme) Accent ¶
func (t *RetroTheme) Accent() lipgloss.Color
func (*RetroTheme) Background ¶
func (t *RetroTheme) Background() lipgloss.Color
func (*RetroTheme) Border ¶
func (t *RetroTheme) Border() lipgloss.Color
func (*RetroTheme) Error ¶
func (t *RetroTheme) Error() lipgloss.Color
func (*RetroTheme) Highlight ¶
func (t *RetroTheme) Highlight() lipgloss.Color
func (*RetroTheme) Info ¶
func (t *RetroTheme) Info() lipgloss.Color
func (*RetroTheme) Primary ¶
func (t *RetroTheme) Primary() lipgloss.Color
func (*RetroTheme) Secondary ¶
func (t *RetroTheme) Secondary() lipgloss.Color
func (*RetroTheme) Selection ¶
func (t *RetroTheme) Selection() lipgloss.Color
func (*RetroTheme) Success ¶
func (t *RetroTheme) Success() lipgloss.Color
func (*RetroTheme) Surface ¶
func (t *RetroTheme) Surface() lipgloss.Color
func (*RetroTheme) Text ¶
func (t *RetroTheme) Text() lipgloss.Color
func (*RetroTheme) TextSubtle ¶
func (t *RetroTheme) TextSubtle() lipgloss.Color
func (*RetroTheme) Warning ¶
func (t *RetroTheme) Warning() lipgloss.Color
type ScreenStack ¶
type ScreenStack struct {
// contains filtered or unexported fields
}
ScreenStack implements a stack of screens. It follows LIFO order.
func NewScreenStack ¶
func NewScreenStack(root Screen) *ScreenStack
NewScreenStack creates a new screen stack
func (*ScreenStack) Active ¶
func (s *ScreenStack) Active() Screen
Active returns the top screen from the stack without removing it Returns the root screen if the stack is empty
func (*ScreenStack) Pop ¶
func (s *ScreenStack) Pop() Screen
Pop removes and returns the top screen from the stack Returns nil if the stack is empty
func (*ScreenStack) Push ¶
func (s *ScreenStack) Push(screen Screen) int
Push adds a screen to the top of the stack and returns the new stack size
type SwitchThemeAction ¶
type SwitchThemeAction struct {
Name string
}
type Theme ¶
type Theme interface {
// Core colors
Primary() lipgloss.Color
Secondary() lipgloss.Color
Accent() lipgloss.Color
Background() lipgloss.Color
Surface() lipgloss.Color
Text() lipgloss.Color
TextSubtle() lipgloss.Color
// Semantic colors
Error() lipgloss.Color
Warning() lipgloss.Color
Success() lipgloss.Color
Info() lipgloss.Color
// UI-specific colors
Border() lipgloss.Color
Highlight() lipgloss.Color
Selection() lipgloss.Color
// Get pre-configured styles
Styles() *ThemeStyles
}
Theme defines the interface for color themes
func NewDarkTheme ¶
func NewDarkTheme() Theme
func NewLightTheme ¶
func NewLightTheme() Theme
func NewRetroTheme ¶
func NewRetroTheme() Theme
type ThemeManager ¶
type ThemeManager struct {
// contains filtered or unexported fields
}
ThemeManager manages the current theme
func NewThemeManager ¶
func NewThemeManager() *ThemeManager
NewThemeManager creates a new theme manager with all available themes
func (*ThemeManager) Current ¶
func (tm *ThemeManager) Current() Theme
Current returns the current active theme
func (*ThemeManager) ListThemes ¶
func (tm *ThemeManager) ListThemes() []string
ListThemes returns all available theme names
func (*ThemeManager) SetTheme ¶
func (tm *ThemeManager) SetTheme(name string) error
SetTheme changes the current theme
type ThemeStyles ¶
type ThemeStyles struct {
Primary lipgloss.Style
Secondary lipgloss.Style
Accent lipgloss.Style
Header lipgloss.Style
Highlight lipgloss.Style
Border lipgloss.Style
Error lipgloss.Style
Warning lipgloss.Style
Success lipgloss.Style
Info lipgloss.Style
Subtle lipgloss.Style
CodeBlock lipgloss.Style
Input lipgloss.Style
}
ThemeStyles contains pre-configured styles for common UI elements
func CurrentStyles ¶
func CurrentStyles() *ThemeStyles
Convenience function to get current theme styles