Skip to content

A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.

Describe the desktop app's own window

Fei241125a78662147c
diff --git a/NOTICE b/NOTICE
index 477157f0..513690ce 100644
--- a/NOTICE
+++ b/NOTICE
@@ -14,15 +14,14 @@ MIT License, Copyright (c) 2026 DeepSeek
apps/desktop/scripts/dev.ts in DeepSeek Harness and reuses a few of its
lines (the release record and the Electron launch arguments). It is a
developer script for screenshots on Linux and is not in the npm package.
- - app/src/web.mjs adapts apps/desktop/src/web-document.ts: the Web document
- with the boot gate, the launch-token cookie exchange and the request
- forwarding.
+ - app/src/web.mjs adapts apps/desktop/src/web-document.ts: the launch-token
+ cookie exchange and the request forwarding.
- app/src/host.mjs follows apps/desktop-host/src/index.ts: the profile boot
and the ready, fatal and shutdown messages.
- app/src/host-process.mjs follows apps/desktop/src/host-process.ts: the
Host in Electron's Node mode and the shutdown escalation.
- - app/src/main.mjs follows apps/desktop/src/main.ts for the dsh-app scheme,
- the request routing and the WebSocket header rewrite.
+ - app/src/main.mjs follows apps/desktop/src/main.ts for the dsh-app scheme
+ and the request routing.
Full license text:
@@ -48,7 +47,9 @@ No other third-party code is copied into this repository. At run time the
plugin uses the @deepseek-ai/* packages of the DeepSeek Harness install it
runs in; they are not bundled. esbuild is a build tool only. The desktop app
in app/ installs the pinned @deepseek-ai/* packages, Electron and pnpm from
-npm; they keep their own licenses.
+npm; they keep their own licenses. The build of its window (app/ui) bundles
+React and React DOM (MIT, Copyright (c) Meta Platforms, Inc. and affiliates)
+from npm; Vite is a build tool only.
==============================================================================
Projects that gave us ideas (no code copied)
diff --git a/app/README.md b/app/README.md
index 5618fb3a..f9b2d4d6 100644
--- a/app/README.md
+++ b/app/README.md
@@ -1,13 +1,13 @@
# DeepSeek Bot desktop app
-The Electron app for Windows and macOS. It installs a pinned DeepSeek Harness (DSH 0.2.0-rc.2) and the `ds-bot` plugin of this repository, boots its own DSH profile `ds-bot` through `@deepseek-ai/dsh/profile-boot`, and keeps its data in its own `DSH_HOME`. It never writes to `~/.dsh`. The design is in [docs/plans/2026-10-16-desktop-app.md](../docs/plans/2026-10-16-desktop-app.md).
+The Electron app for Windows and macOS. It installs a pinned DeepSeek Harness (DSH 0.2.0-rc.2) and the `ds-bot` plugin of this repository, boots its own DSH profile `ds-bot` through `@deepseek-ai/dsh/profile-boot`, and keeps its data in its own `DSH_HOME`. It never writes to `~/.dsh`. Its window is its own page (`ui/`), which talks only to ds-bot's channel in the engine. The design is in [docs/plans/2026-10-16-desktop-app.md](../docs/plans/2026-10-16-desktop-app.md).
## Run
```sh
npm ci
node node_modules/electron/install.js # when npm did not download Electron (no node_modules/electron/dist)
-npm start
+npm start # builds the window (npm run build), then starts the app
```
When GitHub downloads are slow, set `ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/` before the Electron download. Unset `ELECTRON_RUN_AS_NODE` before `npm start` if your terminal has it (terminals inside some Electron-based editors do): with it, Electron runs as plain Node and the app does not start.
@@ -23,9 +23,10 @@ The Host reads model settings and keys the way DSH does: environment variables s
## Check a change
-`scripts/shot.mjs` starts the app on throwaway folders, saves a screenshot of its window, prints the page text, closes the window the way a user does and waits until the app exits. Use the mock model of the plugin, `../ds-bot/dev/mock-llm.mjs` (`MOCK_PORT=<port> node ../ds-bot/dev/mock-llm.mjs`).
+`scripts/shot.mjs` starts the app on throwaway folders, saves a screenshot of its window, prints the page text, closes the window the way a user does and waits until the app exits. Build the window first (`npm run build`). Use the mock model of the plugin, `../ds-bot/dev/mock-llm.mjs` (`MOCK_PORT=<port> node ../ds-bot/dev/mock-llm.mjs`).
```sh
+npm run build
DS_BOT_HOME=<tmp>/home DS_BOT_SHELL_DATA=<tmp>/shell \
DEEPSEEK_BASE_URL=http://127.0.0.1:<port>/v1 DEEPSEEK_API_KEY=mock-key \
node scripts/shot.mjs <tmp>/shot.png 20
@@ -37,12 +38,12 @@ Never point `DS_BOT_HOME` at `~/.dsh` or at the data of an app that you use.
| File | What it does |
|---|---|
-| `src/main.mjs` | Main process: one instance, the `dsh-app://app` scheme, request forwarding to the Host, the WebSocket header rewrite, the window |
+| `src/main.mjs` | Main process: one instance, the `dsh-app://app` scheme (the window's build, and `/api/` forwarded to the Host), the window |
| `src/host-process.mjs` | Starts the Host in Electron's Node mode and owns its exit |
| `src/host.mjs` | The Host: creates the profile `ds-bot` (`dsh-base`, `dsh-web-app`, `ds-bot`), boots it with `runProfile()` on a loopback port and reports the launch URL |
-| `src/web.mjs` | The page document, the launch-token cookie exchange and the request forwarding |
-| `src/preload.cjs` | The boot handshake `dshDesktopBoot` for the page |
+| `src/web.mjs` | The window's files, the launch-token cookie exchange and the request forwarding |
+| `ui/` | The window: React, built with Vite (`vite.config.js`) into `ui/dist`. It uses ds-bot's `api/bot` channel and its live feed `api/bot/feed`, and takes the Bot marks, themes and copy from `../ds-bot/src/client/` |
-Plugins that the user installs from the plugin page are installed with the app's own pnpm (`node_modules/pnpm`).
+The Host installs plugins with the app's own pnpm (`node_modules/pnpm`).
Some files adapt code from DSH Desktop (MIT); see [NOTICE](../NOTICE).
diff --git a/docs/plans/2026-10-16-desktop-app.md b/docs/plans/2026-10-16-desktop-app.md
index 4720e188..16bcb20c 100644
--- a/docs/plans/2026-10-16-desktop-app.md
+++ b/docs/plans/2026-10-16-desktop-app.md
@@ -67,7 +67,7 @@
## 已知限制
-- 目前窗口里显示的是 DSH 的网页界面和 ds-bot 插件的界面。自己的界面、首次启动和导入、DeepSeek 账号登录、每个 Bot 的浏览器、更新和安装包还没有。
+- 窗口里目前只有团队列表和 Bot 的私聊:能选模型、聊天、看回复一边写一边出来、回答提问卡片。群聊、Bot 详情和设置、记忆、Markdown 排版、工具卡片、首次启动和导入、DeepSeek 账号登录、每个 Bot 的浏览器、更新和安装包还没有。模型和密钥目前用环境变量,或数据位置里的 `.env`、`.credentials.yaml` 设置。
- 不签名:Windows 第一次运行会弹出 SmartScreen 警告,macOS 要在系统设置里手动放行。
- 会话里记着工作文件夹的完整路径,不能改。所以导入和搬工作文件夹都要换段。