@xmanrui/dsh-im 0.7.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +152 -0
- package/README.md +25 -131
- package/lib/index.js +116 -114
- package/package.json +2 -1
- package/src/channels/dingtalk/dingtalk-bridge.mjs +67 -4
- package/src/channels/discord/discord-api.mjs +1 -1
- package/src/channels/feishu/bridge.mjs +53 -4
- package/src/channels/qq/qq-bridge.mjs +52 -4
- package/src/channels/shared/harness-approval.mjs +472 -0
- package/src/channels/shared/harness-client.mjs +72 -5
- package/src/channels/shared/text-harness-bridge.mjs +55 -5
- package/src/channels/shared/workspace-command.mjs +70 -6
- package/src/channels/wecom/wecom-bridge.mjs +52 -4
- package/src/channels/weixin/weixin-api.mjs +1 -1
- package/src/channels/weixin/weixin-bridge.mjs +53 -4
package/README.en.md
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
<h1><img src="assets/logo-icon.png" alt="dsh-im logo" width="40" align="absmiddle" style="vertical-align: middle;"> dsh-im</h1>
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
<div align="center">
|
|
6
|
+
<p><strong>Connect IM bots to DeepSeek Harness with ease</strong></p>
|
|
7
|
+
|
|
8
|
+
<p>
|
|
9
|
+
<a href="LICENSE"><img src="https://img.shields.io/github/license/xmanrui/dsh-im" alt="MIT license"></a>
|
|
10
|
+
<img src="https://img.shields.io/badge/agent-DeepSeek%20Harness-5865f2" alt="DeepSeek Harness">
|
|
11
|
+
<img src="https://dsh-im-random-badge.xmanrui-dsh-im.workers.dev" alt="滑动变祖器:今天是梁子或今天是梁圣(随机)">
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p><a href="README.md">简体中文</a> · <strong>English</strong></p>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Introduction
|
|
20
|
+
|
|
21
|
+
Connect IM bots to DeepSeek Harness by scanning a QR code, using an App Manifest, or entering existing bot credentials. One plugin and one settings entry provide unified management for Feishu, WeChat, DingTalk, WeCom, QQ, Slack, Telegram, Discord, and WhatsApp bots. It also supports switching workspaces and rebinding sessions.
|
|
22
|
+
|
|
23
|
+
## Interface
|
|
24
|
+
|
|
25
|
+

