@xmanrui/dsh-im 4.10.0 → 4.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/PROACTIVE_DELIVERY.en.md +15 -1
  2. package/PROACTIVE_DELIVERY.md +15 -1
  3. package/README.en.md +7 -2
  4. package/README.md +8 -3
  5. package/lib/client.js +2341 -1315
  6. package/lib/index.js +250 -245
  7. package/package.json +4 -3
  8. package/plugin-src/client/channel-card-meta.js +9 -1
  9. package/plugin-src/client/channels/dingtalk/api.js +4 -0
  10. package/plugin-src/client/channels/dingtalk/index.js +41 -7
  11. package/plugin-src/client/channels/feishu/api.js +4 -0
  12. package/plugin-src/client/channels/feishu/group-settings.js +581 -0
  13. package/plugin-src/client/channels/feishu/index.js +64 -233
  14. package/plugin-src/client/channels/qq/api.js +4 -0
  15. package/plugin-src/client/channels/qq/index.js +41 -7
  16. package/plugin-src/client/channels/shared/collapsible-account.js +80 -0
  17. package/plugin-src/client/channels/shared/token-api.js +4 -0
  18. package/plugin-src/client/channels/shared/token-channel.js +62 -29
  19. package/plugin-src/client/channels/wecom/api.js +4 -0
  20. package/plugin-src/client/channels/wecom/index.js +41 -7
  21. package/plugin-src/client/channels/weixin/api.js +4 -0
  22. package/plugin-src/client/channels/weixin/index.js +41 -7
  23. package/plugin-src/client/channels/whatsapp/api.js +4 -0
  24. package/plugin-src/client/channels/whatsapp/index.js +40 -7
  25. package/plugin-src/client/delivery-settings.js +73 -5
  26. package/plugin-src/client/i18n.js +22 -0
  27. package/plugin-src/client/model-setting.js +104 -0
  28. package/plugin-src/client/styles.js +62 -0
  29. package/plugin-src/host/channels/dingtalk/production.mjs +3 -0
  30. package/plugin-src/host/channels/dingtalk/rpc.mjs +11 -0
  31. package/plugin-src/host/channels/feishu/production.mjs +3 -0
  32. package/plugin-src/host/channels/feishu/rpc.mjs +16 -0
  33. package/plugin-src/host/channels/qq/production.mjs +3 -0
  34. package/plugin-src/host/channels/qq/rpc.mjs +11 -0
  35. package/plugin-src/host/channels/shared/model-setting-rpc.mjs +19 -0
  36. package/plugin-src/host/channels/shared/production.mjs +3 -0
  37. package/plugin-src/host/channels/shared/rpc.mjs +9 -0
  38. package/plugin-src/host/channels/shared/workspace-rpc.mjs +2 -0
  39. package/plugin-src/host/channels/slack/production.mjs +3 -0
  40. package/plugin-src/host/channels/slack/rpc.mjs +9 -0
  41. package/plugin-src/host/channels/wecom/production.mjs +3 -0
  42. package/plugin-src/host/channels/wecom/rpc.mjs +11 -0
  43. package/plugin-src/host/channels/weixin/production.mjs +3 -0
  44. package/plugin-src/host/channels/weixin/rpc.mjs +11 -0
  45. package/plugin-src/host/channels/whatsapp/production.mjs +3 -0
  46. package/plugin-src/host/channels/whatsapp/rpc.mjs +11 -0
  47. package/plugin-src/host/delivery-adapter.mjs +141 -3
  48. package/plugin-src/host/delivery-rpc.mjs +12 -0
  49. package/plugin-src/host/delivery-service.mjs +110 -3
  50. package/plugin-src/host/delivery-suggestions.mjs +46 -0
  51. package/plugin-src/host/harness-session-coordinator.mjs +6 -5
  52. package/plugin-src/host/index.mjs +18 -1
  53. package/plugin-src/host/session-sync-coordinator.mjs +217 -0
  54. package/scripts/verify-package.mjs +12 -6
  55. package/src/channels/shared/bot-workspace-store.mjs +285 -38
  56. package/src/channels/shared/harness-client.mjs +124 -43
  57. package/src/channels/shared/i18n-en/wecom.mjs +24 -0
  58. package/src/channels/shared/model-setting.mjs +110 -0
  59. package/src/channels/wecom/wecom-bridge.mjs +275 -2
  60. package/src/channels/wecom/wecom-cards.mjs +101 -0
  61. package/src/channels/wecom/wecom-runtime.mjs +2 -0
  62. package/src/channels/whatsapp/whatsapp-runtime.mjs +78 -26
