Documentation
¶
Overview ¶
version.go: Build-time versioning info for TmuxAI (set via -ldflags)
Index ¶
- Variables
- type AIResponse
- type AiClient
- type CLIInterface
- type ChatCompletionChoice
- type ChatCompletionRequest
- type ChatCompletionResponse
- type ChatMessage
- type CommandExecHistory
- type Manager
- func (m *Manager) Countdown(seconds int)
- func (m *Manager) ExecWaitCapture(command string) (CommandExecHistory, error)
- func (m *Manager) FormatConfig() string
- func (m *Manager) GetAvailablePane() system.TmuxPaneDetails
- func (m *Manager) GetConfig() *config.Config
- func (m *Manager) GetExecConfirm() bool
- func (m *Manager) GetMaxCaptureLines() int
- func (m *Manager) GetMaxContextSize() int
- func (m *Manager) GetOpenRouterModel() string
- func (m *Manager) GetPasteMultilineConfirm() bool
- func (m *Manager) GetPrompt() string
- func (m *Manager) GetSendKeysConfirm() bool
- func (m *Manager) GetTmuxPanes() ([]system.TmuxPaneDetails, error)
- func (m *Manager) GetWaitInterval() int
- func (m *Manager) InitExecPane()
- func (m *Manager) IsMessageSubcommand(content string) bool
- func (m *Manager) PrepareExecPane()
- func (m *Manager) PrepareExecPaneWithShell(shell string)
- func (m *Manager) Println(msg string)
- func (m *Manager) ProcessSubCommand(command string)
- func (m *Manager) ProcessUserMessage(ctx context.Context, message string) bool
- func (m *Manager) Start(initMessage string) error
- type Message
Constants ¶
This section is empty.
Variables ¶
var ( Version = "dev" Commit = "none" Date = "unknown" )
Version, Commit, Date are injected at build time.
var AllowedConfigKeys = []string{
"max_capture_lines",
"max_context_size",
"wait_interval",
"send_keys_confirm",
"paste_multiline_confirm",
"exec_confirm",
"openrouter.model",
}
AllowedConfigKeys defines the list of configuration keys that users are allowed to modify
Functions ¶
This section is empty.
Types ¶
type AIResponse ¶
type AIResponse struct { Message string SendKeys []string ExecCommand []string PasteMultilineContent string RequestAccomplished bool ExecPaneSeemsBusy bool WaitingForUserResponse bool NoComment bool }
func (*AIResponse) String ¶
func (ai *AIResponse) String() string
type AiClient ¶
type AiClient struct {
// contains filtered or unexported fields
}
AiClient represents an AI client for interacting with OpenAI-compatible APIs including Azure OpenAI
func NewAiClient ¶
func (*AiClient) ChatCompletion ¶
func (c *AiClient) ChatCompletion(ctx context.Context, messages []Message, model string) (string, error)
ChatCompletion sends a chat completion request to the OpenRouter API
func (*AiClient) GetResponseFromChatMessages ¶
func (c *AiClient) GetResponseFromChatMessages(ctx context.Context, chatMessages []ChatMessage, model string) (string, error)
GetResponseFromChatMessages gets a response from the AI based on chat messages
type CLIInterface ¶
type CLIInterface struct {
// contains filtered or unexported fields
}
func NewCLIInterface ¶
func NewCLIInterface(manager *Manager) *CLIInterface
func (*CLIInterface) Start ¶
func (c *CLIInterface) Start(initMessage string) error
Start starts the CLI interface
type ChatCompletionChoice ¶
ChatCompletionChoice represents a choice in the chat completion response
type ChatCompletionRequest ¶
type ChatCompletionRequest struct { Model string `json:"model,omitempty"` Messages []Message `json:"messages"` }
ChatCompletionRequest represents a request to the chat completion API
type ChatCompletionResponse ¶
type ChatCompletionResponse struct { ID string `json:"id"` Object string `json:"object"` Created int64 `json:"created"` Choices []ChatCompletionChoice `json:"choices"` }
ChatCompletionResponse represents a response from the chat completion API
type ChatMessage ¶
Message represents a chat message
type CommandExecHistory ¶
Parsed only when pane is prepared
type Manager ¶
type Manager struct { Config *config.Config AiClient *AiClient Status string // running, waiting, done PaneId string ExecPane *system.TmuxPaneDetails Messages []ChatMessage ExecHistory []CommandExecHistory WatchMode bool OS string SessionOverrides map[string]interface{} // session-only config overrides // contains filtered or unexported fields }
Manager represents the TmuxAI manager agent
func NewManager ¶
NewManager creates a new manager agent
func (*Manager) ExecWaitCapture ¶
func (m *Manager) ExecWaitCapture(command string) (CommandExecHistory, error)
func (*Manager) FormatConfig ¶
FormatConfig returns a nicely formatted string of all config values with session overrides applied
func (*Manager) GetAvailablePane ¶
func (m *Manager) GetAvailablePane() system.TmuxPaneDetails
GetAvailablePane finds an available pane or creates a new one if none are available
func (*Manager) GetExecConfirm ¶
func (*Manager) GetMaxCaptureLines ¶
GetMaxCaptureLines returns the max capture lines value with session override if present
func (*Manager) GetMaxContextSize ¶
GetMaxContextSize returns the max context size value with session override if present
func (*Manager) GetOpenRouterModel ¶
func (*Manager) GetPasteMultilineConfirm ¶
func (*Manager) GetSendKeysConfirm ¶
func (*Manager) GetTmuxPanes ¶
func (m *Manager) GetTmuxPanes() ([]system.TmuxPaneDetails, error)
func (*Manager) GetWaitInterval ¶
GetWaitInterval returns the wait interval value with session override if present
func (*Manager) InitExecPane ¶
func (m *Manager) InitExecPane()
func (*Manager) IsMessageSubcommand ¶
checks if the given content is a command
func (*Manager) PrepareExecPane ¶
func (m *Manager) PrepareExecPane()
func (*Manager) PrepareExecPaneWithShell ¶ added in v1.1.1
func (*Manager) ProcessSubCommand ¶
processes a command and returns a response
func (*Manager) ProcessUserMessage ¶
Main function to process regular user messages Returns true if the request was accomplished and no further processing should happen