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

69 lines
2.3 KiB
Plaintext

classDiagram
class ProxyModule {
<<module apps/agent/src/net/proxy.ts>>
+normalizeProxyUrl(raw) URL|null
+isBypassed(targetUrl, noProxy) boolean
+pickEnvProxy(env, targetUrl) EnvPick
+parseScutilProxy(text) SysProxy|null
+parseRegQueryProxy(text) SysProxy|null
+detectSystemProxy(platform, run) Promise~SysProxy|null~
+resolveProxy(opts) Promise~ProxyDecision~
+httpGet(url, opts) Promise~HttpResponse~
+tunnelConnection(proxy, target, signal) Function
}
class SelfUpdateCapability {
<<module apps/agent/src/capabilities/selfupdate.ts>>
+agentUpdate(args) Promise~unknown~
-download(url, timeoutMs) Promise~DownloadResult~
-planBackupCleanup(files, keep) string[]
}
class LkgRecord {
<<interface apps/agent/src/lkg.ts>>
+hash string
+hash_full string?
+bytes number
+script_path string
+backup_glob string?
+recorded_at number
+node_version string
+platform string
}
class LkgModule {
<<module apps/agent/src/lkg.ts>>
+recordLKG() LkgRecord|null
+readLKG() LkgRecord|null
+lkgStatus() LkgStatus
+lkgFilePath() string
}
class RollbackCommand {
<<module apps/cli/src/cmd/rollback.ts>>
+cmdRollback(opts) Promise~void~
+planRollback(info) RollbackPlan
+pickBackupByHash(candidates, wantHash) Candidate|null
+hashRemoteFile(client, path) Promise~FileHash~
}
class AuditL2Capability {
<<module apps/agent/src/capabilities/audit-l2.ts>>
+auditL2(args) Promise~unknown~
+verifyL2() L2VerifyResult
+readL2(limit) L2Entry[]
+l2FilePath() string
}
class ManifestSystem {
<<module packages/protocol/src/capabilities/manifest/system.ts>>
+SYSTEM_CAPABILITIES CapabilityDescriptor[]
}
SelfUpdateCapability --> ProxyModule : 单向依赖
SelfUpdateCapability --> LkgModule : 读 LKG(回滚提示)
LkgModule --> LkgRecord : 读写
RollbackCommand --> LkgModule : 经 system.info.lkg 消费
RollbackCommand ..> AuditL2Capability : 无直接依赖(仅同库)
ManifestSystem ..> AuditL2Capability : returns_schema 契约真源