|
|
26
|
+
|
|
27
|
+
## Built-in channels
|
|
28
|
+
|
|
29
|
+
- Feishu: create a bot by QR code or bind an existing bot with App ID + App Secret, then send and receive messages over a persistent connection.
|
|
30
|
+
- WeChat: bind a WeChat bot by scanning a QR code, then send and receive messages through Tencent iLink long polling.
|
|
31
|
+
- DingTalk: create a bot by QR code or bind an existing bot with Client ID + Client Secret, receive messages through DingTalk Stream, and stream Harness replies through AI Cards.
|
|
32
|
+
- WeCom: create an intelligent bot by QR code or bind an existing bot with Bot ID + Secret, receive messages over the official WebSocket connection, and natively show a thinking state, tool progress, and streaming replies.
|
|
33
|
+
- QQ: create a bot by QR code or bind an existing bot with AppID + AppSecret, receive messages over a WebSocket connection, stream private-chat replies with a native typing indicator, and reply in groups when mentioned.
|
|
34
|
+
- Slack: use the bundled App Manifest to create and configure an app, enter its Bot Token (`xoxb-`) and App Token (`xapp-`), receive events over Socket Mode, reply directly in DMs and only when mentioned in channels, and prefer Slack's native streaming-message API for Harness output.
|
|
35
|
+
- Telegram: bind a BotFather-created bot with its Bot Token, receive messages through Bot API long polling, reply directly in private chats, require a mention or reply in groups, and stream Harness output by editing the reply.
|
|
36
|
+
- Discord: bind a Developer Portal bot with its Bot Token, receive events through Gateway v10, reply directly in DMs, require a mention in server channels, and stream Harness output by editing the reply.
|
|
37
|
+
- WhatsApp: scan a QR code to link a WhatsApp device, receive messages over WhatsApp Web, show a native read receipt and typing indicator, and then send the final Harness answer.
|
|
38
|
+
|
|
39
|
+
Other IM platforms can be added through the same channel-adapter structure.
|
|
40
|
+
|
|
41
|
+
## Installation
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
npx -y github:xmanrui/dsh-im install
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Alternatively, install it directly from npm:
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
dsh plugin --profile web add @xmanrui/dsh-im
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Restart `dsh web`, then open **Settings → Plugins → IM Bot**. The installer replaces directly installed `dsh-feishu`, `dsh-weixin`, and `dsh-dingtalk` entries in the profile with `dsh-im` without deleting channel data.
|
|
54
|
+
|
|
55
|
+
Feishu, QQ, DingTalk, and WeCom each provide two entry points. The blue **QR access** action uses the platform QR flow; the key-marked, outlined **Manual access** action immediately to its right connects an existing bot application. Feishu and QQ use App ID + App Secret and AppID + AppSecret respectively, DingTalk uses Client ID + Client Secret, and WeCom uses Bot ID + Secret. Secrets are sent only to the local Harness Host and stored through its protected credential provider; status responses and bot lists never return them.
|
|
56
|
+
|
|
57
|
+
Telegram and Discord do not provide an official QR flow for creating bots, so their pages expose only the key-marked **Manual access** action and request a Bot Token. Generate the Telegram token with BotFather; an existing webhook must be removed by its current service before Bot API long polling can receive updates. Generate the Discord token on the Developer Portal's Bot page, invite the bot to the target server, and grant View Channel, Send Messages, and Read Message History. The plugin reads DMs and server messages that explicitly mention the bot, so it does not request the privileged Message Content intent.
|
|
58
|
+
|
|
59
|
+
Slack provides Manifest-assisted creation with dual-Token access. Choose **Start setup**, copy the bundled App Manifest, open Slack's create page, and select **From a manifest**. Under **Basic Information → App-Level Tokens**, generate an App Token with `connections:write`; then install the app to the workspace under **OAuth & Permissions** to obtain the Bot Token. The plugin validates both Tokens before opening Socket Mode. Slack has no official QR-based bot-creation flow. Both Tokens are sent only to the local Harness Host and stored through its protected credential provider; status responses and bot lists never return them.
|
|
60
|
+
|
|
61
|
+
WhatsApp exposes only **QR access**. On the phone, open **WhatsApp → Settings → Linked devices → Link a device**, then scan the QR code shown by Harness. No Meta console, Cloud API, Webhook, Phone Number ID, or Access Token is required. Linked-device state stays under `~/.dsh/integrations/dsh-whatsapp/auth`; the browser receives only the one-time QR code and redacted account status. Personal accounts can use WhatsApp's **Message yourself** chat directly; the plugin suppresses only its own exact reply message IDs to prevent reply loops.
|
|
62
|
+
|
|
63
|
+
Use a dedicated WhatsApp number for the bot when possible. Linking a personal account makes DMs sent to that account eligible Harness input; group messages trigger only when they mention or reply to the linked account. Limit the number to trusted contacts, and remove the device from both Harness and the phone's **Linked devices** list when it is no longer used.
|
|
64
|
+
|
|
65
|
+
For DingTalk QR binding, scan with an account that belongs to an enterprise or organization and can create bots, then choose **Create a new bot** on the authorization page. If DingTalk reports that the account has not joined an organization, create one or switch to an account that has, then scan again. There is no second local sender-approval flow: the bot's DingTalk visibility is its inbound access scope, so restrict it to trusted organizations, groups, or members.
|
|
66
|
+
|
|
67
|
+
For WeCom QR binding, scan with an account that belongs to an enterprise and can create or manage bots, then confirm creation of the intelligent bot in the mobile app. This creates a WeCom intelligent bot; it does not sign the plugin into a personal WeChat account. For both QR and credential binding, restrict the bot's WeCom visibility to trusted enterprise members and group chats.
|
|
68
|
+
|
|
69
|
+
QQ QR binding uses Tencent's official QQBot v2 flow. Tencent's default authorization page labels the integration as a third-party bot. Scanning creates a QQ Open Platform bot; it does not give the plugin direct control of a personal QQ account. QR binding accepts only the scanner's messages. Manual credentials cannot identify a scanner, so the bot's QQ Open Platform visibility becomes its inbound access scope.
|
|
70
|
+
|
|
71
|
+
Feishu QR binding records the scanner as an allowed user. Manual credentials cannot identify a scanner, so the Feishu application's visibility becomes its inbound access scope. Restrict the application to trusted tenants, groups, or members.
|
|
72
|
+
|
|
73
|
+
Each bot maintains an independent Harness workspace. A newly connected bot records the Harness Host process's current working directory (`process.cwd()`) as its default; the path is persisted and does not change when the Host is later restarted from another directory. Every bot card shows the current path and lets it be edited.
|
|
74
|
+
|
|
75
|
+
## Bot commands
|
|
76
|
+
|
|
77
|
+
| Command | Description |
|
|
78
|
+
| --- | --- |
|
|
79
|
+
| `/workspace <absolute workspace path>` | Switch the current bot's Harness workspace. |
|
|
80
|
+
| `/workspacelist` | List workspace absolute paths that still exist on the current Harness Host. |
|
|
81
|
+
| `/sessionlist [workspace number or absolute path]` | List every registered session ID and title in the selected workspace; omit the argument to use the current workspace. |
|
|
82
|
+
| `/session <Session ID>` | Bind the current chat to an existing Harness session. |
|
|
83
|
+
|
|
84
|
+
Examples: `/workspace /Users/alice/projects/my-app`, `/sessionlist 2`, `/sessionlist /Users/alice/projects/my-app`, or `/session session-id`
|
|
85
|
+
|
|
86
|
+
- The path must be an existing absolute directory. The bot returns an actionable error and the correct usage when validation fails.
|
|
87
|
+
- `/workspacelist` takes no arguments. It combines the Harness global registry with the current bot's path. When that current path still exists and is safe to display, it appears first and is marked as current. Any listed path can be copied directly into `/workspace`.
|
|
88
|
+
- A numeric `/sessionlist` argument uses the same freshly resolved order as `/workspacelist` at command execution time. An absolute path can also select a workspace directly, and the result echoes the resolved path.
|
|
89
|
+
- `/sessionlist` includes every session registered to the selected workspace. Archived sessions are marked as archived; blank and subagent sessions are included when they belong to that workspace; sessions without a title are shown as `No title yet`. Any listed ID can be passed directly to `/session Session ID`.
|
|
90
|
+
- `/session` accepts exactly one Session ID obtained from `/sessionlist`. It neither creates a session nor immediately prompts the model; later messages in the current chat continue the bound session. Regular archived sessions can be bound without being unarchived, while subagent sessions cannot be bound.
|
|
91
|
+
- `/session` locates the session's unique workspace automatically. Binding inside the current workspace replaces only this chat's mapping. A cross-workspace binding switches the bot workspace, clears the old session mappings for all of that bot's chats, and then binds this chat, so it affects the bot's other chats. A reply already being generated may still finish.
|
|
92
|
+
- Workspace switches and session bindings only clear or replace dsh-im chat mappings. They never delete, empty, or archive old Session contents; an old Session can still be listed and bound again.
|
|
93
|
+
- Any user who is already within the platform bot's visibility scope and can normally message it can run these commands; there is no additional administrator/ordinary-user distinction.
|
|
94
|
+
- The list comes from the Harness Host's global registry and can include local absolute paths for other bots, other channels, or non-IM projects. Restrict the bot's visibility to trusted users.
|
|
95
|
+
- Session results also come from the global Harness Host. Session IDs and titles can belong to other bots, other channels, or non-IM projects, and may contain sensitive metadata. Enable these commands only when every user in the bot's visibility scope is trusted.
|
|
96
|
+
- Any user who can run `/session` can continue the selected session and use later messages to write to it or invoke its available tools. Expose the bot and session list only to trusted users.
|
|
97
|
+
- A successful switch clears only the current bot's old Harness session mappings and does not affect other bots.
|
|
98
|
+
- The new workspace applies to subsequent messages; a reply that has already started generating is allowed to finish.
|
|
99
|
+
|
|
100
|
+
## Design
|
|
101
|
+
|
|
102
|
+
- Registers a single **IM Bot** settings page in Harness.
|
|
103
|
+
- Maintains all nine channel Host, client, and runtime sources in this repository without external standalone channel plugins.
|
|
104
|
+
- Follows the DeepSeek Harness language preference and switches the settings UI live between Chinese and English.
|
|
105
|
+
- Uses channel logos for WeChat, Feishu, DingTalk, WeCom, QQ, Slack, Telegram, Discord, and WhatsApp navigation without enable/disable switches.
|
|
106
|
+
- Keeps RPC endpoints, credentials, connection supervision, and session mappings isolated by channel.
|
|
107
|
+
- Returns only QR codes, the public Slack Manifest, and redacted status data to the browser. Manually entered secrets and Tokens travel one way to the local Host; no RPC response returns App Secrets, `bot_token`, DingTalk `client_secret`, WeCom Secrets, QQ `app_secret`, Slack Bot/App Tokens, Telegram/Discord Bot Tokens, WhatsApp linked-device keys, or raw user identifiers.
|
|
108
|
+
|
|
109
|
+
## Local development
|
|
110
|
+
|
|
111
|
+
```sh
|
|
112
|
+
npm install
|
|
113
|
+
npm run check
|
|
114
|
+
node bin/dsh-im.mjs install --source .
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
`npm run check` runs unit tests, builds the Host and Client artifacts, and verifies that the published package contains neither credentials nor standalone channel settings-page registrations.
|
|
118
|
+
|
|
119
|
+
IM management RPCs accept loopback browsers by default. When a Web profile is deliberately served on a trusted LAN, opt the plugin into the Host authorities already trusted by Connection in that profile's `cordis.patch.yml`:
|
|
120
|
+
|
|
121
|
+
```yaml
|
|
122
|
+
- id: xmanrui-dsh-im
|
|
123
|
+
config:
|
|
124
|
+
rpcAuthority: trusted-host
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
`trusted-host` reuses Harness's Host/Origin fence; it is not user authentication. Anyone who can reach that LAN authority can inspect bot status, scan or submit application credentials, reconnect bots, and remove bots. Enable it only on a trusted network.
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Contact
|
|
132
|
+
|
|
133
|
+
You can reach me by email, WeChat, or Xiaohongshu.
|
|
134
|
+
|
|
135
|
+
<table>
|
|
136
|
+
<tr>
|
|
137
|
+
<th align="center">Email</th>
|
|
138
|
+
<th align="center">WeChat</th>
|
|
139
|
+
<th align="center">Xiaohongshu</th>
|
|
140
|
+
</tr>
|
|
141
|
+
<tr>
|
|
142
|
+
<td align="center" valign="middle">
|
|
143
|
+
<a href="mailto:longmanr307@gmail.com">longmanr307@gmail.com</a>
|
|
144
|
+
</td>
|
|
145
|
+
<td align="center" valign="top">
|
|
146
|
+
<a href="docs/images/weixin.jpg"><img src="docs/images/weixin.jpg" alt="WeChat QR code" width="240"></a>
|
|
147
|
+
</td>
|
|
148
|
+
<td align="center" valign="top">
|
|
149
|
+
<a href="docs/images/xhs.jpg"><img src="docs/images/xhs.jpg" alt="Xiaohongshu QR code" width="240"></a>
|
|
150
|
+
</td>
|
|
151
|
+
</tr>
|
|
152
|
+
</table>
|
package/README.md
CHANGED
|
@@ -1,17 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
<h1><img src="assets/logo-icon.png" alt="dsh-im logo" width="40" align="absmiddle" style="vertical-align: middle;"> dsh-im</h1>
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
<div align="center">
|
|
6
|
+
<p><strong>让聊天机器人轻松接入 DeepSeek Harness</strong></p>
|
|
7
|
+
<p><strong>Connect IM bots to DeepSeek Harness with ease</strong></p>
|
|
6
8
|
|
|
7
|
-
<p
|
|
8
|
-
<
|
|
9
|
+
<p>
|
|
10
|
+
<a href="LICENSE"><img src="https://img.shields.io/github/license/xmanrui/dsh-im" alt="MIT 许可证"></a>
|
|
11
|
+
<img src="https://img.shields.io/badge/agent-DeepSeek%20Harness-5865f2" alt="DeepSeek Harness">
|
|
12
|
+
<img src="https://dsh-im-random-badge.xmanrui-dsh-im.workers.dev" alt="滑动变祖器:今天是梁子或今天是梁圣(随机)">
|
|
13
|
+
</p>
|
|
9
14
|
|
|
10
|
-
|
|
15
|
+
<p><strong>简体中文</strong> · <a href="README.en.md">English</a></p>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
---
|
|
11
19
|
|
|
12
|
-
|
|
20
|
+
## 简介
|
|
13
21
|
|
|
14
|
-
|
|
22
|
+
通过扫码、App Manifest 或已有机器人凭据把 IM 机器人接入 DeepSeek Harness。一个插件、一个设置入口,统一管理飞书、微信、钉钉、企业微信、QQ、Slack、Telegram、Discord 和 WhatsApp 机器人。支持切换工作区和重新绑定会话。
|
|
23
|
+
|
|
24
|
+
Connect IM bots to DeepSeek Harness by scanning a QR code, using an App Manifest, or entering existing bot credentials. One plugin and one settings entry provide unified management for Feishu, WeChat, DingTalk, WeCom, QQ, Slack, Telegram, Discord, and WhatsApp bots. It also supports switching workspaces and rebinding sessions.
|
|
15
25
|
|
|
16
26
|
## 界面
|
|
17
27
|
|
|
@@ -121,141 +131,25 @@ IM 管理 RPC 默认仅接受回环浏览器。如果 Web profile 在受信任
|
|
|
121
131
|
|
|
122
132
|
---
|
|
123
133
|
|
|
124
|
-
##
|
|
125
|
-
|
|
126
|
-
Connect IM bots to DeepSeek Harness by scanning a QR code, using an App Manifest, or entering existing bot credentials. One plugin and one settings entry provide unified management for Feishu, WeChat, DingTalk, WeCom, QQ, Slack, Telegram, Discord, and WhatsApp bots.
|
|
127
|
-
|
|
128
|
-
> GitHub description: Connect IM bots to DeepSeek Harness by QR code, App Manifest, or bot credentials (supports Feishu, WeChat, DingTalk, WeCom, QQ, Slack, Telegram, Discord, and WhatsApp).
|
|
129
|
-
|
|
130
|
-
## Interface
|
|
131
|
-
|
|
132
|
-

