@michengai/dsh-im-connect 1.0.26 → 1.0.28

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.
package/README.md CHANGED
@@ -4,225 +4,225 @@
4
4
 
5
5
  <div align="center">
6
6
 
7
- # DSH IM Connect
7
+ # DSH IM Connect
8
8
 
9
- **Connect Feishu, Lark, DingTalk, WeCom, WeChat, QQ, Telegram, Discord, and Slack to local DeepSeek Harness**
9
+ **把飞书、Lark、钉钉、企业微信、微信、QQ、Telegram、Discord、Slack 接到本机 DeepSeek Harness**
10
10
 
11
- [简体中文](README.zh-CN.md) · [Changelog](CHANGELOG.md) · [QQ reference notes](docs/01-当前工作/I022-QQ直接引用接入/00-迭代总览.md) · [Apache-2.0](LICENSE)
11
+ [English](README.en.md) · [更新日志](CHANGELOG.zh-CN.md) · [QQ 引用交接](docs/01-当前工作/I022-QQ直接引用接入/00-迭代总览.md) · [侧栏协作交接](docs/07-迭代归档/2026/I024-侧栏页签协作与渲染修复/00-迭代总览.md) · [Apache-2.0](LICENSE)
12
12
 
13
- [![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](LICENSE)
13
+ [![许可证:Apache-2.0](https://img.shields.io/badge/许可证-Apache--2.0-blue.svg)](LICENSE)
14
14
  [![npm package](https://img.shields.io/npm/v/%40michengai%2Fdsh-im-connect.svg?label=npm%20package)](https://www.npmjs.com/package/@michengai/dsh-im-connect)
15
- [![npm downloads](https://img.shields.io/npm/dt/%40michengai%2Fdsh-im-connect.svg?label=npm%20downloads)](https://www.npmjs.com/package/@michengai/dsh-im-connect)
15
+ [![npm 下载量](https://img.shields.io/npm/dt/%40michengai%2Fdsh-im-connect.svg?label=npm%20%E4%B8%8B%E8%BD%BD%E9%87%8F)](https://www.npmjs.com/package/@michengai/dsh-im-connect)
16
16
  [![DSH Web Plugin](https://img.shields.io/badge/DSH%20Web-Plugin-0f766e.svg)](https://github.com/MichengAI/dsh-im-connect)
17
17
  [![Node.js 22 or later](https://img.shields.io/badge/Node.js-22%20or%20later-339933.svg?logo=node.js&logoColor=white)](https://nodejs.org/)
18
- [![Channels](https://img.shields.io/badge/channels-9-238636.svg)](#-supported-channels)
18
+ [![Channels](https://img.shields.io/badge/channels-9-238636.svg)](#-支持的渠道)
19
19
  </div>
20
20
 
21
- > DSH IM Connect is a community-maintained DeepSeek Harness (DSH) plugin, not an official DeepSeek AI product.
21
+ > DSH IM Connect 是社区维护的 DeepSeek Harness(DSH)插件,并非 DeepSeek AI 官方产品。
22
22
 
23
- ## Features
23
+ ## 功能概览
24
24
 
25
- Send tasks to your local DSH through your usual messenger, even when you are away from the computer. Receive replies, answer questions, and handle tool approvals in the same chat.
25
+ 不在电脑前,也能通过常用聊天软件把任务交给本机 DSH,并在同一聊天里接收回复、回答问题和处理工具审批。
26
26
 
27
- - **Connect familiar platforms**: DingTalk, Feishu, Lark, WeChat, WeCom, QQ, Telegram, Discord, and Slack.
28
- - **Configure accounts separately**: each account has its own workspace, model, reasoning effort, permissions, private-access mode, and send mode.
29
- - **Handle task interactions on your phone**: send work, read replies, and answer single- or multiple-choice questions. Approved users can approve or deny tools in private chats.
30
- - **Keep chat records separate**: each IM chat has its own session under **Channels** in the web workspace.
31
- - **Connect by QR code or credentials**: use the platform-specific setup in **Settings → IM Assistant**, then control message reception per account.
32
- - **Control access**: groups trigger through mentions and private chats follow each account’s access settings, as detailed below.
27
+ - **连接常用消息平台**:支持钉钉、飞书、Lark、微信、企业微信、QQ、Telegram、Discord 和 Slack。
28
+ - **多个账号分别配置**:同一平台可添加多个账号,各自选择工作区、模型、推理强度、权限、私聊准入和发送方式。
29
+ - **手机上完成任务交互**:下任务、读回复、回答单选或多选问题;已批准用户可在私聊中批准或拒绝工具执行。
30
+ - **聊天记录互不混淆**:每个 IM 聊天对应独立会话,在网页工作区「频道」中回看。
31
+ - **按平台扫码或填写凭据**:## 界面预览
33
32
 
34
- ## Who can drive the assistant
33
+ 在「设置 → IM助理」连接账号,管理消息接收开关。
34
+ - **控制谁能使用**:群聊通过 @ 触发,私聊按账号的准入设置处理,详见下表。
35
35
 
36
- Inbound messages are identified before commands, tool approvals, or injection.
36
+ ## 谁可以驱动助手
37
37
 
38
- | Case | Behavior |
39
- |---|---|
40
- | Group without a mention of this bot | Ignored without a reply or pending approval request; mentioning someone else also does not trigger it |
41
- | Group explicitly mentioning this bot | No binding. Anyone can send work |
42
- | DM from the QR scanner | WeChat / Feishu / Lark / QQ scanners are allowlisted automatically |
43
- | DM from anyone else | Appears on the settings pending list until approved |
44
- | DM after QR binding that does not return user identity | DingTalk / WeCom QR setup returns bot credentials only, so the scanner still needs settings approval |
45
- | DM after manual credentials | Telegram, Discord, Slack, and DingTalk / WeCom / QQ bound manually, require approval for every DM |
46
- | DM without a userId | Denied |
47
- | Tool approval | Reply `Approve` / `Deny` (or `批准` / `拒绝`) in the chat bound to that session; works in DMs and groups, and never falls back to the web. No reply within 5 minutes cancels the action, and other text is not queued behind it |
48
- | Interactive choice | Reply with an option number or text in the originating IM conversation; separate multiple choices with commas or add a custom answer; only the initiating user can answer in a group |
38
+ 入站消息先看发送者,再处理命令、工具审批和注入。
49
39
 
50
- WeChat is QR-only and DM-only, so the same WeChat account that scanned can talk immediately. A different WeChat account DMing the bot waits for settings approval.
40
+ | 场景 | 行为 |
41
+ | --- | --- |
42
+ | 群聊未 @ 当前机器人 | 忽略,不回复、不进待批准;只 @ 其他成员也不触发 |
43
+ | 群聊已准确 @ 当前机器人 | 不用绑定,任何人都可以下任务 |
44
+ | 私聊 · 扫码用户 | 微信 / 飞书 / Lark / QQ 扫码者自动进白名单,可直接对话 |
45
+ | 私聊 · 其他人 | 进入设置页待批准;不批准就不能驱动助手 |
46
+ | 私聊 · 扫码不返回身份 | 钉钉 / 企微的快捷绑定只返回机器人凭据,扫码者仍需在设置页批准 |
47
+ | 私聊 · 手动凭据 | Telegram、Discord、Slack,以及手动填写凭据的钉钉 / 企微 / QQ,所有私聊都要先批准 |
48
+ | 私聊缺少 userId | 拒绝 |
49
+ | 工具审批 | 在绑定该会话的聊天里回复「批准 / 拒绝」;群聊和私聊都可以,不用去网页。5 分钟内未回复按取消结束,期间其他文字不会进入下一轮 |
50
+ | 交互选择 | 在原 IM 会话回复选项序号或文字;多选用逗号分隔,也可补充自定义答案;群聊只接受任务发起者回答 |
51
+
52
+ 微信是扫码渠道且只支持私聊,所以连上后用**同一个微信号**即可直接用。换一个微信号私聊,会出现在设置页待批准。
51
53
 
52
- ## 📡 Supported channels
54
+ ## 📡 支持的渠道
53
55
 
54
56
  <p align="center">
55
- <code>🔔 DingTalk</code>&nbsp;
56
- <code>🐦 Feishu</code>&nbsp;
57
+ <code>🔔 钉钉</code>&nbsp;
58
+ <code>🐦 飞书</code>&nbsp;
57
59
  <code>🌐 Lark</code>&nbsp;
58
- <code>💬 WeChat</code>&nbsp;
59
- <code>🏢 WeCom</code>&nbsp;
60
+ <code>💬 微信</code>&nbsp;
61
+ <code>🏢 企业微信</code>&nbsp;
60
62
  <code>🐧 QQ</code>&nbsp;
61
63
  <code>✈️ Telegram</code>&nbsp;
62
64
  <code>🎮 Discord</code>&nbsp;
63
65
  <code>🧩 Slack</code>
64
66
  </p>
65
67
 
66
- | Channel | Status | How to connect | You need |
67
- |---|---|---|---|
68
- | 🔔 **DingTalk** | ✅ Ready | QR, or Client ID / Secret | DingTalk open-platform bot; replies prefer AI Card |
69
- | 🐦 **Feishu** | ✅ Ready | QR, or App ID / App Secret; QR creates the bot automatically | Feishu account, or a self-built bot with App ID / Secret |
70
- | 🌐 **Lark** | ✅ Ready | QR, or App ID / App Secret | Lark account, or a self-built bot with App ID / Secret |
71
- | 💬 **WeChat** | ✅ Ready* | Official iLink QR | Dedicated account recommended; DM only |
72
- | 🏢 **WeCom** | ✅ Ready | QR (recommended), or Bot ID / Secret | WeCom intelligent bot |
73
- | 🐧 **QQ** | ✅ Ready | QR, or AppID / AppSecret | QQ Open Platform bot, not a personal QQ account |
74
- | ✈️ **Telegram** | ✅ Ready | Bot Token only | `@BotFather`; do not enable Webhook on the same bot |
75
- | 🎮 **Discord** | ✅ Ready | Bot Token only | Official Developer Portal bot. Enable the Message Content Intent. The first mention in a text or announcement channel continues in a thread without another mention |
76
- | 🧩 **Slack** | ✅ Ready | Bot Token and App Token | Create an app at api.slack.com and enable Socket Mode. DMs reply directly; channel mentions reply inside that message's thread, and later replies in the thread need no new mention |
77
-
78
- ✅ Ready = text in and out works | *WeChat = official iLink only, no reverse-engineered personal protocol | Groups still require an @ mention. Discord skips repeat mentions only inside a thread the bot created; Slack skips them inside a thread the bot already joined
68
+ | 渠道 | 状态 | 接入方式 | 需要 |
69
+ | --- | --- | --- | --- |
70
+ | 🔔 **钉钉** | ✅ 可用 | 扫码,或 Client ID / Secret | 钉钉开放平台机器人;回复优先走 AI Card |
71
+ | 🐦 **飞书** | ✅ 可用 | 扫码(自动创建机器人),或 App ID / App Secret | 飞书账号,或自建机器人凭据 |
72
+ | 🌐 **Lark** | ✅ 可用 | 扫码,或 App ID / App Secret | Lark 国际版账号,或自建机器人凭据 |
73
+ | 💬 **微信** | ✅ 可用* | 官方 iLink 扫码 | 建议专用小号;仅私聊 |
74
+ | 🏢 **企业微信** | ✅ 可用 | 扫码(推荐),或 Bot ID / Secret | 企业微信智能机器人 |
75
+ | 🐧 **QQ** | ✅ 可用 | 扫码,或 AppID / AppSecret | QQ 开放平台机器人,不是个人号 |
76
+ | ✈️ **Telegram** | ✅ 可用 | 仅填 Bot Token | `@BotFather`;同一 Bot 不要同时开 Webhook |
77
+ | 🎮 **Discord** | ✅ 可用 | 仅填 Bot Token | Developer Portal 的官方 Bot。打开 Message Content Intent;文字频道和公告频道第一次 @ 后在 Thread 中继续,不必重复 @ |
78
+ | 🧩 **Slack** | ✅ 可用 | 填 Bot Token 与 App Token | api.slack.com 建应用并开启 Socket Mode。私聊直接回复,频道被 @ 后在该消息的线程里回复,线程内后续消息不必重复 @ |
79
79
 
80
- ## Image input
80
+ ✅ 可用 = 文字收发可用 | *微信 = 只走腾讯官方 iLink,不做逆向个人号 | 群聊都需要 @ 机器人才回复。Discord 仅文字频道和公告频道在 Bot 自己创建的 Thread 中免重复 @;Slack 在机器人已参与的消息线程中免重复 @
81
81
 
82
- Image input follows DSH Chat's model-capability and attachment rules rather than guessing vision support from model names:
82
+ ## 图片输入
83
83
 
84
- The receive paths cover WeChat, WeCom, DingTalk, Feishu, Lark, QQ, Telegram, Discord, and Slack. See the [image-input verification guide](docs/image-input.md) for protocol forms and live checks.
84
+ 图片输入使用与 DSH Chat 一致的模型能力和附件规则,不按模型名称猜测视觉能力:
85
85
 
86
- - Use the model currently selected for the IM session, not just the global default.
87
- - When the model declares `image` support, store images as standard DSH attachments and submit image content to the model. Session history keeps image references rather than only local-path text.
88
- - When the model explicitly excludes image input, tell the sender to switch models instead of silently dropping the image. Missing capability metadata follows Chat's compatibility behavior and is not, by itself, a reason to reject an image.
89
- - Channel download limits, host attachment size and format limits, DM access rules, and group mention requirements still apply.
90
- - This is inbound image analysis, not a promise that every channel supports sending images from the bot or generating images.
86
+ 覆盖微信、企业微信、钉钉、飞书、Lark、QQ、Telegram、Discord 和 Slack;具体平台消息形式和联调检查见[图片输入验收](docs/image-input.md)。
91
87
 
92
- ## File input
88
+ - 以当前 IM 会话实际使用的模型为准,而不是只看全局默认模型。
89
+ - 模型声明支持 `image` 时,将图片保存为 DSH 标准图片附件并提交给模型;会话记录保留图片引用,而不是只有本地文件路径文字。
90
+ - 模型明确不支持图片时,在 IM 提示切换模型,不静默丢图。模型未提供能力元数据时,遵循 Chat 的兼容规则,不仅因元数据缺失而拒绝。
91
+ - 图片仍受渠道下载限制、宿主附件大小与格式限制,以及原有私聊准入和群聊 @ 规则约束。
92
+ - 此功能是用户向机器人发送图片进行分析,不代表所有渠道都支持机器人发送图片或生成图片。
93
93
 
94
- WeChat, WeCom, DingTalk, Feishu, Lark, QQ, Telegram, Discord, and Slack accept ordinary files through Chat’s upload service for the current session. Send PDFs, documents or spreadsheets for the assistant to process. Format support follows web Chat’s models, tools and file capabilities; uploading does not guarantee that every format can be understood directly.
94
+ ## 文件输入
95
95
 
96
- - Requires the file-upload service on supported hosts (`>=0.2.0-rc.1 <0.3.0-0`). Legacy versions and breaking changes in the `0.3.0` generation are rejected by the version gate. If you still use a `0.1.x` host, install plugin `0.1.78` instead of `@latest`.
97
- - Up to 4 ordinary files per message, totaling 20 MiB. Channel download limits also apply.
98
- - Files become standard Chat attachments and are submitted with session-specific receipts, rather than local-path text.
99
- - Private admission and group mention rules remain in force. File captions such as `/new` or “allow” are content, not commands or approval responses.
100
- - Failed uploads do not submit partial text. Disabling or reloading an account prevents later submission to the old session. Generated files can be sent back after the reply.
96
+ 微信、企业微信、钉钉、飞书、Lark、QQ、Telegram、Discord、Slack 可接收普通文件,并通过 Chat 的上传服务交给当前会话。可以发送 PDF、文档、表格等文件,再让助手读取或处理;能否解析具体格式与网页 Chat 的模型、工具和文件能力一致,不承诺每种格式都能直接理解。
101
97
 
102
- ## File delivery
98
+ - 需要支持的宿主(`>=0.2.0-rc.1 <0.3.0-0`)所提供的文件上传服务。早期版本与 `0.3.0` 代际破坏性更新由版本门拦截。仍在使用 `0.1.x` 的,请安装插件 `0.1.78`,不要装 `@latest`。
99
+ - 单条消息最多 4 个普通文件,累计最多 20 MiB,还受渠道下载限制约束。
100
+ - 文件先保存为 Chat 标准附件,通过当前会话专属的凭据提交;不把本地路径文字当作文件输入。
101
+ - 保留私聊准入与群聊提及规则;文件说明中的 `/new` 或“批准”属于普通内容,不执行命令或审批。
102
+ - 上传失败不提交部分正文,停用或重载账号后不继续向旧会话提交。支持回复后的文件产物回传。
103
103
 
104
- WeChat, WeCom, DingTalk, Feishu, Lark, QQ, Telegram, Discord, and Slack can return files produced by the assistant. For example: “Create a PDF report and send me the file.”
104
+ ## 文件回传
105
105
 
106
- - Aligned with DSH Host delivery contracts: when the assistant explicitly declares deliverables via `tool-present` (`deliverables/presented`), the corresponding files are returned as chat attachments. Ordinary low-level tool mutations (such as editing code or writing state files) are not sent automatically, preventing chat noise and credential leakage.
107
- - File access follows Chat: files outside the workspace are allowed when the host can read them. The plugin does not extract arbitrary paths from reply text. Files created through shell commands or scripts need to be presented explicitly by the assistant.
108
- - Supported hosts use Chat's complete-file download service and its configured size limit. Directories and symbolic links are not sent; channel-specific file limits still apply.
109
- - A failed transfer produces a message naming the file and does not stop the remaining files. Switching away from the session or stopping the account prevents pending delivery from continuing to a different target.
110
- - Send `/export` as a standalone command to receive the current linked session’s Chat ZIP logs in this chat, without child sessions. The ZIP limit is 32 MiB; channel limits also apply. If the file is too large or cannot be sent, use `/export` in web Chat. Paths and other session IDs are not accepted.
106
+ 微信、企业微信、钉钉、飞书、Lark、QQ、Telegram、Discord 和 Slack 均可回传助手产出的文件。例如:“整理成 PDF 报告,并把文件发给我。”
111
107
 
112
- ## Action menu
108
+ - 遵循 DSH 宿主交付契约:当助手通过 `tool-present`(`deliverables/presented`)显式声明交付时,对应文件将作为附件发到聊天中;底层的普通工具写操作(如修改代码、记录状态文件)不会被自动当作产物发送,防止群聊噪音与隐私泄露。
109
+ - 文件访问范围与 Chat 一致,允许宿主可读取的工作区外文件。不从回复正文中猜测文件路径;通过脚本等方式生成的文件,由助手明确 `present` 交付。
110
+ - 已支持的宿主使用 Chat 完整文件下载服务及其配置的大小上限。目录和符号链接不发送,渠道自身的文件限制仍然适用。
111
+ - 单个文件发送失败会明确提示文件名,并继续处理其他文件;切走会话或停止账号后,不会把尚未投递的文件转发到其他聊天。
112
+ - 单独发送 `/export`,可将当前聊天绑定会话的 Chat ZIP 日志发回当前聊天(不含子会话)。ZIP 上限为 32 MiB,渠道自身限制仍适用;超限或发送失败时可在网页 Chat 使用 `/export` 下载。不接受路径或其他会话 ID 参数。
113
113
 
114
- After a valid selection, supported cards remove their buttons and mark the selection; the following reply reports the actual result. WeCom updates are limited to the button callback window; expired actions are still rejected by the server. `/status` offers actions based on the current state, such as stopping a task, pausing or resuming a goal, and viewing queued messages.
114
+ ## 操作菜单
115
115
 
116
- On channels with native buttons, `/sessions`, `/workspaces` and `/models` open a selector directly. After paging, numbered replies and `/session N`, `/workspace N` or `/model N` refer to the current selection page. Text channels keep their original list numbering.
116
+ 有效点击后,支持更新的原卡片移除按钮,提示已选择;实际执行结果见后续回复。企业微信仅能在按钮回调窗口更新,过期卡片仍由服务端拒绝。`/status` 根据实际状态提供停止任务、暂停或恢复目标、查看队列等操作。
117
117
 
118
- Send `/menu` or `/m` to select sessions, workspaces, models and Agent presets, or start, stop, export and inspect a session. Lists support pagination. Click a button or reply with the current menu number; ordinary text exits the menu.
118
+ 支持原生按钮的渠道发送 `/sessions`、`/workspaces`、`/models` 即可直接选择,无需再进入菜单。分页后,回复序号或 `/session 序号`、`/workspace 序号`、`/model 序号` 对应当前选择页;文字渠道仍使用原列表序号。
119
119
 
120
- Menus include previous, next and back actions. WeCom menus paginate to fit card limits, including the main menu (`/menu 2`). Open a selector directly with `/menu sessions`, `/menu workspaces` or `/menu models`; presets and reasoning use `/menu presets` and `/menu reasoning`.
120
+ 发送 `/menu` 或 `/m`,可选择会话、工作区、模型和 Agent 预设,以及新建、停止、导出和查看状态。列表支持分页;点击按钮或回复当前菜单序号即可操作,普通文字退出菜单。
121
121
 
122
- Common command replies offer related next steps: for example, `/model` → select a model / adjust reasoning → back to menu. Supported channels offer buttons; text replies include the commands to send. Navigation buttons on ordinary result replies do not accept numeric shortcuts, so numbers remain chat input; only selection menus accept numbered replies. Oversized cards fall back to complete text.
122
+ 菜单提供上一页、下一页和返回入口;企业微信按卡片容量分页,主菜单也可通过 `/menu 2` 翻页。会话、工作区和模型选择分别可直接发送 `/menu sessions`、`/menu workspaces`、`/menu models`;预设与推理可用 `/menu presets`、`/menu reasoning`。
123
123
 
124
- DingTalk, Telegram, Discord, Slack, and Feishu/Lark use native buttons. WeCom uses cards when button count and text length fit platform limits. Other cases, QQ and WeChat use numbered text. Explicit rejections and capacity limits fall back to complete text. Uncertain network delivery produces a confirmation notice instead of resending the card. Menus are scoped to the account, chat, operator and session, expire after 15 minutes or restart, and recheck permissions on selection. Used buttons cannot execute again.
124
+ 常用命令回复会提供相关下一步,例如 `/model` → 选择模型 / 调整推理 → 返回菜单。支持原生按钮时可点击跳转,其他情况显示可直接发送的命令。普通结果回复的导航按钮不支持数字选择,避免把聊天中的数字误当操作;只有选择菜单支持回复序号。超长卡片保留完整文字回复。
125
125
 
126
- Approvals and questions use the same native-button channels: allow once/reject, single-choice selection, and multiple selections followed by submit. Open questions retain text input. Approvals always stay in the chat that started the task and never fall back to the web; a failed prompt is treated as a denial. If nobody approves or rejects within 5 minutes, the action is canceled and the chat is told it did not run. Other text during that wait is reminded to finish the approval and is not submitted as the next turn. Images and files are still submitted as content and are not treated as the approval reply. In groups only the task initiator can approve; DMs add no extra restriction beyond chatting. Disabling commands does not disable pending approvals or questions. Questions have no such timeout; the next text message is still the answer.
126
+ 钉钉、Telegram、Discord、Slack、飞书/Lark 使用原生按钮;企业微信在按钮数量和正文符合平台限制时使用卡片,其他情况及 QQ、微信使用文字序号。平台明确拒绝或超出卡片容量时退回完整文字;网络异常导致发送结果未知时仅提示确认,避免重复发送。菜单按账号、聊天、操作者和会话隔离,15 分钟或重启后失效;执行时重新检查权限,旧按钮不能重复执行。
127
127
 
128
+ 审批与问答复用上述原生按钮渠道:审批提供批准一次/拒绝,单选题直接点选,多选题勾选后提交;开放问题保留文字回答。审批始终留在发起任务的聊天里,不会回退到网页端;提示发送失败时按拒绝处理。5 分钟内没有批准或拒绝就按取消结束,并说明这次未执行;这段时间里的其他文字只提示先完成审批,不会送进下一轮。图片和文件仍按原消息提交,不当成审批答复。群聊里只接受任务发起者批准,私聊没有额外限制,关闭命令不影响已有审批及问答。问题不设这个超时,下一句文字仍作为答案。
128
129
 
129
- Agent presets: `/presets` (alias `/presetlist`) lists presets; `/preset` shows the current preset. `/preset number-or-ID` starts and switches to a new session in the current workspace, keeping previous sessions. Use `/preset id:ID` for numeric IDs and `/preset --default` for the default preset. Account defaults remain unchanged; later `/new` commands still use account settings. Native buttons support direct selection; text lists use numbers valid for 15 minutes.
130
130
 
131
- Reasoning: `/reasoning` (aliases `/reasonings`, `/reasoninglist`) lists levels for the current model. Use `/reasoning number` or `/reasoning id:effort-ID`, or `/reasoning --default` to reset. Native channels offer paginated buttons. List selections are bound to the session and model; refresh the list after switching. Model and reasoning updates follow Chat’s default-selection persistence rules.
131
+ Agent 预设:`/presets`(别名 `/presetlist`)查看目录,`/preset` 查看当前预设,`/preset 序号或ID` 使用预设在当前工作区新建并切换会话,旧会话保留。纯数字 ID 使用 `/preset id:ID`,`/preset --default` 使用宿主默认预设。账号默认设置不变,后续 `/new` 仍按账号设置创建。原生按钮渠道可直接选择,文字渠道使用列表序号(15 分钟有效)。
132
132
 
133
- Work started by an IM message gets one result notice after response and file delivery finishes, with links to recent messages, status, session export and the menu. Failures, stops and delivery failures are distinguished; tasks and files are not retried automatically. When commands are disabled, notices are text-only. Ordinary numbers remain chat input. Approvals and questions keep their existing prompts. Completion navigation is suppressed after switching sessions, disabling the account or starting a later turn.
133
+ 推理等级:`/reasoning`(别名 `/reasonings`、`/reasoninglist`)提供当前模型的等级选择,`/reasoning 序号` 或 `/reasoning id:等级ID` 设置等级,`/reasoning --default` 恢复默认。原生渠道支持分页按钮;旧列表序号和按钮绑定会话与模型,变化后需重新获取列表。模型与推理修改沿用 Chat 的默认选择保存规则。
134
134
 
135
- ## Message progress
135
+ IM 消息发起的处理结束后,会在正文和文件投递完成后给出一次结果提示,并提供最近记录、状态、会话导出和菜单入口。执行失败、停止和投递失败会分别说明;不会自动重跑任务或重发文件。关闭命令时只显示文字提示,普通数字仍作为聊天内容。审批和问答沿用原交互提示。切换会话、停用账号或后续回合已开始时,不再发送旧回合的完成导航。
136
136
 
137
- Regular chat messages follow the actual task state. Commands continue to use text replies.
137
+ ## 消息处理状态
138
138
 
139
- - DingTalk: labels on the original message show queued, thinking, waiting for confirmation, done, failed, or cancelled.
140
- - Feishu / Lark: reactions indicate processing, done, or failed. Waiting keeps the processing reaction; cancellation removes it.
141
- - Telegram: 👀 processing, 🤔 waiting for confirmation, 👍 done, and 👎 failed. Cancellation removes the reaction. Typing is refreshed while processing.
142
- - Discord: uses the same reactions and edits one message as the answer streams. Typing is refreshed while processing. Cancellation removes the reaction.
143
- - Slack: ✅ done, ❌ failed, 🤔 waiting, and 👀 processing are added as emoji reactions on the original message (requires `reactions:write`). Answers stream by editing one message; Slack has no bot typing indicator.
144
- - WeChat: typing is refreshed while processing and stopped when finished or waiting for confirmation. WeCom and QQ retain their existing reply behavior.
145
- - Telegram also carries the intermediate steps in one placeholder message: its header shows what the assistant is doing (thinking with a running character count, then each tool step with a short argument summary and duration) while the answer grows underneath. The header is cleared as soon as real answer text arrives, so the finished reply contains only the answer. Channels that do not declare status-line support keep their existing behavior.
139
+ 普通聊天消息会随实际任务更新状态;命令仍使用文字回复。
146
140
 
147
- WeChat suppresses transition text in assistant messages that also contain `tool-call` blocks to reduce reply-window usage. Text-only replies, approvals, questions, and result files are unaffected by this filter. Suppressed text does not count as a successful delivery, and history-based redelivery uses the same rule. This does not remove platform limits: long reply fragments and necessary interactions may still exhaust the window. Ambiguous or partial deliveries are not blindly resent in full. See the [WeChat delivery handoff (Chinese)](docs/01-当前工作/I023-微信中间叙述投递过滤/00-迭代总览.md).
141
+ - 钉钉:在原消息上显示排队、思考、等待确认、已完成、失败或取消标签。
142
+ - 飞书 / Lark:使用处理中、完成和失败表情;等待确认沿用处理中表情,取消时撤下表情。
143
+ - Telegram:使用 👀 处理中、🤔 等待确认、👍 完成、👎 失败;取消时撤下表情。处理期间持续显示输入状态。
144
+ - Discord:使用与 Telegram 相同的表情,并编辑同一条消息显示逐步生成的回答。处理期间持续显示输入状态。取消时撤下表情。
145
+ - Slack:用 ✅ 完成、❌ 失败、🤔 等待确认、👀 处理中作为消息表情回应(需要 `reactions:write`);回答通过编辑同一条消息逐步生成,Slack 没有机器人输入状态。
146
+ - 微信:处理期间刷新输入状态,结束或等待确认时停止。企业微信、QQ 保持现有回复方式。
147
+ - Telegram 还把中间态收进同一条占位消息:顶部显示助手正在做什么(思考中及累计字数,之后是每一步工具调用与参数摘要、耗时),正文在下面生长;正文一到就撤掉状态行,最终回复只留正文。未声明支持状态行的渠道行为不变。
148
148
 
149
- Done means the turn completed normally and both text and files were delivered. Stopped or failed tasks and later queued messages are not marked done. Channel permissions and network conditions may prevent status updates without blocking chat. Text labels follow the web language setting.
149
+ 微信默认不投递同一条助手消息中带 `tool-call` 的过渡文字,减少回复窗口消耗;纯文本回复、审批、提问和成果文件不受此过滤影响。过滤不算成功投递,补发读取历史时使用相同规则。该措施不会解除平台限额,长回复分片和必要交互仍可能占满窗口;送达未知或部分送达不会盲目整条重发。实现、验证与回滚见[微信投递交接](docs/01-当前工作/I023-微信中间叙述投递过滤/00-迭代总览.md)。
150
150
 
151
- ## Connection diagnostics
151
+ “已完成”表示该回合正常结束且正文、文件均已投递;停止、失败和下一条排队消息不会误标完成。状态接口受渠道权限与网络影响,更新失败不阻塞聊天;文字标签跟随网页语言设置。
152
152
 
153
- Use **Diagnose connection** in account settings to query platform APIs: WeChat configuration, a ping acknowledgement on the existing WeCom connection, DingTalk credentials, Feishu/Lark credentials and bot identity, QQ credentials and gateway, Telegram bot identity and Webhook conflicts, Discord bot identity and Gateway URL, or Slack bot identity plus Socket Mode state when a connection already exists (no new connection is opened).
153
+ ## 连接诊断
154
154
 
155
- Each check reports passed, failed, or unverified, with timing and a suggested next step. No test messages are sent and no extra message polling is started. Passing one check does not verify all messaging permissions. An older backend prompts you to restart DSH and refresh the page. See the [connection diagnostics API and validation notes (Chinese)](docs/01-当前工作/I015-命令权限与Chat命令/06-账号状态检查.md).
155
+ 账号设置中的“诊断连接”会实际调用渠道接口:微信查询配置,企微检测现有连接的 ping 回执,钉钉验证应用凭据,飞书/Lark 查询鉴权与机器人身份,QQ 查询鉴权与网关,Telegram 查询机器人身份及 Webhook 冲突,Discord 查询机器人身份及 Gateway 地址,Slack 查询机器人身份,并在已建立 Socket Mode 连接时回报连接状态(不新建连接)。
156
156
 
157
- ## Screenshots
157
+ 每项显示通过、失败或未验证、耗时和处理建议。诊断不发送测试消息、不额外拉取聊天消息;单项通过不代表完整收发权限已验证。旧后端不支持诊断时会提示重启 DSH 并刷新页面。接口、各渠道能力边界与验证记录见[账号连接诊断](docs/01-当前工作/I015-命令权限与Chat命令/06-账号状态检查.md)。
158
158
 
159
- Add accounts under each channel in **Settings → IM Assistant**. Expand a channel and click an account name to add a remark so you can tell users apart; leave it blank to restore the automatic name. The settings button configures workspace, model, permission, private access, and send mode, and can edit the same remark. The **Receive messages** switch is on the account row:
159
+ 在「设置 → IM助理」按渠道添加账号。展开渠道后,点击账号名称可填写备注,用来区分是谁在使用;留空则恢复自动名称。设置按钮配置工作区、模型、权限、私聊准入和发送方式,那里也可以改备注;接收消息开关位于账号行:
160
160
 
161
- ![IM Assistant settings](assets/screenshots/settings-channels.png)
161
+ ![IM 助理设置页](assets/screenshots/settings-channels.png)
162
162
 
163
- The workspace splits **Tasks** and **Channels**. IM sessions appear only under **Channels**:
163
+ 工作区左侧「任务 / 频道」分列。IM 会话只出现在「频道」:
164
164
 
165
- ![Workspace channel sidebar](assets/screenshots/workspace-channels.png)
165
+ ![工作区频道侧栏](assets/screenshots/workspace-channels.png)
166
166
 
167
- WeCom and other QR channels support scan-to-bind:
167
+ 企业微信等渠道支持扫码快捷绑定:
168
168
 
169
- ![WeCom QR binding](assets/screenshots/wecom-qr.png)
169
+ ![企业微信扫码绑定](assets/screenshots/wecom-qr.png)
170
170
 
171
- After connecting, drive the local assistant from each IM:
171
+ 连上后,可在各 IM 里直接驱动本机助手:
172
172
 
173
173
  <p align="center">
174
- <img src="assets/screenshots/wecom-chat.jpg" width="220" alt="WeCom chat">
175
- <img src="assets/screenshots/weixin-chat.jpg" width="220" alt="WeChat chat">
176
- <img src="assets/screenshots/dingtalk-chat.jpg" width="220" alt="DingTalk chat">
174
+ <img src="assets/screenshots/wecom-chat.jpg" width="220" alt="企业微信对话">
175
+ <img src="assets/screenshots/weixin-chat.jpg" width="220" alt="微信对话">
176
+ <img src="assets/screenshots/dingtalk-chat.jpg" width="220" alt="钉钉对话">
177
177
  </p>
178
178
  <p align="center">
179
- <img src="assets/screenshots/feishu-chat.jpg" width="220" alt="Feishu chat">
180
- <img src="assets/screenshots/qq-chat.jpg" width="220" alt="QQ chat">
181
- <img src="assets/screenshots/telegram-chat.jpg" width="220" alt="Telegram chat">
179
+ <img src="assets/screenshots/feishu-chat.jpg" width="220" alt="飞书对话">
180
+ <img src="assets/screenshots/qq-chat.jpg" width="220" alt="QQ 对话">
181
+ <img src="assets/screenshots/telegram-chat.jpg" width="220" alt="Telegram 对话">
182
182
  </p>
183
183
 
184
- ## DSH product ecosystem
184
+ ## DSH 产品生态
185
185
 
186
- For a desktop workbench, download [DSH Codex Desktop](https://github.com/MichengAI/dsh-codex-desktop/releases). Existing [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) installations can add plugins as needed by following each project's README. Below are 11 first-party plugins; consult the corresponding desktop release notes and bundled catalog for what that version includes.
186
+ 想使用桌面工作台,可下载 [DSH Codex Desktop](https://github.com/MichengAI/dsh-codex-desktop/releases);已有 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 环境,可按各项目 README 按需安装。以下列出 11 个自研插件;桌面端实际随附范围以对应版本的发行说明和内置清单为准。
187
187
 
188
- | Plugin | What you can do |
188
+ | 插件 | 你可以用它做什么 |
189
189
  | --- | --- |
190
- | [Codex UI](https://github.com/MichengAI/dsh-codex-ui) | Organize projects and conversations, search tasks, and navigate chat turns |
191
- | [Agency Agents](https://github.com/MichengAI/dsh-agency-agents) | Choose and summon specialists for your task |
192
- | [Skills Manager](https://github.com/MichengAI/dsh-skills-manager) | Find, enable, create, and import local skills |
193
- | [Archive Manager](https://github.com/MichengAI/dsh-archive-manager) | Search, restore, or clean up archived conversations |
194
- | [IM Connect](https://github.com/MichengAI/dsh-im-connect) | Send tasks and receive replies through messaging platforms |
195
- | [Automation](https://github.com/MichengAI/dsh-automation) | Schedule tasks and review each run |
196
- | [BTW](https://github.com/MichengAI/dsh-btw) | Ask side questions without interrupting the main task |
197
- | [Simplify](https://github.com/MichengAI/dsh-simplify) | Use `/simplify` to improve code within your Git changes |
198
- | [PUA](https://github.com/MichengAI/dsh-pua) | Guide the Agent to try new approaches after failures, investigate causes, and verify results before completion |
199
- | [Code Review](https://github.com/MichengAI/dsh-code-review) | Use `/review` to request an independent Agent code review and receive the report in the current conversation |
200
- | [Codex Pet](https://github.com/MichengAI/dsh-codex-pet) | View conversation notifications and respond to tool approvals and questions through a desktop pet |
190
+ | [Codex UI](https://github.com/MichengAI/dsh-codex-ui) | 整理项目与会话、搜索任务、跳转对话轮次 |
191
+ | [Agency Agents](https://github.com/MichengAI/dsh-agency-agents) | 按任务选择并召唤专业角色 |
192
+ | [Skills Manager](https://github.com/MichengAI/dsh-skills-manager) | 统一查找、启停、创建和导入本机技能 |
193
+ | [Archive Manager](https://github.com/MichengAI/dsh-archive-manager) | 搜索、恢复或清理已归档会话 |
194
+ | [IM Connect](https://github.com/MichengAI/dsh-im-connect) | 从消息平台下任务、收回复 |
195
+ | [Automation](https://github.com/MichengAI/dsh-automation) | 按计划执行任务,查看每次运行的结果 |
196
+ | [BTW](https://github.com/MichengAI/dsh-btw) | 在当前上下文中临时旁问,不打断主任务 |
197
+ | [Simplify](https://github.com/MichengAI/dsh-simplify) | 用 `/simplify` 整理 Git 改动范围内的代码 |
198
+ | [PUA](https://github.com/MichengAI/dsh-pua) | 引导 Agent 在失败时换方法、查原因,并在完成前验证结果 |
199
+ | [Code Review](https://github.com/MichengAI/dsh-code-review) | 用 `/review` 发起独立 Agent 代码审查,在当前会话接收报告 |
200
+ | [Codex Pet](https://github.com/MichengAI/dsh-codex-pet) | 通过桌面宠物查看会话提醒、处理工具审批和问题回答 |
201
201
 
202
- ## Prerequisites
202
+ ## 前置条件
203
203
 
204
- - A working DeepSeek Harness Web installation with `dsh` available in PowerShell.
205
- - Host compatibility: Full DeepSeek Harness `0.2.x` line (`>=0.2.0-rc.1 <0.3.0-0`), verified with `0.2.0-rc.1`, `0.2.0-rc.2`, `0.2.1-rc.1`, `0.2.1-rc.2`, and `0.2.1-rc.3`, and forwards-compatible with subsequent `0.2.x` releases, alphas, and RCs without requiring routine plugin version bumps. Legacy versions and breaking changes in the `0.3.0` generation are rejected by the version gate. If you still use a `0.1.x` host, install plugin `0.1.78` instead of `@latest`.
206
- - Examples use the `web` profile; replace it with the target profile.
207
- - Source installation and development require Node.js 22+. npm installation does not require running `npm install` in an arbitrary directory.
208
- - After install, restart `dsh web` and hard-refresh the browser before opening **Settings → IM Assistant**.
209
- - **Reverse proxy deployment**: Supports hosting DSH behind prefix-stripping reverse proxies (e.g. `/app/dsh/`). API and update endpoints automatically resolve against the page base URI (`document.baseURI`), preventing 404 errors caused by lost prefix segments.
204
+ - 已可正常运行 DeepSeek Harness Web,且可在 PowerShell 中使用 `dsh`。
205
+ - 宿主支持范围:DeepSeek Harness `0.2.x` 全系列(`>=0.2.0-rc.1 <0.3.0-0`),已验证兼容 `0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-rc.1`~`0.2.1-rc.5`、`0.2.2-rc.1`,并自动支持后续全部 0.2.x RC 版本,同代宿主升级无需重复等待发版。早期版本与 `0.3.0` 代际破坏性更新由版本门拦截。仍在使用 `0.1.x` 的,请安装插件 `0.1.78`,不要装 `@latest`。
206
+ - 以下示例使用 `web` profile;请替换为实际目标 profile。
207
+ - 从源码安装或二次开发需要 Node.js 22+;仅从 npm 安装无需在任意目录执行 `npm install`。
208
+ - 安装后必须重启 `dsh web`,并在浏览器硬刷新,才能看到「设置 → IM助理」。
209
+ - **反向代理部署**:支持将 DSH 部署在带路径前缀的反向代理后面(如 `/app/dsh/`),插件 API 与更新检查端点统一自动按页面基址(`document.baseURI`)相对解析,避免丢失代理路径前缀导致 404。
210
210
 
211
- ## Installation
211
+ ## 安装
212
212
 
213
- The installation commands below use the official npm registry.
213
+ 以下安装命令使用官方 npm 源。
214
214
 
215
- ### Ask an agent to install it (recommended)
215
+ ### 让 Agent 帮你安装(推荐)
216
216
 
217
- Send the prompt below to any agent that can run terminal commands on your computer. Replace `web` with your actual profile. Once installed, use the plugin in DSH.
217
+ 把下面这段话发给任意能够执行本机终端命令的 Agent。将 `web` 替换为实际使用的 profile;安装完成后,在 DSH 中使用本插件。
218
218
 
219
219
  ```text
220
- Install the DSH plugin @michengai/dsh-im-connect into my local web profile by running: dsh plugin --profile web add @michengai/dsh-im-connect@latest --registry=https://registry.npmjs.org/. Then run dsh --profile web --dump-config, confirm the configuration includes im-connect, and explain how to reload DSH and start using the plugin.
220
+ 请将 DSH 插件 @michengai/dsh-im-connect 安装到本机 web profile,执行:dsh plugin --profile web add @michengai/dsh-im-connect@latest --registry=https://registry.npmjs.org/。安装后执行 dsh --profile web --dump-config,确认配置包含 im-connect,并告诉我如何重新加载 DSH 和开始使用。
221
221
  ```
222
222
 
223
- ### Install the latest package from the official npm registry
223
+ ### 从官方 npm 安装最新版
224
224
 
225
- Run this from any PowerShell directory:
225
+ 在任意 PowerShell 目录执行:
226
226
 
227
227
  ```powershell
228
228
  [Console]::OutputEncoding = [System.Text.Encoding]::UTF8
@@ -231,162 +231,163 @@ dsh plugin --profile web add @michengai/dsh-im-connect@latest --registry=https:/
231
231
  dsh --profile web --dump-config
232
232
  ```
233
233
 
234
- To pin a release, replace `@latest` with a version such as `@0.1.28`.
234
+ 需要钉死某一版时,把 `@latest` 换成具体版本,例如 `@0.1.28`。
235
235
 
236
- The configuration output should contain `im-connect`. Restart DSH Web and hard-refresh the browser. Do not copy client files manually: `dsh plugin add` also applies `cordis.patch.yml`.
236
+ 配置输出中应包含 `im-connect`。安装后重启 DSH Web 并在浏览器硬刷新。不要手工复制客户端文件,`dsh plugin add` 会同时应用 `cordis.patch.yml`。
237
237
 
238
- ## Plugin Configuration & Toggles
238
+ ## 插件配置与可选开关
239
239
 
240
- The plugin follows standard DSH bundle configuration conventions. Options are located at:
241
- > **Sidebar → Plugins → Click `@michengai/dsh-im-connect`** (the host's `plugins.bundle.config` slot).
240
+ 插件遵循 DSH 官方扩展配置规范,配置项位于:
241
+ > **主界面侧边栏「插件」→ 点击 `@michengai/dsh-im-connect` 详情页**(对应宿主 `plugins.bundle.config` 槽位)。
242
242
 
243
- Native configuration options are provided here. Their values are persisted in `channels.json` under the plugin's `stateDir` and survive restarts; they are not equivalent Cordis YAML options. `location` and `taskTreeSessions` are managed through this UI, while `onlineUpdate` is also subject to the host lock described below:
243
+ 此处提供原生配置项。界面配置值保存在插件 `stateDir` 下的 `channels.json` 中,重启后保留;它们不是等价的 Cordis YAML 配置项。`location` 和 `taskTreeSessions` 只通过此界面管理,`onlineUpdate` 另受下述宿主锁定规则约束:
244
244
 
245
- ### 1. Entry Location (`location`)
246
- - **Default**: Settings only (`settings`)
247
- - **Description**: Controls where the IM Assistant management page is displayed in the host navigation, supporting three states (matching host bundle entry conventions):
248
- - **Both (`both`)**: Displays a persistent icon in the left primary sidebar and retains the entry in **Settings → IM Assistant**;
249
- - **Sidebar only (`sidebar`)**: Displays only the sidebar icon, omitting the global settings entry;
250
- - **Settings only (`settings`)**: Unregisters the sidebar icon (gracefully switching active views if currently open) and retains only the entry in **Settings → IM Assistant**.
251
- - **Effect**: Clicking the sidebar icon opens the IM Assistant management page directly in the primary workspace with a **960px centered container** (matching host plugin manager conventions). This eliminates vertical scrolling constraints in narrow settings dialogs; state is synchronized live across both entry points.
245
+ ### 1. 入口位置 (`location`)
246
+ - **默认状态**:仅设置(`settings`)
247
+ - **功能说明**:控制 IM 管理面板在宿主中的导航入口展示位置,支持三态切换(对齐官方扩展入口规范):
248
+ - **全部展示 (`both`)**:同时在左侧侧边栏常驻图标并在「设置 → IM助理」保留入口;
249
+ - **仅侧边栏 (`sidebar`)**:仅在左侧主导航栏显示图标入口,不在全局设置侧栏中显示;
250
+ - **仅设置 (`settings`)**:注销侧边栏图标(若当前正停留在 IM 面板,会自动安全切回默认视图,防止悬空和白屏),仅在「设置 → IM助理」保留入口。
251
+ - **生效效果**:在侧边栏点击即可直达 IM 助理中心,并在主工作区以 **960px 居中版心**(对齐官方插件管理与市场规范)展开完整大面板,彻底告别在设置弹窗狭窄视口内滚动的局限;两处入口数据与状态 100% 实时同步。
252
252
 
253
- ### 2. Online Updates (`onlineUpdate` / `updater`)
254
- - **Default**: Enabled (`true`)
255
- - **Description**: Controls whether the plugin checks for and installs updates from npm.
256
- - **Effect**:
257
- - **Dynamic UI Sync**: Disabling the toggle hides the **Check for updates** button and version badge in the header immediately without requiring a full page reload;
258
- - **Endpoint Guard**: When disabled, the update API route returns `HTTP 403` for all check and install requests, preventing unreviewed updates;
259
- - **Host / Platform Lock**: For curated plugin indexes (such as VibeDev) or restricted enterprise environments, this can be locked directly via Cordis configuration (bundle patch) without needing UI interaction:
253
+ ### 2. 在线更新 (`onlineUpdate` / `updater`)
254
+ - **默认状态**:开启(`true`)
255
+ - **功能说明**:控制是否允许在线检查并安装 IM 连接器的新版本。
256
+ - **生效效果**:
257
+ - **界面联动**:关闭开关后,IM 管理面板标题旁的「检查更新」按钮与版本提示将即时隐藏,无需刷新页面;开启后自动恢复展示;
258
+ - **接口安全拦截**:关闭后,服务端的更新路由对任何版本检查和安装请求均返回 `HTTP 403` 禁用状态,彻底杜绝在插件内安装未审核版本;
259
+ - **宿主/平台级锁定**:面向精选插件索引(如 VibeDev)或企业安全合规环境,支持直接在 Cordis 配置文件(bundle patch)中声明,无需进入界面手动配置:
260
260
  ```yaml
261
- updater: false # or onlineUpdate: false
261
+ updater: false # 或 onlineUpdate: false
262
262
  ```
263
- Once configured, the updater is disabled at startup, the update action stays hidden, and the online-update switch is disabled. The host lock takes precedence over the user's choice in `channels.json` and cannot be lifted through the UI. Removing the host lock restores the saved user preference.
264
- - **Update Modes**: When a newer release is available, **Update automatically** runs only when the DSH CLI or Desktop update service is available; otherwise, the dialog provides a profile-specific manual command to copy and run.
263
+ 配置生效后,更新器在启动时即被禁用,更新入口隐藏,详情页在线更新开关置灰。宿主锁定优先于 `channels.json` 中的用户选择,界面不能解除锁定;宿主移除锁定后,重新按已保存的用户选择生效。
264
+ - **更新模式**:发现新版后,只有检测到 DSH CLI 或 Desktop 更新服务时才可使用“自动更新”;其他环境会在弹窗中提供可复制、与当前 Profile 对应的手工更新命令。
265
265
 
266
- ### 3. Show IM Sessions in Task Tree (`taskTreeSessions`)
267
- - **Default**: Disabled (`false`, hides IM sessions in the workspace task tree by default to keep daily workspaces clean)
268
- - **Description**: Controls whether messaging channel sessions appear in the official workspace task tree.
269
- - **Effect**:
270
- - **Workspace Decluttering**: When disabled, all messaging sessions (including `dsh-im-session-*`, legacy `im:*` prefixes, and active channel session bindings) are automatically filtered out from the official workspace task tree, preventing high-frequency chats from flooding your daily development workspaces;
271
- - **Channels Tab Preserved**: Filtering applies only to the official workspace tree. All channel sessions remain fully available and accessible at any time under the sidebar's **Channels** tab;
272
- - **Lightweight Pipeline Collaboration**: Implemented via the `NativeTabRegistry.sessionFilters` inter-plugin protocol without invasive host hijacking. Toggling takes effect immediately and interoperates smoothly with Automation and Archive Manager. Non-supporting host shells degrade gracefully with a one-time warning.
266
+ ### 3. 在任务树显示 IM 会话 (`taskTreeSessions`)
267
+ - **默认状态**:关闭(`false`,默认在任务树隐藏即时通讯会话,保持日常工作区清爽)
268
+ - **功能说明**:控制是否在官方工作区任务树中显示各渠道产生的即时通讯会话。
269
+ - **生效效果**:
270
+ - **降噪隔离**:关闭后,各渠道产生的即时通讯会话(包括新格式 `dsh-im-session-*`、存量 `im:*` 前缀以及活跃频道绑定会话)自动从左侧官方工作区树中过滤,避免高频沟通的即时会话刷满日常开发工作区;
271
+ - **频道面板不受影响**:关闭仅作用于主任务树,在侧栏「频道」页签中依然完整保留并可随时点开、回复和复盘全部渠道会话;
272
+ - **轻量管道协同**:基于 `NativeTabRegistry.sessionFilters` 标准协作协议实现,无需深度劫持宿主组件,切换即时生效,与定时插件及归档管理等第三方插件完全兼容。未支持该协议的外壳会自动安全降级并提示。
273
273
 
274
- ## Usage
274
+ ## 使用
275
275
 
276
- Open **Settings → IM Assistant**, select **Add account** under the target channel, then choose that account's workspace, model, permission, private-access mode, and send mode. To register a new workspace, click **Add workspace…** in the dropdown footer to invoke the system folder picker (manual path inputs are disallowed); hosts lacking native folder pickers show "This Host cannot create workspaces" (upgrade to one of the supported host releases listed in Requirements, or add via the host sidebar).
276
+ 打开「设置 → IM助理」,在目标渠道点击「添加账号」,并为该账号选择工作区、模型、权限、私聊准入和发送方式。若需要新工作区,可展开工作区下拉列表点击底部的「添加工作区…」直接调起系统文件选择器(禁止手输路径);不支持原生目录选择器的宿主会提示「当前 Host 无法新增工作区」,请升级到「环境要求」中列出的受支持宿主版本,或直接在宿主侧栏添加工作区。
277
277
 
278
- | Goal | Action | Notes |
278
+ | 目标 | 操作 | 说明 |
279
279
  | --- | --- | --- |
280
- | Add an account | Select **Add account** under a channel, choose the account settings, then scan or enter credentials | The same channel can contain multiple accounts; WeChat is QR-only, Feishu / Lark accept QR or App ID / App Secret, Telegram and Discord need a Bot Token, and Slack needs a Bot Token plus an App Token |
281
- | Change account settings | Expand the channel, select an account, then edit its workspace, model, reasoning effort, permission, private-access mode, or send mode in its settings dialog | Changes affect only that account and apply to its subsequent sessions immediately |
282
- | Pause receiving | Turn off **Receive messages** on the account row | Credentials and settings stay; only new inbound messages for that account pause |
283
- | Send work from IM | WeChat / Feishu / Lark / QQ QR scanners can DM immediately; DingTalk / WeCom scanners and other users need approval. Groups only need a mention | Each chat has its own channel session |
284
- | Split input | End with `..` to continue, `!!` to flush now | Default merge window is about 5 seconds |
285
- | Start a new session | Send `/new` or `/clear` | Creates and switches the current IM session; previous sessions stay in the Channels list without affecting web tasks |
286
- | Status / help | Send `/status` or `/help` | Current session and dynamically discovered Chat commands |
287
- | Agent preset | Choose **Agent preset** when adding or editing an account | Uses the Chat roster; changes apply to new sessions while previous sessions keep their preset |
288
- | Command permissions | Open Settings on the account row and toggle DM/group commands | Admission is checked first; disabling commands keeps conversation and approval/question replies available |
289
- | Sessions / workspaces | `/sessions`, `/session <number or ID>`; `/workspaces`, `/workspace <number or ID>` | Resume ordinary Chat sessions; workspace selection creates a session without changing account defaults |
290
- | Task controls | `/stop`, `/steer <text>`, `/queue` | Stop, provide instructions, or inspect the queue; stopping preserves Host queued messages |
291
- | Send mode | Open Settings on the account row and choose Queue or Steer under **Send mode** | Queue (the default) keeps today's behavior; Steer hands an ordinary message to the running task as additional instructions immediately (same as `/steer`), and behaves like Queue while the task is idle |
292
- | Segmented replies | Open Settings on the account row, choose Send in segments under **Segmented replies**, and fill in the send-gap range | Defaults to Send as whole; when set to Send in segments, the assistant splits one reply into several short messages at the separator, and the first message also waits a random gap. See [Segmented replies](#segmented-replies) |
293
- | Session with a preset | `/presets`, `/preset <number or ID>`, `/preset --default` | Starts and connects a new session in the current workspace without changing account defaults |
294
- | Model / reasoning | `/models`, `/model <number or provider/model>`, `/reasoning [effort or --default]` | Changes the current selection and updates the Host default for subsequent Chat sessions |
295
- | Result recovery | `/delivery`, `/delivery retry <record-ID>` | Check recent deliveries and resend text from the original task |
296
- | Session management | `/history`, `/rename <title>`, `/fork` | Recent text history, rename, or fork and switch |
297
- | Approve a stranger DM | Open **Settings → IM Assistant** and approve or deny the pending request | Affects DM access only |
298
- | Answer an interactive question | Reply with an option number or text; separate multiple choices with commas, or enter a custom answer | Multiple questions arrive in order; only the initiating user can answer in a group |
299
- | Approve a tool | Reply `Approve` / `Deny` or `批准` / `拒绝` in a DM | Also accepts `yes` / `no` / `allow` / `reject`; group replies cannot grant |
300
- | Review on the web | Open the workspace **Channels** tab | IM sessions never appear under **Tasks** |
280
+ | 添加账号 | 在对应渠道点击「添加账号」,选择账号配置后扫码或填写凭据 | 同一渠道可添加多个账号;微信仅扫码,飞书 / Lark 支持扫码或填写 App ID / App Secret,Telegram 和 Discord 仅填 Bot Token,Slack 填 Bot Token 与 App Token |
281
+ | 修改账号配置 | 展开渠道并选择账号,在设置弹窗中修改工作区、模型、推理强度、权限、私聊准入或发送方式 | 配置只影响当前账号;保存后该账号的后续会话立即使用新配置 |
282
+ | 暂停接收 | 关闭账号行上的「接收消息」开关 | 凭据和账号配置保留,只暂停该账号接收新消息 |
283
+ | 在 IM 里下任务 | 微信 / 飞书 / Lark / QQ 扫码用户可直接私聊;钉钉 / 企微扫码者和其他用户需先批准。群聊只需 @ | 每个聊天对应一条独立频道会话 |
284
+ | 分段输入 | 结尾加 `..` 表示还有后续,`!!` 表示立即提交 | 默认约 5 秒合并窗口 |
285
+ | 新开会话 | 发送 `/new` 或 `/clear` | 新建并切换当前 IM 会话;旧会话保留在频道列表,不影响网页任务 |
286
+ | 查看状态 / 帮助 | 发送 `/status` 或 `/help` | 查看当前会话及动态 Chat 命令 |
287
+ | Agent 预设 | 在新增或编辑账号弹窗选择「Agent 预设」 | 使用 Chat 的预设名册;更改后新会话使用新预设,旧会话保持原预设 |
288
+ | 命令权限 | 点击账号右侧「设置」,调整私聊、群聊命令开关 | 先准入,再判断命令权限;关闭后仍可正常对话和回答审批、问题 |
289
+ | 会话 / 工作区 | `/sessions`、`/session <序号或ID>`;`/workspaces`、`/workspace <序号或ID>` | 可接续普通 Chat 会话;选择工作区会新建会话,不修改账号默认配置 |
290
+ | 任务控制 | `/stop`、`/steer <内容>`、`/queue` | 停止、补充指令、查看队列;停止保留 Host 排队消息 |
291
+ | 发送方式 | 点击账号右侧「设置」,在「发送方式」选择排队发送或插话发送 | 默认排队发送,行为不变;插话发送把普通消息作为补充指令立即交给运行中的任务(等同 `/steer`),任务空闲时与排队发送相同 |
292
+ | 分段回复 | 点击账号右侧「设置」,在「分段回复」选择「分段发送」并填写发送间隔区间 | 默认完整发送;选择分段发送后助手用分隔标记把一次回复拆成多条短消息,第一条也等随机间隔,规则见[分段回复](#分段回复) |
293
+ | 预设新会话 | `/presets`、`/preset <序号或ID>`、`/preset --default` | 使用指定预设在当前工作区新建并接续,不改变账号默认 |
294
+ | 模型 / 推理 | `/models`、`/model <序号或provider/model>`、`/reasoning [等级或 --default]` | 修改当前选择,并更新宿主后续 Chat 新会话的默认选择 |
295
+ | 结果补发 | `/delivery`、`/delivery retry <记录ID>` | 查看近期交付状态,按记录补发原任务文字结果 |
296
+ | 会话管理 | `/history`、`/rename <名称>`、`/fork` | 最近文字对话、改名、分叉并切换 |
297
+ | 批准陌生人私聊 | 打开「设置 → IM助理」,在待批准列表点「批准」或「拒绝」 | 只影响私聊准入,不影响群聊 |
298
+ | 回答交互问题 | 直接回复选项序号或文字;多选用逗号分隔,也可以输入自定义答案 | 多个问题会按顺序发送;群聊只接受任务发起者回答 |
299
+ | 批准工具 | 在私聊回复「批准」或「拒绝」 | 也接受 `yes` / `no` / `allow` / `reject`;群聊无效 |
300
+ | 在网页里回看 | 打开工作区「频道」页签 | IM 会话不会出现在「任务」里 |
301
301
 
302
- After `/workspace`, `/new` and continuing after archiving the current session keep the selected workspace and use the account model, Agent preset, and permission preset. `/session` and `/fork` preserve the original session configuration.
302
+ 通过 `/workspace` 新建后,`/new` 和当前会话归档后的续聊会保留所选工作区,并使用账号配置的模型、Agent 与权限预设。`/session` 接续已有会话、`/fork` 分叉则保留原会话配置。
303
303
 
304
- Switching sessions stops output pushes from previous sessions to this chat, including switches through `/preset` and `/fork`. History remains available on the web, and the stopped delivery stays stopped after restarting DSH. `/unbind` lists this chat's registered sessions; `/unbind <number or ID>` removes an old registration, and `/unbind all` keeps only the current session. `/mute <number or ID>` pauses assistant output without removing the registration; `/unmute` with the same target resumes future output. Use the numbers from `/unbind`.
304
+ ### Telegram 话题命名
305
305
 
306
- Explicitly binding a session with `/session` restores its output, including when selecting the current session again. Mute pauses assistant text and file output; approvals, questions, and task status notices still arrive. Switching or muting discards queued stream updates and cached text; an already sent partial card may remain visible, but the next output starts a fresh stream.
306
+ Telegram 话题默认使用第一条非兜底会话标题自动命名一次,之后不会随对话频繁变化。`/rename <名称>` 会显式同步话题名;普通聊天不受影响。机器人需要拥有该话题的改名权限。
307
307
 
308
- DingTalk replies prefer official AI Card streaming. If card creation fails, plain text preserves line breaks; code fences and list markers remain literal. QQ replies use official markdown and keep headings, bold text, links, and tables; only a platform rejection falls back to plain text (where tables become lists). Telegram replies are sent as Rich Messages with Markdown so headings, bold text, and tables render, falling back to plain text when that method is unavailable; do not enable Webhook on the same bot. Feishu normal replies also use card Markdown, so headings and tables render; cards are split so none holds more than five tables, with a plain-text fallback. Long replies split with structure awareness: table chunks repeat the header, code fences are re-closed, and the `(n/m)` marker only prefixes prose chunks. `/help` is grouped as getting around / sessions and workspaces / models and reasoning / tasks and delivery, with one entry per feature and the usable aliases marked; group titles are bold while the rest of the command copy stays plain text, which keeps them scannable on a phone. Discord renders headings, bold text, code, and lists on the client but has no Markdown tables, and mobile clients cannot scroll horizontally, so pipe tables become a vertical block per row (first two columns as a bold title, remaining columns as `header: value`). Everything else is sent verbatim. Do not configure a Discord Interactions Endpoint URL, or button clicks will not arrive through the Gateway. Slack also has no Markdown tables and no `#` headings, so outgoing text is converted to mrkdwn: headings become a bold whole line, tables become the same vertical block, `**bold**` becomes `*bold*`, and links become `<url|label>`, while code fences stay untouched.
308
+ - `/topicname` 查看当前话题的策略和锁定状态;`/topicname off` 锁定自动命名,`/topicname on` 解除锁定。默认策略下,解除锁定后允许下一个有效标题重新命名。
309
+ - 插件配置 `topicNaming` 支持 `once`(默认)、`follow`(跟随有效标题)和 `off`(关闭自动命名);`/topicname on` 不会覆盖全局 `off`。显式 `/rename` 不受自动命名开关限制。
310
+ - 收到群组论坛的人工改名事件后自动锁定;私聊话题无法依赖该事件检测人工改名,请使用 `/topicname off`。开关与命名状态保存在状态目录的 `topic-titles.json`,重启后保留。
309
311
 
310
- ### Telegram topic naming
312
+ ### 分段回复
311
313
 
312
- Telegram topics are automatically named once from the first non-fallback session title; later conversation titles do not keep changing the topic name. `/rename <title>` explicitly synchronizes the topic name. Ordinary chats are unaffected. The bot needs permission to rename the topic.
314
+ 在账号「设置」里将「分段回复」选为「分段发送」后,助手会把一次回复按分隔标记拆成多条短消息逐条发送,读起来更像连着说几句。默认为「完整发送」,关闭时行为与以前一致。目前只在 QQ 渠道开放(已按逐条投递验证),其他渠道不显示该选项,也不会切分。
313
315
 
314
- - `/topicname` shows this topic's policy and lock state. `/topicname off` locks automatic naming; `/topicname on` unlocks it. With the default policy, unlocking allows the next valid title to name the topic again.
315
- - The plugin configuration `topicNaming` accepts `once` (default), `follow` (follow valid titles), or `off` (disable automatic naming). `/topicname on` does not override global `off`. Explicit `/rename` remains available regardless of automatic naming settings.
316
- - A manual rename event in a group forum locks automatic naming. Private topics cannot rely on that event for manual rename detection; use `/topicname off`. Naming and lock state persist across restarts in `topic-titles.json` under the state directory.
316
+ - **发送间隔**:填写最小与最大间隔(秒,0–60)。每条消息(包括第一条)的发送间隔都从这个区间里随机取;上限低于下限时不会保存,改动保存后立即生效。
317
+ - **分隔标记**:由插件配置 `segmentMarker` 指定,默认 `<<<MSG>>>`,必须独占一行;围栏代码块里的同名标记不会触发分段,代码示例不会被拆散。
318
+ - **配置位置**:开关和间隔按账号保存在 `channels.json`;插件配置 `segmentReply` 可作为所有账号的默认值,账号设置优先。分段发送中途失败就停止,不整条重发,避免重复消息。
317
319
 
318
- ### Segmented replies
320
+ ### 空闲新开会话
319
321
 
320
- When **Segmented replies** is set to Send in segments for an account, the assistant splits one reply at a separator and sends the pieces one by one, which reads like a few messages in a row. It defaults to Send as whole and behavior is unchanged while off. It is currently enabled for QQ only (verified end to end); other channels do not show the option and never split.
322
+ 群聊和私聊都按「聊天」绑定会话,隔了很久再说话容易接着上一个话题。在账号设置里的「发送方式」下方配置「空闲新开会话」,距上一条用户消息超过该时间后,下一条消息会新开一个会话,并在聊天里提示一次;旧会话照常保留,用 `/sessions` 可以切回。缺省为关闭(保持原会话),行为与以前一致。
321
323
 
322
- - **Send gap**: fill in the minimum and maximum gap (seconds, 0–60). Every message, including the first, waits a random gap drawn from that range; saving is rejected when the maximum is lower than the minimum, and changes apply immediately.
323
- - **Separator**: set by the plugin configuration `segmentMarker`, default `<<<MSG>>>`, and must occupy its own line. The same text inside a fenced code block never splits a reply, so code samples stay intact.
324
- - **Where it is stored**: the toggle and range live per account in `channels.json`; the plugin configuration `segmentReply` acts as the default for every account, with the account setting taking precedence. If one segment fails to send, the rest stop instead of resending the whole reply, so no duplicate messages.
324
+ - 旧会话仍在运行时不切换,避免把长任务的补充指令切进新上下文;切换发生在下一条消息提交之前。
325
+ - 计时按聊天持久化在 `sessions.json` 的 `lastInboundAt`,重启后继续累计;`/new`、`/session`、`/workspace` 等手动命令不受影响。
326
+ - 支持在账号设置弹窗中直接选择:30 分钟、1 小时、2 小时、6 小时、12 小时、24 小时或关闭。
325
327
 
326
- ### Idle session rotation
328
+ ### Slack 接入步骤
327
329
 
328
- Groups and DMs bind one session per chat, so a message after a long pause easily continues the previous topic. Configure **Idle session rotation** right below Send mode in account settings; when more than that many minutes passed since the last user message, the next message starts a new session with a single notice in the chat. The previous session is kept and `/sessions` can switch back. The default is Disabled (keep session).
330
+ Slack 走 Socket Mode 长连接,不需要公网地址,也不用配置请求网址:
329
331
 
330
- - A session that is still running is never rotated, so follow-up instructions for a long task stay in the same context; the switch happens before the next message is submitted.
331
- - The timer is stored per chat as `lastInboundAt` in `sessions.json` and keeps counting across restarts; explicit `/new`, `/session`, and `/workspace` are unaffected.
332
- - Configurable per account in settings (30 min, 1 hr, 2 hrs, 6 hrs, 12 hrs, 24 hrs, or Disabled).
332
+ 1. 打开 <https://api.slack.com/apps>,点 **Create New App → From scratch**,选择工作区。
333
+ 2. 左侧 **OAuth & Permissions → Bot Token Scopes**,至少勾选:`chat:write`(回复)、`reactions:write`(状态表情)、`files:read`(接收文件)、`files:write`(回传文件)、`im:history`(接收私聊)、`channels:history`(接收公开频道)、`groups:history`(接收私有频道)、`app_mentions:read`(接收 @)。不要填用户令牌(`xoxp-`)。多人私聊(mpim)这次不支持。
334
+ 3. 回到页面顶部点 **Install to Workspace**,复制 **Bot User OAuth Token**(`xoxb-` 开头)。
335
+ 4. 左侧 **Socket Mode** 打开开关,再点 **Generate Token and Scopes**,勾选 `connections:write`,复制 **App-Level Token**(`xapp-` 开头,只显示一次)。
336
+ 5. 左侧 **Event Subscriptions** 打开订阅,在 **Subscribe to bot events** 添加:`message.im`、`message.channels`、`message.groups`、`app_mention`。
337
+ 6. 在「设置 → IM助理 → Slack → 添加账号」里填入上面两个令牌。
338
+ 7. 把机器人拉进要用的频道:在频道里 `/invite @你的机器人`。频道里只有 @ 机器人才会响应,私聊可以直接说话。
333
339
 
334
- ### Connecting Slack
340
+ 配置要点:
335
341
 
336
- Slack uses a Socket Mode long connection, so no public URL or request URL is required:
342
+ - **回复位置**:私聊直接回复;公开频道和私有频道里,机器人在你那条消息的线程内回复。最近参与的 512 个线程按账号保存在本机,重启 DSH 后仍可继续免 @ 追问。更换机器人身份、清理账号状态目录或线程记录被淘汰后,需要重新 @。多人私聊这次不响应。
343
+ - **格式**:Slack 不支持 Markdown 表格和 `#` 标题,正文会转成 Slack 的 mrkdwn:标题变粗体整行,表格竖排成「粗体标题 + 表头:值」,`**粗体**` 变 `*粗体*`,链接变 `<地址|文字>`。
344
+ - **命令**:Slack 客户端会把半角 `/` 开头的文本当斜杠命令。要用 `/menu` 这类命令,需要在应用里登记同名的 Slash Command。不想登记时,可以像 Discord 一样发送 `!menu`、`!help`,或用全角 `/help`;未知的 `!hello` 仍是普通消息。私聊里的命令仍走私聊白名单。频道里的 `!` 命令不必再 @,回复落在线程里。也可以直接用原生按钮。
345
+ - **诊断**:账号里的「诊断连接」会调用 `auth.test` 校验机器人身份;Socket Mode 的连接状态只在已连接时一并回报,未连接过则只报身份,不会为此新开连接。
346
+ - **权限范围变更后**要重新 Install App 并重新连接机器人,旧的 Bot Token 不会自动获得新权限。
337
347
 
338
- 1. Open <https://api.slack.com/apps> and choose **Create New App → From scratch**, then pick your workspace.
339
- 2. Under **OAuth & Permissions → Bot Token Scopes**, add at least: `chat:write` (replies), `reactions:write` (status reactions), `files:read` (receive files), `files:write` (return files), `im:history` (DMs), `channels:history` (public channels), `groups:history` (private channels), and `app_mentions:read` (@ mentions). Do not paste a user token (`xoxp-`). Multi-person DMs (mpim) are not supported.
340
- 3. Click **Install to Workspace** at the top of the page and copy the **Bot User OAuth Token** (`xoxb-…`).
341
- 4. Open **Socket Mode**, enable it, click **Generate Token and Scopes**, tick `connections:write`, and copy the **App-Level Token** (`xapp-…`, shown once).
342
- 5. Open **Event Subscriptions**, enable events, and under **Subscribe to bot events** add `message.im`, `message.channels`, `message.groups`, and `app_mention`.
343
- 6. In **Settings → IM Assistant → Slack → Add account**, paste both tokens.
344
- 7. Invite the bot to the channels you need with `/invite @your-bot`. Channels only respond after an @ mention; DMs work immediately.
348
+ 切换会话后,旧会话不再向本聊天推送输出,`/preset`、`/fork` 切换也遵循此规则。网页历史仍保留,重启 DSH 后也不会恢复旧推送。`/unbind` 查看本聊天登记的会话;`/unbind 序号或ID` 解除旧登记,`/unbind all` 仅保留当前会话。`/mute 序号或ID` 保留登记但暂停助手输出,`/unmute` 使用同一目标恢复后续输出。序号以 `/unbind` 列表为准。
345
349
 
346
- Notes:
350
+ 通过 `/session` 显式绑定会话会恢复输出,重新选择当前会话也会解除静音。静音暂停助手正文和文件输出,审批、提问和任务状态通知仍会送达。切换或静音会丢弃排队中的流式更新和缓存文本;已经发送的半截卡片可能仍可见,但后续输出会开启新流。
347
351
 
348
- - **Where replies land**: DMs answer directly. Public and private channels answer inside the thread of the message. The 512 most recently joined threads are saved per account on this machine, so follow-ups still need no mention after a restart. Mention the bot again after switching bot identity, clearing the account state directory, or when a thread record is evicted. Multi-person DMs are not handled.
349
- - **Commands**: Slack clients treat a halfwidth `/` as a slash command, so `/menu` must be registered in the app. Without that registration, send `!menu` or `!help`, or a fullwidth `/help`, the same way Discord does. An unknown `!hello` stays an ordinary message. DM commands still use the allowlist. A `!` command in a channel does not need a mention and is answered in a thread. Native buttons also work.
350
- - **Diagnostics**: **Diagnose connection** calls `auth.test` for bot identity and reports Socket Mode state only when a connection already exists; it never opens a new connection for the check.
351
- - **After changing scopes**, reinstall the app and reconnect the bot; an old Bot Token does not gain new scopes automatically.
352
+ 钉钉回复优先走官方 AI Card 流式卡片;创建失败则回退纯文本,保留换行;代码与列表标记按原文显示。QQ 回复走官方 markdown,保留标题、加粗、链接和表格;只有平台拒绝 markdown 时才退回纯文本(那时表格降级成列表)。Telegram 回复用 Rich Message 发送 Markdown,标题、加粗和表格可渲染;该方法不可用时自动回退纯文本,同一 Bot 不要同时开 Webhook。飞书普通回复也用卡片 Markdown,标题和表格会被渲染;按表格数量拆卡,单卡最多 5 个表格,卡片被拒时回退纯文本。长回复分片会保护结构:表格分片重复表头,代码块补齐围栏,序号只加在纯文字片。`/help` 按「入口 / 会话与工作区 / 模型与推理 / 任务与交付」分组,每个功能只列一条入口,并标出可直接使用的别名;分组标题会加粗,其余命令文案保持纯文本,便于在手机上扫读。Discord 客户端会自己渲染标题、加粗、代码和列表,但不支持 Markdown 表格,手机端又无法横向滚动,所以正文里的表格会逐行竖排成「粗体标题 + 表头:值」,其余正文原样发送;不要配置 Interactions Endpoint URL,否则按钮不会从 Gateway 进来。Slack 同样不渲染 Markdown 表格与 `#` 标题,正文会转成 mrkdwn:标题变整行粗体、表格竖排、`**粗体**` 变 `*粗体*`、链接变 `<地址|文字>`,代码块内的内容保持原样。
352
353
 
353
- Send commands as separate text messages; image captions remain ordinary input. Start with `/help`; individual replies also suggest related actions.
354
+ 命令单独发送为文字,图片说明按普通消息处理。首次使用可发 `/help`,各命令回复也会给出相关操作。
354
355
 
355
- - Sessions and workspaces: list numbers expire after 15 minutes. Archived sessions are marked; restore them on the web first. Finish running tasks and pending interactions before switching.
356
- - Models: as in Chat, `/model` and `/reasoning` also attempt to save the default for future sessions. Other existing sessions are not changed.
357
- - Stopping and queues: `/stop` submits a stop request and keeps queued messages. Pause an active goal separately with `/goal pause`. Use `/queue` to view and manage queued messages.
358
- - Forking: `/fork` requires at least one completed turn. If a fork was created but switching failed, follow the session ID and recovery instructions in the reply.
359
- - Permissions and export: `/permission` settings survive session restoration. `/export` follows private-chat admission and private/group command permissions. Completion is reported only after the ZIP file is sent.
356
+ - 会话与工作区:列表序号 15 分钟内有效;归档项在列表中标记,需要先在网页恢复。切换前完成运行任务和待处理交互。
357
+ - 模型:`/model`、`/reasoning` 与 Chat 一致,也会尝试保存后续新会话的默认选择;已有其他会话不主动修改。
358
+ - 停止与队列:`/stop` 先提交停止请求,保留队列;活跃目标另用 `/goal pause` 暂停。发 `/queue` 查看和管理排队消息。
359
+ - 分叉:`/fork` 需要至少一个完整回合。已创建但未切换时,按回复中的会话 ID 和恢复指引接续。
360
+ - 权限与导出:`/permission` 设置在恢复会话时保留;`/export` 遵循私聊准入和私聊/群聊命令权限,只有 ZIP 文件发送成功才回复完成。
360
361
 
361
- Command replies, tool approvals, interactive questions, and channel notices sent directly to the user follow the language saved in the host's global settings. With no saved preference or an unavailable language service, they default to Chinese. Dynamic names, paths, user content, and extension results remain unchanged. Connection status on the settings page still uses the interface dictionary.
362
+ 命令回复、工具审批、交互问答,以及直接发给用户的渠道提示,跟随宿主已保存的全局语言。未保存语言或语言服务不可用时使用中文。动态名称、路径、用户内容与宿主扩展结果保持原文。设置页里的连接状态仍走界面词典。
362
363
 
363
- ## Permissions and security boundaries
364
+ ## 权限与安全边界
364
365
 
365
- Command permission does not grant DM admission or replace tool approval. Enabled users can inspect and resume ordinary Chat sessions and execute registered Host commands. Each account has independent DM/group switches without user IDs; legacy configurations default to enabled for compatibility.
366
+ 命令权限不授予私聊准入,也不替代工具审批。开启命令的用户可查看、接续普通 Chat 会话并执行宿主注册命令。每账号独立设置私聊、群聊开关,不需要用户 ID;旧配置缺少该字段时默认开启以保持兼容。
366
367
 
367
- | Item | Current behavior |
368
+ | 项 | 当前行为 |
368
369
  | --- | --- |
369
- | Access | Groups need no binding, only a mention. Each account can allow only approved users or all DM users; approved-only is the default, and WeChat / Feishu / Lark / QQ QR scanners are added to that account's allowlist automatically |
370
- | Management API | Uses `/api/dsh-im-connect`, following the REST prefix used by other DSH plugins. It delegates Host, Origin, and Cookie checks to Host `connection.requestRejection`, including local requests. Unavailable authentication returns 503; mutations retain JSON, client-header, and 1 MiB limits |
371
- | Secrets | WeChat tokens and other secrets prefer DSH `ctx.credentials`; otherwise they use plaintext `%DSH_HOME%\dsh-im-connect\secrets.json`, restricted to the current user and never safe to sync or share |
372
- | Account state | `channels.json` stores per-account workspace, model, permission, private access, send mode, segmented-reply toggle and gaps, enablement, and credential refs, not raw secrets |
373
- | Browser payloads | Never include tokens, secrets, App Secrets, or internal error details |
374
- | WeChat protocol | Official iLink only; no reverse-engineered personal WeChat protocol |
375
- | Tool approval | The task initiator replies in the chat bound to that session. DM admission decides who can chat and no longer gates approvals, and approvals never go back to the web. No reply within 5 minutes cancels the action instead of queueing later text |
376
- | Interactive questions | Single-choice, multiple-choice, and custom questions return to the originating IM conversation; one conversation handles them in order, and only the initiating user can answer in a group |
370
+ | 用户准入 | 群聊不用绑定,只需 @。每个账号可选择「仅已批准用户」或「允许所有私聊用户」;默认仅批准用户可用,微信 / 飞书 / Lark / QQ 扫码者会自动加入该账号白名单 |
371
+ | 管理接口 | `/api/dsh-im-connect`;通过宿主 `connection.requestRejection` 验证 Host、Origin 和 Cookie,本机也须登录;认证不可用返回 503,写接口保留 JSON、客户端请求头和 1 MiB 限制 |
372
+ | 敏感字段 | 包括微信 token 在内均优先写入 DSH `ctx.credentials`;没有该服务时落到 `%DSH_HOME%\dsh-im-connect\secrets.json`(明文,仅限当前用户,禁止同步或分享) |
373
+ | 账号状态 | `channels.json` 按账号保存工作区、模型、权限、私聊准入、发送方式、分段回复开关与发送间隔、启用状态和凭据引用,不保存明文 Secret |
374
+ | 浏览器回包 | 不返回 token、secret、App Secret 或内部异常详情 |
375
+ | 微信协议 | 只走腾讯官方 iLink,不使用逆向个人微信协议 |
376
+ | 工具批准 | 在绑定该会话的聊天里由任务发起者回复「批准 / 拒绝」;私聊准入只决定谁能对话,不再单独卡审批,也不会交回网页。5 分钟无回复按取消结束,不把期间的其他文字送进下一轮 |
377
+ | 交互问题 | 单选、多选和自定义问题回到发起任务的 IM 会话;同一会话按顺序处理,群聊只接受任务发起者回答 |
377
378
 
378
- Keep the DSH backend listening on loopback. Remote access should use a controlled HTTPS reverse proxy, the actual authority in the Host's `trustedHosts`, and a login through that authority. Do not spoof localhost or remove authentication to bypass 403. Image-download `additionalImageHosts` does not configure management access; see [management authentication](SECURITY.md#管理面). Permission presets use the same host sandbox-policy values as Chat; `danger-full-access` does not wrap a sandbox.
379
+ DSH 后端保持本机监听;远程访问使用受控 HTTPS 反向代理,并在宿主配置实际访问地址的 `trustedHosts`、通过该地址登录。不要伪装 localhost 或删除认证检查来绕过 403;图片下载的 `additionalImageHosts` 不用于管理接口。详见 [管理面认证](SECURITY.md#管理面)。权限预设与 Chat 使用相同的 Host sandbox-policy;`danger-full-access` 不套沙箱。
379
380
 
380
- ## Development
381
+ ## 二次开发
381
382
 
382
- ### Install from source
383
+ ### 从源码安装
383
384
 
384
- Use this for debugging or unpublished changes. The cloned directory becomes the plugin source path:
385
+ 适用于调试或使用未发布改动。克隆后的本地路径就是插件安装路径:
385
386
 
386
387
  ```powershell
387
388
  [Console]::OutputEncoding = [System.Text.Encoding]::UTF8
388
389
  $OutputEncoding = [System.Text.Encoding]::UTF8
389
- # Replace this with an existing projects directory.
390
+ # 替换为本机已存在的项目目录。
390
391
  Set-Location "$HOME\Projects"
391
392
  git clone https://github.com/MichengAI/dsh-im-connect.git
392
393
  Set-Location .\dsh-im-connect
@@ -396,18 +397,18 @@ dsh plugin --profile web add .
396
397
  dsh --profile web --dump-config
397
398
  ```
398
399
 
399
- Restart DSH Web and hard-refresh the browser. `dsh plugin ... add .` reads the package metadata and `cordis.patch.yml`; do not install by copying `lib` directly.
400
+ 完成后重启 DSH Web 并硬刷新浏览器。`dsh plugin ... add .` 会读取当前目录的包信息和 `cordis.patch.yml`;不要改为直接复制 `lib` 目录。
400
401
 
401
- This repository develops in `src` and builds to `lib`:
402
+ 本仓库用 `src` 开发,构建到 `lib`:
402
403
 
403
- - [src\index.ts](src/index.ts): host entry, config, and lifecycle.
404
- - [src\manager.ts](src/manager.ts): channel start/stop, authenticated management API, and credential persistence.
405
- - [src\engine](src/engine): session routing, slash commands, approval, splitting, and outbound push.
406
- - [src\channels](src/channels): DingTalk, Feishu, Lark, WeChat, WeCom, QQ, Telegram, Discord, and Slack adapters.
407
- - `client.js`: settings page and workspace channel sidebar.
408
- - `tests\*.test.mjs`: routing, QR, credentials, QQ, delivery, and sidebar tests.
404
+ - [src\index.ts](src/index.ts):Host 入口、配置和生命周期。
405
+ - [src\manager.ts](src/manager.ts):渠道启停、已认证管理 API、凭据落盘。
406
+ - [src\engine](src/engine):会话路由、斜杠命令、审批、分片和回推。
407
+ - [src\channels](src/channels):钉钉、飞书、Lark、微信、企业微信、QQ、Telegram、Discord、Slack 适配器。
408
+ - `client.js`:设置页和工作区频道侧栏。
409
+ - `tests\*.test.mjs`:路由、扫码、凭据、QQ、投递和侧栏测试。
409
410
 
410
- After changing the source, test and install from the local directory:
411
+ 修改后运行测试并以本地目录安装验证:
411
412
 
412
413
  ```powershell
413
414
  [Console]::OutputEncoding = [System.Text.Encoding]::UTF8
@@ -416,17 +417,17 @@ npm test
416
417
  dsh plugin --profile web add .
417
418
  ```
418
419
 
419
- When changing channel or session logic, keep the engine platform-agnostic, keep adapters from creating agents, and keep web tasks separate from IM channels.
420
+ 修改渠道或会话逻辑时,必须保持:引擎不写死平台名、渠道不创建 agent、网页任务与 IM 频道分列。
420
421
 
421
- ### Native sidebar coordination protocol
422
+ ### 原生侧栏协作协议
422
423
 
423
- IM and Automation share tabs through the active `sidebar.workspaces` entry and the `__dshNativeTabs` registry on the entry or component. This is an inter-plugin convention, not an official stable DSH API. When replacing or restoring a sidebar component or handing over a registry without a host slot notification, the changing plugin should dispatch `dsh-native-sidebar-change` on `window` in a microtask after updating its state (a plain `Event`, with no payload). Receivers reread the active entry. Inserting a tab alone must not forward the event, to avoid notification loops.
424
+ IM 与定时插件通过 `sidebar.workspaces` 当前显示项及条目/组件上的 `__dshNativeTabs` 注册表共享页签。这是插件间约定,不是 DSH 官方稳定 API。直接替换或恢复侧栏组件、交接注册表且宿主不会发送槽位通知时,变更方应在状态更新完成后通过微任务派发 `window` 事件 `dsh-native-sidebar-change`(普通 `Event`,无负载)。接收方重新读取当前显示项;仅插入页签不转发该事件,避免通知循环。
424
425
 
425
- Cleanup restores only components still owned by the plugin, removes its own registry and tabs, and releases event, slot, and tab subscriptions. Changes to the event name, registry structure, or notification semantics require coordinated compatibility updates. IM retries startup every 250ms for at most 20 attempts and stops early after inserting a tab. This only covers startup ordering; it cannot guarantee reconnection when an older plugin silently replaces a component after retries end.
426
+ 清理时只恢复自己仍持有的组件、移除自己拥有的注册表和页签,并解除事件、槽位及页签订阅。事件名、注册表结构或通知语义变更需要协作插件同步兼容。IM 每 250ms、最多 20 次的启动重试在成功插入页签后提前结束;它只兼容启动加载顺序,不能保证旧插件在重试结束后无声替换组件时重新接入。
426
427
 
427
- ## Validation
428
+ ## 验证
428
429
 
429
- For real management-authentication tests, set `DSH_CONNECTION_CONTRACT_ROOT` to the isolated `@deepseek-ai/dsh-client-connection` package root. The Gateway-coexistence case also uses `DSH_CHAT_CONTRACT_ROOT` from the image contracts. Local runs skip these contracts when unconfigured; CI supplies both. Tests use temporary HTTP servers and credentials, not a live Cloudflare deployment.
430
+ 真实管理认证测试需要把 `DSH_CONNECTION_CONTRACT_ROOT` 指向隔离安装的 `@deepseek-ai/dsh-client-connection` 包根目录;与 Gateway 共存的用例同时使用图片契约的 `DSH_CHAT_CONTRACT_ROOT`。未配置时本地会跳过对应契约测试,CI 已配置执行。测试使用临时 HTTP 服务和临时凭据,不代表真实 Cloudflare 部署联调。
430
431
 
431
432
  ```powershell
432
433
  [Console]::OutputEncoding = [System.Text.Encoding]::UTF8
@@ -434,22 +435,23 @@ $OutputEncoding = [System.Text.Encoding]::UTF8
434
435
  npm test
435
436
  ```
436
437
 
437
- `prepublishOnly` runs the tests before publishing.
438
+ `prepublishOnly` 会在发布前自动执行测试。
438
439
 
439
- Sidebar tests read the built `lib/client.js`; run `npm run build` before invoking individual tests directly. The lifecycle harness verifies attachment and disposal with simulated slots, notifications, and timers. It does not render React or replace validation of real messages, archiving, scheduled tasks, or Desktop.
440
+ 侧栏测试读取构建后的 `lib/client.js`;直接运行单项测试前先执行 `npm run build`。生命周期 Harness 验证模拟插槽、通知与计时器下的接入和卸载,不执行 React 渲染,也不代替真实消息、归档、定时任务或 Desktop 验收。
440
441
 
441
442
 
442
- ## Result recovery after disconnects and restarts
443
+ ## 断线与重启后的结果补发
443
444
 
444
- Delivery tracking starts with ordinary IM messages received after this feature is enabled. If the original result is saved but sending has not started, its final text and completion status can be recovered after reconnecting or restarting. Questions, tools, approvals, and files are never replayed. Messages handled by earlier plugin versions are not recovered retroactively.
445
+ 从本功能启用后收到的普通 IM 消息开始记录交付状态。原任务的结果已保存、但尚未开始发送时,可在恢复连接或重启后补发最终文字和结束状态;不会重新执行问题、工具或审批,也不会补发文件。旧版本处理过的消息不回溯补发。
445
446
 
446
- - Telegram, Discord, Slack, Feishu/Lark, and WeCom can attempt background delivery using a stable chat destination. DingTalk, QQ, and WeChat wait for a new message in the original chat to refresh the reply channel. Connection, expiry, and platform quotas still apply.
447
- - When sending was attempted but delivery is unconfirmed, automatic resend pauses. Use `/delivery` to check records, then `/delivery retry <record-ID>` if you want to resend. This may duplicate text you already received. View files in the original session on the web.
448
- - Records and resend actions are scoped to the original sender in the current chat, subject to admission and command permissions. Disabling an account, changing the session binding, or changing access pauses recovery. Restore the original binding and access before retrying manually.
449
- - Recovery is available for 7 days per record, with at most 1,000 records. Delivered and definitively rejected records are removed first when capacity is reached; expired records are cleaned up when a new message arrives. Background checks run in batches every 30 seconds. Unreadable history or unfinished tasks remain pending. Recovery does not resume task execution.
447
+ - Telegram、Discord、Slack、飞书/Lark、企业微信可通过稳定聊天目标后台尝试补发;钉钉、QQ、微信等待原聊天发来新消息刷新回复通道。发送仍受渠道连接、时效和配额限制。
448
+ - Telegram 新建文字和上传文件仅在平台明确限流拒收时有界重试;网络中断、超时或服务错误可能已送达,不自动重发。编辑已有消息时可对临时错误进行有界重试,使用原消息 ID。限流冷却在流式编辑、最终收口和外层补发间共享,不能切换格式绕过。
449
+ - 已尝试发送但无法确认送达时,暂停自动补发。发送 `/delivery` 查看记录;确认需要补发后发送 `/delivery retry <记录ID>`。这可能重复已收到的文字,文件请在网页原会话查看。
450
+ - 查询与补发仅限当前聊天的原发起人,并遵循准入和命令权限。账号停用、原会话换绑或访问权限变化会暂停补发;恢复原绑定与权限后可手动尝试。
451
+ - 每条记录的补发窗口为 7 天,最多保存 1000 条;满额时优先清理已送达或明确未提交的终态记录,过期记录在新消息进入时清理。后台每 30 秒分批检查,历史暂不可读或任务尚未结束时继续等待。补发不是任务自动续跑。
450
452
 
451
- ## License
453
+ ## 许可证
452
454
 
453
- Security guidance is in [SECURITY.md](SECURITY.md).
455
+ 安全说明见 [SECURITY.md](SECURITY.md)。
454
456
 
455
- Licensed under [Apache License 2.0](LICENSE).
457
+ 本项目采用 [Apache License 2.0](LICENSE)。