plugin

package
v0.7.1-restored Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Handshake = plugin.HandshakeConfig{
	ProtocolVersion:  1,
	MagicCookieKey:   "LUCIEN_PLUGIN",
	MagicCookieValue: "lucien_neural_interface",
}

Handshake configuration for plugins

Functions

func CreatePluginTemplate

func CreatePluginTemplate(pluginDir, name string) error

CreatePluginTemplate creates a basic plugin template

Types

type AgentCommand

type AgentCommand struct {
	Name        string
	ScriptPath  string
	Description string
}

AgentCommand represents an agent command configuration

type Bridge

type Bridge struct {
	// contains filtered or unexported fields
}

Bridge handles Python agent command execution

func NewBridge

func NewBridge(pluginDir string) (*Bridge, error)

NewBridge creates a new plugin bridge

func (*Bridge) ExecuteWithTimeout

func (b *Bridge) ExecuteWithTimeout(command string, args []string, timeout time.Duration) (string, error)

ExecuteWithTimeout runs an agent command with a timeout

func (*Bridge) GetAvailableAgents

func (b *Bridge) GetAvailableAgents() []AgentCommand

GetAvailableAgents returns a list of available agent commands

func (*Bridge) IsAgentCommand

func (b *Bridge) IsAgentCommand(command string) bool

IsAgentCommand checks if a command is an agent command

func (*Bridge) RunAgentCommand

func (b *Bridge) RunAgentCommand(command string, args []string) (string, error)

RunAgentCommand executes a Python agent command and returns the output

type Info

type Info struct {
	Name         string            `json:"name"`
	Version      string            `json:"version"`
	Description  string            `json:"description"`
	Author       string            `json:"author"`
	Capabilities []string          `json:"capabilities"`
	Config       map[string]string `json:"config"`
}

Info contains plugin metadata

type LoadedPlugin

type LoadedPlugin struct {
	// contains filtered or unexported fields
}

LoadedPlugin represents a loaded plugin instance

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager handles plugin lifecycle and execution

func New

func New(pluginDir string) *Manager

New creates a new plugin manager

func (*Manager) ExecutePlugin

func (m *Manager) ExecutePlugin(pluginName, command string, args []string) (*Result, error)

ExecutePlugin executes a command in the specified plugin with security validation

func (*Manager) GetPlugin

func (m *Manager) GetPlugin(name string) (*Info, error)

GetPlugin returns information about a specific plugin

func (*Manager) ListPlugins

func (m *Manager) ListPlugins() map[string]*Info

ListPlugins returns information about all loaded plugins

func (*Manager) LoadPlugins

func (m *Manager) LoadPlugins() error

LoadPlugins discovers and loads all plugins from the plugin directory

func (*Manager) UnloadAllPlugins

func (m *Manager) UnloadAllPlugins()

UnloadAllPlugins unloads all plugins

func (*Manager) UnloadPlugin

func (m *Manager) UnloadPlugin(name string) error

UnloadPlugin unloads a specific plugin

type Manifest

type Manifest struct {
	Name         string            `json:"name"`
	Version      string            `json:"version"`
	Description  string            `json:"description"`
	Author       string            `json:"author"`
	Executable   string            `json:"executable"`
	Capabilities []string          `json:"capabilities"`
	Config       map[string]string `json:"config"`
	Dependencies []string          `json:"dependencies"`
}

Manifest describes a plugin's configuration

type PluginInterface

type PluginInterface interface {
	Execute(ctx context.Context, command string, args []string) (*Result, error)
	GetInfo() (*Info, error)
	Initialize(config map[string]interface{}) error
}

PluginInterface defines the interface that all Lucien plugins must implement

type PluginRPC

type PluginRPC struct {
	// contains filtered or unexported fields
}

Plugin RPC implementation

func (*PluginRPC) Execute

func (p *PluginRPC) Execute(ctx context.Context, command string, args []string) (*Result, error)

RPC method implementations

func (*PluginRPC) GetInfo

func (p *PluginRPC) GetInfo() (*Info, error)

func (*PluginRPC) Initialize

func (p *PluginRPC) Initialize(config map[string]interface{}) error

type PluginRPCPlugin

type PluginRPCPlugin struct{}

RPC Plugin implementation

func (*PluginRPCPlugin) Client

func (p *PluginRPCPlugin) Client(broker *plugin.MuxBroker, c *rpc.Client) (interface{}, error)

func (*PluginRPCPlugin) Server

func (p *PluginRPCPlugin) Server(broker *plugin.MuxBroker) (interface{}, error)

type PluginRPCServer

type PluginRPCServer struct {
}

func (*PluginRPCServer) Execute

func (s *PluginRPCServer) Execute(req map[string]interface{}, resp *Result) error

Server RPC methods - simplified for demo

func (*PluginRPCServer) GetInfo

func (s *PluginRPCServer) GetInfo(req interface{}, resp *Info) error

func (*PluginRPCServer) Initialize

func (s *PluginRPCServer) Initialize(config map[string]interface{}, resp *interface{}) error

type Result

type Result struct {
	Output   string                 `json:"output"`
	Error    string                 `json:"error,omitempty"`
	ExitCode int                    `json:"exit_code"`
	Data     map[string]interface{} `json:"data,omitempty"`
}

Result contains plugin execution results

Jump to

Keyboard shortcuts

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