@michengai/dsh-im-connect 0.1.46 → 0.1.48
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/CHANGELOG.md +10 -0
- package/CHANGELOG.zh-CN.md +10 -0
- package/README.md +214 -203
- package/README.zh-CN.md +356 -0
- package/client.js +94 -18
- package/lib/channels/connection-state.d.ts +4 -0
- package/lib/channels/connection-state.d.ts.map +1 -0
- package/lib/channels/connection-state.js +18 -0
- package/lib/channels/connection-state.js.map +1 -0
- package/lib/channels/diagnostics.d.ts +22 -0
- package/lib/channels/diagnostics.d.ts.map +1 -0
- package/lib/channels/diagnostics.js +78 -0
- package/lib/channels/diagnostics.js.map +1 -0
- package/lib/channels/dingtalk.d.ts.map +1 -1
- package/lib/channels/dingtalk.js +8 -0
- package/lib/channels/dingtalk.js.map +1 -1
- package/lib/channels/feishu.d.ts.map +1 -1
- package/lib/channels/feishu.js +19 -0
- package/lib/channels/feishu.js.map +1 -1
- package/lib/channels/qq.d.ts.map +1 -1
- package/lib/channels/qq.js +15 -0
- package/lib/channels/qq.js.map +1 -1
- package/lib/channels/telegram.d.ts.map +1 -1
- package/lib/channels/telegram.js +19 -0
- package/lib/channels/telegram.js.map +1 -1
- package/lib/channels/wecom.d.ts +8 -0
- package/lib/channels/wecom.d.ts.map +1 -1
- package/lib/channels/wecom.js +30 -1
- package/lib/channels/wecom.js.map +1 -1
- package/lib/channels/weixin.d.ts.map +1 -1
- package/lib/channels/weixin.js +18 -0
- package/lib/channels/weixin.js.map +1 -1
- package/lib/client.js +94 -18
- package/lib/engine/types.d.ts +2 -0
- package/lib/engine/types.d.ts.map +1 -1
- package/lib/manager.d.ts +18 -0
- package/lib/manager.d.ts.map +1 -1
- package/lib/manager.js +77 -6
- package/lib/manager.js.map +1 -1
- package/package.json +2 -2
- package/src/channels/connection-state.ts +15 -0
- package/src/channels/diagnostics.ts +66 -0
- package/src/channels/dingtalk.ts +8 -0
- package/src/channels/feishu.ts +18 -0
- package/src/channels/qq.ts +14 -0
- package/src/channels/telegram.ts +16 -0
- package/src/channels/wecom.ts +24 -1
- package/src/channels/weixin.ts +14 -0
- package/src/engine/types.ts +2 -0
- package/src/manager.ts +69 -6
- package/README.en.md +0 -345
package/README.md
CHANGED
|
@@ -4,206 +4,215 @@
|
|
|
4
4
|
|
|
5
5
|
<div align="center">
|
|
6
6
|
|
|
7
|
-
# DSH IM Connect
|
|
7
|
+
# DSH IM Connect
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
**Connect Feishu, Lark, DingTalk, WeCom, WeChat, QQ, and Telegram to local DeepSeek Harness**
|
|
10
10
|
|
|
11
|
-
[
|
|
11
|
+
[简体中文](README.zh-CN.md) · [Changelog](CHANGELOG.md) · [Apache-2.0](LICENSE)
|
|
12
12
|
|
|
13
|
-
[](LICENSE)
|
|
14
14
|
[](https://www.npmjs.com/package/@michengai/dsh-im-connect)
|
|
15
|
-
[](https://www.npmjs.com/package/@michengai/dsh-im-connect)
|
|
16
16
|
[](https://github.com/MichengAI/dsh-im-connect)
|
|
17
17
|
[](https://nodejs.org/)
|
|
18
|
-
[](
|
|
18
|
+
[](#-supported-channels)
|
|
19
19
|
</div>
|
|
20
20
|
|
|
21
|
-
> DSH IM Connect
|
|
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
|
-
|
|
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
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
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
|
-
|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
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>🔔
|
|
56
|
-
<code>🐦
|
|
55
|
+
<code>🔔 DingTalk</code>
|
|
56
|
+
<code>🐦 Feishu</code>
|
|
57
57
|
<code>🌐 Lark</code>
|
|
58
|
-
<code>💬
|
|
59
|
-
<code>🏢
|
|
58
|
+
<code>💬 WeChat</code>
|
|
59
|
+
<code>🏢 WeCom</code>
|
|
60
60
|
<code>🐧 QQ</code>
|
|
61
61
|
<code>✈️ Telegram</code>
|
|
62
62
|
</p>
|
|
63
63
|
|
|
64
|
-
|
|
|
65
|
-
|
|
66
|
-
| 🔔
|
|
67
|
-
| 🐦
|
|
68
|
-
| 🌐 **Lark** | ✅
|
|
69
|
-
| 💬
|
|
70
|
-
| 🏢
|
|
71
|
-
| 🐧 **QQ** | ✅
|
|
72
|
-
| ✈️ **Telegram** | ✅
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
88
|
+
## File input
|
|
81
89
|
|
|
82
|
-
|
|
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
|
-
|
|
98
|
+
## File delivery
|
|
91
99
|
|
|
92
|
-
|
|
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
|
-
|
|
108
|
+
## Action menu
|
|
101
109
|
|
|
102
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
131
|
+
## Message progress
|
|
128
132
|
|
|
129
|
-
|
|
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
|
-
|
|
148
|
+
## Screenshots
|
|
145
149
|
|
|
146
|
-
|
|
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
|
-
|
|
152
|
+

|
|
149
153
|
|
|
150
|
-
|
|
154
|
+
The workspace splits **Tasks** and **Channels**. IM sessions appear only under **Channels**:
|
|
151
155
|
|
|
152
|
-
|
|
156
|
+

|
|
153
157
|
|
|
154
|
-
|
|
158
|
+
WeCom and other QR channels support scan-to-bind:
|
|
155
159
|
|
|
156
|
-
|
|
160
|
+

|
|
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
|
-
|
|
177
|
+
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.
|
|
172
178
|
|
|
173
|
-
|
|
|
179
|
+
| Plugin | What you can do |
|
|
174
180
|
| --- | --- |
|
|
175
|
-
| [Codex UI](https://github.com/MichengAI/dsh-codex-ui) |
|
|
176
|
-
| [
|
|
177
|
-
| [
|
|
178
|
-
| [
|
|
179
|
-
| [
|
|
180
|
-
| [
|
|
181
|
-
| [BTW](https://github.com/MichengAI/dsh-btw) |
|
|
182
|
-
| [Simplify](https://github.com/MichengAI/dsh-simplify) |
|
|
181
|
+
| [Codex UI](https://github.com/MichengAI/dsh-codex-ui) | Organize projects and conversations, search tasks, and navigate chat turns |
|
|
182
|
+
| [Agency Agents](https://github.com/MichengAI/dsh-agency-agents) | Choose and summon specialists for your task |
|
|
183
|
+
| [Skills Manager](https://github.com/MichengAI/dsh-skills-manager) | Find, enable, create, and import local skills |
|
|
184
|
+
| [Archive Manager](https://github.com/MichengAI/dsh-archive-manager) | Search, restore, or clean up archived conversations |
|
|
185
|
+
| [IM Connect](https://github.com/MichengAI/dsh-im-connect) | Send tasks and receive replies through messaging platforms |
|
|
186
|
+
| [Automation](https://github.com/MichengAI/dsh-automation) | Schedule tasks and review each run |
|
|
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 |
|
|
189
|
+
| [PUA](https://github.com/MichengAI/dsh-pua) | Guide the Agent to try new approaches after failures, investigate causes, and verify results before completion |
|
|
190
|
+
| [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 |
|
|
191
|
+
| [Codex Pet](https://github.com/MichengAI/dsh-codex-pet) | View conversation notifications and respond to tool approvals and questions through a desktop pet |
|
|
183
192
|
|
|
184
|
-
##
|
|
193
|
+
## Prerequisites
|
|
185
194
|
|
|
186
|
-
-
|
|
187
|
-
-
|
|
188
|
-
-
|
|
189
|
-
-
|
|
190
|
-
-
|
|
195
|
+
- A working DeepSeek Harness Web installation with `dsh` available in PowerShell.
|
|
196
|
+
- 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.
|
|
197
|
+
- Examples use the `web` profile; replace it with the target profile.
|
|
198
|
+
- Source installation and development require Node.js 22+. npm installation does not require running `npm install` in an arbitrary directory.
|
|
199
|
+
- After install, restart `dsh web` and hard-refresh the browser before opening **Settings → IM Assistant**.
|
|
191
200
|
|
|
192
|
-
##
|
|
201
|
+
## Installation
|
|
193
202
|
|
|
194
|
-
|
|
203
|
+
The installation commands below use the official npm registry.
|
|
195
204
|
|
|
196
|
-
###
|
|
205
|
+
### Ask an agent to install it (recommended)
|
|
197
206
|
|
|
198
|
-
|
|
207
|
+
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
208
|
|
|
200
209
|
```text
|
|
201
|
-
|
|
210
|
+
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
211
|
```
|
|
203
212
|
|
|
204
|
-
###
|
|
213
|
+
### Install the latest package from the official npm registry
|
|
205
214
|
|
|
206
|
-
|
|
215
|
+
Run this from any PowerShell directory:
|
|
207
216
|
|
|
208
217
|
```powershell
|
|
209
218
|
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
@@ -212,81 +221,82 @@ dsh plugin --profile web add @michengai/dsh-im-connect@latest --registry=https:/
|
|
|
212
221
|
dsh --profile web --dump-config
|
|
213
222
|
```
|
|
214
223
|
|
|
215
|
-
|
|
224
|
+
To pin a release, replace `@latest` with a version such as `@0.1.28`.
|
|
216
225
|
|
|
217
|
-
|
|
226
|
+
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
227
|
|
|
219
|
-
##
|
|
228
|
+
## Updates
|
|
220
229
|
|
|
221
|
-
|
|
230
|
+
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
231
|
|
|
223
|
-
##
|
|
232
|
+
## Usage
|
|
224
233
|
|
|
225
|
-
|
|
234
|
+
Open **Settings → IM Assistant**, select **Add account** under the target channel, then choose that account's workspace, model, permission, and private-access mode.
|
|
226
235
|
|
|
227
|
-
|
|
|
236
|
+
| Goal | Action | Notes |
|
|
228
237
|
| --- | --- | --- |
|
|
229
|
-
|
|
|
230
|
-
|
|
|
231
|
-
|
|
|
232
|
-
|
|
|
233
|
-
|
|
|
234
|
-
|
|
|
235
|
-
|
|
|
236
|
-
| Agent
|
|
237
|
-
|
|
|
238
|
-
|
|
|
239
|
-
|
|
|
240
|
-
|
|
|
241
|
-
|
|
|
242
|
-
|
|
|
243
|
-
|
|
|
244
|
-
|
|
|
245
|
-
|
|
|
246
|
-
|
|
|
247
|
-
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
-
|
|
256
|
-
-
|
|
257
|
-
-
|
|
258
|
-
-
|
|
259
|
-
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
##
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
|
238
|
+
| 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 |
|
|
239
|
+
| 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 |
|
|
240
|
+
| Pause receiving | Turn off **Receive messages** on the account row | Credentials and settings stay; only new inbound messages for that account pause |
|
|
241
|
+
| 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 |
|
|
242
|
+
| Split input | End with `..` to continue, `!!` to flush now | Default merge window is about 5 seconds |
|
|
243
|
+
| 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 |
|
|
244
|
+
| Status / help | Send `/status` or `/help` | Current session and dynamically discovered Chat commands |
|
|
245
|
+
| 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 |
|
|
246
|
+
| 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 |
|
|
247
|
+
| 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 |
|
|
248
|
+
| Task controls | `/stop`, `/steer <text>`, `/queue` | Stop, provide instructions, or inspect the queue; stopping preserves Host queued messages |
|
|
249
|
+
| 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 |
|
|
250
|
+
| 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 |
|
|
251
|
+
| Result recovery | `/delivery`, `/delivery retry <record-ID>` | Check recent deliveries and resend text from the original task |
|
|
252
|
+
| Session management | `/history`, `/rename <title>`, `/fork` | Recent text history, rename, or fork and switch |
|
|
253
|
+
| Approve a stranger DM | Open **Settings → IM Assistant** and approve or deny the pending request | Affects DM access only |
|
|
254
|
+
| 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 |
|
|
255
|
+
| Approve a tool | Reply `Approve` / `Deny` or `批准` / `拒绝` in a DM | Also accepts `yes` / `no` / `allow` / `reject`; group replies cannot grant |
|
|
256
|
+
| Review on the web | Open the workspace **Channels** tab | IM sessions never appear under **Tasks** |
|
|
257
|
+
|
|
258
|
+
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.
|
|
259
|
+
|
|
260
|
+
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.
|
|
261
|
+
|
|
262
|
+
Send commands as separate text messages; image captions remain ordinary input. Start with `/help`; individual replies also suggest related actions.
|
|
263
|
+
|
|
264
|
+
- 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.
|
|
265
|
+
- Models: as in Chat, `/model` and `/reasoning` also attempt to save the default for future sessions. Other existing sessions are not changed.
|
|
266
|
+
- 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.
|
|
267
|
+
- 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.
|
|
268
|
+
- 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.
|
|
269
|
+
|
|
270
|
+
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.
|
|
271
|
+
|
|
272
|
+
## Permissions and security boundaries
|
|
273
|
+
|
|
274
|
+
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.
|
|
275
|
+
|
|
276
|
+
| Item | Current behavior |
|
|
268
277
|
| --- | --- |
|
|
269
|
-
|
|
|
270
|
-
|
|
|
271
|
-
|
|
|
272
|
-
|
|
|
273
|
-
|
|
|
274
|
-
|
|
|
275
|
-
|
|
|
276
|
-
|
|
|
278
|
+
| 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 |
|
|
279
|
+
| 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 |
|
|
280
|
+
| 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 |
|
|
281
|
+
| Account state | `channels.json` stores per-account workspace, model, permission, private access, enablement, and credential refs, not raw secrets |
|
|
282
|
+
| Browser payloads | Never include tokens, secrets, App Secrets, or internal error details |
|
|
283
|
+
| WeChat protocol | Official iLink only; no reverse-engineered personal WeChat protocol |
|
|
284
|
+
| 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 |
|
|
285
|
+
| 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
286
|
|
|
278
|
-
DSH
|
|
287
|
+
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
288
|
|
|
280
|
-
##
|
|
289
|
+
## Development
|
|
281
290
|
|
|
282
|
-
###
|
|
291
|
+
### Install from source
|
|
283
292
|
|
|
284
|
-
|
|
293
|
+
Use this for debugging or unpublished changes. The cloned directory becomes the plugin source path:
|
|
285
294
|
|
|
286
295
|
```powershell
|
|
287
296
|
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
288
297
|
$OutputEncoding = [System.Text.Encoding]::UTF8
|
|
289
|
-
|
|
298
|
+
# Replace this with an existing projects directory.
|
|
299
|
+
Set-Location "$HOME\Projects"
|
|
290
300
|
git clone https://github.com/MichengAI/dsh-im-connect.git
|
|
291
301
|
Set-Location .\dsh-im-connect
|
|
292
302
|
npm install
|
|
@@ -295,18 +305,18 @@ dsh plugin --profile web add .
|
|
|
295
305
|
dsh --profile web --dump-config
|
|
296
306
|
```
|
|
297
307
|
|
|
298
|
-
|
|
308
|
+
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
309
|
|
|
300
|
-
|
|
310
|
+
This repository develops in `src` and builds to `lib`:
|
|
301
311
|
|
|
302
|
-
- [src\index.ts](src/index.ts)
|
|
303
|
-
- [src\manager.ts](src/manager.ts)
|
|
304
|
-
- [src\engine](src/engine)
|
|
305
|
-
- [src\channels](src/channels)
|
|
306
|
-
- `client.js
|
|
307
|
-
- `tests\*.test.mjs
|
|
312
|
+
- [src\index.ts](src/index.ts): host entry, config, and lifecycle.
|
|
313
|
+
- [src\manager.ts](src/manager.ts): channel start/stop, authenticated management API, and credential persistence.
|
|
314
|
+
- [src\engine](src/engine): session routing, slash commands, approval, splitting, and outbound push.
|
|
315
|
+
- [src\channels](src/channels): DingTalk, Feishu, Lark, WeChat, WeCom, QQ, and Telegram adapters.
|
|
316
|
+
- `client.js`: settings page and workspace channel sidebar.
|
|
317
|
+
- `tests\*.test.mjs`: routing, QR, credentials, QQ, delivery, and sidebar tests.
|
|
308
318
|
|
|
309
|
-
|
|
319
|
+
After changing the source, test and install from the local directory:
|
|
310
320
|
|
|
311
321
|
```powershell
|
|
312
322
|
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
@@ -315,11 +325,11 @@ npm test
|
|
|
315
325
|
dsh plugin --profile web add .
|
|
316
326
|
```
|
|
317
327
|
|
|
318
|
-
|
|
328
|
+
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
329
|
|
|
320
|
-
##
|
|
330
|
+
## Validation
|
|
321
331
|
|
|
322
|
-
|
|
332
|
+
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
333
|
|
|
324
334
|
```powershell
|
|
325
335
|
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
@@ -327,19 +337,20 @@ $OutputEncoding = [System.Text.Encoding]::UTF8
|
|
|
327
337
|
npm test
|
|
328
338
|
```
|
|
329
339
|
|
|
330
|
-
`prepublishOnly`
|
|
340
|
+
`prepublishOnly` runs the tests before publishing.
|
|
341
|
+
|
|
331
342
|
|
|
332
|
-
##
|
|
343
|
+
## Result recovery after disconnects and restarts
|
|
333
344
|
|
|
334
|
-
|
|
345
|
+
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
346
|
|
|
336
|
-
|
|
347
|
+
- 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.
|
|
348
|
+
- 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.
|
|
349
|
+
- 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.
|
|
350
|
+
- 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
351
|
|
|
338
|
-
|
|
352
|
+
## License
|
|
339
353
|
|
|
340
|
-
|
|
354
|
+
Security guidance is in [SECURITY.md](SECURITY.md).
|
|
341
355
|
|
|
342
|
-
|
|
343
|
-
- 已尝试发送但无法确认送达时,暂停自动补发。发送 `/delivery` 查看记录;确认需要补发后发送 `/delivery retry <记录ID>`。这可能重复已收到的文字,文件请在网页原会话查看。
|
|
344
|
-
- 查询与补发仅限当前聊天的原发起人,并遵循准入和命令权限。账号停用、原会话换绑或访问权限变化会暂停补发;恢复原绑定与权限后可手动尝试。
|
|
345
|
-
- 每条记录的补发窗口为 7 天,最多保存 1000 条;满额时优先清理已送达或明确未提交的终态记录,过期记录在新消息进入时清理。后台每 30 秒分批检查,历史暂不可读或任务尚未结束时继续等待。补发不是任务自动续跑。
|
|
356
|
+
Licensed under [Apache License 2.0](LICENSE).
|