|
|
133
|
-
|
|
134
|
-
## Built-in channels
|
|
135
|
-
|
|
136
|
-
- Feishu: create a bot by QR code or bind an existing bot with App ID + App Secret, then send and receive messages over a persistent connection.
|
|
137
|
-
- WeChat: bind a WeChat bot by scanning a QR code, then send and receive messages through Tencent iLink long polling.
|
|
138
|
-
- DingTalk: create a bot by QR code or bind an existing bot with Client ID + Client Secret, receive messages through DingTalk Stream, and stream Harness replies through AI Cards.
|
|
139
|
-
- WeCom: create an intelligent bot by QR code or bind an existing bot with Bot ID + Secret, receive messages over the official WebSocket connection, and natively show a thinking state, tool progress, and streaming replies.
|
|
140
|
-
- QQ: create a bot by QR code or bind an existing bot with AppID + AppSecret, receive messages over a WebSocket connection, stream private-chat replies with a native typing indicator, and reply in groups when mentioned.
|
|
141
|
-
- Slack: use the bundled App Manifest to create and configure an app, enter its Bot Token (`xoxb-`) and App Token (`xapp-`), receive events over Socket Mode, reply directly in DMs and only when mentioned in channels, and prefer Slack's native streaming-message API for Harness output.
|
|
142
|
-
- Telegram: bind a BotFather-created bot with its Bot Token, receive messages through Bot API long polling, reply directly in private chats, require a mention or reply in groups, and stream Harness output by editing the reply.
|
|
143
|
-
- Discord: bind a Developer Portal bot with its Bot Token, receive events through Gateway v10, reply directly in DMs, require a mention in server channels, and stream Harness output by editing the reply.
|
|
144
|
-
- WhatsApp: scan a QR code to link a WhatsApp device, receive messages over WhatsApp Web, show a native read receipt and typing indicator, and then send the final Harness answer.
|
|
145
|
-
|
|
146
|
-
Other IM platforms can be added through the same channel-adapter structure.
|
|
147
|
-
|
|
148
|
-
## Installation
|
|
149
|
-
|
|
150
|
-
```sh
|
|
151
|
-
npx -y github:xmanrui/dsh-im install
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
Alternatively, install it directly from npm:
|
|
155
|
-
|
|
156
|
-
```sh
|
|
157
|
-
dsh plugin --profile web add @xmanrui/dsh-im
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
Restart `dsh web`, then open **Settings → Plugins → IM Bot**. The installer replaces directly installed `dsh-feishu`, `dsh-weixin`, and `dsh-dingtalk` entries in the profile with `dsh-im` without deleting channel data.
|
|
161
|
-
|
|
162
|
-
Feishu, QQ, DingTalk, and WeCom each provide two entry points. The blue **QR access** action uses the platform QR flow; the key-marked, outlined **Manual access** action immediately to its right connects an existing bot application. Feishu and QQ use App ID + App Secret and AppID + AppSecret respectively, DingTalk uses Client ID + Client Secret, and WeCom uses Bot ID + Secret. Secrets are sent only to the local Harness Host and stored through its protected credential provider; status responses and bot lists never return them.
|
|
163
|
-
|
|
164
|
-
Telegram and Discord do not provide an official QR flow for creating bots, so their pages expose only the key-marked **Manual access** action and request a Bot Token. Generate the Telegram token with BotFather; an existing webhook must be removed by its current service before Bot API long polling can receive updates. Generate the Discord token on the Developer Portal's Bot page, invite the bot to the target server, and grant View Channel, Send Messages, and Read Message History. The plugin reads DMs and server messages that explicitly mention the bot, so it does not request the privileged Message Content intent.
|
|
165
|
-
|
|
166
|
-
Slack provides Manifest-assisted creation with dual-Token access. Choose **Start setup**, copy the bundled App Manifest, open Slack's create page, and select **From a manifest**. Under **Basic Information → App-Level Tokens**, generate an App Token with `connections:write`; then install the app to the workspace under **OAuth & Permissions** to obtain the Bot Token. The plugin validates both Tokens before opening Socket Mode. Slack has no official QR-based bot-creation flow. Both Tokens are sent only to the local Harness Host and stored through its protected credential provider; status responses and bot lists never return them.
|
|
167
|
-
|
|
168
|
-
WhatsApp exposes only **QR access**. On the phone, open **WhatsApp → Settings → Linked devices → Link a device**, then scan the QR code shown by Harness. No Meta console, Cloud API, Webhook, Phone Number ID, or Access Token is required. Linked-device state stays under `~/.dsh/integrations/dsh-whatsapp/auth`; the browser receives only the one-time QR code and redacted account status. Personal accounts can use WhatsApp's **Message yourself** chat directly; the plugin suppresses only its own exact reply message IDs to prevent reply loops.
|
|
169
|
-
|
|
170
|
-
Use a dedicated WhatsApp number for the bot when possible. Linking a personal account makes DMs sent to that account eligible Harness input; group messages trigger only when they mention or reply to the linked account. Limit the number to trusted contacts, and remove the device from both Harness and the phone's **Linked devices** list when it is no longer used.
|
|
171
|
-
|
|
172
|
-
For DingTalk QR binding, scan with an account that belongs to an enterprise or organization and can create bots, then choose **Create a new bot** on the authorization page. If DingTalk reports that the account has not joined an organization, create one or switch to an account that has, then scan again. There is no second local sender-approval flow: the bot's DingTalk visibility is its inbound access scope, so restrict it to trusted organizations, groups, or members.
|
|
173
|
-
|
|
174
|
-
For WeCom QR binding, scan with an account that belongs to an enterprise and can create or manage bots, then confirm creation of the intelligent bot in the mobile app. This creates a WeCom intelligent bot; it does not sign the plugin into a personal WeChat account. For both QR and credential binding, restrict the bot's WeCom visibility to trusted enterprise members and group chats.
|
|
175
|
-
|
|
176
|
-
QQ QR binding uses Tencent's official QQBot v2 flow. Tencent's default authorization page labels the integration as a third-party bot. Scanning creates a QQ Open Platform bot; it does not give the plugin direct control of a personal QQ account. QR binding accepts only the scanner's messages. Manual credentials cannot identify a scanner, so the bot's QQ Open Platform visibility becomes its inbound access scope.
|
|
177
|
-
|
|
178
|
-
Feishu QR binding records the scanner as an allowed user. Manual credentials cannot identify a scanner, so the Feishu application's visibility becomes its inbound access scope. Restrict the application to trusted tenants, groups, or members.
|
|
179
|
-
|
|
180
|
-
Each bot maintains an independent Harness workspace. A newly connected bot records the Harness Host process's current working directory (`process.cwd()`) as its default; the path is persisted and does not change when the Host is later restarted from another directory. Every bot card shows the current path and lets it be edited.
|
|
181
|
-
|
|
182
|
-
## Bot commands
|
|
183
|
-
|
|
184
|
-
| Command | Description |
|
|
185
|
-
| --- | --- |
|
|
186
|
-
| `/workspace <absolute workspace path>` | Switch the current bot's Harness workspace. |
|
|
187
|
-
| `/workspacelist` | List workspace absolute paths that still exist on the current Harness Host. |
|
|
188
|
-
| `/sessionlist [workspace number or absolute path]` | List every registered session ID and title in the selected workspace; omit the argument to use the current workspace. |
|
|
189
|
-
| `/session <Session ID>` | Bind the current chat to an existing Harness session. |
|
|
190
|
-
|
|
191
|
-
Examples: `/workspace /Users/alice/projects/my-app`, `/sessionlist 2`, `/sessionlist /Users/alice/projects/my-app`, or `/session session-id`
|
|
192
|
-
|
|
193
|
-
- The path must be an existing absolute directory. The bot returns an actionable error and the correct usage when validation fails.
|
|
194
|
-
- `/workspacelist` takes no arguments. It combines the Harness global registry with the current bot's path. When that current path still exists and is safe to display, it appears first and is marked as current. Any listed path can be copied directly into `/workspace`.
|
|
195
|
-
- A numeric `/sessionlist` argument uses the same freshly resolved order as `/workspacelist` at command execution time. An absolute path can also select a workspace directly, and the result echoes the resolved path.
|
|
196
|
-
- `/sessionlist` includes every session registered to the selected workspace. Archived sessions are marked as archived; blank and subagent sessions are included when they belong to that workspace; sessions without a title are shown as `No title yet`. Any listed ID can be passed directly to `/session Session ID`.
|
|
197
|
-
- `/session` accepts exactly one Session ID obtained from `/sessionlist`. It neither creates a session nor immediately prompts the model; later messages in the current chat continue the bound session. Regular archived sessions can be bound without being unarchived, while subagent sessions cannot be bound.
|
|
198
|
-
- `/session` locates the session's unique workspace automatically. Binding inside the current workspace replaces only this chat's mapping. A cross-workspace binding switches the bot workspace, clears the old session mappings for all of that bot's chats, and then binds this chat, so it affects the bot's other chats. A reply already being generated may still finish.
|
|
199
|
-
- Workspace switches and session bindings only clear or replace dsh-im chat mappings. They never delete, empty, or archive old Session contents; an old Session can still be listed and bound again.
|
|
200
|
-
- Any user who is already within the platform bot's visibility scope and can normally message it can run these commands; there is no additional administrator/ordinary-user distinction.
|
|
201
|
-
- The list comes from the Harness Host's global registry and can include local absolute paths for other bots, other channels, or non-IM projects. Restrict the bot's visibility to trusted users.
|
|
202
|
-
- Session results also come from the global Harness Host. Session IDs and titles can belong to other bots, other channels, or non-IM projects, and may contain sensitive metadata. Enable these commands only when every user in the bot's visibility scope is trusted.
|
|
203
|
-
- Any user who can run `/session` can continue the selected session and use later messages to write to it or invoke its available tools. Expose the bot and session list only to trusted users.
|
|
204
|
-
- A successful switch clears only the current bot's old Harness session mappings and does not affect other bots.
|
|
205
|
-
- The new workspace applies to subsequent messages; a reply that has already started generating is allowed to finish.
|
|
206
|
-
|
|
207
|
-
## Design
|
|
208
|
-
|
|
209
|
-
- Registers a single **IM Bot** settings page in Harness.
|
|
210
|
-
- Maintains all nine channel Host, client, and runtime sources in this repository without external standalone channel plugins.
|
|
211
|
-
- Follows the DeepSeek Harness language preference and switches the settings UI live between Chinese and English.
|
|
212
|
-
- Uses channel logos for WeChat, Feishu, DingTalk, WeCom, QQ, Slack, Telegram, Discord, and WhatsApp navigation without enable/disable switches.
|
|
213
|
-
- Keeps RPC endpoints, credentials, connection supervision, and session mappings isolated by channel.
|
|
214
|
-
- Returns only QR codes, the public Slack Manifest, and redacted status data to the browser. Manually entered secrets and Tokens travel one way to the local Host; no RPC response returns App Secrets, `bot_token`, DingTalk `client_secret`, WeCom Secrets, QQ `app_secret`, Slack Bot/App Tokens, Telegram/Discord Bot Tokens, WhatsApp linked-device keys, or raw user identifiers.
|
|
215
|
-
|
|
216
|
-
## Local development
|
|
217
|
-
|
|
218
|
-
```sh
|
|
219
|
-
npm install
|
|
220
|
-
npm run check
|
|
221
|
-
node bin/dsh-im.mjs install --source .
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
`npm run check` runs unit tests, builds the Host and Client artifacts, and verifies that the published package contains neither credentials nor standalone channel settings-page registrations.
|
|
225
|
-
|
|
226
|
-
IM management RPCs accept loopback browsers by default. When a Web profile is deliberately served on a trusted LAN, opt the plugin into the Host authorities already trusted by Connection in that profile's `cordis.patch.yml`:
|
|
227
|
-
|
|
228
|
-
```yaml
|
|
229
|
-
- id: xmanrui-dsh-im
|
|
230
|
-
config:
|
|
231
|
-
rpcAuthority: trusted-host
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
`trusted-host` reuses Harness's Host/Origin fence; it is not user authentication. Anyone who can reach that LAN authority can inspect bot status, scan or submit application credentials, reconnect bots, and remove bots. Enable it only on a trusted network.
|
|
235
|
-
|
|
236
|
-
---
|
|
237
|
-
|
|
238
|
-
## 联系方式 / Contact
|
|
134
|
+
## 联系方式
|
|
239
135
|
|
|
240
136
|
欢迎通过邮箱、微信或小红书联系我。
|
|
241
137
|
|
|
242
|
-
You can reach me by email, WeChat, or Xiaohongshu.
|
|
243
|
-
|
|
244
138
|
<table>
|
|
245
139
|
<tr>
|
|
246
|
-
<th align="center"
|
|
247
|
-
<th align="center"
|
|
248
|
-
<th align="center"
|
|
140
|
+
<th align="center">邮箱</th>
|
|
141
|
+
<th align="center">微信</th>
|
|
142
|
+
<th align="center">小红书</th>
|
|
249
143
|
</tr>
|
|
250
144
|
<tr>
|
|
251
145
|
<td align="center" valign="middle">
|
|
252
146
|
<a href="mailto:longmanr307@gmail.com">longmanr307@gmail.com</a>
|
|
253
147
|
</td>
|
|
254
148
|
<td align="center" valign="top">
|
|
255
|
-
<a href="docs/images/weixin.jpg"><img src="docs/images/weixin.jpg" alt="微信二维码
|
|
149
|
+
<a href="docs/images/weixin.jpg"><img src="docs/images/weixin.jpg" alt="微信二维码" width="240"></a>
|
|
256
150
|
</td>
|
|
257
151
|
<td align="center" valign="top">
|
|
258
|
-
<a href="docs/images/xhs.jpg"><img src="docs/images/xhs.jpg" alt="小红书二维码
|
|
152
|
+
<a href="docs/images/xhs.jpg"><img src="docs/images/xhs.jpg" alt="小红书二维码" width="240"></a>
|
|
259
153
|
</td>
|
|
260
154
|
</tr>
|
|
261
155
|
</table>
|