Files
nodeagent/docs/sequence-diagram.mermaid
T
jkooe a7827ba986 docs: 增量 PRD / ARCH 与设计图入库(v2.1.0 全面完善)
本轮「全面完善」的四份设计产出此前后在 git 外(untracked)——
阶段 3 实现所依据的需求/架构/类图/时序图随收口一并入库,
使「代码 ← 设计」的引用链在仓库内闭环(代码注释已按 ARCH 任务号引用)。
2026-10-26 01:01:32 +08:00

22 lines
921 B
Plaintext
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.
sequenceDiagram
participant CLI as 控制端 (CLI/MCP/console)
participant S as agent server.ts
participant SU as selfupdate.ts
participant PX as net/proxy.ts
participant NET as node:http/https
CLI->>S: invoke system.agent.update {url, sha256, timeout_ms}
S->>SU: agentUpdate(args)
SU->>PX: resolveProxy({targetUrl: url})
PX->>PX: NA_PROXY → env → 系统代理(reg/scutil)
PX-->>SU: {proxy, source, notes}
SU->>PX: httpGet(url, {proxy, timeoutMs})
PX->>NET: CONNECT 隧道 / 绝对形态 / 直连
NET-->>PX: 响应字节流(链共享 AbortController)
PX-->>SU: {status, body}
SU->>SU: sha256 校验(不符→丢弃,不落盘)
SU->>SU: 备份 → 就地覆写 → 写后校验(不符→回滚)
SU->>S: agentRestart({delay_ms:1500})
SU-->>S: {updated, via, proxy, proxy_source, incoming_hash, ...}
S-->>CLI: {status:'ok', data}