Documentation
¶
Index ¶
- Variables
- func CalculateConversationHeight(totalHeight int) int
- func CalculateInputHeight(totalHeight int) int
- func CalculateStatusHeight(totalHeight int) int
- func FormatError(message string) string
- func FormatErrorCLI(message string) string
- func FormatMessage(msgType MessageType, message string) string
- func FormatResponsiveCodeBlock(code string, terminalWidth int) string
- func FormatResponsiveMessage(message string, terminalWidth int) string
- func FormatSuccess(message string) string
- func FormatToolCall(toolName string, args map[string]interface{}) string
- func FormatToolResult(result *domain.ToolExecutionResult) string
- func FormatToolResultExpanded(result *domain.ToolExecutionResult) string
- func FormatToolResultExpandedResponsive(result *domain.ToolExecutionResult, terminalWidth int) string
- func FormatToolResultForLLM(result *domain.ToolExecutionResult) string
- func FormatToolResultForUI(result *domain.ToolExecutionResult) string
- func FormatToolResultForUIResponsive(result *domain.ToolExecutionResult, terminalWidth int) string
- func FormatWarning(message string) string
- func GetMargins() (top, right, bottom, left int)
- type AutocompleteImpl
- func (a *AutocompleteImpl) GetSelectedCommand() string
- func (a *AutocompleteImpl) HandleKey(key tea.KeyMsg) (bool, string)
- func (a *AutocompleteImpl) Hide()
- func (a *AutocompleteImpl) IsVisible() bool
- func (a *AutocompleteImpl) Render() string
- func (a *AutocompleteImpl) SetWidth(width int)
- func (a *AutocompleteImpl) Update(inputText string, cursorPos int)
- type CommandOption
- type ConversationRenderer
- type DefaultTheme
- func (t *DefaultTheme) GetAccentColor() string
- func (t *DefaultTheme) GetAssistantColor() string
- func (t *DefaultTheme) GetBorderColor() string
- func (t *DefaultTheme) GetDimColor() string
- func (t *DefaultTheme) GetErrorColor() string
- func (t *DefaultTheme) GetStatusColor() string
- func (t *DefaultTheme) GetUserColor() string
- type HelpBarComponent
- type InputComponent
- type KeyShortcut
- type MessageType
- type ModelSelectorImpl
- func (m *ModelSelectorImpl) GetSelected() string
- func (m *ModelSelectorImpl) Init() tea.Cmd
- func (m *ModelSelectorImpl) IsCancelled() bool
- func (m *ModelSelectorImpl) IsSelected() bool
- func (m *ModelSelectorImpl) SetHeight(height int)
- func (m *ModelSelectorImpl) SetWidth(width int)
- func (m *ModelSelectorImpl) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m *ModelSelectorImpl) View() string
- type SelectionComponent
- type StatusComponent
- type Theme
Constants ¶
This section is empty.
Variables ¶
var GetResponsiveWidth = shared.GetResponsiveWidth
var WrapText = shared.WrapText
Functions ¶
func CalculateConversationHeight ¶ added in v0.18.2
Layout calculations - simplified without interfaces
func CalculateInputHeight ¶ added in v0.18.2
func CalculateStatusHeight ¶ added in v0.18.2
func FormatError ¶
FormatError creates a properly formatted error message without duplicate symbols
func FormatErrorCLI ¶
FormatErrorCLI creates an error message with ❌ prefix for CLI output
func FormatMessage ¶
func FormatMessage(msgType MessageType, message string) string
FormatMessage formats a message with appropriate icons and styling
func FormatResponsiveCodeBlock ¶ added in v0.16.0
FormatResponsiveCodeBlock formats code blocks with responsive width
func FormatResponsiveMessage ¶ added in v0.16.0
func FormatSuccess ¶
FormatSuccess creates a properly formatted success message
func FormatToolCall ¶ added in v0.14.0
FormatToolCall formats a tool call for consistent display across the application
func FormatToolResult ¶ added in v0.14.0
func FormatToolResult(result *domain.ToolExecutionResult) string
FormatToolResult formats a tool execution result for display Returns a compact 3-line summary by default
func FormatToolResultExpanded ¶ added in v0.14.0
func FormatToolResultExpanded(result *domain.ToolExecutionResult) string
FormatToolResultExpanded formats a tool execution result with full details This is shown when user presses Ctrl+R to expand
func FormatToolResultExpandedResponsive ¶ added in v0.16.0
func FormatToolResultExpandedResponsive(result *domain.ToolExecutionResult, terminalWidth int) string
FormatToolResultExpandedResponsive formats a tool execution result with full details and responsive width
func FormatToolResultForLLM ¶ added in v0.14.0
func FormatToolResultForLLM(result *domain.ToolExecutionResult) string
FormatToolResultForLLM formats tool execution results specifically for LLM consumption This returns the actual tool data in a format the LLM can understand and use
func FormatToolResultForUI ¶ added in v0.14.0
func FormatToolResultForUI(result *domain.ToolExecutionResult) string
FormatToolResultForUI formats tool execution results specifically for UI display This shows a compact "ToolName(args)" format with 2 lines of preview
func FormatToolResultForUIResponsive ¶ added in v0.16.0
func FormatToolResultForUIResponsive(result *domain.ToolExecutionResult, terminalWidth int) string
FormatToolResultForUIResponsive formats tool execution results for UI display with responsive width
func FormatWarning ¶
FormatWarning creates a properly formatted warning message
func GetMargins ¶ added in v0.18.2
func GetMargins() (top, right, bottom, left int)
Types ¶
type AutocompleteImpl ¶
type AutocompleteImpl struct {
// contains filtered or unexported fields
}
AutocompleteImpl implements inline autocomplete functionality
func NewAutocomplete ¶
func NewAutocomplete(theme Theme, commandRegistry *commands.Registry) *AutocompleteImpl
NewAutocomplete creates a new autocomplete component
func (*AutocompleteImpl) GetSelectedCommand ¶
func (a *AutocompleteImpl) GetSelectedCommand() string
GetSelectedCommand returns the currently selected command
func (*AutocompleteImpl) HandleKey ¶
func (a *AutocompleteImpl) HandleKey(key tea.KeyMsg) (bool, string)
HandleKey processes key input for autocomplete navigation
func (*AutocompleteImpl) IsVisible ¶
func (a *AutocompleteImpl) IsVisible() bool
IsVisible returns whether autocomplete is currently visible
func (*AutocompleteImpl) Render ¶
func (a *AutocompleteImpl) Render() string
Render returns the autocomplete suggestions as a string
func (*AutocompleteImpl) SetWidth ¶
func (a *AutocompleteImpl) SetWidth(width int)
SetWidth sets the width for rendering
func (*AutocompleteImpl) Update ¶
func (a *AutocompleteImpl) Update(inputText string, cursorPos int)
Update handles autocomplete logic
type CommandOption ¶
CommandOption represents a command option for autocomplete
type ConversationRenderer ¶
type ConversationRenderer interface { SetConversation([]domain.ConversationEntry) GetScrollOffset() int CanScrollUp() bool CanScrollDown() bool ToggleToolResultExpansion(index int) IsToolResultExpanded(index int) bool SetWidth(width int) SetHeight(height int) Render() string }
func CreateConversationView ¶ added in v0.18.2
func CreateConversationView() ConversationRenderer
CreateConversationView creates a new conversation view component
type DefaultTheme ¶
type DefaultTheme struct{}
func NewDefaultTheme ¶
func NewDefaultTheme() *DefaultTheme
func (*DefaultTheme) GetAccentColor ¶
func (t *DefaultTheme) GetAccentColor() string
func (*DefaultTheme) GetAssistantColor ¶
func (t *DefaultTheme) GetAssistantColor() string
func (*DefaultTheme) GetBorderColor ¶
func (t *DefaultTheme) GetBorderColor() string
func (*DefaultTheme) GetDimColor ¶
func (t *DefaultTheme) GetDimColor() string
func (*DefaultTheme) GetErrorColor ¶
func (t *DefaultTheme) GetErrorColor() string
func (*DefaultTheme) GetStatusColor ¶
func (t *DefaultTheme) GetStatusColor() string
func (*DefaultTheme) GetUserColor ¶
func (t *DefaultTheme) GetUserColor() string
type HelpBarComponent ¶ added in v0.16.0
type HelpBarComponent interface { SetShortcuts(shortcuts []shared.KeyShortcut) IsEnabled() bool SetEnabled(enabled bool) SetWidth(width int) SetHeight(height int) Render() string }
func CreateHelpBar ¶ added in v0.18.2
func CreateHelpBar() HelpBarComponent
CreateHelpBar creates a new help bar component
type InputComponent ¶
type InputComponent interface { GetInput() string ClearInput() SetPlaceholder(text string) GetCursor() int SetCursor(position int) SetText(text string) SetWidth(width int) SetHeight(height int) Render() string HandleKey(key tea.KeyMsg) (tea.Model, tea.Cmd) CanHandle(key tea.KeyMsg) bool }
func CreateInputView ¶ added in v0.18.2
func CreateInputView(modelService domain.ModelService, commandRegistry *commands.Registry) InputComponent
CreateInputView creates a new input view component
type KeyShortcut ¶ added in v0.16.0
type KeyShortcut = shared.KeyShortcut
type MessageType ¶
type MessageType int
MessageType represents different types of messages
const ( MessageSuccess MessageType = iota MessageError MessageWarning MessageInfo MessageProgress )
type ModelSelectorImpl ¶
type ModelSelectorImpl struct {
// contains filtered or unexported fields
}
ModelSelectorImpl implements model selection UI
func NewModelSelector ¶
func NewModelSelector(models []string, modelService domain.ModelService, theme Theme) *ModelSelectorImpl
NewModelSelector creates a new model selector
func (*ModelSelectorImpl) GetSelected ¶
func (m *ModelSelectorImpl) GetSelected() string
GetSelected returns the selected model
func (*ModelSelectorImpl) Init ¶
func (m *ModelSelectorImpl) Init() tea.Cmd
func (*ModelSelectorImpl) IsCancelled ¶
func (m *ModelSelectorImpl) IsCancelled() bool
IsCancelled returns true if selection was cancelled
func (*ModelSelectorImpl) IsSelected ¶
func (m *ModelSelectorImpl) IsSelected() bool
IsSelected returns true if a model was selected
func (*ModelSelectorImpl) SetHeight ¶
func (m *ModelSelectorImpl) SetHeight(height int)
SetHeight sets the height of the model selector
func (*ModelSelectorImpl) SetWidth ¶
func (m *ModelSelectorImpl) SetWidth(width int)
SetWidth sets the width of the model selector
func (*ModelSelectorImpl) Update ¶
func (m *ModelSelectorImpl) Update(msg tea.Msg) (tea.Model, tea.Cmd)
func (*ModelSelectorImpl) View ¶
func (m *ModelSelectorImpl) View() string
type SelectionComponent ¶
type StatusComponent ¶
type StatusComponent interface { ShowStatus(message string) ShowError(message string) ShowSpinner(message string) ClearStatus() IsShowingError() bool IsShowingSpinner() bool SetTokenUsage(usage string) SetWidth(width int) SetHeight(height int) Render() string }
func CreateStatusView ¶ added in v0.18.2
func CreateStatusView() StatusComponent
CreateStatusView creates a new status view component