A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.
Refresh documentation to match current dev behavior
Fei24111d518e21df7e
diff --git a/README.md b/README.mdindex fc3ca2c1..c4c184c8 100644--- a/README.md+++ b/README.md@@ -4,7 +4,7 @@English | [中文](README.zh.md)-  +  **[Download DS Bot for Windows 10/11 (64-bit) / 下载 Windows 10/11(64 位)版](https://github.com/Fei2411/DS-Bot/releases/latest)**, about 212 MB / 约 212 MB. A community project, not an official DeepSeek product. / 社区开源项目,不是 DeepSeek 官方产品。@@ -119,6 +119,8 @@ Any bot can hand work to another bot with @. That bot does the work on its own,A group chat has its own memory. What you tell the group stays in the group: its members use it there, and your other chats and the bots outside the group do not see it. You can manage it in the group's details.+For larger work, a group chat can run a goal: the admin aligns with you on what "done" means, splits the work into stages across members, and checks each stage against evidence before moving on.+### Capabilitiesdiff --git a/README.zh.md b/README.zh.mdindex 6f02fc02..2e8bc7b4 100644--- a/README.zh.md+++ b/README.zh.md@@ -4,7 +4,7 @@[English](README.md) | 中文-  +  **[Download DS Bot for Windows 10/11 (64-bit) / 下载 Windows 10/11(64 位)版](https://github.com/Fei2411/DS-Bot/releases/latest)**, about 212 MB / 约 212 MB. A community project, not an official DeepSeek product. / 社区开源项目,不是 DeepSeek 官方产品。@@ -119,6 +119,8 @@ ds bot 拥有群聊功能。群聊是非常好的多 bot 协作方式,但它群聊有自己的记忆。你在群里交代的事留在群里:群成员在这个群里会用到,你的其他对话和群外的 bot 都看不到。你可以在群聊详情里管理它。+做大任务时,群聊可以设定目标(Goal):管理员先和你对齐完成标准,再把工作拆成阶段分给成员,每个阶段对照证据验收通过后才进入下一阶段。+### 能力diff --git a/SECURITY_MODEL.md b/SECURITY_MODEL.mdindex d2ac3dde..ff10c577 100644--- a/SECURITY_MODEL.md+++ b/SECURITY_MODEL.md@@ -20,11 +20,11 @@ Trust boundaries:## Components-- **host** — plugin server side: `ds-bot/index.js`, `ds-bot/src/host/` (roster, tools, turns/delivery, groups, parts, memory, schedules, permissions, connectors, providers).+- **host** — plugin server side: `ds-bot/index.js`, `ds-bot/src/host/` (roster, tools, turns/delivery, groups, goals, parts, memory, schedules, permissions, privacy, folders, connectors, providers).- **secrets** — `ds-bot/src/host/secrets.js` (secrets.json mode 600, `$DSH_SECRET_<NAME>`, redactor) and API keys/providers (`providers.js`, `models.js`).- **client** — browser UI: `ds-bot/src/client/` (incl. widget-html, read-page, connectors UI) and generated `ds-bot/client.js`.- **browser** — Bot browser bridge and browser plugins: `ds-bot/src/host/browser.js`, `browser-plugins.js`, `src/host/browser/`, `browser-plugins/`.-- **desktop-app** — Electron app: `app/src/` (main, preload, IPC, cookie import, updates, import from `~/.dsh`, move-data), `app/engine/`.+- **desktop-app** — Electron app: `app/src/` (main, start-window, preload, IPC, cookie import, updates, import from `~/.dsh`, move-data), `app/engine/`.- **web-search** — `ds-bot/web-search.js`.- **docker** — `docker/Dockerfile`, `entrypoint.sh`, `docker.patch.yml`, `docker-compose.yml`.@@ -49,6 +49,8 @@ Trust boundaries:## Existing controls- Main-Bot checks in `tools.js` (`rt.isMain`, `rt.isAdminOf`).+- Working folders, the team workspace and Bot photos stay out of DSH's data and the team's data (`folders.js` `guarded`/`inData`).+- Private Bots (`privacy.js`): user-only switch; other Bots cannot read a private Bot's working folder, memory or Sessions, and a private Bot's outbound sharing (`message_bot`, shared capabilities, writes outside its folder) requires user approval; protection stays after deletion until the user releases it in Settings.- Per-Bot permission presets (`permissions.js`), set on every Session.- Secrets: scoped per Bot (`canUse`), redacted from tool results and outbound model requests (`redactor`, JSON/URL-encoded forms).- Connectors refuse non-HTTPS addresses (`connectors.js`).diff --git a/app/README.md b/app/README.mdindex 370277e8..9fb3820d 100644--- a/app/README.md+++ b/app/README.md@@ -143,18 +143,20 @@ The launch URL of the Host is good for one use only. When the first load never c| File | What it does ||---|---|-| `src/main.mjs` | Main process: one instance, the window, which loads the Host's loopback address as DSH Web does, and the sign-in page DSH opens, which goes to the system browser |+| `src/main.mjs` | Main process: one instance, the start window and the team window, which loads the Host's loopback address as DSH Web does, and the sign-in page DSH opens, which goes to the system browser |+| `src/start/`, `src/start-window.mjs`, `src/start-frame.mjs`, `scripts/start-assets.mjs` | The start window (720 × 540, Mica on Windows 11): the whale swims across the waterline as the real startup phases finish, cards morph in place, and the window grows to the team window's rectangle on hand-off || `src/shell.mjs`, `src/tray.mjs`, `src/background-notice.mjs` | The window and the tray: the window hides instead of closing, the tray opens it again and quits the app, and the one-time confirmation before the window hides || `src/update-prompt.mjs` | An update prompt that waits for the window to be shown again || `src/host-port.mjs` | The Host's port, kept between starts, since the page keeps its storage per address |-| `src/preload.cjs` | Hands DS Bot's settings the data location and its move, and DS Bot's Bot browsers their webview leases and cookie imports. On Windows it marks the page for the frameless window and sends the caption buttons the colors of the surface under them |-| `src/bot-browser.mjs` | The Bot browsers' webviews: only a leased one attaches, with fixed preferences; each Bot's logins stay on disk until the Bot is deleted; pages cannot reach the Host |+| `src/logs.mjs`, `src/downloads.mjs` | Rotating `main.log` (2 MB × 3 in userData) with key, token and home-path redaction; downloads folder lookup that falls back cleanly when the OS Downloads path is missing |+| `src/preload.cjs` | Hands the start page `dsBotStart`, DS Bot's settings the data location and its move, and DS Bot's Bot browsers their webview leases and cookie imports. On Windows it marks the page for the frameless window and sends the caption buttons the colors of the surface under them |+| `src/bot-browser.mjs`, `src/bot-views.mjs` | The Bot browsers' webviews and native views: only a leased one attaches, with fixed preferences; each Bot's logins stay on disk until the Bot is deleted; pages cannot reach the Host || `src/cookie-parse.mjs`, `src/cookie-import.mjs`, `src/browser-sources.mjs` | Cookie imports: the cookie-file parser (Cookie-Editor JSON, Netscape, Playwright storageState), the write into a Bot's partition with read-back and flush, and the installed-browser profiles a source is cloned from — the source browser itself decrypts its own store over a CDP pipe; values never leave the main process |-| `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/window-frame.mjs`, `src/mica.css`, `src/fonts.css` | The frameless Windows window: the caption band, when Mica is available (Windows 11 22H2 and later), the stylesheet that lets Mica through the sidebar, and the font sheet that leaves CJK fallback to the OS || `src/host-process.mjs` | Starts the Host in the bundled plain Node on Linux, Electron's Node mode elsewhere, 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/app-patch.mjs` | The app's own profile overlay (`profiles/app-onboarding.patch.yml`, passed through `patchFiles`): it turns off DSH Web's automatic credential step (`credentialOnboarding: false`), since models are set up in DS Bot's Models page and the Main Bot's key card |+| `src/profile.mjs`, `src/legacy.mjs` | The profiles: the app's own and the first-run check's, their bundles, creation and update, and the migration / encryption identity compatibility with earlier installs |+| `src/app-patch.mjs`, `src/office-patch.mjs`, `src/goal-patch.mjs`, `src/search-patch.mjs` | The app's profile overlays (passed through `patchFiles`): turns off DSH Web's automatic credential step (`credentialOnboarding: false`), wires the bundled Office runtime when present, removes DSH's `/goal` command and tool from presets in favor of DS Bot's group Goal, and restores a working search provider when `web-search-auto` was disabled || `src/session-check.mjs` | Which chats the pinned DSH refuses because a newer DSH wrote them || `src/first-run.mjs` | The first start's places (the defaults, the saved ones, the folder picker of 「换个位置…」), its offer to import, and the texts of the data move || `src/place.mjs` | The place line of the start page (drive, free space) and the root rule of a picked folder |diff --git a/docs/dev/release-checklist.md b/docs/dev/release-checklist.mdindex e6fdbb40..4a33980c 100644--- a/docs/dev/release-checklist.md+++ b/docs/dev/release-checklist.md@@ -148,13 +148,13 @@ DSH Desktop 和桌面应用各做一遍。| # | 步骤 | 期望 | 结果 ||---|---|---|---|| 12.1 | 运行安装包,选安装位置,安装 | 不要管理员权限;只装给当前用户;开始菜单里有 DS Bot | |-| 12.2 | 第一次打开:选数据位置和总工作区;有 DSH 团队时选复制 | 团队、对话、模型设置都在;DSH 里原来的团队不变 | |+| 12.2 | 第一次打开:启动窗口出现(底注有位置和「换个位置…」);有 DSH 团队时选复制 | 团队、对话、模型设置都在;DSH 里原来的团队不变 | || 12.3 | 给一个 Bot 发消息;再打开设置 → 关于 DS Bot | 收到回复;DS Bot 一行写「随 DS Bot 应用一起更新。」 | || 12.4 | 看窗口:拖标题栏,双击标题栏,点最小化、最大化、关闭;切换浅色和深色 | 没有系统边框;拖得动,双击会最大化,最大化后顶部没有缝;三个按钮都能用,底色和下面的界面一样;Windows 11 上侧栏透出 Mica,Windows 10 上标题栏和侧栏同色 | || 12.5 | 按 `Ctrl+Alt+B` | 侧栏收起,再按一次展开 | || 12.6 | 设置 → 通用 →「位置」:把总工作区换到另一个文件夹,给 Bot 发消息;再把数据位置换到一个空文件夹 | 总工作区换完,Bot 的下一轮在新文件夹里;数据复制完 App 自己重启,团队和对话都在,「位置」里是新的数据位置,旧文件夹还在 | || 12.7 | 装上一个发布版本的 App,打开它,等它提示新版本已经下载好,选「立即重启」 | App 关掉后自己装好新版并重新打开;关于页里是新版本号;团队都在 | |-| 12.8 | 再装一次上一个版本,等下载好的提示,选「稍后」,退出 App,等半分钟再打开 | 打开的是新版 | |+| 12.8 | 再装一次上一个版本,等下载好的提示,选「先不重启」,从托盘退出 App,等半分钟再打开 | 打开的是新版 | |## 13. 桌面应用(macOS)@@ -164,7 +164,7 @@ DSH Desktop 和桌面应用各做一遍。|---|---|---|---|| 13.1 | 发布 Release,等工作流传完文件 | Release 里有 arm64 和 x64 两个 zip | || 13.2 | 用 Safari 从 Release 页下载这台 Mac 的 zip(Safari 会自动解压),把 DS Bot 拖到「应用程序」,第一次打开 | Gatekeeper 拦下,不说「已损坏」;到「系统设置 → 隐私与安全性」点「仍要打开」后能打开 | |-| 13.3 | 第一次打开:选数据位置和总工作区;有 DSH 团队时选复制;给一个 Bot 发消息 | 团队、对话、模型设置都在;收到回复;关于页写「随 DS Bot 应用一起更新。」 | |+| 13.3 | 第一次打开:启动窗口出现(底注有位置和「换个位置…」);有 DSH 团队时选复制;给一个 Bot 发消息 | 团队、对话、模型设置都在;收到回复;关于页写「随 DS Bot 应用一起更新。」 | || 13.4 | 设置 → 通用 →「位置」:把总工作区换到另一个文件夹,给 Bot 发消息;再把数据位置换到一个空文件夹 | 总工作区换完,Bot 的下一轮在新文件夹里;数据复制完 App 自己重启,团队和对话都在,「位置」里是新的数据位置,旧文件夹还在 | |-| 13.5 | 关闭窗口 | 应用退出,Dock 里不留着 | |+| 13.5 | 关闭窗口,再从托盘或 Dock 重新打开;最后从托盘选「退出 DS Bot」 | 第一次关窗提示留在托盘继续运行,确认后窗口隐藏、引擎照常;点 Dock 图标或托盘「打开 DS Bot」窗口回来;托盘「退出 DS Bot」才完全退出 | || 13.6 | 装上一个发布版本的 App 并打开,等新版提示后点「下载」 | 打开这次 Release 的发布页;应用不自己安装新版 | |diff --git a/docs/plans/2026-10-07-roles-and-permissions.md b/docs/plans/2026-10-07-roles-and-permissions.mdindex 0ef2024a..49511282 100644--- a/docs/plans/2026-10-07-roles-and-permissions.md+++ b/docs/plans/2026-10-07-roles-and-permissions.md@@ -18,10 +18,10 @@| 谁 | 范围 | 能做什么 ||---|---|---|-| 用户 | 全部 | 一切操作,包括设置、取消 Main Bot,设置 Bot 和群的沙盒权限 |-| Main Bot | 整个团队 | 建 Bot(`create_bot`)、改任何 Bot(`update_bot`)、停止别的 Bot 正在跑的回合(`stop_bot`);建群、改任何群、删群、往任何群发言;写团队记忆,按用户要求读写某个 Bot 的记忆;给任何 Bot 挂、摘能力 |-| 群管理员 | 自己管的群 | 改自己的群(改名、公告、成员、管理员、回答方式),往自己的群发言,写团队记忆。不能删群,不能改群的工作文件夹 |-| 普通 Bot | 自己 | 改自己的名字、角色、颜色、模型、工作文件夹、指令;给自己挂、摘能力;在群里发言、用 `@` 点名;往自己所在的群发帖(只叫 `@` 点到的成员);在私聊里用 `message_bot` 给任何 Bot 发消息(在群里只能叫本群成员,见 [群聊](2026-10-07-group-chat.md));在群里读写这个群的记忆(见 [上下文与记忆](2026-10-09-context-and-memory.md)) |+| 用户 | 全部 | 一切操作,包括设置、取消 Main Bot,开启或关闭隐私 Bot,设置 Bot 和群的沙盒权限 |+| Main Bot | 整个团队(隐私 Bot 除外) | 建 Bot(`create_bot`)、改任何非隐私 Bot(`update_bot`)、停止别的非隐私 Bot 正在跑的回合(`stop_bot`);建群、改任何群、删群、往任何群发言、推进任何群的 Goal(`group_goal`);写团队记忆,按用户要求读写某个非隐私 Bot 的记忆;给任何非隐私 Bot 挂、摘能力 |+| 群管理员 | 自己管的群 | 改自己的群(改名、公告、成员、管理员、回答方式),设定和推进自己群的 Goal(`group_goal`),往自己的群发言,写团队记忆。不能删群,不能改群的工作文件夹 |+| 普通 Bot | 自己 | 改自己的名字、角色、颜色、模型、思考强度、工作文件夹、指令;给自己挂、摘能力;在群里发言、用 `@` 点名、查看群的 Goal;往自己所在的群发帖(只叫 `@` 点到的成员);在私聊里用 `message_bot` 给任何非隐私 Bot 发消息(在群里只能叫本群成员,见 [群聊](2026-10-07-group-chat.md));在群里读写这个群的记忆(见 [上下文与记忆](2026-10-09-context-and-memory.md))。用户设为隐私的 Bot 另有单向隔离边界,见 [隐私 Bot](2026-10-27-private-bots.md) |- 可以有多个 Main Bot,至少保留一个。只有用户能设置或取消 Main Bot。- Main Bot 不能直接删除,要先取消它的 Main Bot 角色。diff --git a/docs/plans/2026-10-08-browser-and-secrets.md b/docs/plans/2026-10-08-browser-and-secrets.mdindex 5c16685d..a6db9d8f 100644--- a/docs/plans/2026-10-08-browser-and-secrets.md+++ b/docs/plans/2026-10-08-browser-and-secrets.md@@ -66,7 +66,6 @@ Bot 要替用户在网上做事,就会碰到两类东西:网页,以及登- Bot 浏览器只在 DSH Desktop 和桌面应用里有,DSH Web 没有。- 历史消息里的链接还不能直接在 Bot 浏览器里打开(#114)。- 关掉 `auto` 搜索以后,`web_search` 可能报错,恢复方法见 #128。-- 用 opencode 路由时,原生搜索缺少 `x-opencode-session`(#184)。- 导入 cookie 只在桌面应用里有(写进 Bot 自己的存储分区):cookie 文件(Cookie-Editor JSON、cookies.txt、Playwright storageState)和本机 Chrome/Edge/Firefox 的 profile。Chromium 系是先克隆 profile、再让原浏览器自己解密,不是直接读文件。Windows 上 Chrome/Edge 的新 cookie 用 app-bound 加密(v20),只在原 user-data 目录里能解:克隆目录解不开,这些条目会标成跳过;如果整库都是 v20 会直接提示走文件导入。localStorage 等其他登录状态不导。- 密钥只防泄露到模型、记录和其他 Bot 的 shell。有权限的 Bot 在自己的 shell 里能用到值,所以给哪些 Bot 开放,要由用户判断。@@ -75,6 +74,7 @@ Bot 要替用户在网上做事,就会碰到两类东西:网页,以及登- 2026-10-08:每个 Bot 一个浏览器,由用户操作,Bot 只读。- 2026-10-09:`read_browser` 读成 Markdown 并标注链接和控件;密钥卡和替换规则。- 之后:加了多标签页、最多 6 个活着的页面、GitHub 连接器。+- 2026-10-16:opencode 路由的原生搜索带上提问会话的 `x-opencode-session`(#184,PR #240)。- 2026-10-23:桌面应用里也有 Bot 浏览器,登录保存在应用自己的目录里,#449。- 2026-10-23:桌面应用的 Bot 浏览器能导入 cookie(文件和本机浏览器),#458。- 2026-10-21:操作浏览器改由可选插件来做,见 [浏览器插件](2026-10-21-browser-plugins.md)。不配插件时,这一篇的只读行为不变。diff --git a/docs/plans/2026-10-09-context-and-memory.md b/docs/plans/2026-10-09-context-and-memory.mdindex 2ea05fc5..258c2ae7 100644--- a/docs/plans/2026-10-09-context-and-memory.md+++ b/docs/plans/2026-10-09-context-and-memory.md@@ -109,8 +109,8 @@ Bot 是长期的:用户和一个 Bot 聊几周、几个月,上下文一定- Bot 用 `remember` / `forget`。这两个工具检查谁能写哪里、大小限制,并且拒绝看起来像密钥的内容。在私聊里默认写自己的记忆;在群里默认写这个群的记忆,`scope: "own"` 写自己的,`scope: "team"` 写团队的(有权限时)。- 没写进去的时候(没权限、超了大小上限、没找到要删的条目),`remember` / `forget` 报错,不回一句平常的话:模型看得出没存上,对话里也有一行提示,写着简短的失败原因和记忆面板的入口(不重复条目内容)。存进去的那一行还是原来那句短话;条目本来就在的时候,只有一行安静的「已经保存过了」。-- **记忆整理**:一段对话空闲后,由模型读这段对话里新增的内容,像人谈完话后那样保留、修改或删除条目。用户说的话保留得最完整。私聊由 Bot 自己的模型整理,写进它自己的记忆;群聊按群整理一次(不是每个成员各整理一次),用群管理员的模型(没有管理员时用第一个成员的),只写进群记忆,不写个人记忆和团队记忆。整理一次只跑一个。-- 记忆面板:显示模型写的摘要和所有条目,用户可以问、可以直接改。Bot 的面板显示它自己的记忆和团队记忆;群的面板(群详情里的「记忆」)只显示群记忆。+- **记忆整理**:一段对话空闲后,由模型读这段对话里新增的内容,像人谈完话后那样保留、修改或删除条目。用户说的话保留得最完整。私聊由 Bot 自己的模型整理,写进它自己的记忆;群聊按群整理一次(不是每个成员各整理一次),用群管理员的模型(没有管理员时用第一个成员的),只写进群记忆,不写个人记忆和团队记忆,且只保留任务结束后仍有用的约定、决定和事实,不记一次性任务状态(#797)。整理一次只跑一个。+- 记忆面板:显示模型写的摘要、所有条目和「更改记录」(按 `journal.jsonl` 列出每次添加、修改、删除,点两次即可撤销单条改动,见 [记忆撤销与更改记录](2026-11-01-memory-restore.md)),用户可以问、可以直接改。Bot 的面板显示它自己的记忆和团队记忆;群的面板(群详情里的「记忆」)只显示群记忆。- 删除群时,群记忆整份移到 `archive/`,成员的群会话里冻结的记忆段一起作废。- 三条路走同一个写入路径,一次只写一个,由持有团队的那个进程写。- 历史不用 git:文件原地修改,`journal.jsonl` 记下每次改动替换了什么。@@ -137,8 +137,8 @@ Bot 是长期的:用户和一个 Bot 聊几周、几个月,上下文一定- DSH 的一些适配器会给没写 `contextWindow` 的模型自己填一个默认值,这时插件拿到的是适配器的值,不是 500k。README 里要求用户填 `contextWindow`。- 已经开着的会话看不到之后保存的记忆,只能靠 Bot 调 `recall`(#214 在讨论是否改变这一点)。- 和[愿景](../vision.zh.md)第 3 条的差距:- - 愿景要求 Bot 之间的记忆互相只读,现在普通 Bot 不能读别的 Bot 的记忆。- - 愿景要求目标驱动地完成工作,现在 Bot 会话里关掉了 DSH 的 goal(见 [DSH 让步总账](2026-10-13-dsh-concessions.md))。+ - 愿景要求 Bot 之间的记忆互相只读,现在普通 Bot 不能读别的 Bot 的记忆(隐私 Bot 则是显式单向隔离,见 [隐私 Bot](2026-10-27-private-bots.md))。+ - 愿景要求目标驱动地完成工作:群聊已有 DS Bot 自己的 [群聊 Goal](2026-11-01-group-goal.md)(#791),单 Bot 私聊里的 Goal 还没做;Bot 会话里关掉了 DSH 的会话级 goal(见 [DSH 让步总账](2026-10-13-dsh-concessions.md))。- 「Bot 开一个全新的会话、保留身份」(相当于 /new)还没有(#122)。## 变更@@ -149,4 +149,5 @@ Bot 是长期的:用户和一个 Bot 聊几周、几个月,上下文一定- 2026-10-23:换工作文件夹触发的换段在会话尾部显示一行状态(「正在切换工作文件夹」,#486)。其他原因的换段仍然无感。- 2026-10-23:加 `pending.json`,一次改动当成一次来做(#481)。之前文件先写、日志后写,中断会留下没有日志的条目,或没有链接的主题。- 2026-10-23:没写进记忆的时候,`remember` / `forget` 报错,对话里显示一行失败提示和记忆面板的入口(#482)。-- 2026-11-02:群记忆从群会话的系统提示词挪到会话开头的一条快照消息,群会话的系统提示词和工具与私聊相同,首轮能共用私聊的前缀缓存(实测首轮命中从约 2k 到约 13k token)。+- 2026-11-02:群记忆从群会话的系统提示词挪到会话开头的一条快照消息,群会话的系统提示词和工具与私聊相同,首轮能共用私聊的前缀缓存(实测首轮命中从约 2k 到约 13k token,PR #828)。+- 2026-11-02:群记忆整理不再记一次性任务、只保留任务结束后仍有用的内容(#797,PR #827);记忆面板 ⋯ 菜单增加「更改记录」,可按记录 id 撤销单条改动(#464,PR #822)。diff --git a/docs/plans/2026-10-10-bot-runtime.md b/docs/plans/2026-10-10-bot-runtime.mdindex 1a86c692..7da8aa97 100644--- a/docs/plans/2026-10-10-bot-runtime.md+++ b/docs/plans/2026-10-10-bot-runtime.md@@ -1,7 +1,7 @@# Bot 运行配置:预设、模型、思考强度、工作文件夹、能力- 日期:2026-10-10 定预设和能力包,之后陆续补充-- 相关:#99(思考强度)、#159(换模型不生效)、#208、#209(工作文件夹)、#798(Bot 不派子代理)+- 相关:#99(思考强度)、#159(换模型不生效)、#208、#209(工作文件夹)、#227(新 Bot 默认模型)、#798(Bot 不派子代理)- 代码:`ds-bot/src/host/roster.js`、`models.js`、`folders.js`、`capabilities.js`、`permissions.js`,建 Bot 表单在 `src/client/bot-draft.js`权限预设(只读 / 工作区内修改 / 完全权限)和群的统一权限见[角色与权限](2026-10-07-roles-and-permissions.md),这里不重复。@@ -29,8 +29,9 @@- 选择保存在 Bot 的 Session 上。DSH 的 `selectModel` 会顺手把选择写成 profile 的默认模型,所以 DS Bot 每次选完都把用户原来的默认写回去。选择一次只做一个,并等写回完成。- 「能用的模型」:模型列表里提供商还缺 key 的(`needsKey`)不算能用。DS Bot 自己选模型时只从能用的里选;一个也没有时不选,让用户选。用户自己给 Bot 选的模型照样保留,哪怕它缺 key。- 新 Bot 的模型从哪里来:- - 建 Bot 表单:预选 DSH 的默认模型(还在服务中且能用时),否则选第一个能用的模型。用户可以改。- - Main Bot 用 `create_bot` 且没有指定模型:用创建者自己的模型(还在服务中且能用时),否则同上。+ - 设置 → 通用 → 新 Bot →「默认模型」可以给团队设一个新 Bot 的默认模型(`defaultBotModel`)。已有 Bot 不受影响。+ - 建 Bot 表单:预选团队设的新 Bot 默认模型(还在服务中且能用时),否则选 DSH 的默认模型(还在服务中且能用时),再否则选第一个能用的模型。用户可以改。+ - Main Bot 用 `create_bot` 且没有指定模型:优先用团队的新 Bot 默认模型(还在服务中且能用时),没设或不能用时用创建者自己的模型(还在服务中且能用时),否则同上(#227)。- 团队的**第一个 Main Bot** 没有模型,等用户在它的聊天里选好再打招呼。用户在选模型之前就发了消息,开场白不丢:选好模型后,它先回答这条消息,再用一句话说明自己管团队。- 一个 Bot 的回合因为缺 key、key 不对、余额不足或账号登录失效而失败时,记在这个 Bot 上(`blocked`:失败代码、HTTP 状态码、request id、提供商,不存原文),直到它的下一个回合完成、key 或提供商变了、或者它换了模型。聊天里的修复卡读它;卡上的「重试」让 Bot 接着回答用户上一条消息,不再发一遍。开场白因为这些原因失败时重新留着,修好后再发。- 一个 Bot 的模型不再被服务时:先回到它上次实际用过的模型,再回到 DSH 默认(这两个都只在能用时),再回到第一个能用的模型;一个能用的都没有就不选。@@ -39,7 +40,7 @@### 思考强度-- 每个 Bot 可以设一个思考强度,在建 Bot 表单和 Bot 详情里设。+- 每个 Bot 可以设一个思考强度,在建 Bot 表单、Bot 详情和 `create_bot` / `update_bot` 里设。- 只有当前模型提供的强度才会发出去;模型没有这一档就用模型自己的默认。提供方不认识的强度会被直接拒绝,所以绝不硬发。- 换模型、新开一段都保留这个设置。@@ -53,6 +54,7 @@- 保存的是真实路径,和 Session 的 cwd 显示一致。- Bot 可以按用户的一句话给自己设文件夹(`update_bot`),规则同上。- DSH 的 `working_directory` 工具(DSH 0.2.1 起):Bot 进工作文件夹里面的文件夹,只是这段对话换个地方,不存、不换段,下一段回到工作文件夹。进工作文件夹以外的文件夹,等于给自己设新的工作文件夹:规则和 `update_bot` 一样,存进 Bot 的设置,下一步换到新的一段。群设了文件夹时,成员只能在群的文件夹里面换。+- 工作文件夹被外部删除或改名时:总工作区不在了会自动重建;Bot 或群自己的文件夹不在了,在组装提示词前先切到回退文件夹,再换到那里的新一段,不会吞掉消息(#209)。### 能力@@ -72,8 +74,6 @@## 已知限制- **「能用」只看 key 有没有配**:`needsKey` 只覆盖 profile 写了 `apiKeyEnv` 的提供商。key 配了但不对、余额为零,或者是 DeepSeek 账号这类登录式的提供商没登录,都还算能用,要到第一轮失败才知道(失败后有修复卡)。保存 key 时检查、确认能用再打招呼,见 [Windows 上手流程](2026-10-26-windows-onboarding.md) 的 M2。-- `create_bot` 和 `update_bot` 还不能设思考强度,只能在界面上设(#99)。-- DSH 0.2.1-alpha 上,工作文件夹被删或改名后,消息会被吞掉、不会退回总工作区(#209)。- 能力包「coding」「research」的具体组成还没定。- 委派工具按 DSH 的默认名字认;profile 里改了名(`toolName`)的认不出来。@@ -81,7 +81,10 @@- 2026-10-10:Bot 预设归 DS Bot 所有;不预置分工 Bot;能力包只做加法。- 2026-10-14:新的 Bot 会话、群会话和分段显式用 `standard`,修好 PTC 预设下群聊不接力(#37)。+- 2026-10-16:工作文件夹被删除或改名时自动重建总工作区或切到回退文件夹并换段,不再吞消息(#209,PR #250)。- 2026-10-19:Bot 用 DSH 的 `working_directory` 换到工作文件夹以外时,当作给自己设工作文件夹(同样的检查和批准),换到新的一段;在工作文件夹里面换只是走进去(#345)。- 2026-10-20:用户能在设置里换总工作区;中文名「团队工作区」改叫「总工作区」(#364)。- 2026-10-26:DS Bot 自己选模型时只选能用的(缺 key 的不选);先打字不再丢掉第一个 Main Bot 的开场白;凭据类失败记在 Bot 上,供修复卡和「重试」用([Windows 上手流程](2026-10-26-windows-onboarding.md) M1)。+- 2026-10-30:`create_bot` 和 `update_bot` 已经能设思考强度,删掉「只能在界面上设」这条过时的限制(#99)。- 2026-11-01:Bot 不再派 DSH 子代理:委派工具和子代理控制工具不出现在 Bot 会话里,goal、workflow 的用法说明也从 Bot 的系统提示里去掉(#798)。+- 2026-11-02:设置 → 通用里可以给新 Bot 指定团队默认模型,建 Bot 表单和未指定模型的 `create_bot` 优先用它(#227,PR #823)。diff --git a/docs/plans/2026-10-16-desktop-app.md b/docs/plans/2026-10-16-desktop-app.mdindex d0947d7a..1f7fbae1 100644--- a/docs/plans/2026-10-16-desktop-app.md+++ b/docs/plans/2026-10-16-desktop-app.md@@ -28,6 +28,7 @@### 窗口+- 每次启动先显示 720 × 540(显示器工作区矮时 720 × 500)的**启动窗口**(`app/src/start/`):Main Bot 的鲸鱼沿着水线游过三个真实阶段,团队界面在隐藏的主窗口里加载,就绪后启动窗口长到主窗口的矩形、主窗口在原位露面(见 [启动窗口](2026-10-26-start-window.md))。- Windows:窗口无边框,和 DSH Desktop 一样。标题栏并进页面,系统的最小化、最大化、关闭按钮留在右上角,颜色和它下面的界面一致,跟着主题变。拖标题栏移动窗口,双击最大化。- Windows 11(22H2 及以后):侧栏用 Mica 材质,一直通到窗口顶部;对话区也到顶,左上角是圆角,系统按钮在对话区上。Windows 10 上标题栏和侧栏同色、不透明。- 弹出对话框时,标题栏和系统按钮跟页面一起变暗。@@ -68,7 +69,7 @@### 首次启动和导入-- 首次启动分别选数据位置(默认 `~/.ds-bot`)和总工作区(默认 `~/DS Bot`),以后能在设置里改(见下面「改位置」)。两个位置不能一个在另一个里面,也不能在用户 DSH 的数据里。用的是系统对话框。+- 首次启动不弹系统选择框,直接用默认数据位置(`~/.ds-bot`)和总工作区(`~/DS Bot`),记在壳数据的 `locations.json` 里。启动窗口底注右侧写着放在哪、盘还剩多少空间,并带「换个位置…」:点了才打开系统文件夹选择框,选一个文件夹按定根规则(`src/place.mjs`,见 [Windows 上手流程](2026-10-26-windows-onboarding.md))把数据放在 `<根>/data`、总工作区放在 `<根>/workspace`;以后也能在设置里改(见下面「改位置」)。两个位置不能一个在另一个里面,也不能在用户 DSH 的数据里。- 发现用户 DSH 里已有团队时,问要不要导入,只在首次启动问一次。导入复制 Bot、群、记忆、会话、附件、模型设置和密钥,旧位置一个字节都不改。导入以后两个团队各走各的,不同步。- DSH 正在用这个团队时,请用户先关掉。「正在用」和插件的 home-lock 同一个规则:锁在 60 秒内刷新过,且同一台机器上锁里的进程还活着(Windows 会重用进程号,只看进程号会把旧锁当成活的)。- 目标里已经有 `.credentials.yaml` 或 `.env` 时不覆盖,导入结果里记成「保留」;只含引擎自己写的 `client-connection/` 记录的 `.credentials.yaml` 不算用户的,照常换成旧的。复制用的暂存文件夹不论成功、失败还是中途退出都会删掉。@@ -115,7 +116,6 @@- 不 fork DSH,不给 DSH 打补丁。- 不做 npm 安装的桌面应用,也不做在 DSH Desktop 里一键安装。-- 第一版不带 Office 技能。## 暂时不做@@ -129,7 +129,6 @@- 托盘的图标、菜单和「关窗口变藏窗口」在 Windows 上用真的 Electron 验过(`app/scripts/check-lifecycle.mjs`)。macOS 的 Dock 和全屏、Linux 的托盘可见性、系统的关机和注销,都还没有在真的机器上验过:代码按 DSH Desktop 的做法写,单元测试管的是规则本身。- macOS 上窗口还有系统标题栏。无边框要让页面进入 DSH 的 macOS 桌面模式,那时快捷键改由原生菜单输入,应用要提供 DSH Desktop 那样的键盘桥。- 会话里记着工作文件夹的完整路径,不能改。所以导入和搬工作文件夹都要换段。-- 安装的 `@deepseek-ai/dsh` 包带着 Office 套件和语音包,所以安装包里仍有这些文件,只是不加载。## 变更@@ -156,4 +155,6 @@- 2026-10-23:应用里接上 Bot 浏览器:应用自己提供 webview 桥,每个 Bot 的登录存在壳自己的数据里,删掉 Bot 时一起清掉,Issue #449。- 2026-10-25:关掉窗口只是藏起来,应用留在系统托盘;托盘的「打开」找回窗口,「退出」是唯一的正常退出入口,Issue #500。- 2026-10-26:关掉 DSH 网页版的自动凭据引导,模型在 DS Bot 自己的模型页和 key 卡片里配;导入时判断团队「正在用」加上锁的刷新时间,不覆盖已有的 key,总会删掉暂存文件夹;建窗口不再依赖「下载」文件夹;启动失败后再双击也能把窗口叫到前面;Release 最后才标为最新,并附 `SHA256SUMS.txt`、不带版本号的安装包和下载表([Windows 上手流程](2026-10-26-windows-onboarding.md) M1)。+- 2026-10-29:桌面应用随包带上 Office 运行时(Python、独立 Node、LibreOffice 引擎和 Office 技能),见 [Office 文档](2026-10-27-office-documents.md),Issue #613,PR #624。- 2026-11-01:程序、可执行文件和安装包统一使用 DS Bot / dsbot;保留已有安装、数据、浏览器加密身份和旧客户端更新入口的兼容。+- 2026-11-02:LibreOffice 引擎包移到 `app.asar` 外的 `resources/node_modules`,修复打包后 Office 文件预览无法启动子进程的问题(#679,PR #705);启动窗口、鲸鱼进度、底注位置行和恢复卡合入(PR #702)。diff --git a/docs/plans/2026-10-26-start-window.md b/docs/plans/2026-10-26-start-window.mdindex 13227b35..805fbb1d 100644--- a/docs/plans/2026-10-26-start-window.md+++ b/docs/plans/2026-10-26-start-window.md@@ -48,9 +48,9 @@|---|---|---|---|| 标题带 | y 0–40 | 同左 | 空,可以拖动 || 已用秒数 | 右对齐 x 672,y 54–72 | 同左位置,隐藏(卡片等回答时暂停,第 4 节) | 「已用 N 秒」,13/18,`--bt-ink-2`,等宽数字,宽度固定 |-| 水道 | x 48–672,y 156–260 | x 48–672,y 76–180 | 88 px 的鲸鱼,停在三站之一;水线以下的部分被裁掉 |+| 水道 | x 48–672,y 156–260 | x 48–672,y 76–180 | 66 px 的鲸鱼,停在三站之一;水线以下的部分被裁掉 || 水线 | y 260 | y 180 | 1 px `--bt-line`,首尾各 12% 渐隐;上面什么都不画 |-| 圈 | 在水线上,中心 x 180、372 | 同左,跟着水线 | 56 × 12 的细线椭圆,1 px `--bt-line-2`,停住后不透明度 .5;鲸鱼离开第 1 站、第 2 站时各留下一个,第 3 站不留;交接时淡出 |+| 圈 | 在水线上,中心 x 177、369 | 同左,跟着水线 | 42 × 9 的细线椭圆,1 px `--bt-line-2`,停住后不透明度 .5;鲸鱼离开第 1 站、第 2 站时各留下一个,第 3 站不留;交接时淡出 || 鲸鱼的话 | y 274–294,居中 | y 194–214,居中 | 15/20、600,`--bt-ink`;只有一行,不换行,实在放不下才用省略号 || 提示行 | y 300–328,居中 | y 220–248,隐藏 | 13/18,`--bt-ink-2`;最多约 22 个字,或者只有〔打开日志文件夹〕;没有要提前知道的事时空着 || 纸面 | 空 | x 48–672,y 260–496 | 只放卡片 |@@ -63,7 +63,7 @@- 卡片是不透明的 `--bt-card`:1 px `--bt-line` 边,圆角 12,内边距 16 × 20。卡片正文比纸面高时,正文在卡片里滚动,按钮行固定在卡片底部。- 以后的启动:- 没有水线、圈和底注,右上角也没有已用秒数(10 秒起写在下面的提示行里,第 5 节)。- - 64 px 的鲸鱼在 x 360,下面一行字(15/20、600,居中)。没有卡片时整组同样低 80 px,落在窗口的视觉中心;出卡片时一样上移。+ - 48 px 的鲸鱼在 x 360,下面一行字(15/20、600,居中)。没有卡片时整组同样低 80 px,落在窗口的视觉中心;出卡片时一样上移。### 3. 鲸鱼的总规则@@ -113,14 +113,14 @@| 5 | 眼睛跟着键盘焦点 | 键盘把焦点移到纸面或提示行里的按钮、勾选框上 | 眼睛看向那个控件的中心,限幅和跟随指针一样;指针一动就交回指针。卡片出现时焦点自动移到主按钮,那一次不跟,眼睛仍看着卡片 || 6 | 按下预备 | 在回答卡片的按钮上按下指针(展开「详细」「详细信息」、打开模型设置的「更换」、〔复制详细信息〕不算回答) | 身体微蹲:`scale` 1.03 .97,120 ms;点下去时用 `SPRING_TAP` 弹回并点头,移开或取消只弹回;键盘只点头。卡片的动作照旧在点击时才发出 || 7 | 活泼档越跳越稀 | 活泼档,应用主动问、要跳两下的卡片 | 在 0、1.3、3.9、9.1 秒开始跳,以后每 9 秒一次,中间停下来呼吸、眨眼;抚摸或回答后不再跳;导入时空间不够的卡只跳一次 |-| 8 | 潜得更深 | 交接 | 潜到鲸鱼身高的 1.25 倍(首次启动 110 px,以后的启动 80 px),约 200 ms 内整个到水线下,窗口长大之前水道就空了 |+| 8 | 潜得更深 | 交接 | 潜到鲸鱼身高的 1.25 倍(首次启动 82.5 px,以后的启动 60 px),约 200 ms 内整个到水线下,窗口长大之前水道就空了 || 9 | 张望 | 第 2 站工作时(「热身中」的循环),每 5 到 9 秒一次,间隔随机 | 眼睛随机向左或向右看 600 ms:`#eye-pair` 平移 14%,150 ms 过去、停 270 ms、180 ms 回来,`ease-in-out`,叠在上下晃上。10 秒放慢后照常,45 秒换成思考后没有;眼睛跟着指针或键盘焦点时、看向用户的那 600 ms 里、抚摸和跳时都不张望,窗口看不见时也不;正张望着要看向用户时,眼睛先用 120 ms 回正。只在首次启动的第 2 站:以后的启动和搬数据的页面、复制中的卡也用工作的循环,但不张望 |- 动画三档用团队里设的那一档:主窗口的页面报告给应用,应用记在自己的 userData 里,下次启动时用。没有记录时(首次启动)按「正常」。- 安静:只有第一张表的状态动作。没有眼睛跟随、点击转圈、抚摸、尾巴、点头、看向用户、涟漪和「^ ^」眼,也没有第二张表的 1 到 7 和 9。留下的圈只淡入(160 ms),不张开。- 正常:加上眼睛跟随指针、尾巴、点头、看向用户、涟漪、「^ ^」眼,以及第二张表的 1 到 6 和 9。首次启动等待时,点鲸鱼它会转一圈;等用户回答时可以抚摸(UI 标准 8.5)。- 活泼:再加上第二张表的第 7 条:等用户回答时越跳越稀,代替 UI 标准 8.4 的「一直跳」。-- 涟漪是一个 56 × 12 的细线椭圆,只在首次启动出现两次:浮上来和潜下去的地方。潜下去的那一次 160 ms 就淡完,窗口开始长大时已经没有了。以后的启动没有涟漪。鲸鱼离开一站时留下的圈也是这个椭圆,张开后就停在那里(第 2 节)。+- 涟漪是一个 42 × 9 的细线椭圆,只在首次启动出现两次:浮上来和潜下去的地方。潜下去的那一次 160 ms 就淡完,窗口开始长大时已经没有了。以后的启动没有涟漪。鲸鱼离开一站时留下的圈也是这个椭圆,张开后就停在那里(第 2 节)。- 鲸鱼和圈对读屏隐藏(`aria-hidden`)。三个阶段留在一个看不见的列表里(「启动进度」,每项带状态词,当前一项 `aria-current="step"`),礼貌朗读区照旧说「{阶段}:进行中」「{阶段}:已完成」。鲸鱼的话是普通文字,不进朗读区;失败的标题例外,会读出来。卡片出现时朗读它的第一行和第一句话(180 秒的卡读鲸鱼的问题)。### 4. 首次启动,逐拍@@ -154,7 +154,7 @@### 5. 以后的启动-- 0 ms:64 px 的鲸鱼在窗口中间浮上来(`SPRING_TAP` 290 ms),不倾斜,眼睛睁着,没有涟漪。60 ms 后,「正在打开你的团队…」淡入。+- 0 ms:48 px 的鲸鱼在窗口中间浮上来(`SPRING_TAP` 290 ms),不倾斜,眼睛睁着,没有涟漪。60 ms 后,「正在打开你的团队…」淡入。- 没有水线和圈,也没有首次启动的那些话和提示:鲸鱼下面只有这一行已定的字(换位置时是「正在搬 DS Bot 的数据…」)。- 前 1 秒什么都不再动。1 秒后鲸鱼开始工作(只上下晃和眨眼),那行字带流光。- 10 秒起,下面显示「已用 N 秒」。@@ -368,6 +368,7 @@- 2026-10-28 张望:第 3 节第二张表加第 9 条,第 2 站工作时每 5 到 9 秒随机向一边看 600 ms,安静档和减少动态效果没有;维护者问「小鱼的摇晃改为摇晃-张望随机是否可行」,可行,叠在上下晃上。依据:原型 `alive.cjs` 的 wander 用例(正常档 30 秒内三次、间隔 7.8 到 8.5 秒,安静档和指针在页面上时零次)。- 2026-10-29 先打招呼再出发:第 4 节第 2 拍,数据阶段已完成时鲸鱼也等问候读满才离开第 1 站,等的时候晃着。维护者试用落地的启动窗口时「小鲸鱼看到的时候就在第二个位置」:那次首次启动里主进程 2.9 秒就建好了数据文件夹,页面 8.6 秒才画出来(冷启动;之后两次启动 2 秒),鲸鱼浮上来 560 ms 就游到了第 2 站。依据:原型 `alive.cjs` 的 greet 用例(数据阶段在入场结束前完成时,鲸鱼入场后 1.66 秒离开第 1 站、再 0.6 秒说「热身中,等我一下」;搜索到一半完成的也一样,且不说「先找个地方放东西」)、试用副本上的实测(窗口 1.1 秒出现、数据 1.9 秒完成、页面 2.1 秒画出来;鲸鱼入场后 1.68 秒离开第 1 站;`main.mjs` 标记数据完成后紧接着就启动引擎,日志里「engine took」从那一刻起算,和问候无关)。- 2026-10-29 文案分层:启动页的字按页面位置分层、一张表,见 [启动页文案](2026-10-29-start-copy.md);第 11 节 `text.mjs` 一条改成指向它;按各层规则改四处:45 秒的提示和「团队界面没有加载出来」去句号,「会放在 …」加句号、〔重新选〕加 …,OneDrive 的原因里「聊天记录」改成「对话」(第 5、6、7 节)。+- 2026-11-02 鲸鱼缩到 0.75 倍:首次启动 88 → 66 px,以后的启动 64 → 48 px,涟漪和圈 56 × 12 → 42 × 9,绕中心对齐在水线和各站原位置上(PR #702)。## 待定diff --git a/docs/plans/2026-10-26-windows-onboarding.md b/docs/plans/2026-10-26-windows-onboarding.mdindex be0927d5..6cb5cbcf 100644--- a/docs/plans/2026-10-26-windows-onboarding.md+++ b/docs/plans/2026-10-26-windows-onboarding.md@@ -82,7 +82,7 @@ Windows 是桌面应用的主要平台:0.2.0 到 0.2.2 三个版本的安装### 3. 首次启动:启动页- 窗口先出来。进程启动约 1 秒内,启动窗口就显示应用自己的本地页(`app/src/start/`):和现在一样无边框,40 px 的标题带可以拖动,系统按钮在右上角,Windows 11 上用 Mica。启动页在单独的启动窗口里,引擎的页面在隐藏的主窗口里加载([启动窗口](2026-10-26-start-window.md) 第 1 节,待定)。整个启动期间,卡片和失败页也算,启动窗口都是 720 × 540(工作区矮时 720 × 500);它只在交接时改一次大小:长成主窗口的矩形,主窗口在同一个矩形上露面(同上第 8 节)。-- **鲸鱼就是进度。** 首次启动没有标题、三站的标记和说明:Main Bot 的鲸鱼(88 px)在水线上从第 1 站游到第 3 站,它停在哪里就是到了哪一步;它离开第 1、2 站时各在原处留下一个细线的圈,第 3 站没有。三个真实阶段照旧是「准备数据文件夹」→「启动本机引擎」→「打开团队」,但只给读屏:一个看不见的列表「启动进度」(`aria-current="step"`),朗读区照旧说「{阶段}:进行中」「{阶段}:已完成」。5 秒起右上方显示「已用 N 秒」,一直留到「进去吧」。布局、圈和鲸鱼的动作在 [启动窗口](2026-10-26-start-window.md) 第 2、3 节。+- **鲸鱼就是进度。** 首次启动没有标题、三站的标记和说明:Main Bot 的鲸鱼(66 px)在水线上从第 1 站游到第 3 站,它停在哪里就是到了哪一步;它离开第 1、2 站时各在原处留下一个细线的圈,第 3 站没有。三个真实阶段照旧是「准备数据文件夹」→「启动本机引擎」→「打开团队」,但只给读屏:一个看不见的列表「启动进度」(`aria-current="step"`),朗读区照旧说「{阶段}:进行中」「{阶段}:已完成」。5 秒起右上方显示「已用 N 秒」,一直留到「进去吧」。布局、圈和鲸鱼的动作在 [启动窗口](2026-10-26-start-window.md) 第 2、3 节。- **文字都是鲸鱼在说,一次一句短话。** 鲸鱼的话在水线下居中,只占一行,不折行;下面的提示行只说接下来要准备什么(接模型、预览版说明、重装接着用),最多约 22 个字,有卡片时隐藏。首次启动的话和提示:| 时候 | 鲸鱼的话 | 提示行 |@@ -272,7 +272,7 @@ Windows 是桌面应用的主要平台:0.2.0 到 0.2.2 三个版本的安装### 8. 以后的启动和回头入口-- 以后每次启动也显示启动页:64 px 的鲸鱼和「正在打开你的团队…」,没有水线和圈,也没有第 3 节鲸鱼的话和提示;10 秒起显示「已用 N 秒」,45 秒「比平时慢,请再等一会儿」〔打开日志文件夹〕,180 秒和首次启动一样([启动窗口](2026-10-26-start-window.md) 第 5 节)。然后打开上次的 Bot(预计 3 到 12 秒,以后的启动还没实测)。+- 以后每次启动也显示启动页:48 px 的鲸鱼和「正在打开你的团队…」,没有水线和圈,也没有第 3 节鲸鱼的话和提示;10 秒起显示「已用 N 秒」,45 秒「比平时慢,请再等一会儿」〔打开日志文件夹〕,180 秒和首次启动一样([启动窗口](2026-10-26-start-window.md) 第 5 节)。然后打开上次的 Bot(预计 3 到 12 秒,以后的启动还没实测)。- 设置卡由状态决定:没有能用的模型(跳过过、删了 key、退出了登录),Main Bot 的设置卡就回来;账号登录过期时显示「DeepSeek 账号的登录失效了。」〔重新登录〕(桌面应用里同样在登录窗口里登录)。- 目标卡、建议卡和第一件事卡(第 6 节)只在新团队接上模型、上手还没结束时出现。上手结束看 Main Bot 的会话:里面有那行「上手结束」的灰字、或者有用户自己发的消息(第一件事也是),就算结束,从会话里读,不另存标记;结束以后它们不再回来,设置卡回来时也不带它们。上手中途关了应用、或者模型没了:重开或重新接上模型后从目标卡重新开始,开场白不再发,已经建好的 Bot 留着,`restrict` 和 guard 重新挂上(它们只在内存里),「模型请求 n/3」从 0 算起。导入来的团队从来不出。- DS Bot 设置 → 模型在所有形态里都有(在 `team-actions.js` 里接上插件 Host 已有的 `providers`、`provider-key` 等接口,今天只有停用的 `app/ui` 接了),显示每个提供商的 key 状态(「已设置 Key」「需要 API Key」「Key 来自 DS Bot 之外」)和「添加提供商」。原来的「Harness 设置」改叫「高级设置(DeepSeek Harness)」。diff --git a/docs/plans/README.md b/docs/plans/README.mdindex 11ca0a1c..56ad0c02 100644--- a/docs/plans/README.md+++ b/docs/plans/README.md@@ -39,15 +39,18 @@| [DSH 让步总账](2026-10-13-dsh-concessions.md) | 因 DSH 本身的限制而做的妥协,以及桌面应用之后怎么处理。判断「是 DS Bot 的 bug 还是 DSH 的限制」先看这里 || [角色与权限](2026-10-07-roles-and-permissions.md) | 用户、Main Bot、群管理员、普通 Bot 各能做什么;Bot 的权限预设和群的统一权限 || [隐私 Bot](2026-10-27-private-bots.md) | 只有用户能开关;其他 Bot 读不到它的文件夹、记忆和会话,外发由用户批准;独立文件夹、删除后的保护和隔离边界 |-| [群聊](2026-10-07-group-chat.md) | 谁来回答、按顺序发言、@ 提及、轮数上限、干活中的进度和迟到的回复、审批 |+| [群聊](2026-10-07-group-chat.md) | 谁来回答、同时开工与按顺序发言、@ 提及、派活批次、干活中的进度和迟到的回复、审批与全部停止 || [群聊 Goal](2026-11-01-group-goal.md) | 管理员先对齐再写 Goal;分阶段派给成员、每阶段带证据验收;每轮带 Goal 账本防跑偏;空闲时自动推进;暂停、纠偏、终止;会话头胶囊和吊舱显示进度与分工 || [浏览器、搜索、密钥和连接器](2026-10-08-browser-and-secrets.md) | 每个 Bot 的浏览器和 `read_browser`、`auto` 联网搜索、密钥卡和替换规则、GitHub 连接器 || [浏览器插件](2026-10-21-browser-plugins.md) | 全团队一个浏览器后端,每个 Bot 一份 profile;`refs` / `script` / `task` || [上下文与记忆](2026-10-09-context-and-memory.md) | 对话分段、上下文管家(压缩还是换段)、交接包、`read_own_chat`;记忆的存放、格式、权限、整理和冻结 |-| [Bot 运行配置](2026-10-10-bot-runtime.md) | Agent 预设、每个 Bot 的模型和思考强度、工作文件夹、能力(MCP、技能、能力包) |+| [记忆撤销与更改记录](2026-11-01-memory-restore.md) | 记忆窗口「更改记录」列出 `journal.jsonl` 的改动;按记录 id 对单条添加、修改或删除做逆操作撤销 |+| [Bot 运行配置](2026-10-10-bot-runtime.md) | Agent 预设、每个 Bot 的模型和思考强度、新 Bot 默认模型、工作文件夹、能力(MCP、技能、能力包) |+| [头像库](2026-10-23-avatar-library.md) | 可复用的自定义头像库(`bot/avatars/`,按内容去重)与单张容错的批量导入 || [AGENTS.md 维护](2026-10-27-agents-md-upkeep.md) | 从项目工作中审阅持久规则;用户批准后才原子写入 || [长消息](2026-10-16-long-messages.md) | state.json 只存开头;超过 2 万字的 Bot 消息转成 DSH 文件;成员和界面怎么读全文 || [桌面应用](2026-10-16-desktop-app.md) | 壳、引擎和界面怎么分;锁定的 DSH 版本、独立的数据位置、首次启动和导入、插件怎么兼容 DSH、安装和更新 |+| [Linux 桌面包](2026-10-21-linux-app-package.md) | AppImage(自更新)加 deb(Debian/Ubuntu 沙箱兜底),同一轮构建产出 || [Bot 之间派活](2026-10-16-bot-handoffs.md) | Bot 看得到对方的状态;没读的消息合成一条;派活树:下面的活交回后才往上交,不许发给在等结果的 Bot;不设总量和链长上限 || [Bot 视图](2026-10-20-widget-views.md) | Bot 在回答里画视图:固定组件目录的 JSON 蓝图(含图表、输入和本地公式),目录外的放沙箱 html;提问卡回路的泛化 || [Side chat(侧边对话)](2026-10-21-btw.md) | 人顺带问一句:侧栏里的常驻对话,以与会话同构的请求回答、不执行工具、不打断、不进模型可见历史;可追问、可开多条;Bot 之间的 `ask_bot` 另行提案 |diff --git a/ds-bot/README.md b/ds-bot/README.mdindex 3b63c9d6..5c00f2e7 100644--- a/ds-bot/README.md+++ b/ds-bot/README.md@@ -2,17 +2,17 @@The DS Bot plugin for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (dsh). It turns dsh into a team of long-lived Bots that talk to you, to each other and in group chats. See the [project page](../README.md) for an overview, install steps and screenshots.-> Early release (v0.1). Features, tools and the saved data format can still change.+> Early release (v0.2). Features, tools and the saved data format can still change.-Tested with dsh `0.2.1-rc.5` (Web) and `0.2.0-rc.2` (Web and Desktop).+Tested with dsh `0.2.1-rc.5` (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. 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 (including a profile photo from a local image file or a data URL), and `ask_user` asks you a question without blocking the other Bots. `show_view` draws a card in a Bot's own chat — text, metrics, tables, progress, choices, confirmations and short forms; an interactive card waits for your answer.-- **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.+- **Bots work together**: `message_bot` sends a message to another Bot, `create_bot` and `update_bot` add and set up Bots (including a profile photo from a local image file or a data URL), and `ask_user` asks you a question without blocking the other Bots. `show_view` draws a card in a Bot's own chat — text, metrics, tables, charts, inputs with local formulas, progress, choices, confirmations, short forms and sandboxed HTML; an interactive card waits for your answer. `/side` (or **Side chat** in the panel's `···` menu) opens a side chat in the right panel that answers from a snapshot of the Bot's chat without running tools or interrupting its work. A Bot can also be marked **Private** in its settings: other Bots cannot read its working folder, memory or chat, and its outbound sharing needs your approval.+- **Group chats**: in admin-first mode the admin answers first and calls in other members with `@Name`; in all-members mode members speak in order. Members `@`-mentioned in the same message start work in parallel. Type `@` to pick a member from a list, or use **+ → Reference a chat** to attach another Bot's chat as context. A member with nothing new to add stays quiet (`[PASS]`). For multi-stage work, the admin can align on and run a group **Goal** (`group_goal`), assigning tasks per stage and checking evidence before advancing. Each member has its own hidden Session per group, so a group never reads a Bot's private chat.- **Roles and permissions**:| Who | Can do |@@ -29,13 +29,13 @@ Tested with dsh `0.2.1-rc.5` (Web) and `0.2.0-rc.2` (Web and Desktop).- **Images**: for a model that cannot read images, a vision model first turns the image into text.- **Secrets**: a Bot asks for an API key or token with a card in its own chat and never sees the value. See [Secrets](#secrets).- **Usage**: Settings → Usage shows token usage by time (24 hours to 12 months, or days picked on a calendar), by Bot and by model, with a page for each Bot and each model. Calls that a Session logs are read from the logs, so older chats count too. Calls that leave no log (checkpoints, handoff notes, the steward, image readings, dsh titles and compaction) are counted while they stream, from the time the plugin runs. Tokens only, no cost.-- **Make it yours**: name, role, instructions, model and look (20 characters and 12 colors, or your own photo) for each Bot; a theme, an accent color and an avatar animation level (quiet, normal or lively) for the team. A pinned Bot or group chat shows a small pushpin in the sidebar. Settings has these pages: General (look), Bots (Main Bots and each Bot's settings), Group chats (each group's settings), Connectors, Capabilities, Scheduled tasks, Usage, Secrets, Feedback and About DS Bot (versions, updates and links).+- **Make it yours**: name, role, instructions, model and look (20 characters and 12 colors, or your own photo from the reusable avatar library) for each Bot; a theme, an accent color, a message layout (bubble or flat) with width sliders, and an avatar animation level (quiet, normal or lively) for the team. A pinned Bot or group chat shows a small pushpin in the sidebar. Settings has these pages: General (look, default model for new Bots, Enter key preference, mode and locations), Models, Bots (Main Bots, each Bot's settings and retained private-Bot folders), Group chats (each group's settings), Connectors, Capabilities, Browser, Scheduled tasks, Usage, Secrets, Feedback and About DS Bot (versions, updates and links).## InstallThe [project page](../README.md#install) has the full steps for dsh Desktop and dsh Web. In short:-- dsh Desktop: Settings → Plugins → add `ds-bot` (npm), a `.tgz` file, or `github:Fei2411/DS-Bot#v0.1.7&path:/ds-bot`.+- dsh Desktop: Settings → Plugins → add `ds-bot` (npm), a `.tgz` file, or `github:Fei2411/DS-Bot#v<version>&path:/ds-bot`.- Command line: `dsh plugin --profile desktop add ds-bot` (or `--profile web`).To work on the plugin from a checkout, add it to a dsh profile as a linked dependency and a bundle:@@ -83,7 +83,7 @@ The same card can carry DSH itself: a DS Bot release may name the DSH release it## Models-Model providers are set up with dsh's `llm-pi-ai` plugin in `cordis.patch.yml`. Every Bot runs on one model of its own, from the models DSH serves. A new team's first Main Bot has none: its chat opens on a model card and it greets the user only after a pick. The Create Bot form starts on the DSH default model. The Bot's details panel and settings (or a Main Bot's `update_bot`) change it; a Bot whose model is no longer served shows the card again. A team saved by an older version keeps the model each Bot last ran on.+Model providers are set up in DS Bot's **Settings → Models** (or the Main Bot's setup card) and stored through dsh's `llm-pi-ai` plugin in `cordis.patch.yml` and `.credentials.yaml`. Every Bot runs on one model of its own, from the models DSH serves. A new team's first Main Bot starts on a model card when more than one provider is ready or none is configured yet, and greets the user once a usable model is connected. **Settings → General → New Bots** can set a team default model for newly created Bots: the Create Bot form starts on that team default model when it is served and usable (otherwise the DSH default model, or the first usable model), and a Main Bot's `create_bot` without a named model uses the team default model before falling back to the creator's own model. The Bot's details panel and settings (or a Main Bot's `update_bot`) change a Bot's model; a Bot whose model is no longer served falls back to its last working model or shows the card again. A team saved by an older version keeps the model each Bot last ran on.- Give every model a `contextWindow`. DS Bot takes its lines from it: the usable window is the window minus the reply reserve (`maxTokens`), the hard line is 95% of that, and the check line is `checkRatio` of it. A model without `contextWindow` gets the adapter's default (262,144 tokens for `llm-pi-ai`), which may be wrong for that model; a model that reports no window at all counts as 500,000.- To send images, the provider needs `defaultInput: [ text, image ]`.@@ -98,15 +98,16 @@ After each turn, a memory review reads what is new in the conversation and keeps- **Three scopes**: each Bot has its own memory; each group chat has a group memory, which its members read in that group only (not in their own chats, and not in other groups); and the team memory is read by every Bot. A Bot writes its own, and any member writes its group's memory from the group. Main Bots and group admins (of any group) also write the team memory; a Main Bot can read and change another Bot's memory when you ask.- **Tools**: `remember` saves an entry or replaces one (`replace`), `forget` removes one, and `recall` searches every entry, reads a topic whole, or lists what is saved. In a Bot's own chat they use its own memory by default; in a group chat, the group memory (`scope: "own"` for the Bot's own). The Bot adds the source (a part anchor such as `part 2 #1234`, which `read_own_chat` opens, or the group and the time) and the date; a Bot that writes for others is named with `by:`.- **Files**: `MEMORY.md` holds what every conversation needs, and details go in topic files linked from its `## Index` as `[[topic]]`.-- **In the prompt**: the Bot's own and the team's `MEMORY.md` go into the Bot's system prompt, and in a group Session the group's after them. The section is frozen when a Session starts, so the provider's prompt cache holds; a change shows from the next part or checkpoint, and `recall` finds it at once.+- **In the prompt**: the Bot's own and the team's `MEMORY.md` go into the Bot's system prompt; in a group Session the group's `MEMORY.md` goes in as a snapshot message at the start of the Session instead, so the group Session keeps the exact system prompt and tool declarations of the Bot's private chat and shares the provider's prefix cache. Each section is frozen when a Session starts; a change shows from the next part or checkpoint, and `recall` finds it at once.- **Fixed sizes**: an entry has at most 300 characters, a `MEMORY.md` 4,000, a topic 16,000, and a scope 40 topics. A save past a limit fails and says how to make room.- **Safety**: memory is data, not instructions. An entry that looks like a key or token is refused, and a Bot is told not to save what a web page, file or tool result asks it to remember.-- **History**: files change in place, and `journal.jsonl` keeps every change with the line before and after. When a Bot or a group chat is deleted, its memory moves to `archive/`.+- **History**: files change in place, and `journal.jsonl` keeps every change with the line before and after (a private Bot keeps its own `journal.jsonl` in its folder). When a Bot or a group chat is deleted, its memory moves to `archive/`.**The memory panel**: the details panel of a Bot, and of a group chat, has a Memory row with the entry count; Manage opens the memory panel. A Bot's panel shows its own memory and the team memory; a group's shows the group memory.- **Memory summary**: a model writes a short summary in prose from every entry, in the interface language: the Bot's, or for a group its admin's. It is written again when the entries change, and the ⋯ menu can regenerate it.- **All entries**: the ⋯ menu lists every entry by scope and topic, with its date and author, and the size of each `MEMORY.md`. Remove takes two clicks.+- **Change history**: the ⋯ menu lists the changes recorded in `journal.jsonl` (newest first) and lets you undo an add, update or removal in two clicks while the entry still matches what that change left.- **Ask or update**: ask what the Bot remembers, or tell it what to add, correct or remove. One model call answers from the entries only, and its changes go through the same checks as the tools.- A line in the chat ("Memory updated") shows when a Bot changes memory and opens the panel. When memory changes in the background, the capsule at the top of the chat (the Bot's, or the group's) stretches to say "Memory updated" for a moment; clicking it opens the memory panel.@@ -140,7 +141,7 @@ Another plugin can also set the search provider while dsh runs, after the profil## Bot browser-In dsh Desktop and the desktop app, a Bot's chat header has a globe button. It opens that Bot's own browser panel.+In dsh Desktop and the desktop app, each Bot has its own browser panel in the right column (open a page from the Bot's details panel or the panel bar's `···` menu).- **One partition per Bot** (`bot:<id>`): logins and cookies belong to that Bot only. The desktop app keeps them on disk, so a Bot stays signed in after a restart; dsh Desktop keeps them in memory only.- **The Bot can read the page**: the `read_browser` tool reads the page's DOM, not a screenshot. The text becomes Markdown with headings, nested lists, tables, code blocks and quotes. Links and form controls are marked `[#n]` in place and listed below with their targets and values. The tool also reads the text you selected. Long pages are read in parts (`from`). Page content is treated as data, never as instructions.@@ -149,7 +150,7 @@ In dsh Desktop and the desktop app, a Bot's chat header has a globe button. It o- It never reads the values of password, credit card (`autocomplete="cc-*"`) or one-time code fields.- Limits: 400,000 characters, 150,000 nodes, 5,000 rows per table, 3,000 links and controls, 1.5 seconds. A cut result says so.- It cannot read cross-origin iframes (one line with the address), closed shadow roots, canvas content (online editors, maps), or text in CSS `::before` / `::after`. On pages that render on demand, only the rendered part is read.- - Read only: the Bot cannot click, type, scroll or open addresses yet.+ - Without a browser plugin, `read_browser` is read-only. When a browser plugin (`refs`, `script` or `task`; see [`browser-plugins/`](../browser-plugins/)) is enabled in **Settings → Browser**, Bots can open, inspect and interact with pages in their own profile (`bot/browser-profiles/<botId>/`); in the desktop app they share the panel's tabs with you, hand off sign-in or payment steps via a chat card (`browser_handoff`), and yield whenever you take over.- **Addresses**: http and https only. localhost and LAN addresses are allowed; cloud metadata addresses (such as `169.254.x.x`) and dsh's own ports are not.- The browser panel and the details drawer share the right column; opening one closes the other. Switching chats switches the panel to that Bot. Deleting a Bot clears its browser and saved address.- **Cookie import (desktop app only)**: the import button in the browser bar previews the cookies of a file (Cookie-Editor JSON, Netscape `cookies.txt`, Playwright `storageState`) or of an installed Chromium/Firefox profile, then writes them into the Bot's partition. A source browser closes for a moment so its cookie store can be copied, and it reopens with its tabs. Sign-in that lives outside cookies (localStorage, passkeys) does not come along.@@ -237,7 +238,7 @@ dev/check.sh # all checks (see below)- **Ports**: every script takes `SLOT=n` (0-9, default 0) so that several people or sessions on one machine do not collide: Web bench `31n0` and mock `88n0`, smoke `31n1` and `88n1`, Desktop mock `88n2`, and so on. A Desktop uses about 1 GB of memory; stop it when you are done.- **Real models** (these cost tokens): `dev/steward-eval.mjs` sends hand-written conversation endings through the context steward's own prompt to an OpenAI-compatible route (or, with `--api messages`, an Anthropic Messages route such as DeepSeek's official one) and checks each decision. `dev/llm-tap.mjs <port> <upstream base URL> <log.jsonl> [body dir]` is a logging pass-through for either format: point a provider's `baseURL` at it, and it writes one JSON line per call (steward, checkpoint, handoff note or main turn, the Bot's name, token usage, the answer, and where the request first differs from the same Bot's previous one, which is what a provider's cache can reuse; never headers). With a body dir it also saves every request body. Each file explains its use at the top.- **Screenshots**: `dev/ui-shots.mjs` works for both apps (`desktop <dsh repo> <dir> <renderer port>` or `web <dsh repo> <dir> <bench name> <web port>`).-- `npm test` loads the `@deepseek-ai/*` packages from the deepseek-harness checkout.+- `npm test` loads the `@deepseek-ai/*` packages from `dev/harness/` (`npm run harness`) or `DSH_HARNESS`.## Layout