plugins

package
v1.38.9 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecutablePlugin

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

ExecutablePlugin é a implementação concreta para binários externos.

func (*ExecutablePlugin) Description

func (p *ExecutablePlugin) Description() string

func (*ExecutablePlugin) Execute

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

Execute invoca o binário do plugin, captura sua saída e trata erros.

func (*ExecutablePlugin) Name

func (p *ExecutablePlugin) Name() string

func (*ExecutablePlugin) Path

func (p *ExecutablePlugin) Path() string

func (*ExecutablePlugin) Schema added in v1.38.6

func (p *ExecutablePlugin) Schema() string

func (*ExecutablePlugin) Usage

func (p *ExecutablePlugin) Usage() string

func (*ExecutablePlugin) Version

func (p *ExecutablePlugin) Version() string

type Manager

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

Manager descobre, carrega e gerencia o ciclo de vida dos plugins.

func NewManager

func NewManager(logger *zap.Logger) (*Manager, error)

func (*Manager) Close

func (m *Manager) Close()

Close encerra o watcher de arquivos de forma segura.

func (*Manager) GetPlugin

func (m *Manager) GetPlugin(name string) (Plugin, bool)

func (*Manager) GetPlugins

func (m *Manager) GetPlugins() []Plugin

func (*Manager) PluginsDir

func (m *Manager) PluginsDir() string

PluginsDir retorna o diretório onde os plugins estão instalados.

func (*Manager) Reload

func (m *Manager) Reload()

Reload limpa e recarrega todos os plugins do diretório de plugins.

type Metadata

type Metadata struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Usage       string `json:"usage"`
	Version     string `json:"version"`
}

Metadata é a estrutura de descoberta que todo plugin DEVE fornecer via --metadata.

type Plugin

type Plugin interface {
	Name() string
	Description() string
	Usage() string
	Version() string
	Path() string // Expõe o caminho do executável para inspeção.
	Schema() string
	Execute(ctx context.Context, args []string) (string, error)
}

Plugin define a interface para qualquer plugin executável pelo ChatCLI.

func NewPluginFromPath

func NewPluginFromPath(path string) (Plugin, error)

NewPluginFromPath valida um arquivo executável e o carrega como um plugin.

Jump to

Keyboard shortcuts

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