@michengai/dsh-im-connect 0.1.46 → 0.1.47

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 (51) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/CHANGELOG.zh-CN.md +6 -0
  3. package/README.md +211 -203
  4. package/README.zh-CN.md +353 -0
  5. package/client.js +74 -10
  6. package/lib/channels/connection-state.d.ts +4 -0
  7. package/lib/channels/connection-state.d.ts.map +1 -0
  8. package/lib/channels/connection-state.js +18 -0
  9. package/lib/channels/connection-state.js.map +1 -0
  10. package/lib/channels/diagnostics.d.ts +22 -0
  11. package/lib/channels/diagnostics.d.ts.map +1 -0
  12. package/lib/channels/diagnostics.js +78 -0
  13. package/lib/channels/diagnostics.js.map +1 -0
  14. package/lib/channels/dingtalk.d.ts.map +1 -1
  15. package/lib/channels/dingtalk.js +8 -0
  16. package/lib/channels/dingtalk.js.map +1 -1
  17. package/lib/channels/feishu.d.ts.map +1 -1
  18. package/lib/channels/feishu.js +19 -0
  19. package/lib/channels/feishu.js.map +1 -1
  20. package/lib/channels/qq.d.ts.map +1 -1
  21. package/lib/channels/qq.js +15 -0
  22. package/lib/channels/qq.js.map +1 -1
  23. package/lib/channels/telegram.d.ts.map +1 -1
  24. package/lib/channels/telegram.js +19 -0
  25. package/lib/channels/telegram.js.map +1 -1
  26. package/lib/channels/wecom.d.ts +8 -0
  27. package/lib/channels/wecom.d.ts.map +1 -1
  28. package/lib/channels/wecom.js +30 -1
  29. package/lib/channels/wecom.js.map +1 -1
  30. package/lib/channels/weixin.d.ts.map +1 -1
  31. package/lib/channels/weixin.js +18 -0
  32. package/lib/channels/weixin.js.map +1 -1
  33. package/lib/client.js +74 -10
  34. package/lib/engine/types.d.ts +2 -0
  35. package/lib/engine/types.d.ts.map +1 -1
  36. package/lib/manager.d.ts +18 -0
  37. package/lib/manager.d.ts.map +1 -1
  38. package/lib/manager.js +77 -6
  39. package/lib/manager.js.map +1 -1
  40. package/package.json +2 -2
  41. package/src/channels/connection-state.ts +15 -0
  42. package/src/channels/diagnostics.ts +66 -0
  43. package/src/channels/dingtalk.ts +8 -0
  44. package/src/channels/feishu.ts +18 -0
  45. package/src/channels/qq.ts +14 -0
  46. package/src/channels/telegram.ts +16 -0
  47. package/src/channels/wecom.ts +24 -1
  48. package/src/channels/weixin.ts +14 -0
  49. package/src/engine/types.ts +2 -0
  50. package/src/manager.ts +69 -6
  51. package/README.en.md +0 -345
package/README.md CHANGED
@@ -4,206 +4,212 @@
4
4
 
5
5
  <div align="center">
6
6
 
7
- # DSH IM Connect
7
+ # DSH IM Connect
8
8
 
9
- **把飞书、Lark、钉钉、企业微信、微信、QQ、Telegram 接到本机 DeepSeek Harness**
9
+ **Connect Feishu, Lark, DingTalk, WeCom, WeChat, QQ, and Telegram to local DeepSeek Harness**
10
10
 
11
- [English](README.en.md) · [更新日志](CHANGELOG.zh-CN.md) · [Apache-2.0](LICENSE)
11
+ [简体中文](README.zh-CN.md) · [Changelog](CHANGELOG.md) · [Apache-2.0](LICENSE)
12
12
 
