plugins

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildNodeType

func BuildNodeType(kind pluginapi.NodeKind, pluginID string, nodeID string) string

func IsPluginNodeType

func IsPluginNodeType(nodeType string) bool

func ParseNodeType

func ParseNodeType(nodeType string) (pluginapi.NodeKind, string, string, bool)

func PluginTriggerExecutionContext

func PluginTriggerExecutionContext(subscriptionID string, payload any) map[string]any

func ResolveDirectory

func ResolveDirectory(explicit string, hints ...string) (string, error)

ResolveDirectory returns the plugin root directory. It prefers an explicit value and otherwise walks upward from the provided hints until it finds a parent that contains a .agents directory.

Types

type ActionExecutor

type ActionExecutor struct {
	Manager  *Manager
	NodeType string
	Outputs  []pluginapi.OutputHandle
}

func (*ActionExecutor) Execute

func (e *ActionExecutor) Execute(ctx context.Context, config json.RawMessage, input map[string]any) (*node.NodeResult, error)

func (*ActionExecutor) Validate

func (e *ActionExecutor) Validate(config json.RawMessage) error

type BundleStatus

type BundleStatus struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Version     string `json:"version,omitempty"`
	Description string `json:"description,omitempty"`
	Path        string `json:"path"`
	Healthy     bool   `json:"healthy"`
	Error       string `json:"error,omitempty"`
	NodeCount   int    `json:"node_count"`
}

type Manager

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

func NewManager

func NewManager(root string, enabled ...bool) *Manager

func (*Manager) Binding

func (m *Manager) Binding(nodeType string) (NodeBinding, bool)

func (*Manager) Bindings

func (m *Manager) Bindings() []NodeBinding

func (*Manager) ExecuteAction

func (m *Manager) ExecuteAction(ctx context.Context, nodeType string, config json.RawMessage, input map[string]any) (any, error)

func (*Manager) ExecuteTool

func (m *Manager) ExecuteTool(ctx context.Context, nodeType string, config json.RawMessage, args json.RawMessage, input map[string]any) (any, error)

func (*Manager) OpenTriggerRuntime

func (m *Manager) OpenTriggerRuntime(ctx context.Context, pluginID string) (pluginapi.TriggerRuntime, func(), error)

func (*Manager) Refresh

func (m *Manager) Refresh(ctx context.Context) error

func (*Manager) Root

func (m *Manager) Root() string

func (*Manager) Statuses

func (m *Manager) Statuses() []BundleStatus

func (*Manager) Stop

func (m *Manager) Stop()

func (*Manager) ToolDefinition

func (m *Manager) ToolDefinition(ctx context.Context, nodeType string, meta pluginapi.ToolNodeMetadata, config json.RawMessage) (*pluginapi.ToolDefinition, error)

func (*Manager) ValidateConfig

func (m *Manager) ValidateConfig(ctx context.Context, nodeType string, config json.RawMessage) error

type Manifest

type Manifest struct {
	ID          string            `json:"id"`
	Name        string            `json:"name"`
	Version     string            `json:"version,omitempty"`
	Description string            `json:"description,omitempty"`
	Executable  string            `json:"executable"`
	Args        []string          `json:"args,omitempty"`
	Env         map[string]string `json:"env,omitempty"`
	Path        string            `json:"-"`
	Dir         string            `json:"-"`
}

type NodeBinding

type NodeBinding struct {
	Type       string             `json:"type"`
	PluginID   string             `json:"plugin_id"`
	PluginName string             `json:"plugin_name"`
	Kind       pluginapi.NodeKind `json:"kind"`
	Spec       pluginapi.NodeSpec `json:"spec"`
	Manifest   Manifest           `json:"-"`
}

type ToolExecutor

type ToolExecutor struct {
	Manager  *Manager
	NodeType string
}

func (*ToolExecutor) Execute

func (e *ToolExecutor) Execute(ctx context.Context, config json.RawMessage, input map[string]any) (*node.NodeResult, error)

func (*ToolExecutor) ExecuteTool

func (e *ToolExecutor) ExecuteTool(ctx context.Context, config json.RawMessage, args json.RawMessage, input map[string]any) (any, error)

func (*ToolExecutor) ToolDefinition

func (e *ToolExecutor) ToolDefinition(ctx context.Context, meta node.ToolNodeMetadata, config json.RawMessage) (*llm.ToolDefinition, error)

func (*ToolExecutor) Validate

func (e *ToolExecutor) Validate(config json.RawMessage) error

type TriggerEventHandler

type TriggerEventHandler func(ctx context.Context, subscription pluginapi.TriggerSubscription, event *pluginapi.TriggerEvent) error

type TriggerExecutor

type TriggerExecutor struct {
	Manager  *Manager
	NodeType string
}

func (*TriggerExecutor) Execute

func (e *TriggerExecutor) Execute(_ context.Context, _ json.RawMessage, input map[string]any) (*node.NodeResult, error)

func (*TriggerExecutor) Validate

func (e *TriggerExecutor) Validate(config json.RawMessage) error

type TriggerRuntimeService

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

func NewTriggerRuntimeService

func NewTriggerRuntimeService(manager *Manager, onEvent TriggerEventHandler) *TriggerRuntimeService

func (*TriggerRuntimeService) Reload

func (s *TriggerRuntimeService) Reload(ctx context.Context, subscriptions []pluginapi.TriggerSubscription) error

func (*TriggerRuntimeService) Stop

func (s *TriggerRuntimeService) Stop()

Jump to

Keyboard shortcuts

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