feat(pluginmgr): 插件更新接口(upgrade/downgrade 保留配置)+ skill_install overwrite

内核 Registry 拆出 StopAndUnload:
- 停止并从注册表移除插件但保留 config_<name> 表
- 不触发 onRemove 回调(那是删除专用语义)
- RemovePlugin 改为追加清理配置表示清除,更新场景调 StopAndUnload

pluginmgr:
- installFromData/installFromURL/installFromPath 加 overwrite 参数
- 已存在+overwrite=true:StopAndUnload→备份旧目录→解压新包→失败回滚→
  返回 action=upgraded/downgraded/reinstalled+previous_version+config_kept
- 已存在+overwrite=false:返回 error+hint(指向 overwrite 用法)
- cmpVersion 点分版本号数字比较(非字典序)
- 测试覆盖:首次安装→重装拒绝→升级保留配置→降级→失败回滚

skill_install 加 overwrite 参数:
- 同名技能存在时先卸载旧实例+删除目录再安装新包

SDK PluginMgr 接口同步加 StopAndUnload(name string) error

工具链 plugindev 已重建到 /usr/local/bin(7/29→8/25 版本)
QQ 插件诊断日志版(webhook recv 到达+isAtBot 失败日志)已打包并
通过 upgrade 接口热更新部署,配置保留验证通过。
This commit is contained in:
JianFeeeee
2026-08-25 22:02:17 +08:00
parent 5f126d4d10
commit ae42e486de
17 changed files with 3752 additions and 28 deletions

View File

@ -75,8 +75,12 @@ type PluginManager interface {
DisablePlugin(name, by string) error
EnablePlugin(name string) error
// RemovePlugin 卸载插件:先停止(stop handlers + Stop),再执行插件注册的
// onRemove 回调(RegisterOnRemoveHandler),最后从注册表移除。目录删除由调用方负责。
// onRemove 回调(RegisterOnRemoveHandler),最后从注册表移除并清理配置表。
// 目录删除由调用方负责。
RemovePlugin(name string) error
// StopAndUnload 停止并从注册表移除插件但保留配置表,供更新/升级流程使用:
// 换产物不动配置,重装后配置原样生效。不触发 onRemove 回调。
StopAndUnload(name string) error
ReloadPlugins() (string, error)
// ReloadOne 重载单个插件(停止后重新加载,处理 dlclose/dynamic 句柄)。
ReloadOne(name string) error