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.
11 lines
446 B
Go
11 lines
446 B
Go
// Package pluginextract holds the Yaegi symbol table for internal/plugin,
|
|
// generated by `go generate`. Kept separate from internal/plugin itself
|
|
// so the generated file can import it without a self-import cycle.
|
|
package pluginextract
|
|
|
|
import "reflect"
|
|
|
|
//go:generate go run github.com/traefik/yaegi/cmd/yaegi extract -name pluginextract github.com/samcharles93/archie-core/internal/plugin
|
|
|
|
var Symbols = map[string]map[string]reflect.Value{}
|