Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Capability ¶
type Capability string
Capability declares a contract a plugin satisfies.
const ( // CapabilityTools indicates the plugin exposes MCP tools to the LLM. CapabilityTools Capability = "tools" )
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager loads plugin configs, validates them, and registers their capabilities with the appropriate subsystem (currently only MCP tool servers via ToolRegistrar).
func NewManager ¶
NewManager creates a plugin Manager with no plugins loaded.
func (*Manager) Load ¶
func (m *Manager) Load(plugins map[string]config.PluginConfig, existingToolNames map[string]bool) error
Load validates all plugin configs and populates the internal plugin list. existingToolNames is used to detect name collisions with registered [tools.*] entries. Keys are processed in sorted order for deterministic error reporting. Returns an error on the first invalid plugin; does not continue past errors.
func (*Manager) Start ¶
func (m *Manager) Start(ctx context.Context, tools ToolRegistrar) error
Start registers each loaded plugin's capabilities with the appropriate subsystem. Plugins with the "tools" capability are registered as MCP servers via tools.RegisterServer. A failure to register a plugin is logged as an error but does not halt other plugins. Returns the first error encountered, or nil if all plugins started successfully.
type Plugin ¶
type Plugin struct {
Name string
Type PluginType
Command string
Args []string
Env map[string]string
Capabilities []Capability
}
Plugin is the validated, normalised representation of a single plugin entry.
type PluginType ¶
type PluginType string
PluginType is the execution strategy for a plugin.
const ( // TypeSubprocess runs the plugin as a trusted subprocess with direct MCP stdio communication. TypeSubprocess PluginType = "subprocess" // TypeDocker is reserved for future sandboxed execution and is not yet implemented. TypeDocker PluginType = "docker" )