feat: restructure plugin system, add Lua plugin support, update docs

This commit is contained in:
JianFeeeee
2026-07-13 21:48:13 +08:00
parent e49bdca9ff
commit 950090959f
44 changed files with 3098 additions and 1097 deletions

View File

@ -41,6 +41,7 @@ var (
)
func init() {
plugin.RegisterPluginMeta("pluginmgr", "插件管理", "Plugin Manager")
plugin.RegisterFactory("pluginmgr", func(name string, config map[string]interface{}) (sdk.Plugin, error) {
return New(name), nil
})
@ -504,7 +505,7 @@ func validatePackage(data []byte) (*pluginPackage, error) {
return nil, fmt.Errorf("entry %q not found in package", pkg.Entry)
}
valid := map[string]bool{"plugin.so": true, "main.lua": true, "SKILL.md": true}
valid := map[string]bool{"plugin.so": true, "plugin.dll": true, "main.lua": true, "SKILL.md": true}
if !valid[pkg.Entry] {
return nil, fmt.Errorf("unsupported entry: %q", pkg.Entry)
}