Documentation
¶
Overview ¶
Package manage provides session-independent operations for the assistant to configure itself: install/enable/remove plugins, author skills, and add/remove MCP servers. All operations persist to disk (plugin/skill registries and the user config file) and are fully unit-testable without a running session.
Index ¶
- type Configurator
- func (c *Configurator) AddMCPServer(name string, srv types.MCPServer) error
- func (c *Configurator) EffectiveConfig() (types.Config, error)
- func (c *Configurator) GenerateSkill(name, description, instructions string) (SkillInfo, error)
- func (c *Configurator) GetMCPServer(name string) (types.MCPServer, error)
- func (c *Configurator) InstallPlugin(url, ref string) (PluginInfo, error)
- func (c *Configurator) ListMCPServers() ([]MCPServerInfo, error)
- func (c *Configurator) ListPlugins() ([]PluginInfo, error)
- func (c *Configurator) ListSkills() ([]SkillInfo, error)
- func (c *Configurator) RemoveMCPServer(name string) error
- func (c *Configurator) RemovePlugin(name string) error
- func (c *Configurator) SetMCPServerEnabled(name string, enabled bool) error
- func (c *Configurator) SetPluginEnabled(name string, enabled bool) error
- type MCPServerInfo
- type PluginInfo
- type SkillInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configurator ¶
type Configurator struct {
// contains filtered or unexported fields
}
Configurator performs self-configuration operations against a base directory (the plugin/skill registries) and a single user config file (mcp_servers).
func New ¶
func New(baseDir, configPath string) *Configurator
New returns a Configurator rooted at baseDir (use plugin.BaseDir() in prod) writing MCP-server config to configPath (use config.WritablePath() in prod).
func (*Configurator) AddMCPServer ¶
func (c *Configurator) AddMCPServer(name string, srv types.MCPServer) error
AddMCPServer persists an MCP server (stdio or remote) to the user config file. Exactly one of srv.Command (stdio) or srv.URL (remote) must be set.
func (*Configurator) EffectiveConfig ¶
func (c *Configurator) EffectiveConfig() (types.Config, error)
EffectiveConfig recomputes the merged config (same as startup) so callers can re-wire a live session after a change. Disabled MCP servers are dropped here so they never start a transport; ListMCPServers still reports them for the UI.
func (*Configurator) GenerateSkill ¶
func (c *Configurator) GenerateSkill(name, description, instructions string) (SkillInfo, error)
GenerateSkill writes a new SKILL.md into the shared "local" skill pack and ensures that pack is registered enabled, so the skill becomes loadable once the session reloads. Returns the new skill's tool-facing info.
func (*Configurator) GetMCPServer ¶ added in v0.3.0
func (c *Configurator) GetMCPServer(name string) (types.MCPServer, error)
GetMCPServer returns the named server from the user config file.
func (*Configurator) InstallPlugin ¶
func (c *Configurator) InstallPlugin(url, ref string) (PluginInfo, error)
InstallPlugin installs a plugin (DISABLED) and returns its record.
func (*Configurator) ListMCPServers ¶
func (c *Configurator) ListMCPServers() ([]MCPServerInfo, error)
ListMCPServers returns the MCP servers configured in the user config file, sorted by name. It reads the writable user file (the authoritative source for add/remove), not the merged effective config.
func (*Configurator) ListPlugins ¶
func (c *Configurator) ListPlugins() ([]PluginInfo, error)
ListPlugins returns all installed plugins from the registry.
func (*Configurator) ListSkills ¶
func (c *Configurator) ListSkills() ([]SkillInfo, error)
ListSkills returns the skills contributed by enabled skill packs.
func (*Configurator) RemoveMCPServer ¶
func (c *Configurator) RemoveMCPServer(name string) error
RemoveMCPServer deletes an MCP server from the user config file.
func (*Configurator) RemovePlugin ¶
func (c *Configurator) RemovePlugin(name string) error
RemovePlugin deletes a plugin's files and registry record.
func (*Configurator) SetMCPServerEnabled ¶ added in v0.4.1
func (c *Configurator) SetMCPServerEnabled(name string, enabled bool) error
SetMCPServerEnabled flips a configured server's enabled state by toggling its Disabled flag in the user config file. Unknown names error, matching GetMCPServer/RemoveMCPServer.
func (*Configurator) SetPluginEnabled ¶
func (c *Configurator) SetPluginEnabled(name string, enabled bool) error
SetPluginEnabled flips a plugin's enabled flag.
type MCPServerInfo ¶
type MCPServerInfo struct {
Name string
Command string
Args []string
URL string
Transport string
// Authenticated is true if BearerToken or ANY custom header is set; the values
// themselves are never exposed here. Note this deliberately does not distinguish
// a real auth token from an ordinary custom header — its purpose is "don't
// silently print secrets", not "classify which headers are authentication".
Authenticated bool
// Enabled is false when the server's Disabled flag is set. Absent == enabled.
Enabled bool
}
MCPServerInfo is a configured MCP server in tool-facing form.
type PluginInfo ¶
PluginInfo is a registry plugin record in tool-facing form.