Documentation
¶
Index ¶
- Constants
- Variables
- func DiscoverAgentFiles(dirs []string, workingDir string) []string
- func ExpandPath(path, workingDir string) string
- func NewDetailsDialog(app *plugin.App) (plugin.PluginDialog, error)
- func NewListDialog(app *plugin.App) (plugin.PluginDialog, error)
- func NewSubAgentTool(registry *Registry) fantasy.AgentTool
- func SetSelectedAgent(name string)
- type Config
- type DetailsDialog
- func (d *DetailsDialog) ID() string
- func (d *DetailsDialog) Init() error
- func (d *DetailsDialog) Size() (width, height int)
- func (d *DetailsDialog) Title() string
- func (d *DetailsDialog) Update(event plugin.DialogEvent) (done bool, action plugin.PluginAction, err error)
- func (d *DetailsDialog) View() string
- type ListDialog
- func (d *ListDialog) GetSelectedAgent() string
- func (d *ListDialog) ID() string
- func (d *ListDialog) Init() error
- func (d *ListDialog) Size() (width, height int)
- func (d *ListDialog) Title() string
- func (d *ListDialog) Update(event plugin.DialogEvent) (done bool, action plugin.PluginAction, err error)
- func (d *ListDialog) View() string
- type Registry
- type SubAgent
- type SubAgentParams
Constants ¶
const ( // ToolName is the name of the SubAgent tool. ToolName = "subagent" // Description is shown to the LLM. Description = `` /* 492-byte string literal not displayed */ )
const (
// DetailsDialogID is the identifier for the sub-agent details dialog.
DetailsDialogID = "subagents-details"
)
const (
// ListDialogID is the identifier for the sub-agents list dialog.
ListDialogID = "subagents-list"
)
Variables ¶
var DefaultDirs = []string{".crush/agents", "~/.crush/agents"}
DefaultDirs are searched when no dirs are configured.
Functions ¶
func DiscoverAgentFiles ¶
DiscoverAgentFiles finds all .md files in the given directories.
func ExpandPath ¶
ExpandPath expands ~ to home directory and resolves relative paths.
func NewDetailsDialog ¶
func NewDetailsDialog(app *plugin.App) (plugin.PluginDialog, error)
NewDetailsDialog creates a new sub-agent details dialog.
func NewListDialog ¶
func NewListDialog(app *plugin.App) (plugin.PluginDialog, error)
NewListDialog creates a new sub-agents list dialog.
func NewSubAgentTool ¶
NewSubAgentTool creates the SubAgent tool.
func SetSelectedAgent ¶
func SetSelectedAgent(name string)
SetSelectedAgent sets the agent to show in the details dialog.
Types ¶
type Config ¶
type Config struct {
Dirs []string `json:"dirs,omitempty"`
}
Config defines configuration options for this plugin.
type DetailsDialog ¶
type DetailsDialog struct {
// contains filtered or unexported fields
}
DetailsDialog shows details for a specific sub-agent.
func (*DetailsDialog) ID ¶
func (d *DetailsDialog) ID() string
func (*DetailsDialog) Init ¶
func (d *DetailsDialog) Init() error
func (*DetailsDialog) Size ¶
func (d *DetailsDialog) Size() (width, height int)
func (*DetailsDialog) Title ¶
func (d *DetailsDialog) Title() string
func (*DetailsDialog) Update ¶
func (d *DetailsDialog) Update(event plugin.DialogEvent) (done bool, action plugin.PluginAction, err error)
func (*DetailsDialog) View ¶
func (d *DetailsDialog) View() string
type ListDialog ¶
type ListDialog struct {
// contains filtered or unexported fields
}
ListDialog shows all available sub-agents.
func (*ListDialog) GetSelectedAgent ¶
func (d *ListDialog) GetSelectedAgent() string
GetSelectedAgent returns the currently selected agent name. Used by the details dialog to know which agent to show.
func (*ListDialog) ID ¶
func (d *ListDialog) ID() string
func (*ListDialog) Init ¶
func (d *ListDialog) Init() error
func (*ListDialog) Size ¶
func (d *ListDialog) Size() (width, height int)
func (*ListDialog) Title ¶
func (d *ListDialog) Title() string
func (*ListDialog) Update ¶
func (d *ListDialog) Update(event plugin.DialogEvent) (done bool, action plugin.PluginAction, err error)
func (*ListDialog) View ¶
func (d *ListDialog) View() string
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages loaded sub-agents.
func (*Registry) LoadAgents ¶
func (r *Registry) LoadAgents()
LoadAgents discovers and loads all sub-agent files.
func (*Registry) ReloadAgent ¶
ReloadAgent reloads a specific agent from disk.
func (*Registry) SetEnabled ¶
SetEnabled enables or disables a sub-agent.
type SubAgent ¶
type SubAgent struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
Tools []string `yaml:"-"` // Parsed from comma-separated string
ToolsRaw string `yaml:"tools"` // Raw YAML field
DisallowedTools []string `yaml:"-"` // Parsed from comma-separated string
DisallowedRaw string `yaml:"disallowedTools"`
Model string `yaml:"model"`
PermissionMode string `yaml:"permissionMode"`
SystemPrompt string `yaml:"-"` // Markdown body
FilePath string `yaml:"-"` // Source file path
Enabled bool `yaml:"-"` // Runtime state
}
SubAgent represents a loaded sub-agent configuration.
func LoadAgentFile ¶
LoadAgentFile parses a sub-agent YAML+Markdown file.
type SubAgentParams ¶
type SubAgentParams struct {
Agent string `json:"agent" jsonschema:"description=The sub-agent name to invoke"`
Prompt string `json:"prompt" jsonschema:"description=The task for the sub-agent to perform"`
}
SubAgentParams defines the parameters the LLM can pass.