Documentation
¶
Index ¶
- func CheckTerminalCapabilities() error
- func CurrentModel() string
- func GetAvailableModels() []string
- func GetAvailableModelsByProvider() map[string][]string
- func GetModelDisplayName(modelName string) string
- func GetToolsEnabled() bool
- func GetToolsOutputEnabled() bool
- func GetVersion() string
- func GetVersionDisplay() string
- func SetCurrentModel(name string)
- func SetSpeechModeEnabled(enabled bool)
- func SpeechModeEnabled() bool
- func StartUI() error
- func StartUIWithoutAltScreen() error
- func ToggleTools()
- type Config
- type ConfigYAML
- type ConversationPair
- type HelpModel
- type HistoryManager
- func (hm *HistoryManager) AddMessage(message string) error
- func (hm *HistoryManager) ClearHistory() error
- func (hm *HistoryManager) GetHistory() []string
- func (hm *HistoryManager) GetHistoryCount() int
- func (hm *HistoryManager) GetHistoryFile() string
- func (hm *HistoryManager) GetMessageAt(index int) string
- func (hm *HistoryManager) LoadFromFile() error
- func (hm *HistoryManager) SaveToFile() error
- type InputModel
- func (m *InputModel) AddConversationPair(userMsg, aiResponse string)
- func (m InputModel) Init() tea.Cmd
- func (m *InputModel) SetAIResponse(aiResponse string)
- func (m InputModel) ShouldTriggerHelp() bool
- func (m InputModel) ShouldTriggerModelSelect() bool
- func (m InputModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m InputModel) View() string
- type MenuModel
- type ModelSelectModel
- type SlashCommand
- type TreeItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckTerminalCapabilities ¶
func CheckTerminalCapabilities() error
CheckTerminalCapabilities ensures the terminal supports required features
func CurrentModel ¶
func CurrentModel() string
CurrentModel returns the currently selected model (or empty string if unknown).
func GetAvailableModels ¶
func GetAvailableModels() []string
GetAvailableModels returns the list of available AI models from config.yaml
func GetAvailableModelsByProvider ¶
GetAvailableModelsByProvider returns models grouped by provider
func GetModelDisplayName ¶
GetModelDisplayName returns the full model name for display
func GetToolsEnabled ¶
func GetToolsEnabled() bool
GetToolsEnabled returns whether tools are currently enabled
func GetToolsOutputEnabled ¶
func GetToolsOutputEnabled() bool
GetToolsOutputEnabled returns whether tool output should be shown in the UI
func GetVersionDisplay ¶
func GetVersionDisplay() string
GetVersionDisplay returns the formatted version string for display
func SetCurrentModel ¶
func SetCurrentModel(name string)
SetCurrentModel stores the model name selected by the user/UI.
func SetSpeechModeEnabled ¶
func SetSpeechModeEnabled(enabled bool)
SetSpeechModeEnabled sets global speech mode flag
func SpeechModeEnabled ¶
func SpeechModeEnabled() bool
SpeechModeEnabled returns whether speech mode is globally enabled
func StartUIWithoutAltScreen ¶
func StartUIWithoutAltScreen() error
StartUIWithoutAltScreen runs the UI without alternative screen mode Useful for development or when you want to preserve terminal history
func ToggleTools ¶
func ToggleTools()
ToggleTools toggles the tools enabled/disabled state in the global config
Types ¶
type ConfigYAML ¶
type ConfigYAML struct {
Providers map[string]struct {
Models []string `yaml:"models"`
} `yaml:"providers"`
}
ConfigYAML represents the structure of config.yaml for model loading
type ConversationPair ¶
type ConversationPair struct {
UserMessage string
AIResponse string
IsProcessing bool // Whether this conversation is currently being processed
}
ConversationPair represents a user message and AI response pair
type HelpModel ¶
type HelpModel struct {
// contains filtered or unexported fields
}
HelpModel represents the full-screen help interface
type HistoryManager ¶
type HistoryManager struct {
// contains filtered or unexported fields
}
HistoryManager handles persistent storage of input history
func NewHistoryManager ¶
func NewHistoryManager() (*HistoryManager, error)
NewHistoryManager creates a new history manager
func (*HistoryManager) AddMessage ¶
func (hm *HistoryManager) AddMessage(message string) error
AddMessage adds a message to history (avoiding duplicates and empty messages)
func (*HistoryManager) ClearHistory ¶
func (hm *HistoryManager) ClearHistory() error
ClearHistory clears all history
func (*HistoryManager) GetHistory ¶
func (hm *HistoryManager) GetHistory() []string
GetHistory returns the full history slice
func (*HistoryManager) GetHistoryCount ¶
func (hm *HistoryManager) GetHistoryCount() int
GetHistoryCount returns the number of items in history
func (*HistoryManager) GetHistoryFile ¶
func (hm *HistoryManager) GetHistoryFile() string
GetHistoryFile returns the path to the history file
func (*HistoryManager) GetMessageAt ¶
func (hm *HistoryManager) GetMessageAt(index int) string
GetMessageAt returns the message at the given index (0 = oldest, len-1 = newest)
func (*HistoryManager) LoadFromFile ¶
func (hm *HistoryManager) LoadFromFile() error
LoadFromFile loads history from disk
func (*HistoryManager) SaveToFile ¶
func (hm *HistoryManager) SaveToFile() error
SaveToFile saves the current history to disk
type InputModel ¶
type InputModel struct {
// contains filtered or unexported fields
}
InputModel represents the text input state
func NewInputModel ¶
func NewInputModel(provider string) InputModel
NewInputModel creates a new input model for the selected provider
func (*InputModel) AddConversationPair ¶
func (m *InputModel) AddConversationPair(userMsg, aiResponse string)
AddConversationPair adds a user message and AI response pair to the conversation
func (InputModel) Init ¶
func (m InputModel) Init() tea.Cmd
func (*InputModel) SetAIResponse ¶
func (m *InputModel) SetAIResponse(aiResponse string)
SetAIResponse sets the AI response for the most recent conversation pair
func (InputModel) ShouldTriggerHelp ¶
func (m InputModel) ShouldTriggerHelp() bool
ShouldTriggerHelp returns true if help screen should be triggered
func (InputModel) ShouldTriggerModelSelect ¶
func (m InputModel) ShouldTriggerModelSelect() bool
ShouldTriggerModelSelect returns true if model selection screen should be triggered
func (InputModel) View ¶
func (m InputModel) View() string
type MenuModel ¶
type MenuModel struct {
// contains filtered or unexported fields
}
MenuModel represents the main menu state
type ModelSelectModel ¶
type ModelSelectModel struct {
// contains filtered or unexported fields
}
ModelSelectModel represents the full-screen model selection interface
func NewModelSelectModel ¶
func NewModelSelectModel() ModelSelectModel
NewModelSelectModel creates a new model selection model
func (ModelSelectModel) GetSelectedModel ¶
func (m ModelSelectModel) GetSelectedModel() string
GetSelectedModel returns the selected model name
func (ModelSelectModel) Init ¶
func (m ModelSelectModel) Init() tea.Cmd
Init initializes the model selection model
func (ModelSelectModel) View ¶
func (m ModelSelectModel) View() string
View renders the model selection screen
type SlashCommand ¶
SlashCommand represents a slash command with its name and description
func FilterCommands ¶
func FilterCommands(input string) []SlashCommand
FilterCommands filters slash commands based on the input text
func GetAvailableCommands ¶
func GetAvailableCommands() []SlashCommand
GetAvailableCommands returns the list of available slash commands in alphabetical order
type TreeItem ¶
type TreeItem struct {
Text string // Display text
Value string // Actual value (model name or empty for providers)
IsProvider bool // True if this is a provider header
IsLast bool // True if this is the last model in a provider group
}
TreeItem represents an item in the tree structure