13
- [![许可证:Apache-2.0](https://img.shields.io/badge/许可证-Apache--2.0-blue.svg)](LICENSE)
13
+ [![License: Apache-2.0](https://img.shields.io/badge/License-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 下载量](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)
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)
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-7-238636.svg)](#-支持的渠道)
18
+ [![Channels](https://img.shields.io/badge/channels-7-238636.svg)](#-supported-channels)
19
19
  </div>
20
20
 
21
- > DSH IM Connect 是社区维护的 DeepSeek Harness(DSH)插件,并非 DeepSeek AI 官方产品。
21
+ > DSH IM Connect is a community-maintained DeepSeek Harness (DSH) plugin, not an official DeepSeek AI product.
22
22
 
23
- ## 功能概览
23
+ ## Features
24
24
 
25
- 不在电脑前,也能通过常用聊天软件把任务交给本机 DSH,并在同一聊天里接收回复、回答问题和处理工具审批。
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.
26
26
 
27
- - **连接常用消息平台**:支持钉钉、飞书、Lark、微信、企业微信、QQ 和 Telegram。
28
- - **多个账号分别配置**:同一平台可添加多个账号,各自选择工作区、模型、推理强度、权限和私聊准入。
29
- - **手机上完成任务交互**:下任务、读回复、回答单选或多选问题;已批准用户可在私聊中批准或拒绝工具执行。
30
- - **聊天记录互不混淆**:每个 IM 聊天对应独立会话,在网页工作区「频道」中回看。
31
- - **按平台扫码或填写凭据**:在「设置 → IM助理」连接账号,管理消息接收开关。
32
- - **控制谁能使用**:群聊通过 @ 触发,私聊按账号的准入设置处理,详见下表。
27
+ - **Connect familiar platforms**: DingTalk, Feishu, Lark, WeChat, WeCom, QQ, and Telegram.
28
+ - **Configure accounts separately**: each account has its own workspace, model, reasoning effort, permissions, and private-access 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.
33
33
 
34
- ## 谁可以驱动助手
34
+ ## Who can drive the assistant
35
35
 
36
- 入站消息先看发送者,再处理命令、工具审批和注入。
36
+ Inbound messages are identified before commands, tool approvals, or injection.
37
37
 
38
- | 场景 | 行为 |
39
- | --- | --- |
40
- | 群聊未 @ 当前机器人 | 忽略,不回复、不进待批准;只 @ 其他成员也不触发 |
41
- | 群聊已准确 @ 当前机器人 | 不用绑定,任何人都可以下任务 |
42
- | 私聊 · 扫码用户 | 微信 / 飞书 / Lark / QQ 扫码者自动进白名单,可直接对话 |
43
- | 私聊 · 其他人 | 进入设置页待批准;不批准就不能驱动助手 |
44
- | 私聊 · 扫码不返回身份 | 钉钉 / 企微的快捷绑定只返回机器人凭据,扫码者仍需在设置页批准 |
45
- | 私聊 · 手动凭据 | Telegram,以及手动填写凭据的钉钉 / 企微 / QQ,所有私聊都要先批准 |
46
- | 私聊缺少 userId | 拒绝 |
47
- | 工具审批 | 仅白名单用户在私聊回复「批准 / 拒绝」有效;群聊里回不算 |
48
- | 交互选择 | 在原 IM 会话回复选项序号或文字;多选用逗号分隔,也可补充自定义答案;群聊只接受任务发起者回答 |
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, and DingTalk / WeCom / QQ bound manually, require approval for every DM |
46
+ | DM without a userId | Denied |
47
+ | Tool approval | Only an allowlisted user in a DM can reply `Approve` / `Deny` (or `批准` / `拒绝`); group replies do not grant |
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 |
49
49
 
50
- 微信是扫码渠道且只支持私聊,所以连上后用**同一个微信号**即可直接用。换一个微信号私聊,会出现在设置页待批准。
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.
51
51
 
52
- ## 📡 支持的渠道
52
+ ## 📡 Supported channels
53
53
 
54
54
  <p align="center">
55
- <code>🔔 钉钉</code>&nbsp;
56
- <code>🐦 飞书</code>&nbsp;
55
+ <code>🔔 DingTalk</code>&nbsp;
56
+ <code>🐦 Feishu</code>&nbsp;
57
57
  <code>🌐 Lark</code>&nbsp;
58
- <code>💬 微信</code>&nbsp;
59
- <code>🏢 企业微信</code>&nbsp;
58
+ <code>💬 WeChat</code>&nbsp;
59
+ <code>🏢 WeCom</code>&nbsp;
60
60
  <code>🐧 QQ</code>&nbsp;
61
61
  <code>✈️ Telegram</code>
62
62
  </p>
63
63
 
64
- | 渠道 | 状态 | 接入方式 | 需要 |
65
- | --- | --- | --- | --- |
66
- | 🔔 **钉钉** | ✅ 可用 | 扫码,或 Client ID / Secret | 钉钉开放平台机器人;回复优先走 AI Card |
67
- | 🐦 **飞书** | ✅ 可用 | 仅扫码,自动创建机器人 | 飞书账号 |
68
- | 🌐 **Lark** | ✅ 可用 | 仅扫码 | Lark 国际版账号 |
69
- | 💬 **微信** | ✅ 可用* | 官方 iLink 扫码 | 建议专用小号;仅私聊 |
70
- | 🏢 **企业微信** | ✅ 可用 | 扫码(推荐),或 Bot ID / Secret | 企业微信智能机器人 |
71
- | 🐧 **QQ** | ✅ 可用 | 扫码,或 AppID / AppSecret | QQ 开放平台机器人,不是个人号 |
72
- | ✈️ **Telegram** | ✅ 可用 | 仅填 Bot Token | `@BotFather`;同一 Bot 不要同时开 Webhook |
64
+ | Channel | Status | How to connect | You need |
65
+ |---|---|---|---|
66
+ | 🔔 **DingTalk** | ✅ Ready | QR, or Client ID / Secret | DingTalk open-platform bot; replies prefer AI Card |
67
+ | 🐦 **Feishu** | ✅ Ready | QR only; creates the bot automatically | Feishu account |
68
+ | 🌐 **Lark** | ✅ Ready | QR only | Lark account |
69
+ | 💬 **WeChat** | ✅ Ready* | Official iLink QR | Dedicated account recommended; DM only |
70
+ | 🏢 **WeCom** | ✅ Ready | QR (recommended), or Bot ID / Secret | WeCom intelligent bot |
71
+ | 🐧 **QQ** | ✅ Ready | QR, or AppID / AppSecret | QQ Open Platform bot, not a personal QQ account |
72
+ | ✈️ **Telegram** | ✅ Ready | Bot Token only | `@BotFather`; do not enable Webhook on the same bot |
73
+
74
+ ✅ Ready = text in and out works | *WeChat = official iLink only, no reverse-engineered personal protocol | Groups still require an @ mention
75
+
76
+ ## Image input
73
77
 
74
- ✅ 可用 = 文字收发可用 | *微信 = 只走腾讯官方 iLink,不做逆向个人号 | 群聊都需要 @ 机器人才回复
78
+ Image input follows DSH Chat's model-capability and attachment rules rather than guessing vision support from model names:
75
79
 
76
- ## 图片输入
80
+ The receive paths cover WeChat, WeCom, DingTalk, Feishu, Lark, QQ, and Telegram. See the [image-input verification guide](docs/image-input.md) for protocol forms and live checks.
77
81
 
78
- 图片输入使用与 DSH Chat 一致的模型能力和附件规则,不按模型名称猜测视觉能力:
82
+ - Use the model currently selected for the IM session, not just the global default.
83
+ - 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.
84
+ - 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.
85
+ - Channel download limits, host attachment size and format limits, DM access rules, and group mention requirements still apply.
86
+ - This is inbound image analysis, not a promise that every channel supports sending images from the bot or generating images.
79
87
 
80
- 覆盖微信、企业微信、钉钉、飞书、Lark、QQ 和 Telegram;具体平台消息形式和联调检查见[图片输入验收](docs/image-input.md)。
88
+ ## File input
81
89
 
82
- - 以当前 IM 会话实际使用的模型为准,而不是只看全局默认模型。
83
- - 模型声明支持 `image` 时,将图片保存为 DSH 标准图片附件并提交给模型;会话记录保留图片引用,而不是只有本地文件路径文字。
84
- - 模型明确不支持图片时,在 IM 提示切换模型,不静默丢图。模型未提供能力元数据时,遵循 Chat 的兼容规则,不仅因元数据缺失而拒绝。
85
- - 图片仍受渠道下载限制、宿主附件大小与格式限制,以及原有私聊准入和群聊 @ 规则约束。
86
- - 此功能是用户向机器人发送图片进行分析,不代表所有渠道都支持机器人发送图片或生成图片。
90
+ WeChat, WeCom, DingTalk, Feishu, Lark, QQ and Telegram 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.
87
91
 
88
- ## 文件输入
92
+ - Requires the file-upload service in DSH `0.1.5-rc.1` or `0.1.5-rc.2`. On `0.1.2-rc.1`, file input asks you to upgrade; existing text and image support is unchanged.
93
+ - Up to 4 ordinary files per message, totaling 20 MiB. Channel download limits also apply.
94
+ - Files become standard Chat attachments and are submitted with session-specific receipts, rather than local-path text.
95
+ - Private admission and group mention rules remain in force. File captions such as `/new` or “allow” are content, not commands or approval responses.
96
+ - 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.
89
97
 
90
- 微信、企业微信、钉钉、飞书、Lark、QQ、Telegram 可接收普通文件,并通过 Chat 的上传服务交给当前会话。可以发送 PDF、文档、表格等文件,再让助手读取或处理;能否解析具体格式与网页 Chat 的模型、工具和文件能力一致,不承诺每种格式都能直接理解。
98
+ ## File delivery
91
99
 
92
- - 需要 DSH `0.1.5-rc.1` 或 `0.1.5-rc.2` 的文件上传服务;`0.1.2-rc.1` 明确提示升级,文字、图片等既有能力不变。
93
- - 单条消息最多 4 个普通文件,累计最多 20 MiB,还受渠道下载限制约束。
94
- - 文件先保存为 Chat 标准附件,通过当前会话专属的凭据提交;不把本地路径文字当作文件输入。
95
- - 保留私聊准入与群聊提及规则;文件说明中的 `/new` 或“批准”属于普通内容,不执行命令或审批。
96
- - 上传失败不提交部分正文,停用或重载账号后不继续向旧会话提交。支持回复后的文件产物回传。
100
+ WeChat, WeCom, DingTalk, Feishu, Lark, QQ, and Telegram can return files produced by the assistant. For example: “Create a PDF report and send me the file.”
97
101
 
98
- ## 文件回传
102
+ - Files successfully created or edited with Chat's supported file tools are sent after the reply. On hosts with `present`, explicitly presented files are also sent, including existing files.
103
+ - 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 need to be presented explicitly.
104
+ - Newer hosts use Chat's complete-file download service and its configured size limit. DSH `0.1.2-rc.1` uses the host filesystem with a 32 MiB limit. Directories and symbolic links are not sent; channel-specific file limits still apply.
105
+ - 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.
106
+ - 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.
99
107
 
100
- 微信、企业微信、钉钉、飞书、Lark、QQ 和 Telegram 均可回传助手产出的文件。例如:“整理成 PDF 报告,并把文件发给我。”
108
+ ## Action menu
101
109
 
102
- - 使用 Chat 支持的文件工具成功新建或修改的文件,会在回复后发送;宿主支持 `present` 时,也会发送明确交付的文件,包括已有文件。
103
- - 文件访问范围与 Chat 一致,允许宿主可读取的工作区外文件。不从回复正文中猜测文件路径;通过脚本等方式生成的文件,需要助手明确 `present` 交付。
104
- - 新版宿主使用 Chat 完整文件下载服务及其配置的大小上限;DSH `0.1.2-rc.1` 使用宿主文件系统读取,上限为 32 MiB。目录和符号链接不发送,渠道自身的文件限制仍然适用。
105
- - 单个文件发送失败会明确提示文件名,并继续处理其他文件;切走会话或停止账号后,不会把尚未投递的文件转发到其他聊天。
106
- - 单独发送 `/export`,可将当前聊天绑定会话的 Chat ZIP 日志发回当前聊天(不含子会话)。ZIP 上限为 32 MiB,渠道自身限制仍适用;超限或发送失败时可在网页 Chat 使用 `/export` 下载。不接受路径或其他会话 ID 参数。
110
+ 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.
107
111
 
108
- ## 操作菜单
112
+ 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.
109
113
 
110
- 有效点击后,支持更新的原卡片移除按钮,提示已选择;实际执行结果见后续回复。企业微信仅能在按钮回调窗口更新,过期卡片仍由服务端拒绝。`/status` 根据实际状态提供停止任务、暂停或恢复目标、查看队列等操作。
114
+ 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.
111
115
 
112
- 支持原生按钮的渠道发送 `/sessions`、`/workspaces`、`/models` 即可直接选择,无需再进入菜单。分页后,回复序号或 `/session 序号`、`/workspace 序号`、`/model 序号` 对应当前选择页;文字渠道仍使用原列表序号。
116
+ 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`.
113
117
 
114
- 发送 `/menu` 或 `/m`,可选择会话、工作区、模型和 Agent 预设,以及新建、停止、导出和查看状态。列表支持分页;点击按钮或回复当前菜单序号即可操作,普通文字退出菜单。
118
+ 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.
115
119
 
116
- 菜单提供上一页、下一页和返回入口;企业微信按卡片容量分页,主菜单也可通过 `/menu 2` 翻页。会话、工作区和模型选择分别可直接发送 `/menu sessions`、`/menu workspaces`、`/menu models`;预设与推理可用 `/menu presets`、`/menu reasoning`。
120
+ DingTalk, Telegram 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.
117
121
 
118
- 常用命令回复会提供相关下一步,例如 `/model` → 选择模型 / 调整推理 → 返回菜单。支持原生按钮时可点击跳转,其他情况显示可直接发送的命令。普通结果回复的导航按钮不支持数字选择,避免把聊天中的数字误当操作;只有选择菜单支持回复序号。超长卡片保留完整文字回复。
122
+ 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. If a card cannot show the full prompt or fails to send, text is used without omitting approval details. Existing approval eligibility and requester restrictions apply; disabling commands does not disable pending approvals or questions.
119
123
 
120
- 钉钉、Telegram、飞书/Lark 使用原生按钮;企业微信在按钮数量和正文符合平台限制时使用卡片,其他情况及 QQ、微信使用文字序号。平台明确拒绝或超出卡片容量时退回完整文字;网络异常导致发送结果未知时仅提示确认,避免重复发送。菜单按账号、聊天、操作者和会话隔离,15 分钟或重启后失效;执行时重新检查权限,旧按钮不能重复执行。
121
124
 
122
- 审批与问答复用上述原生按钮渠道:审批提供批准一次/拒绝,单选题直接点选,多选题勾选后提交;开放问题保留文字回答。卡片无法完整展示或发送失败时降级文字,不省略审批详情。按钮沿用原审批资格和发起人限制,关闭命令不影响已有审批及问答。
125
+ 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.
123
126
 
127
+ 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.
124
128
 
125
- Agent 预设:`/presets`(别名 `/presetlist`)查看目录,`/preset` 查看当前预设,`/preset 序号或ID` 使用预设在当前工作区新建并切换会话,旧会话保留。纯数字 ID 使用 `/preset id:ID`,`/preset --default` 使用宿主默认预设。账号默认设置不变,后续 `/new` 仍按账号设置创建。原生按钮渠道可直接选择,文字渠道使用列表序号(15 分钟有效)。
129
+ 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.
126
130
 
127
- 推理等级:`/reasoning`(别名 `/reasonings`、`/reasoninglist`)提供当前模型的等级选择,`/reasoning 序号` 或 `/reasoning id:等级ID` 设置等级,`/reasoning --default` 恢复默认。原生渠道支持分页按钮;旧列表序号和按钮绑定会话与模型,变化后需重新获取列表。模型与推理修改沿用 Chat 的默认选择保存规则。
131
+ ## Message progress
128
132
 
129
- IM 消息发起的处理结束后,会在正文和文件投递完成后给出一次结果提示,并提供最近记录、状态、会话导出和菜单入口。执行失败、停止和投递失败会分别说明;不会自动重跑任务或重发文件。关闭命令时只显示文字提示,普通数字仍作为聊天内容。审批和问答沿用原交互提示。切换会话、停用账号或后续回合已开始时,不再发送旧回合的完成导航。
133
+ Regular chat messages follow the actual task state. Commands continue to use text replies.
130
134
 
131
- ## 消息处理状态
135
+ - DingTalk: labels on the original message show queued, thinking, waiting for confirmation, done, failed, or cancelled.
136
+ - Feishu / Lark: reactions indicate processing, done, or failed. Waiting keeps the processing reaction; cancellation removes it.
137
+ - Telegram: 👀 processing, 🤔 waiting for confirmation, 👍 done, and 👎 failed. Cancellation removes the reaction. Typing is refreshed while processing.
138
+ - WeChat: typing is refreshed while processing and stopped when finished or waiting for confirmation. WeCom and QQ retain their existing reply behavior.
132
139
 
133
- 普通聊天消息会随实际任务更新状态;命令仍使用文字回复。
140
+ 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.
134
141
 
135
- - 钉钉:在原消息上显示排队、思考、等待确认、已完成、失败或取消标签。
136
- - 飞书 / Lark:使用处理中、完成和失败表情;等待确认沿用处理中表情,取消时撤下表情。
137
- - Telegram:使用 👀 处理中、🤔 等待确认、👍 完成、👎 失败;取消时撤下表情。处理期间持续显示输入状态。
138
- - 微信:处理期间刷新输入状态,结束或等待确认时停止。企业微信、QQ 保持现有回复方式。
142
+ ## Connection diagnostics
139
143
 
140
- “已完成”表示该回合正常结束且正文、文件均已投递;停止、失败和下一条排队消息不会误标完成。状态接口受渠道权限与网络影响,更新失败不阻塞聊天;文字标签跟随网页语言设置。
144
+ 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, or Telegram bot identity and Webhook conflicts.
141
145
 
142
- ## 界面预览
146
+ 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).
143
147
 
144
- 在「设置 → IM助理」按渠道添加账号。展开渠道后,点击账号行上的设置按钮配置工作区、模型、权限和私聊准入;接收消息开关位于账号行:
148
+ ## Screenshots
145
149
 
146
- ![IM 助理设置页](assets/screenshots/settings-channels.png)
150
+ Add accounts under each channel in **Settings → IM Assistant**. Expand a channel, select an account, and configure its workspace, model, permission, and private access independently in its settings dialog. The **Receive messages** switch is on the account row:
147
151
 
148
- 工作区左侧「任务 / 频道」分列。IM 会话只出现在「频道」:
152
+ ![IM Assistant settings](assets/screenshots/settings-channels.png)
149
153
 
150
- ![工作区频道侧栏](assets/screenshots/workspace-channels.png)
154
+ The workspace splits **Tasks** and **Channels**. IM sessions appear only under **Channels**:
151
155
 
152
- 企业微信等渠道支持扫码快捷绑定:
156
+ ![Workspace channel sidebar](assets/screenshots/workspace-channels.png)
153
157
 
154
- ![企业微信扫码绑定](assets/screenshots/wecom-qr.png)
158
+ WeCom and other QR channels support scan-to-bind:
155
159
 
156
- 连上后,可在各 IM 里直接驱动本机助手:
160
+ ![WeCom QR binding](assets/screenshots/wecom-qr.png)
161
+
162
+ After connecting, drive the local assistant from each IM:
157
163
 
158
164
  <p align="center">
159
- <img src="assets/screenshots/wecom-chat.jpg" width="220" alt="企业微信对话">
160
- <img src="assets/screenshots/weixin-chat.jpg" width="220" alt="微信对话">
161
- <img src="assets/screenshots/dingtalk-chat.jpg" width="220" alt="钉钉对话">
165
+ <img src="assets/screenshots/wecom-chat.jpg" width="220" alt="WeCom chat">
166
+ <img src="assets/screenshots/weixin-chat.jpg" width="220" alt="WeChat chat">
167
+ <img src="assets/screenshots/dingtalk-chat.jpg" width="220" alt="DingTalk chat">
162
168
  </p>
163
169
  <p align="center">
164
- <img src="assets/screenshots/feishu-chat.jpg" width="220" alt="飞书对话">
165
- <img src="assets/screenshots/qq-chat.jpg" width="220" alt="QQ 对话">
166
- <img src="assets/screenshots/telegram-chat.jpg" width="220" alt="Telegram 对话">
170
+ <img src="assets/screenshots/feishu-chat.jpg" width="220" alt="Feishu chat">
171
+ <img src="assets/screenshots/qq-chat.jpg" width="220" alt="QQ chat">
172
+ <img src="assets/screenshots/telegram-chat.jpg" width="220" alt="Telegram chat">
167
173
  </p>
168
174
 
169
- ## DSH 产品生态
175
+ ## DSH product ecosystem
170
176
 
171
- 想直接使用完整工作台,可下载 [DSH Codex Desktop](https://github.com/MichengAI/dsh-codex-desktop/releases);已有 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 环境,可按需独立安装以下 8 个自研插件。桌面端已随附这些插件。
177
+ For a ready-to-use workbench, download [DSH Codex Desktop](https://github.com/MichengAI/dsh-codex-desktop/releases). If you already use [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness), install any of these eight plugins individually. The desktop app includes all eight.
172
178
 
173
- | 插件 | 你可以用它做什么 |
179
+ | Plugin | What you can do |
174
180
  | --- | --- |
175
- | [Codex UI](https://github.com/MichengAI/dsh-codex-ui) | 整理项目与会话、搜索任务、跳转对话轮次 |
176
- | [IM Connect](https://github.com/MichengAI/dsh-im-connect) | 从微信、飞书、钉钉等消息平台下任务、收回复 |
177
- | [Automation](https://github.com/MichengAI/dsh-automation) | 按计划执行任务,查看每次运行的结果 |
178
- | [Skills Manager](https://github.com/MichengAI/dsh-skills-manager) | 统一查找、启停、创建和导入本机技能 |
179
- | [Archive Manager](https://github.com/MichengAI/dsh-archive-manager) | 搜索、恢复或清理已归档会话 |
180
- | [Agency Agents](https://github.com/MichengAI/dsh-agency-agents) | 按任务选择并召唤专业角色 |
181
- | [BTW](https://github.com/MichengAI/dsh-btw) | 在当前上下文中临时旁问,不打断主任务 |
182
- | [Simplify](https://github.com/MichengAI/dsh-simplify) | 用 /simplify 整理 Git 改动范围内的代码 |
181
+ | [Codex UI](https://github.com/MichengAI/dsh-codex-ui) | Organize projects and conversations, search tasks, and navigate chat turns |
182
+ | [IM Connect](https://github.com/MichengAI/dsh-im-connect) | Send tasks and receive replies through your usual messenger |
183
+ | [Automation](https://github.com/MichengAI/dsh-automation) | Schedule tasks and review each run |
184
+ | [Skills Manager](https://github.com/MichengAI/dsh-skills-manager) | Find, enable, create, and import local skills |
185
+ | [Archive Manager](https://github.com/MichengAI/dsh-archive-manager) | Search, restore, or clean up archived conversations |
186
+ | [Agency Agents](https://github.com/MichengAI/dsh-agency-agents) | Choose and summon specialists for your task |
187
+ | [BTW](https://github.com/MichengAI/dsh-btw) | Ask side questions without interrupting the main task |
188
+ | [Simplify](https://github.com/MichengAI/dsh-simplify) | Use /simplify to improve code within your Git changes |
183
189
 
184
- ## 前置条件
190
+ ## Prerequisites
185
191
 
186
- - 已可正常运行 DeepSeek Harness Web,且可在 PowerShell 中使用 `dsh`。
187
- - 当前源码支持 DSH `0.1.2-rc.1`、`0.1.5-rc.1`、`0.1.5-rc.2`,推荐后者;开发依赖固定为 `0.1.5-rc.2`。`0.1.0-rc.8`、`0.1.1-rc.2` 缺少本插件需要的认证与会话控制接口,请先升级 DSH。
188
- - 以下示例使用 `web` profile;请替换为实际目标 profile。
189
- - 从源码安装或二次开发需要 Node.js 22+;仅从 npm 安装无需在任意目录执行 `npm install`。
190
- - 安装后必须重启 `dsh web`,并在浏览器硬刷新,才能看到「设置 → IM助理」。
192
+ - A working DeepSeek Harness Web installation with `dsh` available in PowerShell.
193
+ - The current source supports DSH `0.1.2-rc.1`, `0.1.5-rc.1`, and `0.1.5-rc.2`; the latter is recommended and pinned for development. DSH `0.1.0-rc.8` and `0.1.1-rc.2` lack the authentication and session-control interfaces this plugin requires; upgrade DSH first.
194
+ - Examples use the `web` profile; replace it with the target profile.
195
+ - Source installation and development require Node.js 22+. npm installation does not require running `npm install` in an arbitrary directory.
196
+ - After install, restart `dsh web` and hard-refresh the browser before opening **Settings → IM Assistant**.
191
197
 
192
- ## 安装
198
+ ## Installation
193
199
 
194
- 以下安装命令使用官方 npm 源。
200
+ The installation commands below use the official npm registry.
195
201
 
196
- ### 让 Agent 帮你安装(推荐)
202
+ ### Ask an agent to install it (recommended)
197
203
 
198
- 把下面这段话发给任意能够执行本机终端命令的 Agent。将 `web` 替换为实际使用的 profile;安装完成后,在 DSH 中使用本插件。
204
+ 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.
199
205
 
200
206
  ```text
201
- 请将 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 和开始使用。
207
+ 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.
202
208
  ```
203
209
 
204
- ### 从官方 npm 安装最新版
210
+ ### Install the latest package from the official npm registry
205
211
 
206
- 在任意 PowerShell 目录执行:
212
+ Run this from any PowerShell directory:
207
213
 
208
214
  ```powershell
209
215
  [Console]::OutputEncoding = [System.Text.Encoding]::UTF8
@@ -212,81 +218,82 @@ dsh plugin --profile web add @michengai/dsh-im-connect@latest --registry=https:/
212
218
  dsh --profile web --dump-config
213
219
  ```
214
220
 
215
- 需要钉死某一版时,把 `@latest` 换成具体版本,例如 `@0.1.28`。
221
+ To pin a release, replace `@latest` with a version such as `@0.1.28`.
216
222
 
217
- 配置输出中应包含 `im-connect`。安装后重启 DSH Web 并在浏览器硬刷新。不要手工复制客户端文件,`dsh plugin add` 会同时应用 `cordis.patch.yml`。
223
+ 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`.
218
224
 
219
- ## 在线更新
225
+ ## Updates
220
226
 
221
- 设置标题会显示当前版本和“检查更新”按钮。发现新版后,只有检测到 DSH CLI 或 Desktop 更新服务时才可使用“自动更新”;其他环境会在弹窗中提供可复制、与当前 Profile 对应的手工更新命令。
227
+ The settings title shows the installed version and a **Check for updates** button. 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.
222
228
 
223
- ## 使用
229
+ ## Usage
224
230
 
225
- 打开「设置 → IM助理」,在目标渠道点击「添加账号」,并为该账号选择工作区、模型、权限和私聊准入。
231
+ Open **Settings → IM Assistant**, select **Add account** under the target channel, then choose that account's workspace, model, permission, and private-access mode.
226
232
 
227
- | 目标 | 操作 | 说明 |
233
+ | Goal | Action | Notes |
228
234
  | --- | --- | --- |
229
- | 添加账号 | 在对应渠道点击「添加账号」,选择账号配置后扫码或填写凭据 | 同一渠道可添加多个账号;飞书 / Lark / 微信仅扫码,Telegram 仅填 Bot Token |
230
- | 修改账号配置 | 展开渠道并选择账号,在设置弹窗中修改工作区、模型、推理强度、权限或私聊准入 | 配置只影响当前账号;保存后该账号的后续会话立即使用新配置 |
231
- | 暂停接收 | 关闭账号行上的「接收消息」开关 | 凭据和账号配置保留,只暂停该账号接收新消息 |
232
- | 在 IM 里下任务 | 微信 / 飞书 / Lark / QQ 扫码用户可直接私聊;钉钉 / 企微扫码者和其他用户需先批准。群聊只需 @ | 每个聊天对应一条独立频道会话 |
233
- | 分段输入 | 结尾加 `..` 表示还有后续,`!!` 表示立即提交 | 默认约 5 秒合并窗口 |
234
- | 新开会话 | 发送 `/new` 或 `/clear` | 新建并切换当前 IM 会话;旧会话保留在频道列表,不影响网页任务 |
235
- | 查看状态 / 帮助 | 发送 `/status` 或 `/help` | 查看当前会话及动态 Chat 命令 |
236
- | Agent 预设 | 在新增或编辑账号弹窗选择「Agent 预设」 | 使用 Chat 的预设名册;更改后新会话使用新预设,旧会话保持原预设 |
237
- | 命令权限 | 点击账号右侧「设置」,调整私聊、群聊命令开关 | 先准入,再判断命令权限;关闭后仍可正常对话和回答审批、问题 |
238
- | 会话 / 工作区 | `/sessions`、`/session <序号或ID>`;`/workspaces`、`/workspace <序号或ID>` | 可接续普通 Chat 会话;选择工作区会新建会话,不修改账号默认配置 |
239
- | 任务控制 | `/stop`、`/steer <内容>`、`/queue` | 停止、补充指令、查看队列;停止保留 Host 排队消息 |
240
- | 预设新会话 | `/presets`、`/preset <序号或ID>`、`/preset --default` | 使用指定预设在当前工作区新建并接续,不改变账号默认 |
241
- | 模型 / 推理 | `/models`、`/model <序号或provider/model>`、`/reasoning [等级或 --default]` | 修改当前选择,并更新宿主后续 Chat 新会话的默认选择 |
242
- | 结果补发 | `/delivery`、`/delivery retry <记录ID>` | 查看近期交付状态,按记录补发原任务文字结果 |
243
- | 会话管理 | `/history`、`/rename <名称>`、`/fork` | 最近文字对话、改名、分叉并切换 |
244
- | 批准陌生人私聊 | 打开「设置 → IM助理」,在待批准列表点「批准」或「拒绝」 | 只影响私聊准入,不影响群聊 |
245
- | 回答交互问题 | 直接回复选项序号或文字;多选用逗号分隔,也可以输入自定义答案 | 多个问题会按顺序发送;群聊只接受任务发起者回答 |
246
- | 批准工具 | 在私聊回复「批准」或「拒绝」 | 也接受 `yes` / `no` / `allow` / `reject`;群聊无效 |
247
- | 在网页里回看 | 打开工作区「频道」页签 | IM 会话不会出现在「任务」里 |
248
-
249
- 通过 `/workspace` 新建后,`/new` 和当前会话归档后的续聊会保留所选工作区,并使用账号配置的模型、Agent 与权限预设。`/session` 接续已有会话、`/fork` 分叉则保留原会话配置。
250
-
251
- 钉钉回复优先走官方 AI Card 流式卡片;创建失败则回退纯文本,保留换行;代码与列表标记按原文显示。Telegram 同一 Bot 不要同时开 Webhook。
252
-
253
- 命令单独发送为文字,图片说明按普通消息处理。首次使用可发 `/help`,各命令回复也会给出相关操作。
254
-
255
- - 会话与工作区:列表序号 15 分钟内有效;归档项在列表中标记,需要先在网页恢复。切换前完成运行任务和待处理交互。
256
- - 模型:`/model`、`/reasoning` 与 Chat 一致,也会尝试保存后续新会话的默认选择;已有其他会话不主动修改。
257
- - 停止与队列:`/stop` 先提交停止请求,保留队列;活跃目标另用 `/goal pause` 暂停。发 `/queue` 查看和管理排队消息。
258
- - 分叉:`/fork` 需要至少一个完整回合。已创建但未切换时,按回复中的会话 ID 和恢复指引接续。
259
- - 权限与导出:`/permission` 设置在恢复会话时保留;`/export` 遵循私聊准入和私聊/群聊命令权限,只有 ZIP 文件发送成功才回复完成。
260
-
261
- 命令回复支持中英文,并跟随网页中明确保存的语言选择;未指定语言或语言服务不可用时使用中文。动态名称、路径、用户内容与宿主扩展结果保持原文。工具审批、交互问答和部分渠道错误尚未全部国际化。
262
-
263
- ## 权限与安全边界
264
-
265
- 命令权限不授予私聊准入,也不替代工具审批。开启命令的用户可查看、接续普通 Chat 会话并执行宿主注册命令。每账号独立设置私聊、群聊开关,不需要用户 ID;旧配置缺少该字段时默认开启以保持兼容。
266
-
267
- | 项 | 当前行为 |
235
+ | 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; Feishu / Lark / WeChat are QR-only, while Telegram needs a Bot Token |
236
+ | Change account settings | Expand the channel, select an account, then edit its workspace, model, reasoning effort, permission, or private-access mode in its settings dialog | Changes affect only that account and apply to its subsequent sessions immediately |
237
+ | Pause receiving | Turn off **Receive messages** on the account row | Credentials and settings stay; only new inbound messages for that account pause |
238
+ | 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 |
239
+ | Split input | End with `..` to continue, `!!` to flush now | Default merge window is about 5 seconds |
240
+ | 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 |
241
+ | Status / help | Send `/status` or `/help` | Current session and dynamically discovered Chat commands |
242
+ | 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 |
243
+ | 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 |
244
+ | 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 |
245
+ | Task controls | `/stop`, `/steer <text>`, `/queue` | Stop, provide instructions, or inspect the queue; stopping preserves Host queued messages |
246
+ | 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 |
247
+ | 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 |
248
+ | Result recovery | `/delivery`, `/delivery retry <record-ID>` | Check recent deliveries and resend text from the original task |
249
+ | Session management | `/history`, `/rename <title>`, `/fork` | Recent text history, rename, or fork and switch |
250
+ | Approve a stranger DM | Open **Settings → IM Assistant** and approve or deny the pending request | Affects DM access only |
251
+ | 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 |
252
+ | Approve a tool | Reply `Approve` / `Deny` or `批准` / `拒绝` in a DM | Also accepts `yes` / `no` / `allow` / `reject`; group replies cannot grant |
253
+ | Review on the web | Open the workspace **Channels** tab | IM sessions never appear under **Tasks** |
254
+
255
+ 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.
256
+
257
+ DingTalk replies prefer official AI Card streaming. If card creation fails, plain text preserves line breaks; code fences and list markers remain literal. Do not enable Webhook on the same Telegram bot.
258
+
259
+ Send commands as separate text messages; image captions remain ordinary input. Start with `/help`; individual replies also suggest related actions.
260
+
261
+ - 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.
262
+ - Models: as in Chat, `/model` and `/reasoning` also attempt to save the default for future sessions. Other existing sessions are not changed.
263
+ - 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.
264
+ - 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.
265
+ - 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.
266
+
267
+ Command replies support Chinese and English and follow the language explicitly saved in web settings. With no preference or an unavailable language service, they default to Chinese. Dynamic names, paths, user content, and extension results remain unchanged. Tool approvals, interactive questions, and some channel errors are not yet fully localized.
268
+
269
+ ## Permissions and security boundaries
270
+
271
+ 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.
272
+
273
+ | Item | Current behavior |
268
274
  | --- | --- |
269
- | 用户准入 | 群聊不用绑定,只需 @。每个账号可选择「仅已批准用户」或「允许所有私聊用户」;默认仅批准用户可用,微信 / 飞书 / Lark / QQ 扫码者会自动加入该账号白名单 |
270
- | 管理接口 | `/api/dsh-im-connect`;通过宿主 `connection.requestRejection` 验证 Host、Origin 和 Cookie,本机也须登录;认证不可用返回 503,写接口保留 JSON、客户端请求头和 1 MiB 限制 |
271
- | 敏感字段 | 包括微信 token 在内均优先写入 DSH `ctx.credentials`;没有该服务时落到 `%DSH_HOME%\dsh-im-connect\secrets.json`(明文,仅限当前用户,禁止同步或分享) |
272
- | 账号状态 | `channels.json` 按账号保存工作区、模型、权限、私聊准入、启用状态和凭据引用,不保存明文 Secret |
273
- | 浏览器回包 | 不返回 token、secret、App Secret 或内部异常详情 |
274
- | 微信协议 | 只走腾讯官方 iLink,不使用逆向个人微信协议 |
275
- | 工具批准 | 仅私聊且发送者已在当前账号白名单时生效;即使账号允许所有私聊用户,未批准用户也不能审批工具,且不能跨会话或在群里批准 |
276
- | 交互问题 | 单选、多选和自定义问题回到发起任务的 IM 会话;同一会话按顺序处理,群聊只接受任务发起者回答 |
275
+ | 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 |
276
+ | 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 |
277
+ | 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 |
278
+ | Account state | `channels.json` stores per-account workspace, model, permission, private access, enablement, and credential refs, not raw secrets |
279
+ | Browser payloads | Never include tokens, secrets, App Secrets, or internal error details |
280
+ | WeChat protocol | Official iLink only; no reverse-engineered personal WeChat protocol |
281
+ | Tool approval | Only a user on the current account's allowlist can grant or deny in a DM. Even when all DM users may chat, unapproved users cannot approve tools; approvals cannot cross conversations or come from groups |
282
+ | 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 |
277
283
 
278
- DSH 后端保持本机监听;远程访问使用受控 HTTPS 反向代理,并在宿主配置实际访问地址的 `trustedHosts`、通过该地址登录。不要伪装 localhost 或删除认证检查来绕过 403;图片下载的 `additionalImageHosts` 不用于管理接口。详见 [管理面认证](SECURITY.md#管理面)。权限预设与 Chat 使用相同的 Host sandbox-policy;`danger-full-access` 不套沙箱。
284
+ 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.
279
285
 
280
- ## 二次开发
286
+ ## Development
281
287
 
282
- ### 从源码安装
288
+ ### Install from source
283
289
 
284
- 适用于调试或使用未发布改动。克隆后的本地路径就是插件安装路径:
290
+ Use this for debugging or unpublished changes. The cloned directory becomes the plugin source path:
285
291
 
286
292
  ```powershell
287
293
  [Console]::OutputEncoding = [System.Text.Encoding]::UTF8
288
294
  $OutputEncoding = [System.Text.Encoding]::UTF8
289
- Set-Location D:\Repository\deepseek-harness-plugin
295
+ # Replace this with an existing projects directory.
296
+ Set-Location "$HOME\Projects"
290
297
  git clone https://github.com/MichengAI/dsh-im-connect.git
291
298
  Set-Location .\dsh-im-connect
292
299
  npm install
@@ -295,18 +302,18 @@ dsh plugin --profile web add .
295
302
  dsh --profile web --dump-config
296
303
  ```
297
304
 
298
- 完成后重启 DSH Web 并硬刷新浏览器。`dsh plugin ... add .` 会读取当前目录的包信息和 `cordis.patch.yml`;不要改为直接复制 `lib` 目录。
305
+ 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.
299
306
 
300
- 本仓库用 `src` 开发,构建到 `lib`:
307
+ This repository develops in `src` and builds to `lib`:
301
308
 
302
- - [src\index.ts](src/index.ts):Host 入口、配置和生命周期。
303
- - [src\manager.ts](src/manager.ts):渠道启停、已认证管理 API、凭据落盘。
304
- - [src\engine](src/engine):会话路由、斜杠命令、审批、分片和回推。
305
- - [src\channels](src/channels):钉钉、飞书、Lark、微信、企业微信、QQ、Telegram 适配器。
306
- - `client.js`:设置页和工作区频道侧栏。
307
- - `tests\*.test.mjs`:路由、扫码、凭据、QQ、投递和侧栏测试。
309
+ - [src\index.ts](src/index.ts): host entry, config, and lifecycle.
310
+ - [src\manager.ts](src/manager.ts): channel start/stop, authenticated management API, and credential persistence.
311
+ - [src\engine](src/engine): session routing, slash commands, approval, splitting, and outbound push.
312
+ - [src\channels](src/channels): DingTalk, Feishu, Lark, WeChat, WeCom, QQ, and Telegram adapters.
313
+ - `client.js`: settings page and workspace channel sidebar.
314
+ - `tests\*.test.mjs`: routing, QR, credentials, QQ, delivery, and sidebar tests.
308
315
 
309
- 修改后运行测试并以本地目录安装验证:
316
+ After changing the source, test and install from the local directory:
310
317
 
311
318
  ```powershell
312
319
  [Console]::OutputEncoding = [System.Text.Encoding]::UTF8
@@ -315,11 +322,11 @@ npm test
315
322
  dsh plugin --profile web add .
316
323
  ```
317
324
 
318
- 修改渠道或会话逻辑时,必须保持:引擎不写死平台名、渠道不创建 agent、网页任务与 IM 频道分列。
325
+ When changing channel or session logic, keep the engine platform-agnostic, keep adapters from creating agents, and keep web tasks separate from IM channels.
319
326
 
320
- ## 验证
327
+ ## Validation
321
328
 
322
- 真实管理认证测试需要把 `DSH_CONNECTION_CONTRACT_ROOT` 指向隔离安装的 `@deepseek-ai/dsh-client-connection` 包根目录;与 Gateway 共存的用例同时使用图片契约的 `DSH_CHAT_CONTRACT_ROOT`。未配置时本地会跳过对应契约测试,CI 已配置执行。测试使用临时 HTTP 服务和临时凭据,不代表真实 Cloudflare 部署联调。
329
+ 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.
323
330
 
324
331
  ```powershell
325
332
  [Console]::OutputEncoding = [System.Text.Encoding]::UTF8
@@ -327,19 +334,20 @@ $OutputEncoding = [System.Text.Encoding]::UTF8
327
334
  npm test
328
335
  ```
329
336
 
330
- `prepublishOnly` 会在发布前自动执行测试。
337
+ `prepublishOnly` runs the tests before publishing.
338
+
331
339
 
332
- ## 许可证
340
+ ## Result recovery after disconnects and restarts
333
341
 
334
- 安全说明见 [SECURITY.md](SECURITY.md)。
342
+ 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.
335
343
 
336
- 本项目采用 [Apache License 2.0](LICENSE)。
344
+ - Telegram, 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.
345
+ - 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.
346
+ - 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.
347
+ - 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.
337
348
 
338
- ### 断线与重启后的结果补发
349
+ ## License
339
350
 
340
- 从本功能启用后收到的普通 IM 消息开始记录交付状态。原任务的结果已保存、但尚未开始发送时,可在恢复连接或重启后补发最终文字和结束状态;不会重新执行问题、工具或审批,也不会补发文件。旧版本处理过的消息不回溯补发。
351
+ Security guidance is in [SECURITY.md](SECURITY.md).
341
352
 
342
- - Telegram、飞书/Lark、企业微信可通过稳定聊天目标后台尝试补发;钉钉、QQ、微信等待原聊天发来新消息刷新回复通道。发送仍受渠道连接、时效和配额限制。
343
- - 已尝试发送但无法确认送达时,暂停自动补发。发送 `/delivery` 查看记录;确认需要补发后发送 `/delivery retry <记录ID>`。这可能重复已收到的文字,文件请在网页原会话查看。
344
- - 查询与补发仅限当前聊天的原发起人,并遵循准入和命令权限。账号停用、原会话换绑或访问权限变化会暂停补发;恢复原绑定与权限后可手动尝试。
345
- - 每条记录的补发窗口为 7 天,最多保存 1000 条;满额时优先清理已送达或明确未提交的终态记录,过期记录在新消息进入时清理。后台每 30 秒分批检查,历史暂不可读或任务尚未结束时继续等待。补发不是任务自动续跑。
353
+ Licensed under [Apache License 2.0](LICENSE).