Documentation
¶
Index ¶
- Variables
- func ConvertAnsiToGocuiColor(ansiColor string) gocui.Attribute
- func ConvertColorToAnsi(hexColor string) string
- func ConvertColorToAnsiBg(hexColor string) string
- func CreateMarkdownRendererWithWidth(theme *types.Theme, themeName string, glamourTheme string, width int) (*glamour.TermRenderer, error)
- func FormatToolCall(toolName string, params map[string]any, config *types.Config) string
- func FormatToolResult(toolName string, result map[string]any, todoFormatter *TodoFormatter, ...) string
- func GetAllAvailableGlamourStyles() []string
- func GetDiffThemeForMainTheme(mainThemeName string) string
- func GetDiffThemeNames() []string
- func GetGlamourStyleForTheme(themeName string) string
- func GetThemeColor(hexColor string) gocui.Attribute
- func GetThemeFocusColors(theme *types.Theme) (gocui.Attribute, gocui.Attribute)
- func GetThemeForMode(name string, outputMode string) *types.Theme
- func GetThemeNames() []string
- type DiffFormatter
- type DiffTheme
- type MessageFormatter
- type Theme
- type TodoFormatter
- type TodoItem
Constants ¶
This section is empty.
Variables ¶
var DiffThemes = map[string]*DiffTheme{
"default": {
AddedFg: "#A3BE8C",
AddedBg: "",
RemovedFg: "#BF616A",
RemovedBg: "",
HeaderFg: "#5E81AC",
HeaderBg: "",
HunkFg: "#D08770",
HunkBg: "",
ContextFg: "#D8DEE9",
ContextBg: "",
},
"subtle": {
AddedFg: "#50A050",
AddedBg: "",
RemovedFg: "#A05050",
RemovedBg: "",
HeaderFg: "#6B8CAF",
HeaderBg: "",
HunkFg: "#B8860B",
HunkBg: "",
ContextFg: "#CCCCCC",
ContextBg: "",
},
"vibrant": {
AddedFg: "#00FF00",
AddedBg: "",
RemovedFg: "#FF0000",
RemovedBg: "",
HeaderFg: "#00FFFF",
HeaderBg: "",
HunkFg: "#FFFF00",
HunkBg: "",
ContextFg: "#FFFFFF",
ContextBg: "",
},
"github": {
AddedFg: "#28A745",
AddedBg: "",
RemovedFg: "#D73A49",
RemovedBg: "",
HeaderFg: "#586069",
HeaderBg: "",
HunkFg: "#005CC5",
HunkBg: "",
ContextFg: "#24292E",
ContextBg: "",
},
"classic": {
AddedFg: "#90EE90",
AddedBg: "",
RemovedFg: "#FFB6C1",
RemovedBg: "",
HeaderFg: "#87CEEB",
HeaderBg: "",
HunkFg: "#F0E68C",
HunkBg: "",
ContextFg: "#F5F5F5",
ContextBg: "",
},
"highlighted": {
AddedFg: "#E8E8E8",
AddedBg: "#2F5A1A",
RemovedFg: "#E8E8E8",
RemovedBg: "#6B1F1F",
HeaderFg: "#E8E8E8",
HeaderBg: "#234068",
HunkFg: "#E8E8E8",
HunkBg: "#6B3A1C",
ContextFg: "#ECEFF4",
ContextBg: "",
},
}
DiffThemes defines available diff color schemes
var Themes = map[string]*Theme{
"default": {
BorderDefault: "#6B6B6B",
BorderFocused: "#B0B0B0",
BorderMuted: "#3C3C3C",
TitleDefault: "#8A8A8A",
TitleFocused: "#D0D0D0",
TitleMuted: "#5A5A5A",
TextPrimary: "#E8E8E8",
TextSecondary: "#D4D4D4",
TextTertiary: "#8A8A8A",
Primary: "#6B9B6B",
Secondary: "#6B8CAF",
Tertiary: "#8A8A8A",
Error: "#C85450",
Warning: "#D4A854",
Success: "#6B9B6B",
Muted: "#5A5A5A",
},
"minimal": {
BorderDefault: "#505050",
BorderFocused: "#808080",
BorderMuted: "#2A2A2A",
TitleDefault: "#707070",
TitleFocused: "#A0A0A0",
TitleMuted: "#404040",
TextPrimary: "#D0D0D0",
TextSecondary: "#B0B0B0",
TextTertiary: "#707070",
Primary: "#808080",
Secondary: "#707070",
Tertiary: "#606060",
Error: "#A05050",
Warning: "#A0A050",
Success: "#50A050",
Muted: "#404040",
},
"dracula": {
BorderDefault: "#6272A4",
BorderFocused: "#8BE9FD",
BorderMuted: "#44475A",
TitleDefault: "#8BE9FD",
TitleFocused: "#F1FA8C",
TitleMuted: "#6272A4",
TextPrimary: "#F8F8F2",
TextSecondary: "#E6E6E6",
TextTertiary: "#6272A4",
Primary: "#50FA7B",
Secondary: "#BD93F9",
Tertiary: "#6272A4",
Error: "#FF5555",
Warning: "#F1FA8C",
Success: "#50FA7B",
Muted: "#44475A",
},
"monokai": {
BorderDefault: "#75715E",
BorderFocused: "#A6E22E",
BorderMuted: "#49483E",
TitleDefault: "#A6E22E",
TitleFocused: "#E6DB74",
TitleMuted: "#75715E",
TextPrimary: "#F8F8F2",
TextSecondary: "#E6E6E6",
TextTertiary: "#75715E",
Primary: "#A6E22E",
Secondary: "#66D9EF",
Tertiary: "#75715E",
Error: "#F92672",
Warning: "#E6DB74",
Success: "#A6E22E",
Muted: "#49483E",
},
"solarized": {
BorderDefault: "#657B83",
BorderFocused: "#839496",
BorderMuted: "#073642",
TitleDefault: "#268BD2",
TitleFocused: "#B58900",
TitleMuted: "#657B83",
TextPrimary: "#EEE8D5",
TextSecondary: "#93A1A1",
TextTertiary: "#657B83",
Primary: "#859900",
Secondary: "#268BD2",
Tertiary: "#657B83",
Error: "#DC322F",
Warning: "#B58900",
Success: "#859900",
Muted: "#586E75",
},
"nord": {
BorderDefault: "#616E88",
BorderFocused: "#88C0D0",
BorderMuted: "#3B4252",
TitleDefault: "#88C0D0",
TitleFocused: "#EBCB8B",
TitleMuted: "#616E88",
TextPrimary: "#ECEFF4",
TextSecondary: "#E5E9F0",
TextTertiary: "#616E88",
Primary: "#A3BE8C",
Secondary: "#5E81AC",
Tertiary: "#616E88",
Error: "#BF616A",
Warning: "#EBCB8B",
Success: "#A3BE8C",
Muted: "#4C566A",
},
"catppuccin": {
BorderDefault: "#585B70",
BorderFocused: "#89B4FA",
BorderMuted: "#313244",
TitleDefault: "#89B4FA",
TitleFocused: "#F9E2AF",
TitleMuted: "#585B70",
TextPrimary: "#CDD6F4",
TextSecondary: "#BAC2DE",
TextTertiary: "#6C7086",
Primary: "#A6E3A1",
Secondary: "#89B4FA",
Tertiary: "#6C7086",
Error: "#F38BA8",
Warning: "#F9E2AF",
Success: "#A6E3A1",
Muted: "#45475A",
},
"tokyo-night": {
BorderDefault: "#565F89",
BorderFocused: "#7AA2F7",
BorderMuted: "#32344A",
TitleDefault: "#7AA2F7",
TitleFocused: "#E0AF68",
TitleMuted: "#565F89",
TextPrimary: "#C0CAF5",
TextSecondary: "#A9B1D6",
TextTertiary: "#565F89",
Primary: "#9ECE6A",
Secondary: "#7AA2F7",
Tertiary: "#565F89",
Error: "#F7768E",
Warning: "#E0AF68",
Success: "#9ECE6A",
Muted: "#414868",
},
"gruvbox": {
BorderDefault: "#928374",
BorderFocused: "#83A598",
BorderMuted: "#504945",
TitleDefault: "#83A598",
TitleFocused: "#FABD2F",
TitleMuted: "#928374",
TextPrimary: "#EBDBB2",
TextSecondary: "#D5C4A1",
TextTertiary: "#928374",
Primary: "#B8BB26",
Secondary: "#83A598",
Tertiary: "#928374",
Error: "#FB4934",
Warning: "#FABD2F",
Success: "#B8BB26",
Muted: "#665C54",
},
"github-dark": {
BorderDefault: "#484F58",
BorderFocused: "#58A6FF",
BorderMuted: "#21262D",
TitleDefault: "#58A6FF",
TitleFocused: "#D29922",
TitleMuted: "#484F58",
TextPrimary: "#E6EDF3",
TextSecondary: "#B1BAC4",
TextTertiary: "#7D8590",
Primary: "#3FB950",
Secondary: "#58A6FF",
Tertiary: "#7D8590",
Error: "#F85149",
Warning: "#D29922",
Success: "#3FB950",
Muted: "#30363D",
},
"rose-pine": {
BorderDefault: "#6E6A86",
BorderFocused: "#9CCFD8",
BorderMuted: "#26233A",
TitleDefault: "#9CCFD8",
TitleFocused: "#F6C177",
TitleMuted: "#6E6A86",
TextPrimary: "#E0DEF4",
TextSecondary: "#908CAA",
TextTertiary: "#6E6A86",
Primary: "#31748F",
Secondary: "#9CCFD8",
Tertiary: "#6E6A86",
Error: "#EB6F92",
Warning: "#F6C177",
Success: "#31748F",
Muted: "#403D52",
},
"one-dark": {
BorderDefault: "#5C6370",
BorderFocused: "#61AFEF",
BorderMuted: "#353B45",
TitleDefault: "#61AFEF",
TitleFocused: "#E5C07B",
TitleMuted: "#5C6370",
TextPrimary: "#ABB2BF",
TextSecondary: "#9CA3AF",
TextTertiary: "#5C6370",
Primary: "#98C379",
Secondary: "#61AFEF",
Tertiary: "#5C6370",
Error: "#E06C75",
Warning: "#E5C07B",
Success: "#98C379",
Muted: "#4B5263",
},
}
Functions ¶
func ConvertAnsiToGocuiColor ¶
ConvertAnsiToGocuiColor converts ANSI color to gocui.Attribute (legacy compatibility)
func ConvertColorToAnsi ¶
ConvertColorToAnsi converts hex color to ANSI escape sequence for text coloring
func ConvertColorToAnsiBg ¶ added in v0.1.4
ConvertColorToAnsiBg converts hex color to ANSI escape sequence for background coloring
func CreateMarkdownRendererWithWidth ¶
func CreateMarkdownRendererWithWidth(theme *types.Theme, themeName string, glamourTheme string, width int) (*glamour.TermRenderer, error)
CreateMarkdownRendererWithWidth creates a markdown renderer with specified width - exported for use by components
func FormatToolCall ¶
FormatToolCall formats tool calls for display in the chat interface
func FormatToolResult ¶
func FormatToolResult(toolName string, result map[string]any, todoFormatter *TodoFormatter, config *types.Config) string
FormatToolResult formats the result of a tool execution for display in the chat interface
func GetAllAvailableGlamourStyles ¶
func GetAllAvailableGlamourStyles() []string
GetAllAvailableGlamourStyles returns all built-in glamour themes
func GetDiffThemeForMainTheme ¶ added in v0.1.4
GetDiffThemeForMainTheme maps main theme names to appropriate diff themes
func GetDiffThemeNames ¶ added in v0.1.4
func GetDiffThemeNames() []string
GetDiffThemeNames returns all available diff theme names
func GetGlamourStyleForTheme ¶
GetGlamourStyleForTheme maps our theme names to appropriate glamour styles
func GetThemeColor ¶
GetThemeColor converts a theme hex color to gocui.Attribute using gocui.GetColor
func GetThemeFocusColors ¶
GetThemeFocusColors returns focus colors (legacy compatibility)
func GetThemeForMode ¶
GetThemeForMode returns a theme (ignores mode now)
Types ¶
type DiffFormatter ¶
type DiffFormatter struct {
// contains filtered or unexported fields
}
DiffFormatter formats diff output with diff-specific colors
func NewDiffFormatter ¶
func NewDiffFormatter(diffTheme *DiffTheme) *DiffFormatter
NewDiffFormatter creates a new diff formatter with the given diff theme
func (*DiffFormatter) Format ¶
func (f *DiffFormatter) Format(content string) string
Format applies diff theme colors to diff content
func (*DiffFormatter) FormatSideBySide ¶
func (f *DiffFormatter) FormatSideBySide(oldContent, newContent string, width int) string
FormatSideBySide formats a side-by-side diff (simplified version)
func (*DiffFormatter) FormatUnified ¶
func (f *DiffFormatter) FormatUnified(oldContent, newContent string, oldName, newName string) string
FormatUnified formats a unified diff with colors
type DiffTheme ¶ added in v0.1.4
type DiffTheme struct {
// Added lines
AddedFg string
AddedBg string
// Removed lines
RemovedFg string
RemovedBg string
// File headers (--- and +++ lines)
HeaderFg string
HeaderBg string
// Hunk headers (@@ lines)
HunkFg string
HunkBg string
// Context lines
ContextFg string
ContextBg string
}
DiffTheme defines colors for diff formatting
func GetDiffTheme ¶ added in v0.1.4
GetDiffTheme returns the diff theme by name
type MessageFormatter ¶
type MessageFormatter struct {
// contains filtered or unexported fields
}
func NewMessageFormatter ¶
func (*MessageFormatter) FormatMessageWithWidth ¶
func (f *MessageFormatter) FormatMessageWithWidth(msg types.Message, width int) string
type Theme ¶
type Theme struct {
// Border colors
BorderDefault string
BorderFocused string
BorderMuted string
// Title colors (for titles and subtitles)
TitleDefault string
TitleFocused string
TitleMuted string
// Text colors (for content that needs gocui colors)
TextPrimary string
TextSecondary string
TextTertiary string
// Accent colors
Primary string
Secondary string
Tertiary string
Error string
Warning string
Success string
Muted string
}
Theme defines a theme using W3C hex colors - clean and precise!
type TodoFormatter ¶
type TodoFormatter struct {
// contains filtered or unexported fields
}
TodoFormatter handles formatting of todo tool results for display in the TUI
func NewTodoFormatter ¶
func NewTodoFormatter(theme *types.Theme) *TodoFormatter
NewTodoFormatter creates a new TodoFormatter instance
func (*TodoFormatter) FormatTodoList ¶
func (f *TodoFormatter) FormatTodoList(todos []TodoItem) string
FormatTodoList formats a list of todos for display
func (*TodoFormatter) FormatTodoToolResult ¶
func (f *TodoFormatter) FormatTodoToolResult(result map[string]interface{}) string
FormatTodoToolResult formats the result from TodoWrite tools