Documentation
¶
Index ¶
- Variables
- func CheckVoiceSystem() string
- func GetUIProgram() *tea.Program
- func NewChatCommand() *cobra.Command
- type AiResponseMsg
- type AiStreamMsg
- type ApprovalMode
- type BashCommandArgs
- type BashCommandResult
- type ChatUI
- type ComprehensiveServerInfo
- type ConversationTurn
- type DiscoveryResponse
- type FunctionConfirmation
- type MCPServerInfo
- type MCPServerListResult
- type TermChat
- func (tc *TermChat) AddMessage(role, content string)
- func (tc *TermChat) ExecuteNativeToolCall(toolCall interface{}, index int) (interface{}, error)
- func (tc *TermChat) FindServerForTool(toolName string) string
- func (tc *TermChat) FormatToolResultWithArgs(toolName, serverName string, result interface{}, duration time.Duration, ...) string
- func (tc *TermChat) GetAIManager() *ai.Manager
- func (tc *TermChat) GetApprovalMode() ApprovalMode
- func (tc *TermChat) GetChatHistory() []TermChatMessage
- func (tc *TermChat) GetCurrentModel() string
- func (tc *TermChat) GetMCPClient() *mcp.MCPClient
- func (tc *TermChat) GetMCPFunctions() []ai.Function
- func (tc *TermChat) GetOptimizedSystemPrompt() string
- func (tc *TermChat) GetSystemContext() string
- func (tc *TermChat) GetVerboseMode() bool
- func (tc *TermChat) RequestFunctionConfirmation(functionName, arguments string) bool
- func (tc *TermChat) Run() error
- type TermChatMessage
- type TodoItem
- type TodoList
- type TodoPriority
- type TodoStatus
- type ToolExecutionResult
- type VoiceConfig
- type VoiceManager
- func (vm *VoiceManager) GetTTSQueueStatus() (queueLength int, isPlaying bool)
- func (vm *VoiceManager) InterruptTTS()
- func (vm *VoiceManager) PlayAudio(audioData []byte) error
- func (vm *VoiceManager) SetCallbacks(onWakeWord func(), onTranscript func(string), onTTSReady func([]byte))
- func (vm *VoiceManager) SkipToNextTTS()
- func (vm *VoiceManager) Start() error
- func (vm *VoiceManager) Stop()
- func (vm *VoiceManager) TextToSpeech(text string) error
- func (vm *VoiceManager) TriggerManualRecording() error
Constants ¶
This section is empty.
Variables ¶
var ( ArmyGreen = lipgloss.Color("58") // #5f5f00 - darker army green LightGreen = lipgloss.Color("64") // #5f8700 - lighter army green Brown = lipgloss.Color("94") // #875f00 - brown Yellow = lipgloss.Color("226") // #ffff00 - bright yellow GoldYellow = lipgloss.Color("220") // #ffd700 - gold yellow Red = lipgloss.Color("196") // #ff0000 - red Tan = lipgloss.Color("180") // #d7af87 - tan )
Color theme constants for consistent styling
Functions ¶
func CheckVoiceSystem ¶
func CheckVoiceSystem() string
CheckVoiceSystem checks if all voice dependencies are available (stub)
func GetUIProgram ¶
GetUIProgram returns the global UI program reference
func NewChatCommand ¶
NewChatCommand creates the chat command that integrates with the Cobra CLI
Types ¶
type AiResponseMsg ¶
type AiResponseMsg struct {
Content string
}
AiResponseMsg represents complete AI response (exported for turn.go)
type AiStreamMsg ¶
type AiStreamMsg struct {
Content string
}
AiStreamMsg represents streaming AI content (exported for turn.go)
type ApprovalMode ¶
type ApprovalMode int
ApprovalMode defines the level of autonomous behavior
const ( DEFAULT ApprovalMode = iota AUTO_EDIT YOLO )
func (ApprovalMode) Description ¶
func (am ApprovalMode) Description() string
Description returns a description of what the mode does
func (ApprovalMode) GetModeIndicatorNoEmoji ¶
func (am ApprovalMode) GetModeIndicatorNoEmoji() string
GetModeIndicatorNoEmoji returns the mode indicator without emojis for UI display
func (ApprovalMode) ShouldConfirm ¶
func (am ApprovalMode) ShouldConfirm(functionName string) bool
ShouldConfirm returns whether a function should be confirmed based on the approval mode
func (ApprovalMode) String ¶
func (am ApprovalMode) String() string
String returns the string representation of the approval mode
type BashCommandArgs ¶
type BashCommandArgs struct {
Command string `json:"command"`
WorkingDirectory string `json:"working_directory,omitempty"`
Timeout int `json:"timeout,omitempty"` // in seconds
Description string `json:"description,omitempty"`
}
BashCommandArgs represents the arguments for bash command execution
type BashCommandResult ¶
type BashCommandResult struct {
Command string `json:"command"`
ExitCode int `json:"exit_code"`
Stdout string `json:"stdout"`
Stderr string `json:"stderr"`
Duration string `json:"duration"`
WorkingDir string `json:"working_dir"`
Description string `json:"description,omitempty"`
}
BashCommandResult represents the result of bash command execution
type ChatUI ¶
type ChatUI struct {
// contains filtered or unexported fields
}
ChatUI represents the terminal UI model for the chat interface
type ComprehensiveServerInfo ¶
type ComprehensiveServerInfo struct {
Name string `json:"name"`
Version string `json:"version"`
Description string `json:"description"`
URL string `json:"url"`
Protocol string `json:"protocol"`
ConnectionStatus string `json:"connection_status"`
Capabilities []string `json:"capabilities"`
Tools []mcp.Tool `json:"tools"`
LastSeen time.Time `json:"last_seen"`
}
ComprehensiveServerInfo represents detailed information about an MCP server
type ConversationTurn ¶
type ConversationTurn struct {
// contains filtered or unexported fields
}
ConversationTurn represents a single turn in the conversation
func NewConversationTurn ¶
func NewConversationTurn(chat *TermChat, userRequest string) *ConversationTurn
NewConversationTurn creates a new conversation turn
func NewConversationTurnSilent ¶
func NewConversationTurnSilent(chat *TermChat, userRequest string) *ConversationTurn
NewConversationTurnSilent creates a new conversation turn in silent mode
type DiscoveryResponse ¶
type DiscoveryResponse struct {
DiscoveredServers []struct {
Name string `json:"name"`
URL string `json:"url"`
Protocol string `json:"protocol"`
Capabilities []string `json:"capabilities"`
} `json:"discovered_servers"`
ConnectionStatus map[string]struct {
Connected bool `json:"connected"`
LastSeen string `json:"last_seen"`
} `json:"connection_status"`
}
DiscoveryResponse represents the response from the discovery endpoint
type FunctionConfirmation ¶
type FunctionConfirmation struct {
FunctionName string
Arguments string
Callback func(bool) // Callback to execute when confirmation is received
}
FunctionConfirmation represents a pending function call confirmation
type MCPServerInfo ¶
type MCPServerInfo struct {
Name string `json:"name"`
Status string `json:"status"`
Tools []string `json:"tools"`
Description string `json:"description"`
}
MCPServerInfo represents information about an MCP server
type MCPServerListResult ¶
type MCPServerListResult struct {
Servers []MCPServerInfo `json:"servers"`
Total int `json:"total"`
Status string `json:"status"`
}
MCPServerListResult represents the result of listing MCP servers
type TermChat ¶
type TermChat struct {
// contains filtered or unexported fields
}
TermChat represents a split-screen terminal chat interface
func (*TermChat) AddMessage ¶
AddMessage adds a message to chat history (public wrapper)
func (*TermChat) ExecuteNativeToolCall ¶
ExecuteNativeToolCall executes a native tool call
func (*TermChat) FindServerForTool ¶
FindServerForTool finds the appropriate server for a tool
func (*TermChat) FormatToolResultWithArgs ¶
func (tc *TermChat) FormatToolResultWithArgs(toolName, serverName string, result interface{}, duration time.Duration, args map[string]interface{}) string
FormatToolResultWithArgs formats tool execution results with access to original arguments (exported for testing)
func (*TermChat) GetAIManager ¶
GetAIManager returns the AI manager
func (*TermChat) GetApprovalMode ¶
func (tc *TermChat) GetApprovalMode() ApprovalMode
GetApprovalMode returns the current approval mode
func (*TermChat) GetChatHistory ¶
func (tc *TermChat) GetChatHistory() []TermChatMessage
GetChatHistory returns the chat history
func (*TermChat) GetCurrentModel ¶
GetCurrentModel returns the current model
func (*TermChat) GetMCPClient ¶
GetMCPClient returns the MCP client
func (*TermChat) GetMCPFunctions ¶
GetMCPFunctions returns MCP functions (public wrapper)
func (*TermChat) GetOptimizedSystemPrompt ¶
GetOptimizedSystemPrompt returns a comprehensive system prompt optimized for all AI providers
func (*TermChat) GetSystemContext ¶
GetSystemContext returns the system context (wrapper for GetOptimizedSystemPrompt)
func (*TermChat) GetVerboseMode ¶
GetVerboseMode returns the verbose mode setting
func (*TermChat) RequestFunctionConfirmation ¶
RequestFunctionConfirmation requests confirmation for function execution
type TermChatMessage ¶
type TermChatMessage struct {
Role string
Content string // Markdown content (for AI context)
Timestamp time.Time
}
TermChatMessage represents a chat message
type TodoItem ¶
type TodoItem struct {
ID string `json:"id"`
Content string `json:"content"`
Status TodoStatus `json:"status"`
Priority TodoPriority `json:"priority"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
CompletedAt *time.Time `json:"completedAt,omitempty"`
}
TodoItem represents a single TODO item in the AI's task list
type TodoList ¶
type TodoList struct {
Items []TodoItem `json:"items"`
}
TodoList manages a collection of TODO items for the AI agent
func (*TodoList) AddItem ¶
func (tl *TodoList) AddItem(content string, priority TodoPriority) string
AddItem adds a new TODO item to the list
func (*TodoList) RemoveItem ¶
RemoveItem removes a TODO item from the list
func (*TodoList) UpdateItemStatus ¶
func (tl *TodoList) UpdateItemStatus(id string, status TodoStatus) bool
UpdateItemStatus updates the status of a TODO item
type TodoPriority ¶
type TodoPriority string
TodoPriority represents the priority level of a TODO item
const ( TodoPriorityLow TodoPriority = "low" TodoPriorityMedium TodoPriority = "medium" TodoPriorityHigh TodoPriority = "high" TodoPriorityUrgent TodoPriority = "urgent" )
type TodoStatus ¶
type TodoStatus string
TodoStatus represents the status of a TODO item
const ( TodoStatusPending TodoStatus = "pending" TodoStatusInProgress TodoStatus = "in_progress" TodoStatusCompleted TodoStatus = "completed" TodoStatusCancelled TodoStatus = "cancelled" )
type ToolExecutionResult ¶
type ToolExecutionResult struct {
ToolCall ai.ToolCall
Result interface{}
Error error
Index int // Preserve original order
}
ToolExecutionResult holds the result of a single tool execution
type VoiceConfig ¶
type VoiceConfig struct {
WakeWord string
TTSEndpoint string
TTSVoice string
TTSModel string
WhisperModel string
SampleRate int
FrameLength int
EnergyThreshold int
SpeechTimeoutSeconds float64
MaxRecordingSeconds int
WakeWordExclusionTime float64
PostWakewordDelay float64
Enabled bool
}
VoiceConfig holds voice-related configuration (stub version)
func NewVoiceConfig ¶
func NewVoiceConfig() *VoiceConfig
NewVoiceConfig creates voice configuration from environment variables (stub)
type VoiceManager ¶
type VoiceManager struct {
// contains filtered or unexported fields
}
VoiceManager handles voice interaction (stub version)
func NewVoiceManager ¶
func NewVoiceManager(config *VoiceConfig) (*VoiceManager, error)
NewVoiceManager creates a new voice manager (stub)
func (*VoiceManager) GetTTSQueueStatus ¶
func (vm *VoiceManager) GetTTSQueueStatus() (queueLength int, isPlaying bool)
GetTTSQueueStatus returns info about the current TTS queue (stub)
func (*VoiceManager) InterruptTTS ¶
func (vm *VoiceManager) InterruptTTS()
InterruptTTS stops current TTS playback and clears the queue (stub)
func (*VoiceManager) PlayAudio ¶
func (vm *VoiceManager) PlayAudio(audioData []byte) error
PlayAudio plays audio data (stub)
func (*VoiceManager) SetCallbacks ¶
func (vm *VoiceManager) SetCallbacks(onWakeWord func(), onTranscript func(string), onTTSReady func([]byte))
SetCallbacks sets the callback functions (stub)
func (*VoiceManager) SkipToNextTTS ¶
func (vm *VoiceManager) SkipToNextTTS()
SkipToNextTTS skips to the next TTS response in queue (stub)
func (*VoiceManager) Start ¶
func (vm *VoiceManager) Start() error
Start begins voice processing (stub)
func (*VoiceManager) TextToSpeech ¶
func (vm *VoiceManager) TextToSpeech(text string) error
TextToSpeech converts text to speech (stub)
func (*VoiceManager) TriggerManualRecording ¶
func (vm *VoiceManager) TriggerManualRecording() error
TriggerManualRecording manually starts a recording session (stub)