Documentation
¶
Index ¶
- Constants
- func FormatSlashCommandError(err error, commandName string) string
- func GetSelectedModel(cfg *config.Config) models.Model
- func IsHidden(file string) (bool, error)
- func ValidateSlashCommand(input string) error
- type AttachmentAddedMsg
- type ClearSessionMsg
- type CloseCommandDialogMsg
- type CloseInitDialogMsg
- type CloseModelDialogMsg
- type CloseMultiArgumentsDialogMsg
- type CloseQuitMsg
- type CloseSessionDialogMsg
- type CloseThemeDialogMsg
- type Command
- type CommandDialog
- type CommandRunCustomMsg
- type CommandSelectedMsg
- type CompletionDialog
- type CompletionDialogCloseMsg
- type CompletionDialogCompleteItemMsg
- type CompletionItem
- type CompletionItemI
- type CompletionProvider
- type CompletionSelectedMsg
- type DirNode
- type FilePrickerKeyMap
- type FilepickerCmp
- type HelpCmp
- type InitDialogCmp
- type ModelDialog
- type ModelSelectedMsg
- type MultiArgumentsDialogCmp
- type PermissionAction
- type PermissionDialogCmp
- type PermissionResponseMsg
- type ProcessedCommand
- type QuitDialog
- type SessionDialog
- type SessionSelectedMsg
- type ShowInitDialogMsg
- type ShowMultiArgumentsDialogMsg
- type SlashCommandProcessor
- func (scp *SlashCommandProcessor) AutofillCommand(input string) string
- func (scp *SlashCommandProcessor) GetAvailableCommands() []string
- func (scp *SlashCommandProcessor) GetCommonPrefix(input string) string
- func (scp *SlashCommandProcessor) GetSuggestions(input string, maxCount int) []Suggestion
- func (scp *SlashCommandProcessor) IsSlashCommand(input string) bool
- func (scp *SlashCommandProcessor) ProcessSlashCommand(input string) *SlashCommandResult
- type SlashCommandResult
- type SlashSuggestionAutofillMsg
- type SlashSuggestionDialog
- func (d *SlashSuggestionDialog) GetSelectedSuggestion() *Suggestion
- func (d *SlashSuggestionDialog) Hide()
- func (d *SlashSuggestionDialog) Init() tea.Cmd
- func (d *SlashSuggestionDialog) IsVisible() bool
- func (d *SlashSuggestionDialog) SetSize(width, height int)
- func (d *SlashSuggestionDialog) Show(input string)
- func (d *SlashSuggestionDialog) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (d *SlashSuggestionDialog) View() string
- type SlashSuggestionKeyMap
- type SlashSuggestionSelectedMsg
- type Suggestion
- type ThemeChangedMsg
- type ThemeDialog
Constants ¶
const ( UserCommandPrefix = "user:" ProjectCommandPrefix = "project:" BuiltinCommandPrefix = "builtin:" )
Command prefix constants
Variables ¶
This section is empty.
Functions ¶
func FormatSlashCommandError ¶
FormatSlashCommandError formats error messages for slash commands
func ValidateSlashCommand ¶
ValidateSlashCommand validates a slash command input for basic syntax
Types ¶
type AttachmentAddedMsg ¶
type AttachmentAddedMsg struct {
Attachment message.Attachment
}
type ClearSessionMsg ¶
type ClearSessionMsg struct {
SessionID string // Session ID to clear messages for
}
ClearSessionMsg is sent when the /clear command is executed
type CloseCommandDialogMsg ¶
type CloseCommandDialogMsg struct{}
CloseCommandDialogMsg is sent when the command dialog is closed
type CloseInitDialogMsg ¶
type CloseInitDialogMsg struct {
Initialize bool
}
CloseInitDialogMsg is a message that is sent when the init dialog is closed.
type CloseModelDialogMsg ¶
type CloseModelDialogMsg struct{}
CloseModelDialogMsg is sent when a model is selected
type CloseMultiArgumentsDialogMsg ¶
type CloseMultiArgumentsDialogMsg struct {
Submit bool
CommandID string
Content string
Args map[string]string
}
CloseMultiArgumentsDialogMsg is a message that is sent when the multi-arguments dialog is closed.
type CloseQuitMsg ¶
type CloseQuitMsg struct{}
type CloseSessionDialogMsg ¶
type CloseSessionDialogMsg struct{}
CloseSessionDialogMsg is sent when the session dialog is closed
type CloseThemeDialogMsg ¶
type CloseThemeDialogMsg struct{}
CloseThemeDialogMsg is sent when the theme dialog is closed
type Command ¶
type Command struct {
ID string
Title string
Description string
Content string // Raw content for slash commands
FilePath string // Path to the command file for file expansion base path
Handler func(cmd Command) tea.Cmd
}
Command represents a command that can be executed
func LoadCustomCommands ¶
LoadCustomCommands loads custom commands from both XDG_CONFIG_HOME and project data directory
type CommandDialog ¶
CommandDialog interface for the command selection dialog
func NewCommandDialogCmp ¶
func NewCommandDialogCmp() CommandDialog
NewCommandDialogCmp creates a new command selection dialog
type CommandRunCustomMsg ¶
type CommandRunCustomMsg struct {
Content string
Args map[string]string // Map of argument names to values
}
CommandRunCustomMsg is sent when a custom command is executed
type CommandSelectedMsg ¶
type CommandSelectedMsg struct {
Command Command
}
CommandSelectedMsg is sent when a command is selected
type CompletionDialog ¶
func NewCompletionDialogCmp ¶
func NewCompletionDialogCmp(completionProvider CompletionProvider) CompletionDialog
type CompletionDialogCloseMsg ¶
type CompletionDialogCloseMsg struct{}
type CompletionDialogCompleteItemMsg ¶
type CompletionDialogCompleteItemMsg struct {
Value string
}
type CompletionItem ¶
func (*CompletionItem) DisplayValue ¶
func (ci *CompletionItem) DisplayValue() string
func (*CompletionItem) GetValue ¶
func (ci *CompletionItem) GetValue() string
type CompletionItemI ¶
type CompletionItemI interface {
utilComponents.SimpleListItem
GetValue() string
DisplayValue() string
}
func NewCompletionItem ¶
func NewCompletionItem(completionItem CompletionItem) CompletionItemI
type CompletionProvider ¶
type CompletionProvider interface {
GetId() string
GetEntry() CompletionItemI
GetChildEntries(query string) ([]CompletionItemI, error)
}
type CompletionSelectedMsg ¶
type FilePrickerKeyMap ¶
type FilepickerCmp ¶
type FilepickerCmp interface {
tea.Model
ToggleFilepicker(showFilepicker bool)
IsCWDFocused() bool
}
func NewFilepickerCmp ¶
func NewFilepickerCmp(app *app.App) FilepickerCmp
type HelpCmp ¶
func NewHelpCmp ¶
func NewHelpCmp() HelpCmp
type InitDialogCmp ¶
type InitDialogCmp struct {
// contains filtered or unexported fields
}
InitDialogCmp is a component that asks the user if they want to initialize the project.
func NewInitDialogCmp ¶
func NewInitDialogCmp() InitDialogCmp
NewInitDialogCmp creates a new InitDialogCmp.
func (InitDialogCmp) Bindings ¶
func (m InitDialogCmp) Bindings() []key.Binding
Bindings implements layout.Bindings.
func (*InitDialogCmp) SetSize ¶
func (m *InitDialogCmp) SetSize(width, height int)
SetSize sets the size of the component.
type ModelDialog ¶
ModelDialog interface for the model selection dialog
func NewModelDialogCmp ¶
func NewModelDialogCmp() ModelDialog
type ModelSelectedMsg ¶
ModelSelectedMsg is sent when a model is selected
type MultiArgumentsDialogCmp ¶
type MultiArgumentsDialogCmp struct {
// contains filtered or unexported fields
}
MultiArgumentsDialogCmp is a component that asks the user for multiple command arguments.
func NewMultiArgumentsDialogCmp ¶
func NewMultiArgumentsDialogCmp(commandID, content string, argNames []string) MultiArgumentsDialogCmp
NewMultiArgumentsDialogCmp creates a new MultiArgumentsDialogCmp.
func (MultiArgumentsDialogCmp) Bindings ¶
func (m MultiArgumentsDialogCmp) Bindings() []key.Binding
Bindings implements layout.Bindings.
func (MultiArgumentsDialogCmp) Init ¶
func (m MultiArgumentsDialogCmp) Init() tea.Cmd
Init implements tea.Model.
func (*MultiArgumentsDialogCmp) SetSize ¶
func (m *MultiArgumentsDialogCmp) SetSize(width, height int)
SetSize sets the size of the component.
func (MultiArgumentsDialogCmp) View ¶
func (m MultiArgumentsDialogCmp) View() string
View implements tea.Model.
type PermissionAction ¶
type PermissionAction string
const ( PermissionAllow PermissionAction = "allow" PermissionAllowForSession PermissionAction = "allow_session" PermissionDeny PermissionAction = "deny" )
Permission responses
type PermissionDialogCmp ¶
type PermissionDialogCmp interface {
tea.Model
layout.Bindings
SetPermissions(permission permission.PermissionRequest) tea.Cmd
}
PermissionDialogCmp interface for permission dialog component
func NewPermissionDialogCmp ¶
func NewPermissionDialogCmp() PermissionDialogCmp
type PermissionResponseMsg ¶
type PermissionResponseMsg struct {
Permission permission.PermissionRequest
Action PermissionAction
}
PermissionResponseMsg represents the user's response to a permission request
type ProcessedCommand ¶
type ProcessedCommand struct {
Command *Command
Content string
Args map[string]string
HasNamedArgs bool
RemainingText string
OriginalCommand string
}
ProcessedCommand represents a processed slash command ready for execution
type QuitDialog ¶
func NewQuitCmp ¶
func NewQuitCmp() QuitDialog
type SessionDialog ¶
type SessionDialog interface {
tea.Model
layout.Bindings
SetSessions(sessions []session.Session)
SetSelectedSession(sessionID string)
}
SessionDialog interface for the session switching dialog
func NewSessionDialogCmp ¶
func NewSessionDialogCmp() SessionDialog
NewSessionDialogCmp creates a new session switching dialog
type SessionSelectedMsg ¶
SessionSelectedMsg is sent when a session is selected
type ShowInitDialogMsg ¶
type ShowInitDialogMsg struct {
Show bool
}
ShowInitDialogMsg is a message that is sent to show the init dialog.
type ShowMultiArgumentsDialogMsg ¶
ShowMultiArgumentsDialogMsg is a message that is sent to show the multi-arguments dialog.
type SlashCommandProcessor ¶
type SlashCommandProcessor struct {
// contains filtered or unexported fields
}
SlashCommandProcessor handles parsing and processing of slash commands
func NewSlashCommandProcessor ¶
func NewSlashCommandProcessor(commands []Command) *SlashCommandProcessor
NewSlashCommandProcessor creates a new slash command processor
func (*SlashCommandProcessor) AutofillCommand ¶
func (scp *SlashCommandProcessor) AutofillCommand(input string) string
AutofillCommand returns the completed command text if there's a unique match
func (*SlashCommandProcessor) GetAvailableCommands ¶
func (scp *SlashCommandProcessor) GetAvailableCommands() []string
GetAvailableCommands returns a list of available command names for autocomplete
func (*SlashCommandProcessor) GetCommonPrefix ¶
func (scp *SlashCommandProcessor) GetCommonPrefix(input string) string
GetCommonPrefix returns the longest common prefix among suggestions
func (*SlashCommandProcessor) GetSuggestions ¶
func (scp *SlashCommandProcessor) GetSuggestions(input string, maxCount int) []Suggestion
GetSuggestions returns slash command suggestions based on partial input
func (*SlashCommandProcessor) IsSlashCommand ¶
func (scp *SlashCommandProcessor) IsSlashCommand(input string) bool
IsSlashCommand checks if the input text is a slash command
func (*SlashCommandProcessor) ProcessSlashCommand ¶
func (scp *SlashCommandProcessor) ProcessSlashCommand(input string) *SlashCommandResult
ProcessSlashCommand parses and processes a slash command input
type SlashCommandResult ¶
type SlashCommandResult struct {
Processed *ProcessedCommand
Error error
NeedsArgDialog bool
}
SlashCommandResult represents the result of processing a slash command
type SlashSuggestionAutofillMsg ¶
type SlashSuggestionAutofillMsg struct{}
type SlashSuggestionDialog ¶
type SlashSuggestionDialog struct {
// contains filtered or unexported fields
}
SlashSuggestionDialog represents a dialog for showing slash command suggestions
func NewSlashSuggestionDialog ¶
func NewSlashSuggestionDialog(processor *SlashCommandProcessor) *SlashSuggestionDialog
NewSlashSuggestionDialog creates a new suggestion dialog
func (*SlashSuggestionDialog) GetSelectedSuggestion ¶
func (d *SlashSuggestionDialog) GetSelectedSuggestion() *Suggestion
GetSelectedSuggestion returns the currently selected suggestion
func (*SlashSuggestionDialog) Hide ¶
func (d *SlashSuggestionDialog) Hide()
Hide hides the suggestions dialog
func (*SlashSuggestionDialog) Init ¶
func (d *SlashSuggestionDialog) Init() tea.Cmd
Init initializes the dialog
func (*SlashSuggestionDialog) IsVisible ¶
func (d *SlashSuggestionDialog) IsVisible() bool
IsVisible returns whether the dialog is currently visible
func (*SlashSuggestionDialog) SetSize ¶
func (d *SlashSuggestionDialog) SetSize(width, height int)
SetSize sets the dialog dimensions
func (*SlashSuggestionDialog) Show ¶
func (d *SlashSuggestionDialog) Show(input string)
Show displays the suggestions for given input
func (*SlashSuggestionDialog) View ¶
func (d *SlashSuggestionDialog) View() string
View renders the suggestion dialog
type SlashSuggestionKeyMap ¶
type SlashSuggestionKeyMap struct {
Up key.Binding
Down key.Binding
Select key.Binding
Escape key.Binding
Tab key.Binding
}
SlashSuggestionKeyMap defines key bindings for suggestion navigation
type SlashSuggestionSelectedMsg ¶
type SlashSuggestionSelectedMsg struct {
Command string
}
Messages for slash suggestion events
type Suggestion ¶
type Suggestion struct {
Command string // The command name (without /)
Title string // Display title
Description string // Command description
}
Suggestion represents a slash command suggestion for autocomplete
type ThemeChangedMsg ¶
type ThemeChangedMsg struct {
ThemeName string
}
ThemeChangedMsg is sent when the theme is changed
type ThemeDialog ¶
ThemeDialog interface for the theme switching dialog
func NewThemeDialogCmp ¶
func NewThemeDialogCmp() ThemeDialog
NewThemeDialogCmp creates a new theme switching dialog