- 四组并行完成:main/wire*.go、wire_capacity|channels|runtime、channels|persona_*|emotion|observability、 voice|plugins|stream|skills|vision|subagent_tool|extractor|mcp|sessionread_tool|terminal_tool。 - 机械校验(git diff -U0 去 // 行与空行)仅剩 wire_frontend.go:84 一处行尾注释:代码前缀 「\ta.gw = gw 」经 cat -A 与 HEAD 逐字节比对一致(allow 清单已声明)。 - 验收:隔离 worktree(HEAD + 本批 patch)go build/vet 绿、全树 58 包 ok、 linux/amd64 + darwin/arm64 交叉编译绿;gofmt -l 干净。 - 备注:整树两次红均为负载敏感 flake(backthink / orchestration 的 timeout 类用例单独 -count=20 全过)。
20 lines
830 B
Go
20 lines
830 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
|
|
pluginmgr "git.yeij.top/AskaEth/Cyrene_v2/internal/capability/plugin"
|
|
"git.yeij.top/AskaEth/Cyrene_v2/internal/config/runtimeconfig"
|
|
"git.yeij.top/AskaEth/Cyrene_v2/internal/logger"
|
|
)
|
|
|
|
// wirePlugins 在能力注册表与被 gitignore 的 plugins.json 之上构建运行时插件管理器,
|
|
// 再恢复每个已持久化的 MCP server,使已安装的插件在重启后依然存在。启动时连不上的
|
|
// server 只记日志并保留在 plugins.json 中(主人可重试或卸载它);启动绝不因某个
|
|
// 外部 server 不可用而失败。
|
|
func (a *app) wirePlugins(ctx context.Context) {
|
|
path := runtimeconfig.DefaultPluginsPath(resolveDataDir(a.cfg))
|
|
a.plugins = pluginmgr.NewManager(a.caps, path, logger.WithSource(a.log, "capability/plugin"))
|
|
a.plugins.Restore(ctx)
|
|
}
|