@@ -78,6 +78,18 @@ Assume the Feishu bot has already received a message in the alert group:
78
78
 
79
79
  If the group Chat ID is edited later, callers can continue using the same `botId + release-alerts` pair.
80
80
 
81
+ ## Two-way sync for direct-message Sessions
82
+
83
+ A saved direct-message target has an opt-in **Two-way Session sync** switch. When enabled:
84
+
85
+ 1. User text submitted from DSH Web/CLI to the DM's current Session is sent to the DM with a `[来自 DSH]` prefix.
86
+ 2. After that turn completes successfully, the final assistant text merged in step order is sent once more with a `[DSH 助手]` prefix.
87
+ 3. Ordinary IM prompts and `/steer` continue through the existing reply path. They are neither duplicated nor forwarded to another target.
88
+
89
+ The setting stores the private conversation target, never a `sessionId`, so it follows `/session` changes automatically. After `/new` or a workspace change, its status becomes **Waiting for this DM to establish a new Session** and recovers as soon as that DM creates one; the switch does not need to be toggled again.
90
+
91
+ Enabling requires one uniquely known DM that already has a current Session for this bot. Groups, Slack Threads, Telegram Topics, Discord server channels, and targets that cannot be confirmed as DMs are unavailable. A channel with an explicit remote `harnessBaseUrl` is also unsupported. The first version mirrors current-Host text only—no images, files, cards, tool progress, approvals, or history. Changing the target type or native route disables sync; renaming the target does not.
92
+
81
93
  ## Native fields for all nine channels
82
94
 
83
95
  Choose a known conversation whenever possible. Obtain and enter a platform-native ID manually only when the target is missing from the suggestions.
