Files
mulit-agent/controller/docs/steps/04-通信与Agent注册.md
T

10 lines
838 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 04:通信与 Agent 注册
1. 实现 `CommunicationService`:HTTP 客户端、WebSocket 客户端、连接状态、超时、退避重连、确认和去重。
2. 实现注册/撤销、凭据签发、`agent.hello`、心跳和能力同步用例;将在线判定和最后活动时间持久化。
3. 定义 `AgentLifecyclePort`,提供本地、Docker、远程等适配器接口;首版可先实现远程连接适配器。
4. 将网络事件转换为 Go 应用层状态,React 前端通过定时查询或受控事件订阅更新 ViewModel;网络 goroutine 不得直接访问 WebView。
5. 加入连接诊断页所需的最近错误、延迟、协议版本和重连次数数据。
验收:可在不重启 UI 的情况下注册、断开、重连和撤销测试 Agent;重复心跳和乱序事件不会错误覆盖较新的状态。