A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.
Document the desktop app's updates and its release check
Fei2411b56bddd5d17e
diff --git a/app/README.md b/app/README.mdindex 3a8c4bb7..a4cc6572 100644--- a/app/README.md+++ b/app/README.md@@ -19,6 +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 folder for the files that Bots make | `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`) |+| `DS_BOT_UPDATE_URL` | A folder URL with a `latest.yml` and the installer it names, which the installed app updates from (see [Updates](#updates)). With `DS_BOT_HOME`, the app checks for updates only when this is set | The newest GitHub release |## First start and import@@ -68,7 +69,22 @@ npm run check-packed # starts the packaged app on throwaway folders with the melectron-builder packs only the packages that it finds through `dependencies` and `optionalDependencies`. The DSH packages ask for many packages as peers, which npm installs but electron-builder would leave out, so `package.json` lists them as dependencies. `npm test` fails when one is missing and names it.-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.+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)).++## 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.++`app-update.yml` in the package 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.++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+```++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`.## Layout@@ -81,6 +97,7 @@ The Windows installer installs for the current user only, without administrator| `src/profile.mjs` | The profile: its name, its bundles, and its creation and update || `src/first-run.mjs` | The first start's dialogs: the two folders and the offer to import || `src/import.mjs` | The import of a Bot team from the user's DSH |+| `src/updates.mjs` | The updates of the installed app on Windows: the checks, the background download and the question to restart || `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 || `src/web.mjs` | DSH's Web front end document, the launch-token cookie exchange and the request forwarding |@@ -88,6 +105,7 @@ The Windows installer installs for the current user only, without administrator| `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 || `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 feed folder |The Host installs plugins with the app's own pnpm (`node_modules/pnpm`).diff --git a/docs/dev/release-checklist.md b/docs/dev/release-checklist.mdindex b7c25384..bc4589b5 100644--- a/docs/dev/release-checklist.md+++ b/docs/dev/release-checklist.md@@ -9,6 +9,7 @@ CI 只跑单元测试和 Linux 上的测试台。窗口外框、输入法、高- Windows 10 / 11 x64,或 macOS(Apple 芯片)。- 官方的 DSH Desktop,版本和 README 里写的一致(现在是 `0.2.0-rc.2`)。只从 DeepSeek Harness 官方渠道下载。- 要发的包:在 `ds-bot/` 里运行 `npm pack`,得到 `ds-bot-<版本>.tgz`。+- 桌面应用的安装包:在 `app/` 里运行 `npm run dist`,得到 `app/dist-pack/DeepSeek-Bot-<版本>-win-x64.exe`。`app/package.json` 和 `ds-bot/package.json` 的版本号要一样。- 一个能用的模型(DeepSeek API key 或账号)。测试里要填的密钥都用**假值**。- 想保留现有数据,先备份数据目录:Windows 是 `C:\Users\<用户名>\.dsh\`,macOS 是 `~/.dsh/`。最好用一台没有自己团队数据的机器或账户来测。@@ -134,3 +135,15 @@ CI 只跑单元测试和 Linux 上的测试台。窗口外框、输入法、高| 11.1 | 插件页卸载 `ds-bot`,重启 | 回到普通 DSH;数据目录里的 `bot/` 还在 | || 11.2 | 重新安装 | 原来的团队、对话、记忆、密钥都在 | || 11.3 | 从上一个发布版本升级到这一版 | 团队、主题、颜色、浏览器宽度和标签页都保留 | |++## 12. 桌面应用(Windows)++12.4 和 12.5 要在 Release 发布、工作流传完安装包之后做:Release 里要有安装包、它的 `.blockmap` 和 `latest.yml`。上一个发布版本没有安装包时,跳过这两项。++| # | 步骤 | 期望 | 结果 |+|---|---|---|---|+| 12.1 | 运行安装包,选安装位置,安装 | 不要管理员权限;只装给当前用户;开始菜单里有 DeepSeek Bot | |+| 12.2 | 第一次打开:选数据位置和 Bot 工作文件夹;有 DSH 团队时选复制 | 团队、对话、模型设置都在;DSH 里原来的团队不变 | |+| 12.3 | 给一个 Bot 发消息;再打开设置 → 关于 DS Bot | 收到回复;DS Bot 一行写「随 DeepSeek Bot 应用一起更新。」 | |+| 12.4 | 装上一个发布版本的 App,打开它,等它提示新版本已经下载好,选「立即重启」 | App 关掉后自己装好新版并重新打开;关于页里是新版本号;团队都在 | |+| 12.5 | 再装一次上一个版本,等下载好的提示,选「稍后」,退出 App,等半分钟再打开 | 打开的是新版 | |diff --git a/docs/plans/2026-10-16-desktop-app.md b/docs/plans/2026-10-16-desktop-app.mdindex 7976f363..2b17d14f 100644--- a/docs/plans/2026-10-16-desktop-app.md+++ b/docs/plans/2026-10-16-desktop-app.md@@ -65,6 +65,10 @@- 应用标识(appId)是 `io.github.fei2411.deepseekbot`,以后不改:Windows 靠它认出这个应用和它的更新,macOS 用它当应用标识。- Windows(x64):安装向导,可以改程序位置,装完可以直接运行。只给当前用户安装:不问「为所有用户还是只为我」,不要管理员权限,默认装在 `%LOCALAPPDATA%\Programs\DeepSeek Bot`。卸载不删数据位置。- Windows 自动更新:后台下载,校验 sha512,下载完在窗口里提示重启以更新;不重启的话,下次退出时装上。+ - 启动时查一次 GitHub 上最新的 Release,之后每 4 小时查一次。Release 里的 `latest.yml` 写着安装包的文件名和 sha512。+ - 提示是窗口上的系统对话框:「立即重启」先停掉引擎再装;「稍后」等下次退出。+ - 应用里的 ds-bot 和 DSH 随应用一起更新:插件不自己查这两项的更新,关于页写「随 DeepSeek Bot 应用一起更新」。+- 发版:发布 Release 时,工作流打 Windows 安装包,把它、它的 `.blockmap` 和 `latest.yml` 传到 Release。应用和 ds-bot 用同一个版本号,Release 的标签就是这个版本号。- macOS(Apple 芯片和 Intel):dmg;不能自动更新,有新版时提示下载。- 安装包带着锁定的 DSH 装上的全部文件,不按 profile 删减。- 不签名。@@ -81,7 +85,7 @@## 已知限制-- 还没有:在设置里改数据位置和 Bot 工作文件夹;导入后逐个试读会话(同一格式版本里更新的 DSH 加了新事件时,锁定版打不开那段对话);更新。+- 还没有:在设置里改数据位置和 Bot 工作文件夹;导入后逐个试读会话(同一格式版本里更新的 DSH 加了新事件时,锁定版打不开那段对话);macOS 的 dmg 和有新版时的下载提示。- 不签名:Windows 第一次运行会弹出 SmartScreen 警告,macOS 要在系统设置里手动放行。- 会话里记着工作文件夹的完整路径,不能改。所以导入和搬工作文件夹都要换段。- 安装的 `@deepseek-ai/dsh` 包带着 Office 套件和语音包,所以安装包里仍有这些文件,只是不加载。@@ -97,3 +101,4 @@- 2026-10-18:设置里加「模型」页,服务商和 key 存在 DSH 里,PR #319。- 2026-10-18:自己的界面先停下,窗口换回 DSH 的网页前端和系统标题栏;引擎的 profile 换回 `dsh-base`、`dsh-web-app`、`ds-bot`,PR #323。- 2026-10-18:首次启动选两个位置、从用户 DSH 导入团队的细节,PR #324。+- 2026-10-19:Windows 自动更新的细节;发 Release 时传 Windows 安装包;应用里的插件不再自己查更新。