XWorkTech

XWorkTech Docs

XWorkmate(开箱即用的 DeepSeek Harness 发行版)架构总览与文档索引

系统梳理 XWorkmate 基于 DeepSeek Harness (dsh@0.2.2-rc.5) 的发行版架构、薄壳运行时、插件分层与镜像矩阵、品牌与插槽体系、accounts.svc.plus 认证与三大独立远端服务契约,以及构建验收排障手册。

XWorkmate(开箱即用的 DeepSeek Harness 发行版)工程参考与架构总览

[!NOTE] 本目录汇总 XWorkmate DSH 发行版(xworkmate-dsh-distro v1.2.0,内核固定 @deepseek-ai/dsh@0.2.2-rc.5)的架构决策、已验证实现、插件治理边界、UI 插槽规范、远端服务契约与构建排障实录。文档明确区分已验证实现与独立远端部署/后续演进契约,不含任何敏感凭据或本机绝对路径。


一、产品定位与核心工程原则

xworkmate-app 已从传统的重型 Flutter 业务客户端全面转型为开箱即用的 DeepSeek Harness(DSH)发行版:

  1. 零上游内核补丁(Zero Kernel Patches):
    • 上游内核镜像于 ai-workspace-lab/deepseek-harness,版本锁定 0.2.2-rc.5(Cordis ~4.1.0、Node v24.20.0、pnpm 12.4.2)。
    • 所有品牌、布局、登录认证、桥接、网络互联与生态扩展全部以标准 DSH 插件 + Cordis Patch 层交付,不修改 @deepseek-ai/dsh* 上游包源码。
  2. Flutter 极薄跨端壳(Thin Native Shell):
    • xworkmate-app 仅保留跨端窗口与打包壳、内嵌 DSH Node 宿主监督器(DshRuntimeSupervisor)、原生 WebView 容器和白名单 JS↔Native 桥(NativeBridge)。
    • 遵循 Clean-Cut(无向后兼容)策略,下线原 Flutter 业务 UI、桌面控制器、旧版侧边栏/抽屉和旧运行时代码(共移除 313 个旧文件)。
  3. 三级插件治理模型:
    • 一等发行版插件(5 个):账号认证(dsh-svcplus-account)、桥接路由(dsh-bridge-connector)、品牌(xworkmate-ui-brand)、布局(xworkmate-ui-layout)、首页(xworkmate-ui-home)。
    • 内置精选扩展(17 项):含 XConnect-One 零信任远程互联插件、第三方插件市场 dshmarket、dsh-better-sidebar 首选工作台侧栏及 14 项核心扩展,全部默认启用(builtIn: true, enabled: true)、支持用户独立开关(userToggleable: true)、不可卸载删除(removable: false)。
    • 独立可选插件(非内置):如工作台数据统计看板 @ai-workspace-lab/dsh-workbench-analytics,维护于独立仓库,不写入发行版 distro.manifest.json / profile/package.json,支持按需安装与卸载。
  4. 认证与远端服务彻底解耦:
    • 使用 https://accounts.svc.plus(含 TOTP MFA 与 profile/sync)替代官方 DeepSeek 登录。
    • 三个远端伴生服务(bridge.svc.plus、ai-desktop.svc.plus、mausbot.svc.plus)各自拥有独立的 Compose、K3s/GitOps、Vault ESO 凭据路径与升级周期。

二、总体架构拓扑

