Documentation
¶
Index ¶
- type ClearShortcut
- type ConfigShortcut
- type ConversationMetadata
- type ConversationSelectShortcut
- func (c *ConversationSelectShortcut) CanExecute(args []string) bool
- func (c *ConversationSelectShortcut) Execute(ctx context.Context, args []string) (ShortcutResult, error)
- func (c *ConversationSelectShortcut) GetDescription() string
- func (c *ConversationSelectShortcut) GetName() string
- func (c *ConversationSelectShortcut) GetUsage() string
- type ConversationSummary
- type CustomShortcut
- type CustomShortcutConfig
- type CustomShortcutsConfig
- type ExitShortcut
- type ExportShortcut
- func (c *ExportShortcut) CanExecute(args []string) bool
- func (c *ExportShortcut) Execute(ctx context.Context, args []string) (ShortcutResult, error)
- func (c *ExportShortcut) GetDescription() string
- func (c *ExportShortcut) GetName() string
- func (c *ExportShortcut) GetUsage() string
- func (c *ExportShortcut) PerformExport(ctx context.Context) (string, error)
- type GitShortcut
- func (g *GitShortcut) CanExecute(args []string) bool
- func (g *GitShortcut) Execute(ctx context.Context, args []string) (ShortcutResult, error)
- func (g *GitShortcut) GetDescription() string
- func (g *GitShortcut) GetName() string
- func (g *GitShortcut) GetUsage() string
- func (g *GitShortcut) PerformCommit(ctx context.Context, args []string, diff string) (string, error)
- type HelpShortcut
- type PersistentConversationRepository
- type Registry
- func (r *Registry) Execute(ctx context.Context, name string, args []string) (ShortcutResult, error)
- func (r *Registry) Get(name string) (Shortcut, bool)
- func (r *Registry) GetAll() []Shortcut
- func (r *Registry) GetShortcuts() map[string]string
- func (r *Registry) GetShortcutsStartingWith(prefix string) []string
- func (r *Registry) List() []string
- func (r *Registry) LoadCustomShortcuts(baseDir string) error
- func (r *Registry) ParseShortcut(input string) (string, []string, error)
- func (r *Registry) Register(shortcut Shortcut)
- func (r *Registry) Unregister(name string)
- type Shortcut
- type ShortcutResult
- type SideEffectType
- type SwitchShortcut
- type TokenStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClearShortcut ¶
type ClearShortcut struct {
// contains filtered or unexported fields
}
ClearShortcut clears the conversation history
func NewClearShortcut ¶
func NewClearShortcut(repo domain.ConversationRepository) *ClearShortcut
func (*ClearShortcut) CanExecute ¶
func (c *ClearShortcut) CanExecute(args []string) bool
func (*ClearShortcut) Execute ¶
func (c *ClearShortcut) Execute(ctx context.Context, args []string) (ShortcutResult, error)
func (*ClearShortcut) GetDescription ¶
func (c *ClearShortcut) GetDescription() string
func (*ClearShortcut) GetName ¶
func (c *ClearShortcut) GetName() string
func (*ClearShortcut) GetUsage ¶
func (c *ClearShortcut) GetUsage() string
type ConfigShortcut ¶
type ConfigShortcut struct {
// contains filtered or unexported fields
}
ConfigShortcut allows runtime configuration management
func NewConfigShortcut ¶
func NewConfigShortcut(cfg *config.Config, reloadFunc func() (*config.Config, error), configService interface { SetValue(key, value string) error }) *ConfigShortcut
NewConfigShortcut creates a new config shortcut
func (*ConfigShortcut) CanExecute ¶
func (c *ConfigShortcut) CanExecute(args []string) bool
func (*ConfigShortcut) Execute ¶
func (c *ConfigShortcut) Execute(ctx context.Context, args []string) (ShortcutResult, error)
func (*ConfigShortcut) GetDescription ¶
func (c *ConfigShortcut) GetDescription() string
func (*ConfigShortcut) GetName ¶
func (c *ConfigShortcut) GetName() string
func (*ConfigShortcut) GetUsage ¶
func (c *ConfigShortcut) GetUsage() string
type ConversationMetadata ¶ added in v0.45.0
type ConversationMetadata struct { ID string Title string CreatedAt string UpdatedAt string MessageCount int TokenStats TokenStats Model string Tags []string Summary string }
ConversationMetadata represents conversation metadata
type ConversationSelectShortcut ¶ added in v0.45.0
type ConversationSelectShortcut struct {
// contains filtered or unexported fields
}
ConversationSelectShortcut shows the conversation selection dropdown
func NewConversationSelectShortcut ¶ added in v0.45.0
func NewConversationSelectShortcut(repo PersistentConversationRepository) *ConversationSelectShortcut
NewConversationSelectShortcut creates a new conversation select shortcut
func (*ConversationSelectShortcut) CanExecute ¶ added in v0.45.0
func (c *ConversationSelectShortcut) CanExecute(args []string) bool
func (*ConversationSelectShortcut) Execute ¶ added in v0.45.0
func (c *ConversationSelectShortcut) Execute(ctx context.Context, args []string) (ShortcutResult, error)
func (*ConversationSelectShortcut) GetDescription ¶ added in v0.45.0
func (c *ConversationSelectShortcut) GetDescription() string
func (*ConversationSelectShortcut) GetName ¶ added in v0.45.0
func (c *ConversationSelectShortcut) GetName() string
func (*ConversationSelectShortcut) GetUsage ¶ added in v0.45.0
func (c *ConversationSelectShortcut) GetUsage() string
type ConversationSummary ¶ added in v0.45.0
type ConversationSummary struct { ID string Title string CreatedAt string UpdatedAt string MessageCount int TokenStats TokenStats Model string Tags []string Summary string }
ConversationSummary represents a saved conversation summary
type CustomShortcut ¶ added in v0.44.0
type CustomShortcut struct {
// contains filtered or unexported fields
}
CustomShortcut implements the Shortcut interface for user-defined shortcuts
func NewCustomShortcut ¶ added in v0.44.0
func NewCustomShortcut(config CustomShortcutConfig) *CustomShortcut
NewCustomShortcut creates a new custom shortcut from configuration
func (*CustomShortcut) CanExecute ¶ added in v0.44.0
func (c *CustomShortcut) CanExecute(args []string) bool
func (*CustomShortcut) Execute ¶ added in v0.44.0
func (c *CustomShortcut) Execute(ctx context.Context, args []string) (ShortcutResult, error)
func (*CustomShortcut) GetDescription ¶ added in v0.44.0
func (c *CustomShortcut) GetDescription() string
func (*CustomShortcut) GetName ¶ added in v0.44.0
func (c *CustomShortcut) GetName() string
func (*CustomShortcut) GetUsage ¶ added in v0.44.0
func (c *CustomShortcut) GetUsage() string
type CustomShortcutConfig ¶ added in v0.44.0
type CustomShortcutConfig struct { Name string `yaml:"name"` Description string `yaml:"description"` Command string `yaml:"command"` Args []string `yaml:"args,omitempty"` WorkingDir string `yaml:"working_dir,omitempty"` }
CustomShortcutConfig represents a user-defined shortcut configuration
type CustomShortcutsConfig ¶ added in v0.44.0
type CustomShortcutsConfig struct {
Shortcuts []CustomShortcutConfig `yaml:"shortcuts"`
}
CustomShortcutsConfig represents the structure of a custom shortcuts YAML file
type ExitShortcut ¶
type ExitShortcut struct{}
ExitShortcut exits the application
func NewExitShortcut ¶
func NewExitShortcut() *ExitShortcut
func (*ExitShortcut) CanExecute ¶
func (c *ExitShortcut) CanExecute(args []string) bool
func (*ExitShortcut) Execute ¶
func (c *ExitShortcut) Execute(ctx context.Context, args []string) (ShortcutResult, error)
func (*ExitShortcut) GetDescription ¶
func (c *ExitShortcut) GetDescription() string
func (*ExitShortcut) GetName ¶
func (c *ExitShortcut) GetName() string
func (*ExitShortcut) GetUsage ¶
func (c *ExitShortcut) GetUsage() string
type ExportShortcut ¶
type ExportShortcut struct {
// contains filtered or unexported fields
}
ExportShortcut exports the conversation
func NewExportShortcut ¶
func NewExportShortcut(repo domain.ConversationRepository, agentService domain.AgentService, modelService domain.ModelService, config *config.Config) *ExportShortcut
func (*ExportShortcut) CanExecute ¶
func (c *ExportShortcut) CanExecute(args []string) bool
func (*ExportShortcut) Execute ¶
func (c *ExportShortcut) Execute(ctx context.Context, args []string) (ShortcutResult, error)
func (*ExportShortcut) GetDescription ¶
func (c *ExportShortcut) GetDescription() string
func (*ExportShortcut) GetName ¶
func (c *ExportShortcut) GetName() string
func (*ExportShortcut) GetUsage ¶
func (c *ExportShortcut) GetUsage() string
func (*ExportShortcut) PerformExport ¶
func (c *ExportShortcut) PerformExport(ctx context.Context) (string, error)
PerformExport performs the actual export operation (called by side effect handler)
type GitShortcut ¶
type GitShortcut struct {
// contains filtered or unexported fields
}
GitShortcut handles all git operations (status, pull, log, commit, push, etc.)
func NewGitShortcut ¶
func NewGitShortcut(commitClient sdk.Client, config *config.Config) *GitShortcut
NewGitShortcut creates a new unified git shortcut
func (*GitShortcut) CanExecute ¶
func (g *GitShortcut) CanExecute(args []string) bool
func (*GitShortcut) Execute ¶
func (g *GitShortcut) Execute(ctx context.Context, args []string) (ShortcutResult, error)
func (*GitShortcut) GetDescription ¶
func (g *GitShortcut) GetDescription() string
func (*GitShortcut) GetName ¶
func (g *GitShortcut) GetName() string
func (*GitShortcut) GetUsage ¶
func (g *GitShortcut) GetUsage() string
func (*GitShortcut) PerformCommit ¶
func (g *GitShortcut) PerformCommit(ctx context.Context, args []string, diff string) (string, error)
PerformCommit executes the actual commit with AI-generated message (called by side effect handler)
type HelpShortcut ¶
type HelpShortcut struct {
// contains filtered or unexported fields
}
HelpShortcut shows available shortcuts
func NewHelpShortcut ¶
func NewHelpShortcut(registry *Registry) *HelpShortcut
func (*HelpShortcut) CanExecute ¶
func (c *HelpShortcut) CanExecute(args []string) bool
func (*HelpShortcut) Execute ¶
func (c *HelpShortcut) Execute(ctx context.Context, args []string) (ShortcutResult, error)
func (*HelpShortcut) GetDescription ¶
func (c *HelpShortcut) GetDescription() string
func (*HelpShortcut) GetName ¶
func (c *HelpShortcut) GetName() string
func (*HelpShortcut) GetUsage ¶
func (c *HelpShortcut) GetUsage() string
type PersistentConversationRepository ¶ added in v0.45.0
type PersistentConversationRepository interface { ListSavedConversations(ctx context.Context, limit, offset int) ([]ConversationSummary, error) LoadConversation(ctx context.Context, conversationID string) error GetCurrentConversationMetadata() ConversationMetadata SaveConversation(ctx context.Context) error StartNewConversation(title string) error GetCurrentConversationID() string SetConversationTitle(title string) DeleteSavedConversation(ctx context.Context, conversationID string) error }
PersistentConversationRepository interface for conversation persistence
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages all available shortcuts
func (*Registry) GetShortcuts ¶
GetShortcuts returns a map of shortcut names to descriptions
func (*Registry) GetShortcutsStartingWith ¶
GetShortcutsStartingWith returns shortcuts that start with the given prefix
func (*Registry) LoadCustomShortcuts ¶ added in v0.44.0
LoadCustomShortcuts loads user-defined shortcuts from the specified base directory
func (*Registry) ParseShortcut ¶
ParseShortcut parses a shortcut line input into shortcut name and arguments Handles quoted strings properly
func (*Registry) Unregister ¶
Unregister removes a shortcut from the registry
type Shortcut ¶
type Shortcut interface { GetName() string GetDescription() string GetUsage() string Execute(ctx context.Context, args []string) (ShortcutResult, error) CanExecute(args []string) bool }
Shortcut interface represents a chat shortcut that can be executed
func LoadCustomShortcuts ¶ added in v0.44.0
LoadCustomShortcuts loads user-defined shortcuts from shortcuts/ directory within the specified base directory
type ShortcutResult ¶
type ShortcutResult struct { Output string Success bool SideEffect SideEffectType Data any }
ShortcutResult represents the result of a shortcut execution
type SideEffectType ¶
type SideEffectType int
SideEffectType defines the types of side effects a shortcut can have
const ( SideEffectNone SideEffectType = iota SideEffectClearConversation SideEffectExportConversation SideEffectExit SideEffectSwitchModel SideEffectShowHelp SideEffectReloadConfig SideEffectGenerateCommit SideEffectSaveConversation SideEffectShowConversationSelection )
type SwitchShortcut ¶
type SwitchShortcut struct {
// contains filtered or unexported fields
}
SwitchShortcut switches the active model
func NewSwitchShortcut ¶
func NewSwitchShortcut(modelService domain.ModelService) *SwitchShortcut
func (*SwitchShortcut) CanExecute ¶
func (c *SwitchShortcut) CanExecute(args []string) bool
func (*SwitchShortcut) Execute ¶
func (c *SwitchShortcut) Execute(ctx context.Context, args []string) (ShortcutResult, error)
func (*SwitchShortcut) GetDescription ¶
func (c *SwitchShortcut) GetDescription() string
func (*SwitchShortcut) GetName ¶
func (c *SwitchShortcut) GetName() string
func (*SwitchShortcut) GetUsage ¶
func (c *SwitchShortcut) GetUsage() string