ZCode 知识库内容目录。每个 wiki 页面按类型列出,附一行摘要。 阅读此文件以快速定位相关页面。 Last updated: 2026-10-14 | Total pages: 20 分析基线:ZCode master @ aac4755(v3.15.1,2026-10-10)

总览与架构

  • overview — ZCode 是什么:智谱/Z.ai 开源的 AI 编程工作台,桌面/Web/CLI 三形态、三层运行边界、快速上手与看点
  • architecture — Renderer/Host/CLI 三层运行架构、单窗口唯一 Host、Main↔Host↔CLI 进程模型、workspace identity、通信协议三层心智模型、产品能力地图
  • monorepo — 双 pnpm workspace、根 packages(19)与 apps/zcode-cli/packages(30)清单、包级依赖图、其他顶层目录

Agent 运行时

  • agent-core — AgentRuntime 装配、turn 状态机与执行序列、model step、streaming 工具协调、context builder 与 compact、resume
  • session-runtime — 两套事实源(Session Event Store + SQLite)、消息/Part 模型、CommandInbox、Conversation topic 投影、Session Resident Pool、usage
  • zcode-protocol — ZCode Protocol 与通信分层、V4 读/写路径、snapshot/delta、两代协议并存、delivery profile、owner/lease
  • cli-tui — CLI 命令分发、headless 输出、TUI(OpenTUI + React)、slash command、CLI 配置(MCP/Hooks)、SEA 打包
  • model-provider — Provider/Model 建模、provider-node、模型选项 DSL(受限 CEL)、CLI 侧模型执行、模型能力边界、网关转发
  • tool-system — 内置工具清单、工具契约、调度器、执行流水线、权限流程、权限模式与风险、Hook 运行时

平台与交付

  • desktop — Electron 五段进程模型、Main↔Host 通信、Desktop↔Agent stdio、窗口远端连接注册表、插件沙箱
  • server-remote — @zcode/server(HTTP/WS/stdio)、@zcode/server-cli(Supervisor/Core 双层)、远程 SSH/WSL/Docker、sendText 完整路径
  • web-mobile — Web 客户端与手机远控、shared-host attachment、会话分享(web-share/share-ui)、Android 远控壳
  • distribution — 桌面打包(electron-builder)、CLI SEA、统一分发包(zcode)、独立 Server 包、native-search 工具、第三方声明

扩展生态

  • plugin-system — 插件三层结构(官方市场/Personal Source/系统内置)、domain 词汇、manifest 兼容、seed 机制、生命周期、UI Plugin 与 MCP Apps 沙箱
  • skills-system — Skill 定义与发现优先级、渐进披露加载、bundled-skills、skill-creator、.agents/skills、与 Claude Code 对比
  • mcp-integration — MCP 四条配置来源、配置格式、插件侧 MCP、客户端实现、平台边界、MCP Apps
  • dynamic-workflow — 模型写 TypeScript 脚本指挥多 subagent:facade、analysis core、四张图、journal、门控
  • office-computer-use — Office 文档技能插件(docx/xlsx/pptx/pdf + visual-judge)、Computer Use fail-closed 占位、node_repl 共用 runtime

工程与参考

  • engineering — 版本锚点、构建编排(根 pnpm / CLI turbo)、关键脚本、架构治理(policy/检查器/ratchet)、测试矩阵、lint/format/release、GitLab CI、工程纪律
  • glossary — 术语表(架构/协议/运行时/工具安全/扩展生态/工程)

相关

  • SCHEMA — 本子库约定、frontmatter 与 tag 分类法、更新策略