cc-haha/docs/desktop/index.md
程序员阿江(Relakkes) 386a41e606 feat(desktop): enable Electron migration path
Introduce the Electron desktop shell alongside the existing React renderer and local Bun server boundary. The migration keeps the DesktopHost contract explicit across Tauri, Electron, and browser runtimes while adding Electron main/preload services for dialogs, shell, notifications, updates, tray/window lifecycle, terminal, preview WebContentsView, app mode, and release/package validation.

The commit also carries the latest local main desktop command updates, including agent slash entries and hidden-by-default markdown thinking details, so the packaged Electron build matches the current main UX surface.

Constraint: React renderer, local Bun server, REST/WebSocket, and sidecar boundaries must remain reusable during the migration
Constraint: macOS dev packages are ad-hoc signed and cannot prove Developer ID notarization or Gatekeeper release launch
Rejected: Browser-only smoke validation | it cannot exercise native dialogs, keychain prompts, notification behavior, or packaged app startup
Confidence: medium
Scope-risk: broad
Directive: Do not remove Tauri host support until signed Electron release artifacts pass native OS smoke on macOS, Windows, and Linux
Tested: bun run check:desktop
Tested: cd desktop && bun run check:electron
Tested: CSC_IDENTITY_AUTO_DISCOVERY=false bun run electron📦dir
Tested: bun run test:package-smoke --platform macos --package-kind dir --artifacts-dir desktop/build-artifacts/electron
Tested: Computer Use read packaged Electron app window at desktop/build-artifacts/electron/mac-arm64/Claude Code Haha.app
Not-tested: Developer ID signed/notarized Gatekeeper launch
Not-tested: Real OS notification click-to-session action
Not-tested: Windows and Linux packaged app smoke on real hosts
2026-06-01 22:43:16 +08:00

3.1 KiB
Raw Blame History

桌面端文档

图形化的 AI Code Editor支持多会话、多标签、IM 接入的完整桌面体验。

桌面端界面


文档目录

快速上手

面向用户的桌面端使用指南界面布局、对话操作、多标签、权限控制、项目管理、模型配置、IM 适配器、定时任务。

架构设计

面向开发者的技术架构三层架构Electron Host → Server → CLI、WebSocket 协议、HTTP API、状态管理、协议代理、适配器桥接、目录结构。

功能详解

深入每个功能模块聊天引擎、代码展示、工具调用、Agent Teams、提供商管理、技能/Agent、定时任务、IM 适配器、设计系统。

安装指南

下载安装、macOS/Windows 常见问题、Web UI 模式。

H5 访问

面向个人和团队的可选浏览器访问:开启 H5、生成 Token、配置允许来源、通过局域网或反向代理在手机上访问聊天界面。

Tauri 迁移 Electron 调研索引

桌面端从 Tauri 2 迁移到 Electron 的系统能力盘点、React 复用边界、目标架构、安全要求和迁移路径。

Electron 迁移任务清单

逐阶段执行清单host adapter、Electron main/preload、系统能力、build/release、跨平台 smoke 和 Computer Use 验收。

Electron 迁移验证清单

迁移收口验证自动化证据、Review 收口项、macOS Computer Use smoke、Windows/Linux 实机验收边界。

Electron 迁移交互式验收清单

本地浏览器可直接打开的验收 checklist支持勾选进度、记录问题、导出 Markdown。


快速开始

用户

  1. 阅读 安装指南 下载安装
  2. 阅读 快速上手 了解界面和操作
  3. 配置 AI 模型提供商,开始对话

开发者

  1. 阅读 架构设计 理解三层架构
  2. 关键源码位置:
    • desktop/src/ — React 前端
    • desktop/electron/ — Electron main/preload/系统能力 host
    • desktop/src-tauri/ — 迁移期保留的 Tauri/Rust legacy host 与 sidecar 资源目录
    • desktop/sidecars/ — Sidecar 入口
    • src/server/ — Express API 服务端
    • adapters/ — IM 适配器

核心概念

概念 说明
Electron Host 跨平台桌面壳层管理窗口、系统能力、Sidecar 进程和更新
Sidecar 随主进程启动的后台服务,运行 API 服务器
Session 一次对话会话,绑定工作目录,通过 WebSocket 通信
Tab 标签页,对应一个 Session 或特殊页面
Provider AI 模型提供商,支持 Anthropic/OpenAI 兼容接口
Adapter IM 适配器Telegram/飞书接入 Claude Code
Store Zustand 状态容器,按领域拆分管理