Documentation
¶
Index ¶
- type CreatePluginRequest
- type Executor
- type HandlerType
- type Inspector
- type Manager
- func (m *Manager) ActiveSkills() []PluginSkillWithPlugin
- func (m *Manager) ActiveSystemPrompts() []string
- func (m *Manager) ActiveTools() []PluginToolWithPlugin
- func (m *Manager) CreatePlugin(req CreatePluginRequest, activeWorkspace string) (*Plugin, error)
- func (m *Manager) DeletePlugin(id string) error
- func (m *Manager) ExecuteTool(ctx context.Context, pluginID string, toolName string, ...) (*PluginToolResult, error)
- func (m *Manager) Get(id string) (*Plugin, bool)
- func (m *Manager) List() []*Plugin
- func (m *Manager) Register(p *Plugin) error
- func (m *Manager) Reload()
- func (m *Manager) SetWorkspace(dir string)
- func (m *Manager) TogglePlugin(id string, enabled bool) error
- type Plugin
- type PluginSkillDef
- type PluginSkillWithPlugin
- type PluginSource
- type PluginToolDef
- type PluginToolResult
- type PluginToolWithPlugin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreatePluginRequest ¶
type CreatePluginRequest struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Version string `json:"version,omitempty"`
Author string `json:"author,omitempty"`
Scope string `json:"scope,omitempty"` // "workspace" or "global"
SystemPrompt string `json:"system_prompt,omitempty"`
Tools []PluginToolDef `json:"tools,omitempty"`
Skills []PluginSkillDef `json:"skills,omitempty"`
Files map[string]string `json:"files,omitempty"` // filename -> content
}
CreatePluginRequest is the payload used by the agent or UI to create a new plugin.
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor runs plugin tools safely with timeouts and workspace context.
func NewExecutor ¶
func (*Executor) Execute ¶
func (e *Executor) Execute(ctx context.Context, p *Plugin, tool *PluginToolDef, args map[string]interface{}, workspaceDir string) (*PluginToolResult, error)
Execute runs a plugin tool with the provided arguments and context.
func (*Executor) SetInspector ¶
SetInspector sets or updates the inspector interface.
type HandlerType ¶
type HandlerType string
HandlerType specifies how a plugin tool executes.
const ( HandlerCommand HandlerType = "command" // Executes a shell command template HandlerScript HandlerType = "script" // Executes a script file in the plugin directory HandlerInline HandlerType = "inline" // Built-in or inline code )
type Inspector ¶
type Inspector interface {
List() []*Plugin
ActiveTools() []PluginToolWithPlugin
ActiveSkills() []PluginSkillWithPlugin
ActiveSystemPrompts() []string
}
Inspector allows components like Executor to inspect live runtime plugin state.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) ActiveSkills ¶
func (m *Manager) ActiveSkills() []PluginSkillWithPlugin
ActiveSkills returns all skills contributed by enabled plugins.
func (*Manager) ActiveSystemPrompts ¶
ActiveSystemPrompts returns system prompts from all enabled plugins.
func (*Manager) ActiveTools ¶
func (m *Manager) ActiveTools() []PluginToolWithPlugin
ActiveTools returns all tools provided by currently enabled plugins.
func (*Manager) CreatePlugin ¶
func (m *Manager) CreatePlugin(req CreatePluginRequest, activeWorkspace string) (*Plugin, error)
CreatePlugin creates a plugin on disk and registers it immediately.
func (*Manager) DeletePlugin ¶
DeletePlugin deletes a plugin from disk and unregisters it.
func (*Manager) ExecuteTool ¶
func (m *Manager) ExecuteTool(ctx context.Context, pluginID string, toolName string, args map[string]interface{}, workspaceDir string) (*PluginToolResult, error)
ExecuteTool dispatches execution of a plugin tool.
func (*Manager) Reload ¶
func (m *Manager) Reload()
Reload scans the global and workspace plugin directories.
func (*Manager) SetWorkspace ¶
type Plugin ¶
type Plugin struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Version string `json:"version"`
Author string `json:"author,omitempty"`
Enabled bool `json:"enabled"`
Source PluginSource `json:"source"`
Path string `json:"path,omitempty"` // Path to plugin.json
Dir string `json:"dir,omitempty"` // Directory holding plugin files
SystemPrompt string `json:"system_prompt,omitempty"`
Tools []PluginToolDef `json:"tools,omitempty"`
Skills []PluginSkillDef `json:"skills,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
// Cordis runtime state (cordis.yml compositions only).
CordisState string `json:"cordis_state,omitempty"` // ACTIVE|PENDING|FAILED|UNLOADING|DISPOSED
CordisError string `json:"cordis_error,omitempty"` // apply/config failure detail
CordisInject []string `json:"cordis_inject,omitempty"`
}
Plugin represents a registered or discovered agent plugin.
type PluginSkillDef ¶
type PluginSkillDef struct {
Name string `json:"name"`
Description string `json:"description"`
Body string `json:"body"`
}
PluginSkillDef defines a skill bundled within a plugin.
type PluginSkillWithPlugin ¶
type PluginSkillWithPlugin struct {
PluginID string
Skill PluginSkillDef
}
PluginSkillWithPlugin pairs a bundled skill with its parent plugin ID.
type PluginSource ¶
type PluginSource string
PluginSource indicates where the plugin was discovered or created.
const ( SourceWorkspace PluginSource = "workspace" SourceGlobal PluginSource = "global" SourceRuntime PluginSource = "runtime" SourceBuiltin PluginSource = "builtin" )
type PluginToolDef ¶
type PluginToolDef struct {
Name string `json:"name"`
Description string `json:"description"`
Parameters map[string]interface{} `json:"parameters,omitempty"`
HandlerType HandlerType `json:"handler_type"`
Command string `json:"command,omitempty"`
Script string `json:"script,omitempty"`
TimeoutSeconds int `json:"timeout_seconds,omitempty"`
}
PluginToolDef defines a tool exposed by a plugin to the agent.
type PluginToolResult ¶
type PluginToolResult struct {
Stdout string `json:"stdout,omitempty"`
Stderr string `json:"stderr,omitempty"`
ExitCode int `json:"exit_code"`
Success bool `json:"success"`
Error string `json:"error,omitempty"`
}
PluginToolResult is returned after executing a plugin tool.
type PluginToolWithPlugin ¶
type PluginToolWithPlugin struct {
PluginID string
Tool PluginToolDef
}
PluginToolWithPlugin pairs an exposed tool with its parent plugin ID.