mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-17 13:13:35 +08:00
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
3.1 KiB
3.1 KiB
桌面端文档
图形化的 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。
快速开始
用户
开发者
- 阅读 架构设计 理解三层架构
- 关键源码位置:
desktop/src/— React 前端desktop/electron/— Electron main/preload/系统能力 hostdesktop/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 状态容器,按领域拆分管理 |
