manage

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2026 License: MIT Imports: 11 Imported by: 0

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

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, command string, args []string, env map[string]string) error

AddMCPServer persists an MCP server to the user config file.

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.

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) 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) 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
}

MCPServerInfo is a configured MCP server in tool-facing form.

type PluginInfo

type PluginInfo struct {
	Name      string
	SourceURL string
	Ref       string
	Enabled   bool
}

PluginInfo is a registry plugin record in tool-facing form.

type SkillInfo

type SkillInfo struct {
	Name        string
	Description string
	Pack        string
}

SkillInfo is one available skill in tool-facing form.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL