Documentation
¶
Overview ¶
Package plugins provides a plugin registry and hook system for Forge.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentConfig ¶
type AgentConfig struct {
Name string
Description string
Tools []ToolDefinition
Identity *IdentityConfig
Model *PluginModelConfig
Extra map[string]any
}
AgentConfig is the intermediate representation from a FrameworkPlugin.
type FrameworkPlugin ¶
type FrameworkPlugin interface {
Name() string
DetectProject(dir string) (bool, error)
ExtractAgentConfig(dir string) (*AgentConfig, error)
GenerateWrapper(config *AgentConfig) ([]byte, error)
RuntimeDependencies() []string
}
FrameworkPlugin adapts a specific agent framework to the Forge build pipeline.
type FrameworkRegistry ¶
type FrameworkRegistry struct {
// contains filtered or unexported fields
}
FrameworkRegistry holds framework plugins in registration order.
func NewFrameworkRegistry ¶
func NewFrameworkRegistry() *FrameworkRegistry
NewFrameworkRegistry creates an empty FrameworkRegistry.
func (*FrameworkRegistry) Detect ¶
func (r *FrameworkRegistry) Detect(dir string) (FrameworkPlugin, error)
Detect iterates plugins in registration order and returns the first whose DetectProject returns true. Returns nil if no plugin matches.
func (*FrameworkRegistry) Get ¶
func (r *FrameworkRegistry) Get(name string) FrameworkPlugin
Get returns a plugin by name, or nil if not found.
func (*FrameworkRegistry) Register ¶
func (r *FrameworkRegistry) Register(p FrameworkPlugin)
Register appends a framework plugin to the registry.
type IdentityConfig ¶
IdentityConfig holds agent identity metadata extracted by a plugin.
type Plugin ¶
type Plugin interface {
// Name returns the unique plugin name.
Name() string
// Version returns the plugin version.
Version() string
// Init initialises the plugin with arbitrary configuration.
Init(config map[string]any) error
// Hooks returns the set of hook points this plugin wants to intercept.
Hooks() []HookPoint
// Execute runs the plugin logic for the given hook point.
Execute(ctx context.Context, hook HookPoint, data map[string]any) error
}
Plugin is the interface that Forge plugins must implement.
type PluginModelConfig ¶
PluginModelConfig holds model info extracted by a plugin.