Skip to content

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

Describe changing the team workspace and the data location

Fei24119b34aed1f611
diff --git a/app/README.md b/app/README.md
index 4b8240a6..5c27b77e 100644
--- a/app/README.md
+++ b/app/README.md
@@ -25,7 +25,9 @@ On macOS, Electron's default `userData` directory for `productName` "DeepSeek Bo
## First start and import
-At its first start the app asks, in system dialogs, for the data location (`~/.ds-bot` by default) and the folder for the files that Bots make (`~/DeepSeek Bot`), and keeps the answer in `locations.json` in its own data. Neither folder may be inside the other or inside the user's DSH data.
+At its first start the app asks, in system dialogs, for the data location (`~/.ds-bot` by default) and the team workspace (`~/DeepSeek Bot`), and keeps the answer in `locations.json` in its own data. Neither folder may be inside the other or inside the user's DSH data.
+
+Both change later in DS Bot's Settings > General > Locations. The plugin moves the team workspace and tells the app, which writes it into `locations.json`. The data location moves through the app (`src/move-data.mjs`): the new folder must be empty or new and apart from the old data, the team workspace, the user's DSH data and the program folder. The app stops the Host, copies the data (without the team's lock) into a staging folder beside the new one, renames it to the new folder once it is whole, writes `locations.json` and starts again. A failed or interrupted copy leaves the old location in use and removes the staging folder; the old folder always stays. A run on throwaway folders (`DS_BOT_HOME`) keeps its data location.
When the user's DSH (`DSH_HOME`, else `~/.dsh`) has a Bot team, the app offers to copy it (`src/import.mjs`). It only reads there. Before the copy it checks that no running DSH holds the team and that no chat is in a newer session format than the pinned DSH reads. Then the pinned DSH reads each chat once: a newer DSH can write records that the pinned one refuses in the same format. It reads a throwaway copy in the data location, with a profile of its own (`import-check`: `dsh-base` and `dsh-web-app`, without `ds-bot`), and removes the copy afterwards. A chat that a newer DSH wrote stops the copy as a newer format does; a damaged one does not, since the user's DSH cannot read it either. Then the app starts the Host once on the new data location, so that DSH does not register the copied Sessions' folders as projects. The copy takes `bot/` (without its lock, turns in flight and workspace), every Session the team names, the attachments, `.credentials.yaml`, `.env`, the model rows of one profile's `cordis.patch.yml`, and the old team workspace's files, which go into the new folder without replacing a file there. `bot/imported.json` records it. At its next turn, each Bot and group moves on to a fresh part in the new folder.
@@ -107,14 +109,15 @@ The script serves a releases list with one release of that version that has this
| File | What it does |
|---|---|
| `src/main.mjs` | Main process: one instance, the `dsh-app://app` scheme (DSH's Web front end, and everything else forwarded to the Host), the window and its boot data |
-| `src/preload.cjs` | Hands the window the boot data that DSH's Web front end needs. On Windows it marks the page for the frameless window and sends the caption buttons the colors of the surface under them |
+| `src/preload.cjs` | Hands the window the boot data that DSH's Web front end needs, and DS Bot's settings the data location and its move. On Windows it marks the page for the frameless window and sends the caption buttons the colors of the surface under them |
| `src/window-frame.mjs`, `src/mica.css` | The frameless Windows window: the caption band, when Mica is available (Windows 11 22H2 and later), and the stylesheet that lets Mica through the sidebar |
| `src/host-process.mjs` | Starts the Host in Electron's Node mode and owns its exit |
| `src/host.mjs` | The Host: boots the profile with `runProfile()` and reports the launch URL and the page injections; for the first-run check (`DS_BOT_CHECK`), the chats it cannot read |
| `src/profile.mjs` | The profiles: the app's own and the first-run check's, their bundles, and their creation and update |
| `src/session-check.mjs` | Which chats the pinned DSH refuses because a newer DSH wrote them |
-| `src/first-run.mjs` | The first start's dialogs: the two folders and the offer to import |
+| `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 |
| `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 |
diff --git a/docs/dev/release-checklist.md b/docs/dev/release-checklist.md
index b0ced1e5..02403d97 100644
--- a/docs/dev/release-checklist.md
+++ b/docs/dev/release-checklist.md
@@ -139,26 +139,28 @@ CI 只跑单元测试和 Linux 上的测试台。窗口外框、输入法、高
## 12. 桌面应用(Windows)
-12.6 和 12.7 要在 Release 发布、工作流传完安装包之后做:Release 里要有安装包、它的 `.blockmap` 和 `latest.yml`。上一个发布版本没有安装包时,跳过这两项。
+12.7 和 12.8 要在 Release 发布、工作流传完安装包之后做:Release 里要有安装包、它的 `.blockmap` 和 `latest.yml`。上一个发布版本没有安装包时,跳过这两项。
| # | 步骤 | 期望 | 结果 |
|---|---|---|---|
| 12.1 | 运行安装包,选安装位置,安装 | 不要管理员权限;只装给当前用户;开始菜单里有 DeepSeek Bot | |
-| 12.2 | 第一次打开:选数据位置和 Bot 工作文件夹;有 DSH 团队时选复制 | 团队、对话、模型设置都在;DSH 里原来的团队不变 | |
+| 12.2 | 第一次打开:选数据位置和总工作区;有 DSH 团队时选复制 | 团队、对话、模型设置都在;DSH 里原来的团队不变 | |
| 12.3 | 给一个 Bot 发消息;再打开设置 → 关于 DS Bot | 收到回复;DS Bot 一行写「随 DeepSeek Bot 应用一起更新。」 | |
| 12.4 | 看窗口:拖标题栏,双击标题栏,点最小化、最大化、关闭;切换浅色和深色 | 没有系统边框;拖得动,双击会最大化,最大化后顶部没有缝;三个按钮都能用,底色和下面的界面一样;Windows 11 上侧栏透出 Mica,Windows 10 上标题栏和侧栏同色 | |
| 12.5 | 按 `Ctrl+Alt+B` | 侧栏收起,再按一次展开 | |
-| 12.6 | 装上一个发布版本的 App,打开它,等它提示新版本已经下载好,选「立即重启」 | App 关掉后自己装好新版并重新打开;关于页里是新版本号;团队都在 | |
-| 12.7 | 再装一次上一个版本,等下载好的提示,选「稍后」,退出 App,等半分钟再打开 | 打开的是新版 | |
+| 12.6 | 设置 → 通用 →「位置」:把总工作区换到另一个文件夹,给 Bot 发消息;再把数据位置换到一个空文件夹 | 总工作区换完,Bot 的下一轮在新文件夹里;数据复制完 App 自己重启,团队和对话都在,「位置」里是新的数据位置,旧文件夹还在 | |
+| 12.7 | 装上一个发布版本的 App,打开它,等它提示新版本已经下载好,选「立即重启」 | App 关掉后自己装好新版并重新打开;关于页里是新版本号;团队都在 | |
+| 12.8 | 再装一次上一个版本,等下载好的提示,选「稍后」,退出 App,等半分钟再打开 | 打开的是新版 | |
## 13. 桌面应用(macOS)
-13.2–13.5 在 Apple 芯片和 Intel Mac 上分别做一次。13.5 要上一个发布版本有这台 Mac 的 DMG;没有时跳过。
+13.2–13.6 在 Apple 芯片和 Intel Mac 上分别做一次。13.6 要上一个发布版本有这台 Mac 的 DMG;没有时跳过。
| # | 步骤 | 期望 | 结果 |
|---|---|---|---|
| 13.1 | 发布 Release,等工作流传完文件 | Release 里有 arm64 和 x64 两个 DMG | |
| 13.2 | 用浏览器从 Release 页下载这台 Mac 的 DMG,打开,把 DeepSeek Bot 拖到「应用程序」,第一次打开 | Gatekeeper 拦下,不说「已损坏」;到「系统设置 → 隐私与安全性」点「仍要打开」后能打开 | |
-| 13.3 | 第一次打开:选数据位置和 Bot 工作文件夹;有 DSH 团队时选复制;给一个 Bot 发消息 | 团队、对话、模型设置都在;收到回复;关于页写「随 DeepSeek Bot 应用一起更新。」 | |
-| 13.4 | 关闭窗口 | 应用退出,Dock 里不留着 | |
-| 13.5 | 装上一个发布版本的 App 并打开,等新版提示后点「下载」 | 打开这次 Release 的发布页;应用不自己安装新版 | |
+| 13.3 | 第一次打开:选数据位置和总工作区;有 DSH 团队时选复制;给一个 Bot 发消息 | 团队、对话、模型设置都在;收到回复;关于页写「随 DeepSeek Bot 应用一起更新。」 | |
+| 13.4 | 设置 → 通用 →「位置」:把总工作区换到另一个文件夹,给 Bot 发消息;再把数据位置换到一个空文件夹 | 总工作区换完,Bot 的下一轮在新文件夹里;数据复制完 App 自己重启,团队和对话都在,「位置」里是新的数据位置,旧文件夹还在 | |
+| 13.5 | 关闭窗口 | 应用退出,Dock 里不留着 | |
+| 13.6 | 装上一个发布版本的 App 并打开,等新版提示后点「下载」 | 打开这次 Release 的发布页;应用不自己安装新版 | |
diff --git a/docs/plans/2026-10-10-bot-runtime.md b/docs/plans/2026-10-10-bot-runtime.md
index 7ca6e167..b6423262 100644
--- a/docs/plans/2026-10-10-bot-runtime.md
+++ b/docs/plans/2026-10-10-bot-runtime.md
@@ -41,10 +41,11 @@
### 工作文件夹
-- 一个 Bot 在哪里干活:群设了文件夹,群里的成员都用群的;否则用 Bot 自己的;都没设就用团队工作区。
+- 一个 Bot 在哪里干活:群设了文件夹,群里的成员都用群的;否则用 Bot 自己的;都没设就用总工作区。
+- 用户在 DS Bot 设置 → 通用 →「位置」里换总工作区。用总工作区的 Bot 和群在下一个回合换到新的一段;旧文件夹和里面的文件不动。总工作区同样不能在 DSH 或团队的数据里,也不能包含它们;插件自带的默认位置在 DSH 的数据里,换走以后还能换回来。
- Session 的文件夹在创建时就固定了,所以改文件夹会让对话换到新的一段(见[上下文与记忆](2026-10-09-context-and-memory.md))。
- 不能设成 DSH 或团队存数据的文件夹,也不能设成包含它们的文件夹:能写那里的 Bot 就能改自己的权限或整个团队。
-- 设到团队工作区以外,等于扩大了 Bot 能写的范围。所以如果 Bot 要给「写入受文件夹限制」的 Bot 设这样的文件夹,要先请用户批准。
+- 设到总工作区以外,等于扩大了 Bot 能写的范围。所以如果 Bot 要给「写入受文件夹限制」的 Bot 设这样的文件夹,要先请用户批准。
- 保存的是真实路径,和 Session 的 cwd 显示一致。
- Bot 可以按用户的一句话给自己设文件夹(`update_bot`),规则同上。
- DSH 的 `working_directory` 工具(DSH 0.2.1 起):Bot 进工作文件夹里面的文件夹,只是这段对话换个地方,不存、不换段,下一段回到工作文件夹。进工作文件夹以外的文件夹,等于给自己设新的工作文件夹:规则和 `update_bot` 一样,存进 Bot 的设置,下一步换到新的一段。群设了文件夹时,成员只能在群的文件夹里面换。
@@ -68,7 +69,7 @@
- **新 Bot 可能落到没配好密钥的模型上**:DSH 不告诉插件哪个提供方已经配好了凭据,「在模型列表里」不等于「能用」。建 Bot 表单预选 DSH 默认,而 DS Bot 每次都会把默认写回原值,所以这个默认可能一直停在出厂值。新 Bot 的第一次回复就可能报缺少凭据。怎么根治待维护者定(方向:只自动选有证据能用的模型,没有证据就问用户;凭据失败时回到选模型,而不是报错)。
- `create_bot` 和 `update_bot` 还不能设思考强度,只能在界面上设(#99)。
-- DSH 0.2.1-alpha 上,工作文件夹被删或改名后,消息会被吞掉、不会退回团队工作区(#209)。
+- DSH 0.2.1-alpha 上,工作文件夹被删或改名后,消息会被吞掉、不会退回总工作区(#209)。
- 能力包「coding」「research」的具体组成还没定。
## 变更
@@ -76,3 +77,4 @@
- 2026-10-10:Bot 预设归 DS Bot 所有;不预置分工 Bot;能力包只做加法。
- 2026-10-14:新的 Bot 会话、群会话和分段显式用 `standard`,修好 PTC 预设下群聊不接力(#37)。
- 2026-10-19:Bot 用 DSH 的 `working_directory` 换到工作文件夹以外时,当作给自己设工作文件夹(同样的检查和批准),换到新的一段;在工作文件夹里面换只是走进去(#345)。
+- 2026-10-20:用户能在设置里换总工作区;中文名「团队工作区」改叫「总工作区」(#364)。
diff --git a/docs/plans/2026-10-16-desktop-app.md b/docs/plans/2026-10-16-desktop-app.md
index 091f1e67..d920169d 100644
--- a/docs/plans/2026-10-16-desktop-app.md
+++ b/docs/plans/2026-10-16-desktop-app.md
@@ -51,17 +51,26 @@
### 首次启动和导入
-- 首次启动分别选数据位置(默认 `~/.ds-bot`)和 Bot 工作文件夹(默认 `~/DeepSeek Bot`),以后能在设置里改。两个位置不能一个在另一个里面,也不能在用户 DSH 的数据里。用的是系统对话框。
+- 首次启动分别选数据位置(默认 `~/.ds-bot`)和总工作区(默认 `~/DeepSeek Bot`),以后能在设置里改(见下面「改位置」)。两个位置不能一个在另一个里面,也不能在用户 DSH 的数据里。用的是系统对话框。
- 发现用户 DSH 里已有团队时,问要不要导入,只在首次启动问一次。导入复制 Bot、群、记忆、会话、附件、模型设置和密钥,旧位置一个字节都不改。导入以后两个团队各走各的,不同步。
- DSH 正在用这个团队时,请用户先关掉。
- 引擎先在新数据位置启动一次再复制,这样 DSH 不会把旧团队的文件夹当成自己的项目。
- - 旧团队工作文件夹里的文件复制到新的 Bot 工作文件夹,不覆盖已有的文件。
+ - 旧团队工作文件夹里的文件复制到新的总工作区,不覆盖已有的文件。
- 模型设置只取 profile 里模型的那几行(DeepSeek API 和账号、其他服务商、默认模型、预设)。几个 profile 都有时让用户选一份。DSH 里另外配的 MCP、技能和 DSH Agent 不导入。
- 导入后,每个 Bot 和群在下一个回合前换到新的一段(新工作文件夹),旧段只当历史读,照常能看、能搜。以后搬工作文件夹也一样。
- 用户 DSH 写的会话格式比锁定版新时,停下来请用户先更新 DeepSeek Bot。
- 复制之前,用锁定版把团队的每段对话读一遍:同一个格式版本里,新版 DSH 也能写入锁定版必须拒绝的记录。读的是数据位置里一份临时副本,用一个不带 `ds-bot` 的 DSH profile(只有 `dsh-base`、`dsh-web-app`),读完删掉。有新版 DSH 写的对话时,和格式版本新一样停下来,按钮是「退出 / 不带团队开始」;选退出的话,下次打开重新问位置和导入。文件损坏的对话不拦:用户自己的 DSH 也打不开它们。检查本身跑不起来时照常复制。
- 首次启动没走完就退出时什么都不记,下次打开从头再问:关掉欢迎框或选「退出」、在对话框开着时退出、复制途中关掉窗口都算。复制会停在安全的地方,不留下半个团队,下次能重新复制。
+### 改位置
+
+- 入口在 DS Bot 设置 → 通用 →「位置」。总工作区就是没有单独设置文件夹的 Bot 和群工作的地方,英文界面叫 Team workspace。
+- 换总工作区:选或输入一个文件夹,不存在就新建。不能在 DSH 或团队的数据里,也不能包含它们。不用重启。用总工作区的 Bot 和群在下一个回合换到新的一段,和其他换文件夹一样;旧文件夹和里面的文件不动。插件版也能换。
+- 换数据位置(只有桌面应用有):选一个空文件夹或新文件夹,不能和总工作区互相包含,不能在用户 DSH 的数据里或程序目录里,也不能选整个磁盘。确认后停掉引擎,把数据复制到新文件夹旁边的临时文件夹,复制完整才改成新文件夹的名字,然后应用自己重启,用新位置。
+ - 旧数据文件夹原样保留,用户确认没问题后自己删。
+ - 复制失败就提示原因,重启后接着用旧位置;复制途中退出也是旧位置,不留半份数据和临时文件夹。
+ - 开发和测试用的临时运行(`DS_BOT_HOME`)不能换数据位置。
+
### 插件
- DSH 插件的引擎部分(工具、模型、MCP、技能、搜索等)原样安装、原样运行。安装用应用自带的 pnpm。
@@ -96,7 +105,6 @@
## 已知限制
-- 还没有:在设置里改数据位置和 Bot 工作文件夹。
- 第一次运行:Windows 会弹出 SmartScreen 警告,macOS 要在系统设置里手动放行。
- macOS 上关掉窗口就退出应用(和 Windows 一样),Dock 里不留着。
- macOS 上窗口还有系统标题栏。无边框要让页面进入 DSH 的 macOS 桌面模式,那时快捷键改由原生菜单输入,应用要提供 DSH Desktop 那样的键盘桥。
@@ -120,3 +128,4 @@
- 2026-10-19:复制团队前用锁定版把每段对话读一遍,有新版 DSH 写的对话时停下来,PR #340。
- 2026-10-20:首次启动没走完就退出时什么都不记,下次从头再问;欢迎框加「退出」;复制停在安全的地方,不留半个团队,PR #360。
- 2026-10-20:Windows 上窗口无边框,Windows 11 上侧栏用 Mica;macOS 仍用系统标题栏,Issue #362。
+- 2026-10-20:设置里能换总工作区和数据位置;中文界面里「团队工作区」改叫「总工作区」,Issue #364。
diff --git a/ds-bot/README.md b/ds-bot/README.md
index 03d6011c..7380e526 100644
--- a/ds-bot/README.md
+++ b/ds-bot/README.md
@@ -9,7 +9,7 @@ Tested with dsh `0.2.1-rc.2` (Web) and `0.2.0-rc.2` (Web and Desktop).
## Features
- **Long-lived Bots**: each Bot is a dsh Session in the "DS Bot" workspace, with its own name, role, instructions and model.
-- **Working folders**: a Bot can work in a folder you choose instead of the team workspace, and a group chat can set one folder for all its members there. Pick it in the Bot's settings or details panel or in the group's settings, or ask a Bot (`update_bot`, `update_group`). After a change, the chat goes on in a fresh part that starts in the new folder. When a Bot sets a folder outside the team workspace, or adds a Bot to a group that works in one, it asks for your approval if those Bots can only write in their folder. Folders that hold dsh data (`$DSH_HOME`, the team's data) are refused.
+- **Working folders**: a Bot can work in a folder you choose instead of the team workspace, and a group chat can set one folder for all its members there. Pick it in the Bot's settings or details panel or in the group's settings, or ask a Bot (`update_bot`, `update_group`). After a change, the chat goes on in a fresh part that starts in the new folder. When a Bot sets a folder outside the team workspace, or adds a Bot to a group that works in one, it asks for your approval if those Bots can only write in their folder. Folders that hold dsh data (`$DSH_HOME`, the team's data) are refused. The team workspace itself moves in Settings > General > Locations; Bots and groups that work there go on in a fresh part in the new folder, and the old folder keeps its files.
- **Permission presets**: each Bot runs with its own dsh permission preset (Read only, Workspace or Full access), set in its details panel. A group chat can run all its members with one preset there, in place of their own: turn on **Same for every member** under Permissions in the group's settings. Only you set permissions; Bots cannot change them.
- **Bots work together**: `message_bot` sends a message to another Bot, `create_bot` and `update_bot` add and set up Bots, and `ask_user` asks you a question without blocking the other Bots.
- **Group chats**: members speak one at a time, and each one reads the latest messages first. A message can `@Name` a member to pass the turn on; type `@` to pick one from a list. **+ → Reference a chat** adds another Bot's chat to a message as context, and in a group the members who answer get it. A member with nothing new to add stays quiet (`[PASS]`). Each member has its own hidden Session per group, so a group never reads a Bot's private chat.