Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildCoordinator ¶
func BuildCoordinator( cfg bootstrap.Config, store *store.Store, models *bootstrap.ModelSet, bundle assets.Bundle, recordUsage UsageRecorder, ) (*agentcore.Agent, *tools.AskUserTool, *ctxpack.WriterRestorePack, *corecontext.ContextEngine)
BuildCoordinator 组装 Coordinator Agent 及其 SubAgent。 返回 Agent、AskUserTool、WriterRestorePack 以及 Coordinator 的 ContextEngine 引用——Host 层 /model 切换时需要直接调 SetContextWindow + SetReserveTokens 联动新模型的窗口(writer/architect/editor 走 ContextManagerFactory 自动重建, 不需要 ref;只有常驻的 coordinator 需要)。 Host 层通过 Agent.Subscribe 获取事件流,不再需要 emit 回调。
Types ¶
type UsageRecorder ¶
type UsageRecorder func(agentName string, msg agentcore.AgentMessage)
UsageRecorder 是 BuildCoordinator 可选的用量回调;签名与 OnMessage 一致, 每条 agent 消息都会调一次,由 Host 层负责聚合。nil 表示不追踪。
Click to show internal directories.
Click to hide internal directories.