feat(plugins): 面板动作执行器接线 —— 动作真可用,不再 501 兜底(L1)
- 插件管理器加生产动作处理器登记面(RegisterActions);未登记处理器/未声明动作仍 404 - web-search 四个动作真读写真源 + 真发 HTTP 探针:plugin.listProviders/saveProvider/ testProvider/reauthProvider(配置落 $DATA_DIR/config/plugins/web-search.json,0600) - 失败回结构化错误码(不含上游原文)+ 审计带 code 字段;501 文案改为「未登记处理器」 - 拆出 panelactions.go(动作索引推导/OptionsActionName/三闸门分发),panels.go 519→347 行 缺口(如实):面板保存后运行中的工具**不热重载**(下一片做);声明面缺 primary/fallback (按 DECISIONS-2026-10-06 #1/#2 补)。
This commit is contained in:
1 parent
a150211468
commit
2e1c3ed3fd
13 files changed
+2043
-204
No files matched your search
+29
-21
@@ -69,24 +69,24 @@ func (a *app) wireFrontend() error {
|
||||
tidyDryRunner = a.memoryTidy
|
||||
}
|
||||
gw, err := gateway.New(a.cfg, gateway.Deps{
|
||||
Log: logger.WithSource(a.log, "gateway"),
|
||||
Auth: jwt,
|
||||
Bus: a.bus,
|
||||
Registry: a.caps,
|
||||
Loop: a.loop,
|
||||
Session: a.sessions,
|
||||
Personas: a.personas,
|
||||
Memories: a.memStore,
|
||||
History: a.history,
|
||||
IoT: a.iot,
|
||||
Scheduler: a.scheduler,
|
||||
Tasks: a.tasks,
|
||||
Automations: a.automation,
|
||||
Users: apiKeys,
|
||||
Refresh: refreshStore,
|
||||
Backthink: a.backthink,
|
||||
RAG: ragStore,
|
||||
LLM: a.llm,
|
||||
Log: logger.WithSource(a.log, "gateway"),
|
||||
Auth: jwt,
|
||||
Bus: a.bus,
|
||||
Registry: a.caps,
|
||||
Loop: a.loop,
|
||||
Session: a.sessions,
|
||||
Personas: a.personas,
|
||||
Memories: a.memStore,
|
||||
History: a.history,
|
||||
IoT: a.iot,
|
||||
Scheduler: a.scheduler,
|
||||
Tasks: a.tasks,
|
||||
Automations: a.automation,
|
||||
Users: apiKeys,
|
||||
Refresh: refreshStore,
|
||||
Backthink: a.backthink,
|
||||
RAG: ragStore,
|
||||
LLM: a.llm,
|
||||
// EnvPath 与 main.go 启动时 config.Load(envPath) 用同一条路径:面板
|
||||
// 「重置为 env 默认」(切片 R1)按既有解析入口重读同一份 `.env` 声明,
|
||||
// 网关自己不 fopen `.env`。
|
||||
@@ -164,7 +164,9 @@ func (a *app) wireFrontend() error {
|
||||
}
|
||||
|
||||
// wirePanelHub 给已构造的插件管理器接上面板声明中枢,并把它接到既有进程内 bus 的
|
||||
// `ws.panels_changed` 上(design/09 §5.2.1;切片 PLG-2)。
|
||||
// `ws.panels_changed` 上(design/09 §5.2.1;切片 PLG-2)。之后再把内置插件的**动作
|
||||
// 处理器**登记到管理器上(切片 L1/PLG-2 的执行面接线):没有这一步,面板的每个动作都
|
||||
// 只能诚实回 501(声明在、没人执行)。
|
||||
//
|
||||
// 三条约束都在这里落地:
|
||||
// - **不新开端口**:热更新信号只走进程内 bus(hub 订阅 ws.> ⇒ 帧类型 panels_changed),
|
||||
@@ -177,7 +179,8 @@ func wirePanelHub(a *app) {
|
||||
if a.plugins == nil {
|
||||
return
|
||||
}
|
||||
hub, err := pluginmgr.NewPanels(logger.WithSource(a.log, "capability/plugin/panels"))
|
||||
log := logger.WithSource(a.log, "capability/plugin/panels")
|
||||
hub, err := pluginmgr.NewPanels(log)
|
||||
if err != nil {
|
||||
a.log.Warn("panel hub unavailable, plugin panel endpoints will answer 501", "error", err)
|
||||
return
|
||||
@@ -194,7 +197,12 @@ func wirePanelHub(a *app) {
|
||||
}
|
||||
})
|
||||
a.plugins.AttachPanels(hub)
|
||||
declareBuiltinPanels(hub, logger.WithSource(a.log, "capability/plugin/panels"))
|
||||
declareBuiltinPanels(hub, log)
|
||||
// 登记动作处理器必须在**声明之后**:登记期会核对「登记的处理器有没有对应声明」,
|
||||
// 顺序反过来只会得到一串「声明还没到」的 WARN。
|
||||
// 日志来源另标一处(动作接线 ≠ 面板中枢):`source=cmd/cyrene/wire_plugin_actions`
|
||||
// 让「谁登记了哪些动作 / 哪些声明没人实现」能在日志里独立定位。
|
||||
wireBuiltinPluginActions(a.plugins, hub, a, logger.WithSource(a.log, actionWireLogSource))
|
||||
}
|
||||
|
||||
// declareBuiltinPanels 把**编译进二进制的内置插件**的面板声明交给中枢
|
||||
|
||||
Reference in new issue
Block a user