plugins

package
v0.0.0-...-c5791a9 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0

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

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.

func (*Plugin) Execute

func (p *Plugin) Execute(args ...string) (string, error)

Execute runs a plugin with the given arguments.

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 NewRegistry

func NewRegistry() *Registry

NewRegistry creates an empty plugin registry.

func (*Registry) All

func (r *Registry) All() []*Plugin

All returns all discovered plugins.

func (*Registry) FormatList

func (r *Registry) FormatList() string

FormatList returns a formatted string listing all plugins.

func (*Registry) Get

func (r *Registry) Get(name string) *Plugin

Get returns a plugin by name.

func (*Registry) LoadDir

func (r *Registry) LoadDir(dir string) error

LoadDir discovers plugins in the given directory. Plugins are executable files (scripts or binaries).

Jump to

Keyboard shortcuts

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