Commit 056a38c
committed
docs(developers): add daemon-mode developer deep-dive documentation set (Chinese)
Adds 21-file Chinese developer documentation set under
docs/developers/daemon/ for qwen serve daemon mode. Plus one
nav entry in docs/developers/_meta.ts and a sub-nav under
docs/developers/daemon/_meta.ts.
The set complements (not replaces) the existing daemon docs:
- docs/users/qwen-serve.md — operator quickstart, flags, threat model
- docs/developers/qwen-serve-protocol.md — wire-level HTTP routes
- docs/developers/examples/daemon-client-quickstart.md — TS walkthrough
- docs/developers/daemon-client-adapters/* — adapter design drafts
- docs/design/f2-mcp-transport-pool.md — F2 design v2.2
It is the developer architecture reference that's been missing — a new
contributor's path through the system, with one architectural diagram
doc + per-component deep-dives + a quickstart/operations chapter.
Document set:
Foundation
- 00-index.md navigation, glossary, reading paths
- 01-architecture.md system architecture + 6 Mermaid diagrams
Server core
- 02-serve-runtime.md runQwenServe bootstrap, Express, lifecycle,
validatePolicyConfig + InvalidPolicyConfigError
- 03-acp-bridge.md @qwen-code/acp-bridge package internals
- 04-permission-mediation.md MultiClientPermissionMediator — four
policies, N=floor(M/2)+1 quorum + M=2
unanimity edge case, X-Qwen-Client-Id
self-declaration security caveat
- 05-mcp-transport-pool.md McpTransportPool (F2) including pool-aware
snapshot fields (entryCount / entrySummary),
MCPCallInterruptedError on silent transport
drop, canonicalOAuth fingerprint
normalization, extension-uninstall orphan
reap via MAX_IDLE_MS, IDE-close drain path,
/mcp refresh pool gate
- 06-mcp-budget-guardrails.md WorkspaceMcpBudget — modes, hysteresis,
refused-batch coalescing, scope: 'pool'
future reservation
- 07-workspace-filesystem.md WorkspaceFileSystem sandbox + FsError
preservation over ACP wire
- 08-session-lifecycle.md create/attach/load/resume, identity,
heartbeat, eviction
- 09-event-schema.md typed event schema v1 (29 known event types)
with payloads, reducers, envelope-level
metadata (_meta.serverTimestamp), tool-call
_meta (provenance + serverId), SDK reducer
behavior (awaitingResync flag,
RESYNC_PASSTHROUGH_TYPES)
- 10-event-bus.md EventBus + Last-Event-ID replay +
ring-eviction-on-resume state_resync_required
recovery flow
- 11-capabilities-versioning.md capability registry, protocol
version, conditional advertisement
- 12-auth-security.md bearer, host allowlist, mutation gate,
--require-auth, /health exemption,
device-flow, X-Qwen-Client-Id identity
caveat, sanitizeForStderr CVE-2021-42574
defense
Clients
- 13-sdk-daemon-client.md TypeScript SDK — DaemonClient,
DaemonSessionClient, DaemonAuthFlow, SSE,
MCP_RESTART_DEFAULT_TIMEOUT_MS 330s
rationale
- 14-cli-tui-adapter.md DaemonTuiAdapter
- 15-channel-adapters.md DaemonChannelBridge + DingTalk / WeChat /
Telegram
- 16-vscode-ide-adapter.md DaemonIdeConnection (loopback-only)
Reference appendices
- 17-configuration.md env vars + CLI flags + settings.json keys
- 18-error-taxonomy.md typed errors per layer (filesystem boundary,
bridge errors, daemon-host error kinds,
boot-time config errors, device-flow)
- 19-observability.md QWEN_SERVE_DEBUG, debug recipes, /demo
console
Quickstart / operations
- 20-quickstart-operations.md 9 startup recipes; full CLI flag /
env / settings.json reference; boot
fail-loud scenarios; curl validation
checklist; /demo console usage; full call
chain from `qwen serve` to listening
server with line numbers; embedded-mode
examples; graceful vs force shutdown
Each topic doc follows: 概览 / 职责 / 架构 / 流程 (with Mermaid
diagrams) / 状态与生命周期 / 依赖 / 配置 / 注意 & 已知局限 / 参考.
Pinned to the daemon_mode_b_main code surface (F2 pool, F3 mediator,
F4 prereqs). Some referenced files (McpTransportPool, state_resync_
required, validatePolicyConfig, FsError-over-wire, sanitizeForStderr)
land on main only when daemon_mode_b_main next batches up — the doc
set arrives ahead of the feature merges by design.
History: prior revision of this PR was bilingual EN+ZH; switched to
Chinese-only per maintainer preference and added 20-quickstart-
operations.md to consolidate startup / validation / call-chain
content that surfaced during review.1 parent 48b0a8b commit 056a38c
23 files changed
Lines changed: 4428 additions & 0 deletions
File tree
- docs/developers
- daemon
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
0 commit comments