Skip to content

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

Document the Linux packages

klarkxy951c530c9c0c
diff --git a/AGENTS.md b/AGENTS.md
index dd802059..74ad5ff2 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -7,7 +7,7 @@ Instructions for AI coding agents that work on this repository. Human contributo
DS Bot is a team of long-lived Bots, built on DeepSeek Harness (DSH). It has two parts:
- `ds-bot/`: the Bot features, written as a DSH plugin. The plugin runs in DSH Desktop, in DSH Web and in the desktop app.
-- `app/`: the desktop app for Windows and macOS. It runs a pinned DSH with the `ds-bot` plugin, in its own profile and its own `DSH_HOME`, and imports an existing team from the user's DSH.
+- `app/`: the desktop app for Windows, macOS and Linux. It runs a pinned DSH with the `ds-bot` plugin, in its own profile and its own `DSH_HOME`, and imports an existing team from the user's DSH.
The Bot team:
diff --git a/README.md b/README.md
index e149a461..b0b94ceb 100644
--- a/README.md
+++ b/README.md
@@ -17,14 +17,15 @@ DeepSeek Bot (DS Bot) is a bot plugin for [DeepSeek Harness](https://github.com/
## Install
-**Desktop app (Windows, macOS)**
+**Desktop app (Windows, macOS, Linux)**
The desktop app brings its own DSH, so you don't need to install DSH first. Download it from [Releases](https://github.com/Fei2411/DeepSeek-Bot/releases):
- Windows (x64): `DeepSeek-Bot-<version>-win-x64.exe`. Run it; it installs for your user only, without administrator rights. If Windows shows "Windows protected your PC", select **More info** → **Run anyway**.
- macOS: `DeepSeek-Bot-<version>-mac-arm64.zip` for an Apple chip, `DeepSeek-Bot-<version>-mac-x64.zip` for Intel. Safari unzips it by itself; drag **DeepSeek Bot** into **Applications** and open it. When macOS says it cannot check the app, open **System Settings** → **Privacy & Security** and select **Open Anyway**.
+- Linux (x64): `DeepSeek-Bot-<version>-linux-x86_64.AppImage` runs on every distribution — make it executable and open it. It mounts through FUSE 2, which you may need to install first (`sudo apt install libfuse2t64` on Ubuntu 24.04+, `sudo dnf install fuse-libs` on Fedora, `sudo pacman -S fuse2` on Arch). On Ubuntu 24.04 and later an AppImage can refuse to start (Ubuntu restricts the sandbox it needs); the `DeepSeek-Bot-<version>-linux-amd64.deb` on Debian/Ubuntu does not have this problem and adds a menu entry.
-At the first start the app asks where to keep its data and the Bots' files, and offers to copy a Bot team from your DSH (it only reads your DSH). Set up a model in its settings. The Windows app updates itself; the macOS app tells you when a new version is ready to download.
+At the first start the app asks where to keep its data and the Bots' files, and offers to copy a Bot team from your DSH (it only reads your DSH). Set up a model in its settings. The Windows app and the Linux AppImage update themselves; the macOS app and the Linux deb tell you when a new version is ready to download.
**As a plugin in DSH**
diff --git a/README.zh.md b/README.zh.md
index 13b19469..f2aab21e 100644
--- a/README.zh.md
+++ b/README.zh.md
@@ -17,14 +17,15 @@ DeepSeek Bot(简称 DS Bot)是一个基于 [DeepSeek Harness](https://github
## 安装
-**桌面应用(Windows、macOS)**
+**桌面应用(Windows、macOS、Linux)**
桌面应用自带 dsh,不用先装 dsh。在 [Releases](https://github.com/Fei2411/DeepSeek-Bot/releases) 里下载:
- Windows(x64):`DeepSeek-Bot-<版本>-win-x64.exe`。运行它即可安装,只装给当前用户,不要管理员权限。如果提示“Windows 已保护你的电脑”,点 **更多信息** → **仍要运行**。
- macOS:Apple 芯片下载 `DeepSeek-Bot-<版本>-mac-arm64.zip`,Intel 下载 `DeepSeek-Bot-<版本>-mac-x64.zip`。Safari 会自动解压;把 **DeepSeek Bot** 拖进 **应用程序**,再打开。如果提示无法检查这个 App,打开 **系统设置** → **隐私与安全性**,点 **仍要打开**。
+- Linux(x64):`DeepSeek-Bot-<版本>-linux-x86_64.AppImage` 通用于所有发行版——加上可执行权限后打开即可。它通过 FUSE 2 挂载,可能需要先安装(Ubuntu 24.04+ 用 `sudo apt install libfuse2t64`,Fedora 用 `sudo dnf install fuse-libs`,Arch 用 `sudo pacman -S fuse2`)。Ubuntu 24.04 及以后版本会限制 AppImage 需要的沙箱,AppImage 可能因此拒绝启动;Debian/Ubuntu 上的 `DeepSeek-Bot-<版本>-linux-amd64.deb` 没有这个问题,还会加菜单项。
-第一次打开时,App 会问数据和 Bot 的文件放在哪里,并可以从你的 dsh 复制 Bot 团队(只读取你的 dsh,不改它)。在 App 的设置里配好模型就能用。Windows 版会自动更新;macOS 版有新版本时会提示你下载。
+第一次打开时,App 会问数据和 Bot 的文件放在哪里,并可以从你的 dsh 复制 Bot 团队(只读取你的 dsh,不改它)。在 App 的设置里配好模型就能用。Windows 版和 Linux 的 AppImage 会自动更新;macOS 版和 Linux 的 deb 有新版本时会提示你下载。
**作为 dsh 插件**
diff --git a/app/README.md b/app/README.md
index 8f74f270..89811b45 100644
--- a/app/README.md
+++ b/app/README.md
@@ -1,6 +1,6 @@
# DeepSeek Bot desktop app
-The Electron app for Windows and macOS. It installs a pinned DeepSeek Harness (DSH 0.2.1-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 shows DSH's Web front end with the plugin, as DSH Desktop does. 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, macOS and Linux. It installs a pinned DeepSeek Harness (DSH 0.2.1-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 shows DSH's Web front end with the plugin, as DSH Desktop does. The design is in [docs/plans/2026-10-16-desktop-app.md](../docs/plans/2026-10-16-desktop-app.md).
## Run
@@ -19,7 +19,7 @@ npm installs `ds-bot` from `../ds-bot` as a copy of its package files (`install-
| `DS_BOT_HOME` | The data location: the `DSH_HOME` of the app. When it is set, the app asks nothing at its first start and imports nothing | The folder chosen at the first start |
| `DS_BOT_WORKSPACE` | With `DS_BOT_HOME`: the team workspace | `bot/workspace` in the data location |
| `DS_BOT_SHELL_DATA` | The app's own data (window, Chromium storage, `locations.json`) | Electron's `userData` (Windows: `%APPDATA%\DeepSeek Bot`; macOS: `~/Library/Application Support/DeepSeek Bot`) |
-| `DS_BOT_UPDATE_URL` | Windows: a folder URL with `latest.yml` and its installer. macOS: a URL returning a JSON list like GitHub's `releases` API; a release counts only when this Mac's zip is attached. Prereleases count only for prerelease installs (see [Updates](#updates)). With `DS_BOT_HOME`, the app checks only when this is set | The newest GitHub release |
+| `DS_BOT_UPDATE_URL` | Windows and a Linux AppImage: a folder URL with `latest.yml` / `latest-linux.yml` and the installer. macOS and a Linux deb: a URL returning a JSON list like GitHub's `releases` API; a release counts only when this machine's package is attached. Prereleases count only for prerelease installs (see [Updates](#updates)). With `DS_BOT_HOME`, the app checks only when this is set | The newest GitHub release |
On macOS, Electron's default `userData` directory for `productName` "DeepSeek Bot" is `~/Library/Application Support/DeepSeek Bot`.
@@ -64,8 +64,8 @@ Never point `DS_BOT_HOME` at `~/.dsh` or at the data of an app that you use.
[electron-builder](https://www.electron.build/) packages the app with the settings in `electron-builder.yml`. Build on the platform that you package for: the native modules (`node-pty`, `sharp`, `koffi`) are taken from `node_modules` as npm installed them, not rebuilt.
```sh
-npm run pack # the app without an installer: dist-pack/win-unpacked/ (Windows), dist-pack/mac*/ (macOS)
-npm run dist # the installer: dist-pack/DeepSeek-Bot-<version>-win-x64.exe (Windows), a .zip (macOS)
+npm run pack # the app without an installer: dist-pack/win-unpacked/ (Windows), dist-pack/mac*/ (macOS), dist-pack/linux-unpacked/ (Linux)
+npm run dist # the installer: dist-pack/DeepSeek-Bot-<version>-win-x64.exe (Windows), a .zip (macOS), an .AppImage and a .deb (Linux)
npm run check-packed # starts the packaged app on throwaway folders with the mock model, chats once, closes it
```
@@ -77,32 +77,35 @@ electron-builder packs only the packages that it finds through `dependencies` an
The Windows installer installs for the current user only, without administrator rights, by default into `%LOCALAPPDATA%\Programs\DeepSeek Bot` (`build/installer.nsh` skips the page that asks for all users or only for the current one). The uninstaller removes the program and keeps the data location and the app's own data. CI builds the Windows installer on every pull request, checks the packaged app, then installs it, checks the installed app and uninstalls it. For a change to `app/` or the workflows, it also updates the installed app before the uninstall (see [Updates](#updates)).
+Linux gets one AppImage for every distribution — it runs on any glibc system, updates itself, and needs no per-distribution packages — and a deb for Debian/Ubuntu, built in the same `npm run dist`. An AppImage mounts through FUSE 2 (`libfuse2t64` on Ubuntu 24.04+/Debian 13+, `libfuse2` on Ubuntu 22.04, `fuse-libs` on Fedora, `fuse2` on Arch; `--appimage-extract-and-run` works without it). Ubuntu 24.04 and later restrict the unprivileged user namespaces that Chromium's sandbox needs, so an AppImage can refuse to start there ("The SUID sandbox helper binary was found, but is not configured correctly"): the deb does not have this problem, since its post-install sets `chrome-sandbox` up (electron-builder 26 also writes an AppArmor profile). The binary and the deb's menu entry are `deepseek-bot` (`executableName`); the deb installs into `/opt/DeepSeek Bot`. CI builds the Linux packages on every pull request, checks the AppImage's self-update on a throwaway copy, and installs, checks, update-checks and removes the deb.
+
## Updates
-The installed app on Windows updates itself with electron-updater (`src/updates.mjs`). At its start and every 4 hours it reads `latest.yml` of the newest GitHub release, which names the installer and its sha512. It downloads that installer in the background and checks its sha512. When the download is done, a dialog on the window asks whether to restart now: then the app stops its Host and runs the installer, which opens the app again. Otherwise the installer runs when the app quits.
+The installed app on Windows updates itself with electron-updater (`src/updates.mjs`), and so does an AppImage on Linux (`APPIMAGE` is set then). At its start and every 4 hours it reads `latest.yml` (Windows) or `latest-linux.yml` (AppImage) of the newest GitHub release, which names the installer and its sha512. It downloads that installer in the background and checks its sha512. When the download is done, a dialog on the window asks whether to restart now: then the app stops its Host and runs the installer, which opens the app again. Otherwise the installer runs when the app quits.
The checks start before the Host (after a first start's import), so that a version whose Host does not start can still update. When the start fails, the app waits up to 15 seconds for the newest check. When it found a newer version, the error box says so; after the box the app waits for the download, then installs it and opens again.
-On macOS, the app checks GitHub's releases at start and every 4 hours. It asks once per version, after that release's zip for this Mac is attached. Stable installs ignore prereleases; prerelease installs can see them. Download opens the release page; Later closes the dialog. The app does not install the update itself. `DS_BOT_UPDATE_URL` on macOS points to a JSON list like the `releases` API response. A release needs `tag_name`, an HTTPS `html_url`, and the matching architecture's zip in `assets`.
+On macOS, the app checks GitHub's releases at start and every 4 hours. It asks once per version, after that release's zip for this Mac is attached. A Linux deb works the same way, except that it waits for the `linux-amd64` deb (Debian's name for x64). Stable installs ignore prereleases; prerelease installs can see them. Download opens the release page; Later closes the dialog. The app does not install the update itself. `DS_BOT_UPDATE_URL` on macOS and for a deb points to a JSON list like the `releases` API response. A release needs `tag_name`, an HTTPS `html_url`, and the machine's package in `assets`.
-On Windows, `app-update.yml` tells the app where its releases are; `npm run dist` writes it from `publish` in `electron-builder.yml`, together with `latest.yml` beside the installer (`npm run pack` writes neither). Neither command publishes. The release workflow (`.github/workflows/release.yml`) builds the installer when a release is published and attaches the installer, its `.blockmap` and `latest.yml` to the release. The release tag is the version of `ds-bot`, and `npm test` checks that the app has the same version. The macOS release job builds each zip on a matching-architecture runner and attaches only the zip.
+On Windows and for an AppImage, `app-update.yml` tells the app where its releases are; `npm run dist` writes it from `publish` in `electron-builder.yml`, together with `latest.yml` / `latest-linux.yml` beside the installer (`npm run pack` writes neither). Neither command publishes. The release workflow (`.github/workflows/release.yml`) builds the packages when a release is published and attaches the Windows installer with its `.blockmap` and `latest.yml`, the AppImage with its `.blockmap`, the deb and `latest-linux.yml` to the release. The release tag is the version of `ds-bot`, and `npm test` checks that the app has the same version. The macOS release job builds each zip on a matching-architecture runner and attaches only the zip.
On throwaway folders (`DS_BOT_HOME`) the app checks for updates only from `DS_BOT_UPDATE_URL`, and it never asks: the update waits until the app quits. `scripts/check-update.mjs` checks the update of a packaged app with such a feed:
```sh
npx electron-builder --publish never -c.extraMetadata.version=<next version> -c.directories.output=dist-next # the feed
-node scripts/check-update.mjs "dist-pack/win-unpacked/DeepSeek Bot.exe" dist-next --kill
+node scripts/check-update.mjs "dist-pack/win-unpacked/DeepSeek Bot.exe" dist-next --kill # Windows
+node scripts/check-update.mjs ./deepseek-bot.AppImage dist-next --kill # a Linux AppImage (latest-linux.yml)
```
-It serves the feed folder, starts the app on throwaway folders and waits until the app has downloaded the update and checked its sha512. Then it closes the app as a user does, so that the app installs the update as it quits; with `--kill` it ends the app, so that nothing is installed. On your own machine use `--kill`: the installer would install into `%LOCALAPPDATA%\Programs\DeepSeek Bot`. The download stays in `%LOCALAPPDATA%\deepseek-bot-updater`. CI runs it without `--kill` on its installed app, then checks that the installed version is the new one and that the updated app passes `check-packed`.
+It serves the feed folder, starts the app on throwaway folders and waits until the app has downloaded the update and checked its sha512. Then it closes the app as a user does, so that the app installs the update as it quits; with `--kill` it ends the app, so that nothing is installed. On your own machine use `--kill`: the installer would install into `%LOCALAPPDATA%\Programs\DeepSeek Bot`, and an AppImage replaces itself. The download stays in `%LOCALAPPDATA%\deepseek-bot-updater` (`~/.cache/deepseek-bot-updater` on Linux). CI runs it without `--kill` on its installed app, then checks that the installed version is the new one and that the updated app passes `check-packed`; for an AppImage it checks that the file is the new one.
-On macOS, pass the app executable and a version to mock a newer release:
+On macOS and for a Linux deb, pass the app executable and a version to mock a newer release:
```sh
node scripts/check-update.mjs "<app executable>" 99.0.0
```
-The script serves a releases list with one release of that version that has this Mac's zip, starts the app on throwaway folders with it, waits until the app logs the new version, and closes the window. It does not open a browser.
+The script serves a releases list with one release of that version that has this machine's package (the Mac's zip, or the `linux-amd64` deb), starts the app on throwaway folders with it, waits until the app logs the new version, and closes the window. It does not open a browser.
## Layout
@@ -119,14 +122,14 @@ The script serves a releases list with one release of that version that has this
| `src/first-run.mjs` | The first start's dialogs (the two folders and the offer to import) and the texts of the data move |
| `src/import.mjs` | The import of a Bot team from the user's DSH |
| `src/move-data.mjs` | The move of the data location: which folders can take it, and the copy through a staging folder |
-| `src/updates.mjs` | The Windows installer updates and macOS release-page checks |
+| `src/updates.mjs` | The self-updates (Windows installer, Linux AppImage) and the release-page checks (macOS, Linux deb) |
| `engine/` | On hold, not installed: the bundle `deepseek-bot-engine` for the app's own window in `ui/` |
| `test/` | `npm test`: the composition of the profile, and the dependencies that the package needs |
| `ui/` | On hold, not built or packaged: the app's own window. React, built with Vite (`vite.config.js`) into `ui/dist`. It draws the plugin's own Bot views from `../ds-bot/src/client/` (sidebar, chat rows, docks, dialogs and their stylesheets) and puts its own Markdown in place of DSH's. It uses ds-bot's `api/bot` channel and its live feed `api/bot/feed` |
| `assets/` | The app icon: `icon.svg`, `icon.png` (1024 px) and `icon.ico` (Windows, 16 to 256 px). `npm run icon` (`scripts/icon.mjs`) draws them again from the Main Bot's whale in `../ds-bot` |
-| `electron-builder.yml`, `build/` | The package and the installer: app identity, files, icons, the Windows installer and the macOS disk image |
+| `electron-builder.yml`, `build/` | The package and the installers: app identity, files, icons, the Windows installer, the macOS zip and the Linux AppImage and deb |
| `scripts/check-packed.mjs` | `npm run check-packed`: the check of a packaged app |
-| `scripts/check-update.mjs` | The check of a packaged app's update from a Windows feed folder or a macOS release |
+| `scripts/check-update.mjs` | The check of a packaged app's update from a feed folder (Windows, AppImage) or a mocked release (macOS, deb) |
The Host installs plugins with the app's own pnpm (`node_modules/pnpm`).
diff --git a/docs/plans/2026-10-21-linux-app-package.md b/docs/plans/2026-10-21-linux-app-package.md
new file mode 100644
index 00000000..318cc1bd
--- /dev/null
+++ b/docs/plans/2026-10-21-linux-app-package.md
@@ -0,0 +1,26 @@
+# Linux 桌面包:一个 AppImage 通吃 + deb 兜底
+
+- 日期:2026-10-21
+- 相关:#410
+
+## 为什么
+
+桌面应用只有 Windows(NSIS)和 macOS(zip)两个包。Linux 如果按发行版分别打 deb/rpm/pacman,每加一个格式就多一条维护线,而且这些格式都不支持应用内自动更新。
+
+## 已定的行为
+
+- Linux 只出两个包,同一次 `npm run dist` 产出:**AppImage**(主包,一个文件跑所有 glibc 发行版)加 **deb**(Debian/Ubuntu 兜底)。不打 rpm/pacman/Flatpak/Snap,也不做按发行版分包。
+- AppImage 是 Linux 上唯一被 electron-updater 原生支持的格式:读 `latest-linux.yml`,后台下载、退出时替换自身,与 Windows 共用 `watchUpdates` 路径。
+- deb 不能自更新:与 macOS 共用 `watchReleases` 发布页提醒路径,等待的资产是 `linux-amd64.deb`(`watchReleases` 因此加了 `asset` 参数,默认仍是 mac zip)。
+- 文件名遵循 Linux 惯例而非 `${arch}` 字面量:AppImage 是 `linux-x86_64`,deb 是 `linux-amd64`(electron-builder 对 Linux 目标的架构名映射;与 IPFS Desktop 等先例一致)。`main.mjs` 和 `check-update.mjs` 里因此有 x64→amd64 的映射。
+- `main.mjs` 按 `APPIMAGE` 环境变量区分 Linux 上两种格式的更新路径。
+- 不选 Flatpak/Snap:应用要在宿主机跑 pnpm 装插件、用 node-pty 开真实终端、读 `~/.dsh` 导入团队,与沙箱直接冲突(`flatpak-spawn --host` 等于拆空沙箱;Snap 的 classic 限制要商店特批,非 Ubuntu 发行版也普遍抵触)。先例:IPFS Desktop 因 confinement 问题弃用 Snap,主推 AppImage。
+- 已知坑写进 README:AppImage 需要 FUSE 2(Ubuntu 24.04+/Debian 13+ 装 `libfuse2t64`);Ubuntu 24.04+ 的 AppArmor 限制非特权 user namespace,会拦 AppImage 里的 Chromium 沙箱——deb 无此问题(post-install 设好 `chrome-sandbox`,electron-builder 26 起自动生成 AppArmor profile)。
+- 只出 x64;arm64 留到有 `linux/arm64` 预编译链(node-pty 等)确认后的后续工作。
+- 二进制与菜单项名 `deepseek-bot`(`executableName`),deb 装进 `/opt/DeepSeek Bot`。
+
+## CI
+
+- `test.yml` 加 `app-package-linux`:构建、xvfb 下 `check-packed`、deb 安装/检查/更新提醒/卸载、AppImage 自更新端到端(退出后文件 sha512 等于新版)。runner 上 `sysctl kernel.apparmor_restrict_unprivileged_userns=0` 并装 `libfuse2t64`(一次性的抛弃环境,安全代价可接受)。
+- `release.yml` 加 `app-linux` job:把 AppImage(含 `.blockmap`)、deb 和 `latest-linux.yml` 挂到 release。
+- `result` 汇总 job 的 `needs` 同步加 `app-package-linux`。