Daemon plugins (Yaegi-interpreted .go files) are now loaded from the configured plugin_dir at startup. Each file must export a 'Plugin' variable using the _Plugin wrapper struct, which bridges Yaegi types to the Go plugin.Plugin interface. Changes: - internal/plugin/pluginextract/ — generated Yaegi symbol table for the plugin package (mirrors wfextract pattern), including the _Plugin interface wrapper that lets interpreted code implement Go interfaces - LoadDir now accepts optional symbol tables via variadic parameter, avoiding an import cycle between plugin and pluginextract - Plugin tests rewritten as behavioral (not structural), verifying actual Yaegi interpretation of valid, invalid, and missing plugins - config.PluginDir field for specifying the plugin directory - daemon.PluginRegistry field for holding loaded plugins - main.go wires plugin loading: LoadDir at startup, register into daemon, log each loaded plugin Why: the Plugin interface and LoadDir existed but weren't connected to the daemon. Skills define workflows; daemon plugins are the extension point for forge resolvers, storage backends, and other core-daemon concerns.
37 lines
1.1 KiB
Go
37 lines
1.1 KiB
Go
// Code generated by 'yaegi extract github.com/samcharles93/archie-core/internal/plugin'. DO NOT EDIT.
|
|
|
|
package pluginextract
|
|
|
|
import (
|
|
"github.com/samcharles93/archie-core/internal/plugin"
|
|
"reflect"
|
|
)
|
|
|
|
func init() {
|
|
Symbols["github.com/samcharles93/archie-core/internal/plugin/plugin"] = map[string]reflect.Value{
|
|
// function, constant and variable definitions
|
|
"LoadDir": reflect.ValueOf(plugin.LoadDir),
|
|
|
|
// type definitions
|
|
"Plugin": reflect.ValueOf((*plugin.Plugin)(nil)),
|
|
"Registry": reflect.ValueOf((*plugin.Registry)(nil)),
|
|
|
|
// interface wrapper definitions
|
|
"_Plugin": reflect.ValueOf((*_github_com_samcharles93_archie_core_internal_plugin_Plugin)(nil)),
|
|
}
|
|
}
|
|
|
|
// _github_com_samcharles93_archie_core_internal_plugin_Plugin is an interface wrapper for Plugin type
|
|
type _github_com_samcharles93_archie_core_internal_plugin_Plugin struct {
|
|
IValue interface{}
|
|
WName func() string
|
|
WVersion func() string
|
|
}
|
|
|
|
func (W _github_com_samcharles93_archie_core_internal_plugin_Plugin) Name() string {
|
|
return W.WName()
|
|
}
|
|
func (W _github_com_samcharles93_archie_core_internal_plugin_Plugin) Version() string {
|
|
return W.WVersion()
|
|
}
|