@@ -250,10 +262,11 @@ Every response is either `{ ok: true, value }` or `{ ok: false, error: { code, m
250
262
  | `target.create` | `{ botId, target: { targetId, name?, kind, route } }` | The complete created target |
251
263
  | `target.update` | `{ botId, targetId, target: { name?, kind, route } }` | The complete updated target |
252
264
  | `target.delete` | `{ botId, targetId }` | `{ deleted: true }` |
265
+ | `target.session-sync.set` | `{ botId, targetId, enabled }` | `{ enabled, state }`; manages DM sync from the local settings UI |
253
266
  | `target.test` | `{ botId, targetId }` | `{ sent: true }` |
254
267
  | `target.test` | `{ botId, target: { kind, route } }` | `{ sent: true }`; tests a draft without saving it |
255
268
 
256
- Payloads are validated with exact fields. The inner `target` in `target.update` must not contain `targetId`; a draft test must not contain `targetId` or `name`.
269
+ Payloads are validated with exact fields. The inner `target` in `target.update` must not contain `targetId`; a draft test must not contain `targetId` or `name`. Every target returned by `target.list` includes read-only `sessionSync: { enabled, state }`, where `state` is `off`, `active`, `waiting`, or `unavailable`; the internal private-conversation key is never returned to the client.
257
270
 
258
271
  ## Error handling
259
272
 
@@ -269,6 +282,7 @@ An HTTP failure returns `{ "error": { "code", "message", "details" } }`. Same-Ho
269
282
  | `bot-not-connected` | 503 | The bot is offline; let the caller decide whether to retry after reconnection |
270
283
  | `target-rejected` | 422 | The platform explicitly rejected the target or the bot lacks permission; check platform permissions and the target ID |
271
284
  | `delivery-failed` | 502 | A network, platform, or other safely redacted delivery failure; check bot state and Host logs |
285
+ | `session-sync-unavailable` | — | The target is not a confirmed current-Host DM, has no current Session, or uses a remote Harness; create it from a known DM and establish a Session first |
272
286
  | `cancelled` | 408 | The call was cancelled; stop or start a new call as required by the application |
273
287
 
274
288
  The HTTP protocol layer may also return `method-not-allowed` (405), `unsupported-media-type` (415), or `payload-too-large` (413).
@@ -78,6 +78,18 @@
78
78
 
79
79
  以后即使编辑并更换群 Chat ID,调用方仍可继续使用同一组 `botId + release-alerts`。
80
80
 
81
+ ## 私聊会话双向同步
82
+
83
+ 已保存的私聊目标可以在目标行开启「会话双向同步」,默认关闭。开启后:
84
+
85
+ 1. DSH Web/CLI 向该私聊当前绑定的 Session 提交的用户文字,会以 `[来自 DSH]` 开头发送到私聊。
86
+ 2. 该 Turn 成功完成后,按 step 合并的最终助手文字会以 `[DSH 助手]` 开头再发送一次。
87
+ 3. IM 用户自己的普通提问和 `/steer` 仍走原回复链,不会被同步逻辑重复发送或转发给其他目标。
88
+
89
+ 开关只保存私聊目标,不保存 `sessionId`,因此会自动跟随 `/session` 切换。执行 `/new` 或切换工作区后,状态暂时显示「等待该私聊建立新会话」;该私聊下一次建立 Session 后自动恢复,无需重新开关。
90
+
91
+ 开启要求目标来自该机器人已经聊过、已有当前 Session 的唯一私聊。群聊、Slack Thread、Telegram Topic、Discord 服务器频道和其他无法确认是私聊的目标显示为不可用。显式配置了远程 `harnessBaseUrl` 的渠道也不支持;首版仅同步当前 Host 的文字,不同步图片、文件、卡片、工具过程、审批或历史消息。修改目标类型或平台路由会自动关闭同步,改名不会。
92
+
81
93
  ## 九渠道手动填写字段
82
94
 
83
95
  优先从已聊会话中选择。只有目标未出现在候选中时,才需要手动取得以下平台原生 ID。
@@ -250,10 +262,11 @@ async function sendDailyReport(connection, summary) {
250
262
  | `target.create` | `{ botId, target: { targetId, name?, kind, route } }` | 已创建的完整目标 |
251
263
  | `target.update` | `{ botId, targetId, target: { name?, kind, route } }` | 更新后的完整目标 |
252
264
  | `target.delete` | `{ botId, targetId }` | `{ deleted: true }` |
265
+ | `target.session-sync.set` | `{ botId, targetId, enabled }` | `{ enabled, state }`;仅供本机设置页管理私聊同步 |
253
266
  | `target.test` | `{ botId, targetId }` | `{ sent: true }` |
254
267
  | `target.test` | `{ botId, target: { kind, route } }` | `{ sent: true }`;测试草稿,不保存 |
255
268
 
256
- 接口严格校验字段。`target.update` 的内部 `target` 不能包含 `targetId`;草稿测试不能包含 `targetId` 或 `name`。
269
+ 接口严格校验字段。`target.update` 的内部 `target` 不能包含 `targetId`;草稿测试不能包含 `targetId` 或 `name`。`target.list` 返回的每个目标带只读 `sessionSync: { enabled, state }`,其中 `state` 为 `off`、`active`、`waiting` 或 `unavailable`;内部私聊键不会返回客户端。
257
270
 
258
271
  ## 错误处理
259
272
 
@@ -269,6 +282,7 @@ HTTP 失败响应格式为 `{ "error": { "code", "message", "details" } }`。同
269
282
  | `bot-not-connected` | 503 | 机器人当前离线;恢复连接后由调用方决定是否重试 |
270
283
  | `target-rejected` | 422 | 平台明确拒绝目标或机器人缺少发送权限;检查平台权限和目标 ID |
271
284
  | `delivery-failed` | 502 | 网络、平台或其他无法安全细分的发送失败;检查连接状态和 Host 日志 |
285
+ | `session-sync-unavailable` | — | 目标不是可确认的当前 Host 私聊,尚无当前 Session,或渠道使用远程 Harness;先从已聊私聊创建目标并建立 Session |
272
286
  | `cancelled` | 408 | 调用被取消;按业务需要结束或重新发起 |
273
287
 
274
288
  HTTP 协议层还可能返回 `method-not-allowed`(405)、`unsupported-media-type`(415)或 `payload-too-large`(413)。
package/README.en.md CHANGED
@@ -56,7 +56,7 @@ Connect IM bots to DeepSeek Harness by scanning a QR code, using an App Manifest
56
56
  | Slack | Create an app from the bundled App Manifest, then enter a Bot Token (`xoxb-`) and App Token (`xapp-`) | Socket Mode connection; direct DM replies, mention-only channel replies, and preferred native streaming API |
57
57
  | Telegram | Enter a Bot Token generated by @BotFather | Bot API long polling; DMs work by default and groups respond to mentions or replies, while each bot can optionally enable a private-DM allowlist; private chats stream through a Rich Message Draft and persist one rich final, groups and Topics finalize their placeholder in place, and unsupported Rich delivery falls back to ordinary text |
58
58
  | Discord | Enter a Bot Token generated in the Developer Portal | Gateway v10 connection; direct DM replies; the first mention in a server text or announcement channel creates a native Thread, where follow-up messages no longer need to mention the bot; replies stream through message edits |
59
- | WhatsApp | Scan a QR code with mobile WhatsApp to link a device | WhatsApp Web connection; self-chat only by default, with optional selected-contact and open-response modes; read receipt and typing indicator followed by the final answer |
59
+ | WhatsApp | Scan a QR code with mobile WhatsApp to link a device | WhatsApp Web connection; self-chat only by default, with optional selected-contact and open-response modes; read receipt and typing indicator, with tool progress and incremental answers shown by editing one message at one-second intervals; long replies split automatically and failed edits fall back to a complete text reply |
60
60
 
61
61
  Other IM platforms can be added through the same channel-adapter structure.
62
62
 
@@ -123,6 +123,7 @@ Use the proxy URL required by your network and restart the Host after changing i
123
123
  | Default behavior | Description |
124
124
  | --- | --- |
125
125
  | Bot workspace | Each bot stores its workspace independently. New bots start with the Host's current working directory, which can later be changed from the bot card. |
126
+ | Model | Every bot in all nine IM channels can choose a model directly below its workspace, or follow the Host default. A change applies only to later new Sessions; send `/new` and then an ordinary message in the current chat to use it. |
126
127
  | Agent Preset | Each bot can choose an Agent Preset on its settings card. When none is chosen, new Sessions follow the Host's `agent-presets.default`. A channel-level `config.agentPreset` is only the default for later new bots on that channel. Changing the preset never modifies or clears existing Sessions; if the current chat already has a Session, send `/new` and then a regular message to create one with the new selection. |
127
128
  | Context enhancement | Open settings from a bot card to enable groups and DMs independently. Both switches default to off, including for existing bots after an upgrade. |
128
129
 
@@ -130,6 +131,8 @@ Use the proxy URL required by your network and restart the Host after changing i
130
131
 
131
132
  All nine IM channels can proactively send text through a stable `botId + targetId` pair. Bot settings support choosing a known conversation or entering a target manually, testing the current route before saving, and copying call parameters. HTTP POST, same-Host plugins, and Connection RPC share the same target configuration and delivery core.
132
133
 
134
+ Saved direct-message targets also offer an opt-in **Two-way Session sync** switch. Once enabled, user text submitted from DSH Web/CLI and the final assistant text in that DM's current Session are mirrored back to the DM; ordinary IM prompts and `/steer` are not duplicated. The switch follows the current Session across `/session`, `/new`, and workspace changes. The first version supports text DMs on the current Host only; groups, Topics, Threads, and explicit remote `harnessBaseUrl` connections are unavailable.
135
+
133
136
  See the [Proactive Delivery Guide](PROACTIVE_DELIVERY.en.md) ([简体中文](PROACTIVE_DELIVERY.md)) for setup steps, native fields for all nine channels, complete call examples, management endpoints, error codes, and troubleshooting.
134
137
 
135
138
  ### Context enhancement
@@ -149,6 +152,7 @@ See the [Proactive Delivery Guide](PROACTIVE_DELIVERY.en.md) ([简体中文](PRO
149
152
  | Command | Description |
150
153
  | --- | --- |
151
154
  | `/help` | Show the commands and usage supported by the bot. |
155
+ | `/menu`, `/m` | Open the Feishu or Enterprise WeChat interactive menu. WeCom provides native dropdowns for sessions, models, presets and workspaces, plus buttons for applying selections, new sessions, stop, compact, status and help. It also opens on the daily direct-chat entry event. |
152
156
  | `/new` | Unbind the current chat so its next ordinary message starts a new Harness Session. |
153
157
  | `/status` | Check the connection between the current bot and DeepSeek Harness. |
154
158
  | `/version` | Show the version of the running dsh-im plugin. |
@@ -187,10 +191,11 @@ See the [Proactive Delivery Guide](PROACTIVE_DELIVERY.en.md) ([简体中文](PRO
187
191
 
188
192
  - **Image understanding**: all nine built-in channels can send JPEG, PNG, WebP, and GIF files sent as images to Harness, with an optional text description. Each image is limited to 5 MB, and all images in one message are limited to 20 MB in total.
189
193
  - **Switch workspaces from a bot card**: every bot card on the settings page shows its current Harness workspace. Enter an existing absolute directory path directly or open the directory picker. Switching clears only that bot's old chat mappings; it never deletes, empties, or archives old Sessions. Replies already in progress may finish, while later messages use the new workspace.
194
+ - **Choose a model from a bot card**: every bot card in all nine IM channels offers the Host's available models directly below the workspace, plus an option to follow the default. The selection is stored per bot and used only for later new Sessions; existing Sessions and replies already in progress are unchanged.
190
195
  - **Choose an Agent Preset from a bot card**: every bot card can select one of the Host's existing Agent Presets, or follow the Host default. The change applies only to that bot and only to later new Sessions; existing Sessions and replies already in progress are left unchanged.
191
196
  - **Check the connection and send a test message**: when a bot is online, clicking **Check connection** verifies the platform connection and sends a “DeepSeek Harness connection test succeeded” message to the bot's most recently remembered direct conversation; WhatsApp uses the account's self-chat. The test neither creates a Harness Session nor invokes the model. The bot must have received at least one direct message before it has a remembered test target; otherwise the page reports that no test conversation is available yet.
192
197
  - **Retry a connection or remove an integration**: when a bot is offline, its card action changes to **Retry connection**. Use **Remove integration** when the bot is no longer needed. Each action affects only the selected bot and leaves other bots and channels unchanged.
193
- - **Manage multiple bots independently**: a channel can have multiple connected bots. Credentials, connection state, workspace, Agent Preset, and chat-to-Session mappings are kept separately for every bot, so card actions do not affect sibling bots.
198
+ - **Manage multiple bots independently**: a channel can have multiple connected bots. Credentials, connection state, workspace, model, Agent Preset, and chat-to-Session mappings are kept separately for every bot, so card actions do not affect sibling bots.
194
199
  - **Streaming replies and progress**: the plugin uses each platform's available capabilities to show thinking state, tool progress, and incremental answers. Platforms without a native streaming API complete replies through message edits, card updates, or a final message.
195
200
 
196
201
  ## Design
package/README.md CHANGED
@@ -37,7 +37,7 @@
37
37
 
38
38
  ## 简介
39
39
 
40
- 通过扫码、App Manifest 或已有机器人凭据把 IM 机器人接入 DeepSeek Harness,并让本机 Harness 主动连接公网 AI Office。一个插件、一个设置入口,统一管理九种 IM 渠道和 AI Office Connector。**每个 IM 渠道都支持接入多个机器人**,各机器人的连接状态、工作区和会话绑定彼此独立。
40
+ 通过扫码、App Manifest 或已有机器人凭据把 IM 机器人接入 DeepSeek Harness,并让本机 Harness 主动连接公网 AI Office。一个插件、一个设置入口,统一管理九种 IM 渠道和 AI Office Connector。**每个 IM 渠道都支持接入多个机器人**,各机器人的连接状态、工作区、模型和会话绑定彼此独立。
41
41
 
42
42
  Connect IM bots to DeepSeek Harness by scanning a QR code, using an App Manifest, or entering existing bot credentials, and let the local Harness connect outward to a public AI Office. One plugin and one settings entry manage nine multi-bot IM channels and the AI Office Connector.
43
43
 
@@ -59,7 +59,7 @@ Connect IM bots to DeepSeek Harness by scanning a QR code, using an App Manifest
59
59
  | Slack | 使用预置 App Manifest 创建应用,再填写 Bot Token(`xoxb-`)和 App Token(`xapp-`) | Socket Mode 长连接;私聊直接回复,频道被 @ 后响应,优先使用官方流式消息 API |
60
60
  | Telegram | 使用 @BotFather 生成的 Bot Token | Bot API 长轮询;默认私聊直接响应、群聊被提及或回复时响应,也可为每个机器人独立启用私聊白名单安全模式;私聊通过 Rich Message Draft 流式预览并持久化最终富消息,群聊和 Topic 原位完成占位消息,平台不支持时回退为普通文字 |
61
61
  | Discord | 使用 Developer Portal 生成的 Bot Token | Gateway v10 长连接;私信直接回复;服务器文字/公告频道首次 @ 后创建原生 Thread,后续在线程中无需重复 @,并通过编辑消息流式显示回答 |
62
- | WhatsApp | 使用手机 WhatsApp 扫码关联设备 | WhatsApp Web 长连接;默认仅响应账号自聊,也可切换到指定联系人或开放响应模式;显示已读和“正在输入”,再发送最终回答 |
62
+ | WhatsApp | 使用手机 WhatsApp 扫码关联设备 | WhatsApp Web 长连接;默认仅响应账号自聊,也可切换到指定联系人或开放响应模式;显示已读和“正在输入”,通过每秒编辑同一条消息显示工具进度和逐步生成的回答,长回复自动分段,编辑失败时回退为完整文字回复 |
63
63
 
64
64
  其他 IM 平台可继续按同一渠道适配器结构接入。
65
65
 
@@ -126,6 +126,7 @@ dsh web
126
126
  | 默认行为 | 说明 |
127
127
  | --- | --- |
128
128
  | 机器人工作区 | 每个机器人独立保存工作区。新机器人默认使用 Host 当时的工作目录;之后可在机器人卡片中修改。 |
129
+ | 模型 | 九个 IM 渠道的每个机器人都可在工作区下方独立选择模型;未选择时跟随 Host 默认。切换只影响之后新建的会话;当前聊天先发送 `/new`,再发送普通消息才会使用新选择。 |
129
130
  | Agent Preset | 每个机器人可在设置页卡片中选择 Agent Preset。未选择时跟随 Host 的 `agent-presets.default`;渠道级 `config.agentPreset` 只作为该渠道之后新接入机器人的默认值。切换不会修改或清空已有会话;若当前聊天已有会话,需先发送 `/new`,再发送一条普通消息,才会按新选择创建会话。 |
130
131
  | 上下文增强 | 从机器人卡片打开设置,分别决定群聊、私聊是否增强;两个开关默认均关闭,旧机器人升级后也不会自动开启。 |
131
132
 
@@ -133,6 +134,8 @@ dsh web
133
134
 
134
135
  九个 IM 渠道都可以使用稳定的 `botId + targetId` 主动发送文字消息。机器人设置页支持从已聊会话选择或手工填写目标、保存前测试当前路由,以及复制调用参数;HTTP POST、同 Host 插件和 Connection RPC 共用同一目标配置与投递核心。
135
136
 
137
+ 已保存的私聊目标还可以开启默认关闭的「会话双向同步」。开启后,DSH Web/CLI 在该私聊当前 Session 中发送的用户文字和最终助手文字会同步回私聊;IM 侧原有提问与 `/steer` 不会重复。开关自动跟随 `/session`、`/new` 和工作区切换后的当前 Session。首版仅支持当前 Host 的私聊文字;群聊、Topic、Thread 与显式远程 `harnessBaseUrl` 不支持。
138
+
136
139
  设置步骤、九渠道字段、完整调用示例、管理端点、错误码与排错说明请查看[《主动投递使用指南》](PROACTIVE_DELIVERY.md)([English](PROACTIVE_DELIVERY.en.md))。
137
140
 
138
141
  ### 上下文增强
@@ -152,6 +155,7 @@ dsh web
152
155
  | 命令 | 作用 |
153
156
  | --- | --- |
154
157
  | `/help` | 显示机器人支持的命令和用法。 |
158
+ | `/menu`、`/m` | 飞书和企业微信打开交互菜单。企微可直接下拉选择会话、模型、预设和工作区,点击应用,并提供新会话、停止、压缩、状态与帮助按钮;收到每日进入单聊事件时也会自动展示菜单。 |
155
159
  | `/new` | 解除当前聊天的会话绑定,让下一条普通消息开启全新 Harness 会话。 |
156
160
  | `/status` | 检查当前机器人与 DeepSeek Harness 的连接状态。 |
157
161
  | `/version` | 查看当前运行的 dsh-im 插件版本。 |
@@ -190,10 +194,11 @@ dsh web
190
194
 
191
195
  - **图片识别**:九个内置渠道都可以把 JPEG、PNG、WebP,以及以图片文件方式发送的 GIF 交给 Harness;图片可以附带文字说明。单张图片上限为 5 MB,单条消息中的图片总大小上限为 20 MB。
192
196
  - **在机器人卡片切换工作区**:设置页中的每张机器人卡片都会显示当前 Harness 工作区。可以直接填写已有目录的绝对路径,也可以打开目录选择器。切换只清除该机器人的旧聊天映射,不会删除、清空或归档旧 Session;已经开始的回复可以继续完成,后续消息使用新工作区。
197
+ - **在机器人卡片选择模型**:九个 IM 渠道的每张机器人卡片都在工作区下方提供模型选择,可选 Host 当前可用模型或跟随默认。选择按机器人独立保存,只用于之后新建的 Session;已有 Session 和正在生成的回复不受影响。
193
198
  - **在机器人卡片选择 Agent Preset**:设置页中的每张机器人卡片都可以选择 Host 已有的 Agent Preset,或跟随 Host 默认。切换只作用于该机器人,并且只影响之后新建的会话;已有会话和正在生成的回复不受影响。
194
199
  - **检查连接并发送测试消息**:机器人在线时,点击卡片上的「检查连接」会检查平台连接,并向该机器人最近记录的私聊发送一条“DeepSeek Harness 连接测试成功”消息;WhatsApp 会发送到账号自聊。测试消息不会创建 Harness Session,也不会调用模型。机器人必须至少收到过一条私聊才能记住测试目标,否则页面会提示尚无可用的测试会话。
195
200
  - **重试连接和移除接入**:机器人离线时,卡片上的操作会变为「重试连接」;不再使用时可以点击「移除接入」。这些操作都只作用于所选机器人,不影响其他机器人或渠道。
196
- - **多机器人独立管理**:同一渠道可以接入多个机器人。每个机器人分别保存凭据、连接状态、工作区、Agent Preset 和聊天会话映射,卡片上的工作区、Preset、连接检查、重试和移除操作互不影响。
201
+ - **多机器人独立管理**:同一渠道可以接入多个机器人。每个机器人分别保存凭据、连接状态、工作区、模型、Agent Preset 和聊天会话映射,卡片上的工作区、模型、Preset、连接检查、重试和移除操作互不影响。
197
202
  - **流式回复和进度提示**:插件会按各平台能力显示正在思考、工具执行和逐步生成的回答;不支持原生流式接口的平台会通过编辑消息、卡片更新或最终消息完成回复。
198
203
 
199
204
  ## 设计