Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionResult ¶
type ActionResult struct {
Success bool `json:"success"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
Error string `json:"error,omitempty"`
NextMenu string `json:"next_menu,omitempty"`
NextAction string `json:"next_action,omitempty"`
UpdateData map[string]interface{} `json:"update_data,omitempty"`
ShouldExit bool `json:"should_exit,omitempty"`
RefreshMenu bool `json:"refresh_menu,omitempty"`
}
ActionResult represents the result of executing an action
type Menu ¶
type Menu struct {
ID string `yaml:"id"`
Title string `yaml:"title"`
Input bool `yaml:"input,omitempty"`
Entries []MenuEntry `yaml:"entries,omitempty"`
ConfirmAction *MenuAction `yaml:"confirm_action,omitempty"`
CancelKey string `yaml:"cancel_key,omitempty"`
CancelNextID string `yaml:"cancel_next_id,omitempty"`
Provider string `yaml:"provider,omitempty"` // Provider to generate dynamic entries
ProviderParam string `yaml:"provider_param,omitempty"` // Parameter for the provider
Map map[string]Menu `yaml:"-"`
}
Menu represents a single menu definition
type MenuAction ¶
type MenuAction struct {
Type string `yaml:"type"`
Target string `yaml:"target,omitempty"`
Command string `yaml:"command,omitempty"`
NextID string `yaml:"next_id,omitempty"`
Message string `yaml:"message,omitempty"`
Function string `yaml:"function,omitempty"` // Interactive function name
Params map[string]interface{} `yaml:"params,omitempty"` // Parameters for functions
Executor string `yaml:"executor,omitempty"` // Action executor ID
ActionID string `yaml:"action_id,omitempty"` // Specific action within executor
FilePath string `yaml:"file_path,omitempty"` // File path for file operations
Confirm bool `yaml:"confirm,omitempty"` // Whether to show confirmation
ConfirmText string `yaml:"confirm_text,omitempty"` // Custom confirmation message
}
MenuAction represents an action that can be taken
type MenuConfig ¶
type MenuConfig struct {
Menus []Menu `yaml:"menus"`
}
MenuConfig represents the complete menu configuration
type MenuEntry ¶
type MenuEntry struct {
Key string `yaml:"key"`
Label string `yaml:"label"`
Action string `yaml:"action"`
Target string `yaml:"target,omitempty"`
Message string `yaml:"message,omitempty"`
Command string `yaml:"command,omitempty"`
NextID string `yaml:"next_id,omitempty"`
FilePath string `yaml:"file_path,omitempty"` // For file-based actions
Params map[string]interface{} `yaml:"params,omitempty"` // Parameters for interactive functions
IsDynamic bool `yaml:"-"` // Marks entries generated by functions
Context map[string]interface{} `yaml:"context,omitempty"` // Additional context for this entry
DisplayOnly bool `yaml:"display_only,omitempty"` // Entry is for display only (non-selectable)
Condition string `yaml:"condition,omitempty"` // Condition to evaluate for showing this entry
IsProvider bool `yaml:"-"` // Marks entries from providers
ProviderID string `yaml:"-"` // ID of the provider that generated this entry
}
MenuEntry represents a single menu item
type ModelUpdate ¶
ModelUpdate represents a model update from a plugin
Click to show internal directories.
Click to hide internal directories.