Documentation
¶
Overview ¶
Package plugins provides plugin discovery and loading for Claudio. Plugins are executable scripts or binaries in ~/.claudio/plugins/ that extend Claudio with custom commands and tools.
Index ¶
- func LoadLspConfigs(pluginDir string) map[string]config.LspServerConfig
- func LoadLuaLspConfigs(lspDir string) map[string]config.LspServerConfig
- type Plugin
- type PluginProxyTool
- func (t *PluginProxyTool) Description() string
- func (t *PluginProxyTool) Execute(ctx context.Context, input json.RawMessage) (*tools.Result, error)
- func (t *PluginProxyTool) InputSchema() json.RawMessage
- func (t *PluginProxyTool) IsReadOnly() bool
- func (t *PluginProxyTool) Name() string
- func (t *PluginProxyTool) PluginInstructions() string
- func (t *PluginProxyTool) RequiresApproval(_ json.RawMessage) bool
- func (d PluginProxyTool) SearchHint() string
- func (d PluginProxyTool) ShouldDefer() bool
- type Registry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadLspConfigs ¶
func LoadLspConfigs(pluginDir string) map[string]config.LspServerConfig
LoadLspConfigs discovers *.lsp.json files in the plugins directory and returns the merged LSP server configs. Each file should contain a JSON object mapping server names to LspServerConfig.
func LoadLuaLspConfigs ¶
func LoadLuaLspConfigs(lspDir string) map[string]config.LspServerConfig
LoadLuaLspConfigs discovers *.lua files in lspDir (~/.claudio/lsp/) and returns the merged LSP server configs. Each file must return a table:
return {
gopls = { command="gopls", args={"serve"}, extensions={".go",".mod"} }
}
Types ¶
type Plugin ¶
type Plugin struct {
Name string // Derived from filename
Path string // Absolute path to the executable
Description string // From --describe flag or first line of output
Schema json.RawMessage // From --schema flag (nil = use generic fallback)
Instructions string // From --instructions flag (markdown for system prompt)
IsScript bool // True if it's a script (not compiled binary)
}
Plugin represents a discovered plugin.
type PluginProxyTool ¶
type PluginProxyTool struct {
PluginName string
PluginPath string
Desc string
Instructions string
OutputFilterEnabled bool
FilterRecorder func(cmd string, bytesIn, bytesOut int)
// contains filtered or unexported fields
}
PluginProxyTool wraps a plugin executable as a tools.Tool implementation.
func NewProxyTool ¶
func NewProxyTool(p *Plugin) *PluginProxyTool
NewProxyTool creates a PluginProxyTool from a discovered Plugin.
func (*PluginProxyTool) Description ¶
func (t *PluginProxyTool) Description() string
func (*PluginProxyTool) Execute ¶
func (t *PluginProxyTool) Execute(ctx context.Context, input json.RawMessage) (*tools.Result, error)
func (*PluginProxyTool) InputSchema ¶
func (t *PluginProxyTool) InputSchema() json.RawMessage
func (*PluginProxyTool) IsReadOnly ¶
func (t *PluginProxyTool) IsReadOnly() bool
func (*PluginProxyTool) Name ¶
func (t *PluginProxyTool) Name() string
func (*PluginProxyTool) PluginInstructions ¶
func (t *PluginProxyTool) PluginInstructions() string
PluginInstructions returns the plugin's markdown instructions for lazy delivery via ToolSearch.
func (*PluginProxyTool) RequiresApproval ¶
func (t *PluginProxyTool) RequiresApproval(_ json.RawMessage) bool
func (PluginProxyTool) SearchHint ¶
func (d PluginProxyTool) SearchHint() string
func (PluginProxyTool) ShouldDefer ¶
func (d PluginProxyTool) ShouldDefer() bool
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds all discovered plugins.
func (*Registry) FormatList ¶
FormatList returns a formatted string listing all plugins.