flowchart TB
    subgraph Shell["XWorkmate Native Thin Shell (Flutter)"]
        App["ShellApp / ShellWebViewPage"]
        Sup["DshRuntimeSupervisor (Loopback + Process Lifecycle)"]
        Bridge["NativeBridge (Allowlisted JS to Native)"]
    end

    subgraph Runtime["Embedded DSH Runtime (Node 24 + dsh 0.2.2-rc.5)"]
        Host["host.mjs (User-Plugin Preserving Profile Sync)"]
        Core["@deepseek-ai/dsh + Cordis 4.1.0"]
        FirstParty["5 First-Party Distro Plugins (svcplus-account, bridge-connector, ui-brand, ui-layout, ui-home)"]
        BuiltIn["17 Built-in Curated Extensions (xconnect-one, dshmarket, dsh-better-sidebar, ...)"]
        Optional["Optional Standalone Plugins (e.g. dsh-workbench-analytics)"]
    end

    subgraph Remote["Independent *.svc.plus Remote Services"]
        Accounts["accounts.svc.plus (SSO / MFA / profile sync / Overlay Control)"]
        BridgeSvc["bridge.svc.plus (xworkmate-bridge: /acp/rpc)"]
        DesktopSvc["ai-desktop.svc.plus (xworkmate-remote-desktop: WebRTC + CUA)"]
        MausBotSvc["mausbot.svc.plus (OpenMausBot behind forward_auth)"]
    end

    App <--> Bridge
    App <-->|"HTTP/WS 127.0.0.1 Auth Cookie"| Core
    Sup -->|"spawn / probe / SIGTERM to SIGKILL"| Host
    Host --> Core
    Core --- FirstParty
    Core --- BuiltIn
    Core -. "user install/uninstall" .-> Optional

    FirstParty -->|"HTTPS Login/MFA/Sync"| Accounts
    FirstParty -->|"Unified /acp/rpc Bearer"| BridgeSvc
    BuiltIn -->|"ds-harness-remote / CUA"| DesktopSvc
    BuiltIn -->|"XConnect-One Overlay"| Accounts
    FirstParty -. "dsh-dbot-mausbot contract" .-> MausBotSvc

三、文档目录导航

章节 文件 核心内容
01 01-architecture-and-thin-shell.md Flutter 薄壳架构、嵌入式 Node/DSH 监督器、followRedirects = false 就绪探测、Token 脱敏、host.mjs 用户插件持久化与 NativeBridge 安全边界
02 02-plugin-ecosystem-and-mirror-matrix.md 5 一等插件 + 17 内置精选扩展 + 独立可选插件(dsh-workbench-analytics)完整清单、ai-workspace-lab GitHub 镜像矩阵、tsdown 浏览器模块规范与 Cordis v4 契约
03 03-ui-ux-brand-and-slot-architecture.md XWorkmate 品牌(Worky-Bot SVG + 双主题色板)、DSH 0.2.2-rc.5 插槽映射、替换 探索未至之境 与 DSH 本地构建 规范、插件市场 合并至 插件 选项卡及 dsh-better-sidebar 职责边界
04 04-auth-security-and-remote-services.md accounts.svc.plus 登录/MFA/Sync 全链路、Fail-Closed 安全红线、bridge.svc.plus / ai-desktop.svc.plus / mausbot.svc.plus 独立部署规范与 dsh-dbot-mausbot 集成契约
05 05-build-verification-and-troubleshooting.md 全链路构建与验收门禁命令、实机联调沉淀的 8 类工程避坑与修复记录、独立可选插件安装/卸载与验证流程

四、核心代码仓库索引

仓库 角色 地址
xworkmate-app XWorkmate DSH 发行版主仓(Flutter 薄壳 + dsh-distro/ + deploy/svc-plus/,当前开发分支 feat/dsh-distro-fusion) https://github.com/ai-workspace-lab/xworkmate-app
deepseek-harness 上游 DSH 内核镜像(基线 0.2.2-rc.5) https://github.com/ai-workspace-lab/deepseek-harness
dsh-workbench-analytics 独立可选工作台数据统计看板插件(非内置) https://github.com/ai-workspace-lab/dsh-workbench-analytics
xconnect-one XConnect-One 零信任内网互联上游仓库 https://github.com/ai-workspace-xstream/xconnect-one
xworkmate-bridge bridge.svc.plus 远端 ACP 桥接控制面 https://github.com/ai-workspace-lab/xworkmate-bridge
xworkmate-remote-desktop ai-desktop.svc.plus 远端桌面与 CUA 执行节点 https://github.com/ai-workspace-lab/xworkmate-remote-desktop
OpenMausBot mausbot.svc.plus 多 Bot 群聊与 @mention 编排后端 https://github.com/ai-workspace-lab/OpenMausBot