Documentation
¶
Index ¶
- func DefaultDir() string
- func InstallFromGitHub(ctx context.Context, repo string) error
- func InstallFromLocal(src string) error
- func InstallFromMarketplace(ctx context.Context, pluginRef string) error
- func Uninstall(name string) error
- func UpdateAllInstalledPlugins(ctx context.Context) error
- func UpdateInstalledPlugin(ctx context.Context, name string) error
- type Author
- type Capabilities
- type Command
- type DaemonTool
- type DaemonToolRef
- type ExecTool
- type LoadResult
- type Loader
- type MCPConfig
- type MCPServerSpec
- type Manifest
- type MarketplaceCatalog
- type MarketplaceEntry
- type MarketplaceRegistry
- type MarketplaceSource
- type Registry
- func (r *Registry) Add(name string, entry RegistryEntry) error
- func (r *Registry) Get(name string) (RegistryEntry, bool)
- func (r *Registry) Put(name string, entry RegistryEntry) error
- func (r *Registry) Remove(name string) error
- func (r *Registry) Save() error
- func (r *Registry) SetEnabled(name string, enabled bool) error
- type RegistryEntry
- type ToolDef
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultDir ¶ added in v0.30.1
func DefaultDir() string
DefaultDir returns the default plugin installation directory.
func InstallFromGitHub ¶
InstallFromGitHub downloads the latest release tarball from a GitHub repo and installs it to ~/.ratchet/plugins/<name>/. repo must be in "owner/name" format.
func InstallFromLocal ¶
InstallFromLocal copies src to ~/.ratchet/plugins/<name>/ and registers it. src must contain a valid plugin manifest.
func InstallFromMarketplace ¶ added in v0.30.2
func UpdateAllInstalledPlugins ¶ added in v0.30.2
Types ¶
type Capabilities ¶
type Capabilities struct {
Skills string `json:"skills,omitempty"` // relative dir path
Agents string `json:"agents,omitempty"` // relative dir path
Commands string `json:"commands,omitempty"` // relative dir path
Tools string `json:"tools,omitempty"` // relative dir path
Hooks string `json:"hooks,omitempty"` // relative file path
MCP string `json:"mcp,omitempty"` // relative file path
ACPProfiles string `json:"acpProfiles,omitempty"` // relative file path
}
Capabilities declares which capability directories/files a plugin provides.
type Command ¶
type Command struct {
Name string // slash command name (derived from filename without extension)
Content string // full markdown content
Path string
}
Command represents a slash command contributed by a plugin.
type DaemonTool ¶
type DaemonTool struct {
// contains filtered or unexported fields
}
DaemonTool manages a long-running plugin process that handles multiple tool calls over its lifetime using JSON-RPC 2.0 over stdin/stdout.
func StartDaemon ¶
func StartDaemon(ctx context.Context, binPath string) (*DaemonTool, error)
StartDaemon launches the daemon binary, performs the initialize handshake, and returns a ready DaemonTool.
func (*DaemonTool) Defs ¶
func (d *DaemonTool) Defs() []ToolDef
Defs returns the tool definitions declared by the daemon at initialize time.
func (*DaemonTool) Stop ¶
func (d *DaemonTool) Stop() error
Stop gracefully shuts down the daemon: closes stdin, waits for exit with a timeout, then kills if necessary.
type DaemonToolRef ¶
type DaemonToolRef struct {
// contains filtered or unexported fields
}
DaemonToolRef wraps a single named tool exposed by a DaemonTool.
func NewDaemonToolRef ¶
func NewDaemonToolRef(daemon *DaemonTool, def ToolDef) *DaemonToolRef
NewDaemonToolRef creates a DaemonToolRef for the named tool.
func (*DaemonToolRef) Definition ¶
func (r *DaemonToolRef) Definition() provider.ToolDef
Definition implements plugin.Tool.
func (*DaemonToolRef) Description ¶
func (r *DaemonToolRef) Description() string
Description implements plugin.Tool.
type ExecTool ¶
type ExecTool struct {
// contains filtered or unexported fields
}
ExecTool implements plugin.Tool by spawning a new process for each call. The binary receives JSON-encoded arguments on stdin and must write a JSON result to stdout.
func LoadExecTool ¶
LoadExecTool reads tool.json from toolDir and locates the binary. The binary must be an executable file inside toolDir named after the tool.
func (*ExecTool) Definition ¶
Definition implements plugin.Tool.
func (*ExecTool) Description ¶
Description implements plugin.Tool.
type LoadResult ¶
type LoadResult struct {
Skills []skills.Skill
Agents []agent.AgentDefinition
Commands []Command
Hooks *hooks.HookConfig
Tools []plugin.Tool
MCPConfigs []MCPConfig
ACPProfiles []acpclient.Profile
// Daemons holds all started daemon processes so callers can stop them.
// Call StopDaemons() to cleanly shut them all down.
Daemons []*DaemonTool
}
LoadResult aggregates all capabilities discovered across loaded plugins.
func (*LoadResult) StopDaemons ¶
func (r *LoadResult) StopDaemons()
StopDaemons stops all daemon tool processes tracked by this LoadResult.
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader discovers and loads plugins from a directory.
type MCPConfig ¶
type MCPConfig struct {
PluginName string
PluginDir string
Servers map[string]MCPServerSpec `json:"mcpServers"`
}
MCPConfig holds all MCP server declarations from a plugin's .mcp.json.
type MCPServerSpec ¶
type MCPServerSpec struct {
Command string `json:"command"`
Args []string `json:"args,omitempty"`
Env map[string]string `json:"env,omitempty"`
}
MCPServerSpec describes a single MCP server entry from .mcp.json.
type Manifest ¶
type Manifest struct {
Name string `json:"name"`
Version string `json:"version"`
Description string `json:"description"`
Author Author `json:"author"`
Capabilities Capabilities `json:"capabilities"`
}
Manifest represents a plugin's plugin.json manifest.
func LoadManifest ¶
LoadManifest reads a plugin manifest from pluginDir. It tries .ratchet-plugin/plugin.json first, then .claude-plugin/plugin.json.
type MarketplaceCatalog ¶ added in v0.30.2
type MarketplaceCatalog struct {
Plugins []MarketplaceEntry `json:"plugins"`
// contains filtered or unexported fields
}
MarketplaceCatalog is the on-disk marketplace.json shape.
func LoadMarketplaceCatalog ¶ added in v0.30.2
func LoadMarketplaceCatalog(path string) (*MarketplaceCatalog, error)
LoadMarketplaceCatalog loads a local marketplace catalog JSON file.
func LoadMarketplaceCatalogFromSource ¶ added in v0.30.2
func LoadMarketplaceCatalogFromSource(ctx context.Context, source string) (*MarketplaceCatalog, error)
func (*MarketplaceCatalog) Get ¶ added in v0.30.2
func (c *MarketplaceCatalog) Get(name string) (MarketplaceEntry, bool)
type MarketplaceEntry ¶ added in v0.30.2
type MarketplaceEntry struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Version string `json:"version"`
Source string `json:"source"`
SHA256 string `json:"sha256,omitempty"`
Relevance string `json:"relevance,omitempty"`
AutoUpdate bool `json:"autoUpdate,omitempty"`
}
MarketplaceEntry describes a plugin entry published by a marketplace catalog.
type MarketplaceRegistry ¶ added in v0.30.2
type MarketplaceRegistry struct {
Marketplaces map[string]MarketplaceSource `json:"marketplaces"`
// contains filtered or unexported fields
}
MarketplaceRegistry stores configured marketplace sources.
func LoadDefaultMarketplaceRegistry ¶ added in v0.30.2
func LoadDefaultMarketplaceRegistry() (*MarketplaceRegistry, error)
LoadDefaultMarketplaceRegistry reads the user's marketplace registry.
func LoadMarketplaceRegistry ¶ added in v0.30.2
func LoadMarketplaceRegistry(path string) (*MarketplaceRegistry, error)
LoadMarketplaceRegistry reads a marketplace registry from path.
func (*MarketplaceRegistry) Add ¶ added in v0.30.2
func (r *MarketplaceRegistry) Add(source MarketplaceSource) error
func (*MarketplaceRegistry) Get ¶ added in v0.30.2
func (r *MarketplaceRegistry) Get(name string) (MarketplaceSource, bool)
func (*MarketplaceRegistry) List ¶ added in v0.30.2
func (r *MarketplaceRegistry) List() []MarketplaceSource
func (*MarketplaceRegistry) Remove ¶ added in v0.30.2
func (r *MarketplaceRegistry) Remove(name string) error
func (*MarketplaceRegistry) Save ¶ added in v0.30.2
func (r *MarketplaceRegistry) Save() error
type MarketplaceSource ¶ added in v0.30.2
type MarketplaceSource struct {
Name string `json:"name"`
Source string `json:"source"`
AutoUpdate bool `json:"autoUpdate,omitempty"`
}
MarketplaceSource records a configured plugin marketplace catalog source.
type Registry ¶
type Registry struct {
Plugins map[string]RegistryEntry `json:"plugins"`
// contains filtered or unexported fields
}
Registry tracks installed plugins in ~/.ratchet/plugins/registry.json.
func (*Registry) Add ¶
func (r *Registry) Add(name string, entry RegistryEntry) error
Add inserts or replaces a plugin entry and saves.
func (*Registry) Get ¶
func (r *Registry) Get(name string) (RegistryEntry, bool)
Get retrieves a plugin entry by name.
func (*Registry) Put ¶ added in v0.30.2
func (r *Registry) Put(name string, entry RegistryEntry) error
type RegistryEntry ¶
type RegistryEntry struct {
Source string `json:"source"` // "github:org/repo" or "local:/path"
Version string `json:"version"`
InstalledAt time.Time `json:"installed_at"`
Path string `json:"path"`
Enabled bool `json:"enabled"`
}
RegistryEntry records an installed plugin.
func (*RegistryEntry) UnmarshalJSON ¶ added in v0.30.2
func (e *RegistryEntry) UnmarshalJSON(data []byte) error