@michengai/dsh-im-connect 0.1.67 → 0.1.69
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 +17 -1
- package/CHANGELOG.zh-CN.md +17 -1
- package/README.md +37 -15
- package/README.zh-CN.md +38 -15
- package/SECURITY.md +2 -2
- package/assets/brands/discord-symbol.svg +3 -0
- package/assets/brands/slack-hash.png +0 -0
- package/assets/brands/slack-hash.svg +6 -0
- package/assets/brands//346/235/245/346/272/220.txt +14 -0
- package/client.js +45 -12
- package/lib/channels/channel-image-download.d.ts +3 -1
- package/lib/channels/channel-image-download.d.ts.map +1 -1
- package/lib/channels/channel-image-download.js +37 -3
- package/lib/channels/channel-image-download.js.map +1 -1
- package/lib/channels/factory.d.ts.map +1 -1
- package/lib/channels/factory.js +4 -0
- package/lib/channels/factory.js.map +1 -1
- package/lib/channels/meta.d.ts.map +1 -1
- package/lib/channels/meta.js +11 -0
- package/lib/channels/meta.js.map +1 -1
- package/lib/channels/slack-markdown.d.ts +34 -0
- package/lib/channels/slack-markdown.d.ts.map +1 -0
- package/lib/channels/slack-markdown.js +161 -0
- package/lib/channels/slack-markdown.js.map +1 -0
- package/lib/channels/slack.d.ts +106 -0
- package/lib/channels/slack.d.ts.map +1 -0
- package/lib/channels/slack.js +804 -0
- package/lib/channels/slack.js.map +1 -0
- package/lib/client.js +52 -13
- package/lib/engine/session-id.d.ts +1 -1
- package/lib/engine/session-id.d.ts.map +1 -1
- package/lib/engine/session-id.js +1 -1
- package/lib/engine/session-id.js.map +1 -1
- package/package.json +1 -1
- package/src/channels/channel-image-download.ts +30 -2
- package/src/channels/factory.ts +3 -0
- package/src/channels/meta.ts +11 -0
- package/src/channels/slack-markdown.ts +162 -0
- package/src/channels/slack.ts +828 -0
- package/src/engine/session-id.ts +2 -2
- package/src/plugin-update-ui.js +7 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,23 @@
|
|
|
4
4
|
|
|
5
5
|
Recent published versions are listed below. Git tags and GitHub Releases now mirror these entries; historical sections retain links to their original release commits.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## 0.1.69 - 2026-10-08
|
|
8
|
+
|
|
9
|
+
- New Slack channel. Add a Bot Token and an App Token on the Slack card in **Settings → IM Assistant**; it connects over Socket Mode and needs no public URL.
|
|
10
|
+
- Slack DMs still use the allowlist. Mentions in public and private channels answer inside that message's thread. The 512 most recently joined threads are saved per account, so follow-ups still need no mention after a restart. Switching the bot identity does not inherit the old records. Multi-person DMs are not supported.
|
|
11
|
+
- Outgoing text is converted to Slack mrkdwn: headings become bold whole lines, Markdown tables go vertical, `**bold**` becomes `*bold*`, links become `<url|label>`, and code fences stay untouched. Long replies split with structure awareness.
|
|
12
|
+
- Native button choices, emoji status reactions, image and file transfer, `/stop`, approvals, and interactive questions are supported; **Diagnose connection** verifies bot identity.
|
|
13
|
+
- Existing channels are unaffected: Slack uses its own channel id `slack`, and its sessions stay separate from web tasks.
|
|
14
|
+
- Slack and Discord icons now use the official marks instead of a gray dot.
|
|
15
|
+
- Opening IM Assistant no longer expands WeChat by default. Every channel starts collapsed.
|
|
16
|
+
- Slack accepts `!help`, `!m`, and fullwidth `/help` the same way Discord does. An unknown `!hello` stays an ordinary message. A slash command that opens a channel thread counts as participation, so a later reply in that thread needs no new mention.
|
|
17
|
+
- Slack choice cards keep the full text and the closed status. If delivery is unknown, the plugin does not send a second copy.
|
|
18
|
+
- Restart DSH and refresh the page after upgrading.
|
|
19
|
+
|
|
20
|
+
## 0.1.68 - 2026-10-08
|
|
21
|
+
|
|
22
|
+
- The channel sidebar keeps its layout when another plugin reloads. Its runtime styles now belong to this plugin.
|
|
23
|
+
- Restart DSH and refresh the page after upgrading.
|
|
8
24
|
|
|
9
25
|
## 0.1.67 - 2026-10-08
|
|
10
26
|
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -4,7 +4,23 @@
|
|
|
4
4
|
|
|
5
5
|
以下记录近期发布的版本。Git 标签与 GitHub Release 现已和这些条目同步;历史条目继续保留原始发布提交链接。
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## 0.1.69 - 2026-10-08
|
|
8
|
+
|
|
9
|
+
- 新增 Slack 渠道。在「设置 → IM助理」的 Slack 卡片里填 Bot Token 与 App Token 即可连接,走 Socket Mode 长连接,不需要公网地址。
|
|
10
|
+
- Slack 私聊直接回复,并仍走私聊白名单;公开频道和私有频道被 @ 后在该消息的线程内回复。最近参与的 512 个线程按账号保存,重启后可继续免 @ 追问;更换机器人身份不会继承旧记录。多人私聊这次不支持。
|
|
11
|
+
- 正文转成 Slack mrkdwn:标题变整行粗体、Markdown 表格竖排、`**粗体**` 变 `*粗体*`、链接变 `<地址|文字>`,代码块内容保持原样。长回复按结构分片。
|
|
12
|
+
- 支持原生按钮选择、表情状态回应、图片与文件收发、`/stop`、审批和交互问题;账号设置里的「诊断连接」会校验机器人身份。
|
|
13
|
+
- 新增渠道不影响已有渠道:Slack 使用独立的渠道标识 `slack`,会话与网页任务照样分列。
|
|
14
|
+
- Slack 和 Discord 的图标改用官方标,不再显示灰圆点。
|
|
15
|
+
- 打开「IM助理」时不再默认展开微信,各渠道都先收起。
|
|
16
|
+
- Slack 也可像 Discord 一样用 `!help`、`!m` 或全角 `/help` 发命令;未知的 `!hello` 仍是普通消息。斜杠命令开出的线程会计入已参与线程,之后直接追问不必再 @。
|
|
17
|
+
- Slack 长按钮卡片会保留完整正文和关闭状态。交付结果未知时不会再自动补发一条。
|
|
18
|
+
- 升级后请重启 DSH 并刷新页面。
|
|
19
|
+
|
|
20
|
+
## 0.1.68 - 2026-10-08
|
|
21
|
+
|
|
22
|
+
- 其它插件重载后,频道侧栏不再丢失排版。运行期样式表现在归属本插件。
|
|
23
|
+
- 升级后请重启 DSH 并刷新页面。
|
|
8
24
|
|
|
9
25
|
## 0.1.67 - 2026-10-08
|
|
10
26
|
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# DSH IM Connect
|
|
8
8
|
|
|
9
|
-
**Connect Feishu, Lark, DingTalk, WeCom, WeChat, QQ, Telegram, and
|
|
9
|
+
**Connect Feishu, Lark, DingTalk, WeCom, WeChat, QQ, Telegram, Discord, and Slack to local DeepSeek Harness**
|
|
10
10
|
|
|
11
11
|
[简体中文](README.zh-CN.md) · [Changelog](CHANGELOG.md) · [Apache-2.0](LICENSE)
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@
|
|
|
15
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
|
-
[](#-supported-channels)
|
|
19
19
|
</div>
|
|
20
20
|
|
|
21
21
|
> DSH IM Connect is a community-maintained DeepSeek Harness (DSH) plugin, not an official DeepSeek AI product.
|
|
@@ -24,7 +24,7 @@
|
|
|
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
|
-
- **Connect familiar platforms**: DingTalk, Feishu, Lark, WeChat, WeCom, QQ, Telegram, and
|
|
27
|
+
- **Connect familiar platforms**: DingTalk, Feishu, Lark, WeChat, WeCom, QQ, Telegram, Discord, and Slack.
|
|
28
28
|
- **Configure accounts separately**: each account has its own workspace, model, reasoning effort, permissions, and private-access mode.
|
|
29
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
30
|
- **Keep chat records separate**: each IM chat has its own session under **Channels** in the web workspace.
|
|
@@ -42,7 +42,7 @@ Inbound messages are identified before commands, tool approvals, or injection.
|
|
|
42
42
|
| DM from the QR scanner | WeChat / Feishu / Lark / QQ scanners are allowlisted automatically |
|
|
43
43
|
| DM from anyone else | Appears on the settings pending list until approved |
|
|
44
44
|
| DM after QR binding that does not return user identity | DingTalk / WeCom QR setup returns bot credentials only, so the scanner still needs settings approval |
|
|
45
|
-
| DM after manual credentials | Telegram, Discord, and DingTalk / WeCom / QQ bound manually, require approval for every DM |
|
|
45
|
+
| DM after manual credentials | Telegram, Discord, Slack, and DingTalk / WeCom / QQ bound manually, require approval for every DM |
|
|
46
46
|
| DM without a userId | Denied |
|
|
47
47
|
| Tool approval | Reply `Approve` / `Deny` (or `批准` / `拒绝`) in the chat bound to that session; works in DMs and groups, and never falls back to the web. No reply within 5 minutes cancels the action, and other text is not queued behind it |
|
|
48
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 |
|
|
@@ -59,7 +59,8 @@ WeChat is QR-only and DM-only, so the same WeChat account that scanned can talk
|
|
|
59
59
|
<code>🏢 WeCom</code>
|
|
60
60
|
<code>🐧 QQ</code>
|
|
61
61
|
<code>✈️ Telegram</code>
|
|
62
|
-
<code>🎮 Discord</code
|
|
62
|
+
<code>🎮 Discord</code>
|
|
63
|
+
<code>🧩 Slack</code>
|
|
63
64
|
</p>
|
|
64
65
|
|
|
65
66
|
| Channel | Status | How to connect | You need |
|
|
@@ -72,14 +73,15 @@ WeChat is QR-only and DM-only, so the same WeChat account that scanned can talk
|
|
|
72
73
|
| 🐧 **QQ** | ✅ Ready | QR, or AppID / AppSecret | QQ Open Platform bot, not a personal QQ account |
|
|
73
74
|
| ✈️ **Telegram** | ✅ Ready | Bot Token only | `@BotFather`; do not enable Webhook on the same bot |
|
|
74
75
|
| 🎮 **Discord** | ✅ Ready | Bot Token only | Official Developer Portal bot. Enable the Message Content Intent. The first mention in a text or announcement channel continues in a thread without another mention |
|
|
76
|
+
| 🧩 **Slack** | ✅ Ready | Bot Token and App Token | Create an app at api.slack.com and enable Socket Mode. DMs reply directly; channel mentions reply inside that message's thread, and later replies in the thread need no new mention |
|
|
75
77
|
|
|
76
|
-
✅ Ready = text in and out works | *WeChat = official iLink only, no reverse-engineered personal protocol | Groups still require an @ mention. Discord skips repeat mentions only inside a thread the bot created
|
|
78
|
+
✅ Ready = text in and out works | *WeChat = official iLink only, no reverse-engineered personal protocol | Groups still require an @ mention. Discord skips repeat mentions only inside a thread the bot created; Slack skips them inside a thread the bot already joined
|
|
77
79
|
|
|
78
80
|
## Image input
|
|
79
81
|
|
|
80
82
|
Image input follows DSH Chat's model-capability and attachment rules rather than guessing vision support from model names:
|
|
81
83
|
|
|
82
|
-
The receive paths cover WeChat, WeCom, DingTalk, Feishu, Lark, QQ, Telegram, and
|
|
84
|
+
The receive paths cover WeChat, WeCom, DingTalk, Feishu, Lark, QQ, Telegram, Discord, and Slack. See the [image-input verification guide](docs/image-input.md) for protocol forms and live checks.
|
|
83
85
|
|
|
84
86
|
- Use the model currently selected for the IM session, not just the global default.
|
|
85
87
|
- When the model declares `image` support, store images as standard DSH attachments and submit image content to the model. Session history keeps image references rather than only local-path text.
|
|
@@ -89,7 +91,7 @@ The receive paths cover WeChat, WeCom, DingTalk, Feishu, Lark, QQ, Telegram, and
|
|
|
89
91
|
|
|
90
92
|
## File input
|
|
91
93
|
|
|
92
|
-
WeChat, WeCom, DingTalk, Feishu, Lark, QQ, Telegram, and
|
|
94
|
+
WeChat, WeCom, DingTalk, Feishu, Lark, QQ, Telegram, Discord, and Slack accept ordinary files through Chat’s upload service for the current session. Send PDFs, documents or spreadsheets for the assistant to process. Format support follows web Chat’s models, tools and file capabilities; uploading does not guarantee that every format can be understood directly.
|
|
93
95
|
|
|
94
96
|
- Requires the file-upload service in DSH `0.1.5-rc.1`, `0.1.5-rc.2`, `0.1.5-rc.3`, `0.1.7-rc.1`, `0.1.7-rc.2`, `0.2.0-rc.1`, or `0.2.0-rc.2`. On `0.1.2-rc.1`, file input asks you to upgrade; existing text and image support is unchanged.
|
|
95
97
|
- Up to 4 ordinary files per message, totaling 20 MiB. Channel download limits also apply.
|
|
@@ -99,7 +101,7 @@ WeChat, WeCom, DingTalk, Feishu, Lark, QQ, Telegram, and Discord accept ordinary
|
|
|
99
101
|
|
|
100
102
|
## File delivery
|
|
101
103
|
|
|
102
|
-
WeChat, WeCom, DingTalk, Feishu, Lark, QQ, Telegram, and
|
|
104
|
+
WeChat, WeCom, DingTalk, Feishu, Lark, QQ, Telegram, Discord, and Slack can return files produced by the assistant. For example: “Create a PDF report and send me the file.”
|
|
103
105
|
|
|
104
106
|
- 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.
|
|
105
107
|
- File access follows Chat: files outside the workspace are allowed when the host can read them. The plugin does not extract arbitrary paths from reply text. Files created through shell commands need to be presented explicitly.
|
|
@@ -119,7 +121,7 @@ Menus include previous, next and back actions. WeCom menus paginate to fit card
|
|
|
119
121
|
|
|
120
122
|
Common command replies offer related next steps: for example, `/model` → select a model / adjust reasoning → back to menu. Supported channels offer buttons; text replies include the commands to send. Navigation buttons on ordinary result replies do not accept numeric shortcuts, so numbers remain chat input; only selection menus accept numbered replies. Oversized cards fall back to complete text.
|
|
121
123
|
|
|
122
|
-
DingTalk, Telegram, Discord, and Feishu/Lark use native buttons. WeCom uses cards when button count and text length fit platform limits. Other cases, QQ and WeChat use numbered text. Explicit rejections and capacity limits fall back to complete text. Uncertain network delivery produces a confirmation notice instead of resending the card. Menus are scoped to the account, chat, operator and session, expire after 15 minutes or restart, and recheck permissions on selection. Used buttons cannot execute again.
|
|
124
|
+
DingTalk, Telegram, Discord, Slack, and Feishu/Lark use native buttons. WeCom uses cards when button count and text length fit platform limits. Other cases, QQ and WeChat use numbered text. Explicit rejections and capacity limits fall back to complete text. Uncertain network delivery produces a confirmation notice instead of resending the card. Menus are scoped to the account, chat, operator and session, expire after 15 minutes or restart, and recheck permissions on selection. Used buttons cannot execute again.
|
|
123
125
|
|
|
124
126
|
Approvals and questions use the same native-button channels: allow once/reject, single-choice selection, and multiple selections followed by submit. Open questions retain text input. Approvals always stay in the chat that started the task and never fall back to the web; a failed prompt is treated as a denial. If nobody approves or rejects within 5 minutes, the action is canceled and the chat is told it did not run. Other text during that wait is reminded to finish the approval and is not submitted as the next turn. Images and files are still submitted as content and are not treated as the approval reply. In groups only the task initiator can approve; DMs add no extra restriction beyond chatting. Disabling commands does not disable pending approvals or questions. Questions have no such timeout; the next text message is still the answer.
|
|
125
127
|
|
|
@@ -138,13 +140,14 @@ Regular chat messages follow the actual task state. Commands continue to use tex
|
|
|
138
140
|
- Feishu / Lark: reactions indicate processing, done, or failed. Waiting keeps the processing reaction; cancellation removes it.
|
|
139
141
|
- Telegram: 👀 processing, 🤔 waiting for confirmation, 👍 done, and 👎 failed. Cancellation removes the reaction. Typing is refreshed while processing.
|
|
140
142
|
- Discord: uses the same reactions and edits one message as the answer streams. Typing is refreshed while processing. Cancellation removes the reaction.
|
|
143
|
+
- Slack: ✅ done, ❌ failed, 🤔 waiting, and 👀 processing are added as emoji reactions on the original message (requires `reactions:write`). Answers stream by editing one message; Slack has no bot typing indicator.
|
|
141
144
|
- WeChat: typing is refreshed while processing and stopped when finished or waiting for confirmation. WeCom and QQ retain their existing reply behavior.
|
|
142
145
|
|
|
143
146
|
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.
|
|
144
147
|
|
|
145
148
|
## Connection diagnostics
|
|
146
149
|
|
|
147
|
-
Use **Diagnose connection** in account settings to query platform APIs: WeChat configuration, a ping acknowledgement on the existing WeCom connection, DingTalk credentials, Feishu/Lark credentials and bot identity, QQ credentials and gateway, Telegram bot identity and Webhook conflicts,
|
|
150
|
+
Use **Diagnose connection** in account settings to query platform APIs: WeChat configuration, a ping acknowledgement on the existing WeCom connection, DingTalk credentials, Feishu/Lark credentials and bot identity, QQ credentials and gateway, Telegram bot identity and Webhook conflicts, Discord bot identity and Gateway URL, or Slack bot identity plus Socket Mode state when a connection already exists (no new connection is opened).
|
|
148
151
|
|
|
149
152
|
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).
|
|
150
153
|
|
|
@@ -238,7 +241,7 @@ Open **Settings → IM Assistant**, select **Add account** under the target chan
|
|
|
238
241
|
|
|
239
242
|
| Goal | Action | Notes |
|
|
240
243
|
| --- | --- | --- |
|
|
241
|
-
| 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,
|
|
244
|
+
| 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, Telegram and Discord need a Bot Token, and Slack needs a Bot Token plus an App Token |
|
|
242
245
|
| 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 |
|
|
243
246
|
| Pause receiving | Turn off **Receive messages** on the account row | Credentials and settings stay; only new inbound messages for that account pause |
|
|
244
247
|
| 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 |
|
|
@@ -264,7 +267,26 @@ Switching sessions stops output pushes from previous sessions to this chat, incl
|
|
|
264
267
|
|
|
265
268
|
Explicitly binding a session with `/session` restores its output, including when selecting the current session again. Mute pauses assistant text and file output; approvals, questions, and task status notices still arrive. Switching or muting discards queued stream updates and cached text; an already sent partial card may remain visible, but the next output starts a fresh stream.
|
|
266
269
|
|
|
267
|
-
DingTalk replies prefer official AI Card streaming. If card creation fails, plain text preserves line breaks; code fences and list markers remain literal. QQ replies use official markdown and keep headings, bold text, links, and tables; only a platform rejection falls back to plain text (where tables become lists). Telegram replies are sent as Rich Messages with Markdown so headings, bold text, and tables render, falling back to plain text when that method is unavailable; do not enable Webhook on the same bot. Feishu normal replies also use card Markdown, so headings and tables render; cards are split so none holds more than five tables, with a plain-text fallback. Long replies split with structure awareness: table chunks repeat the header, code fences are re-closed, and the `(n/m)` marker only prefixes prose chunks. `/help` is grouped as getting around / sessions and workspaces / models and reasoning / tasks and delivery, with one entry per feature and the usable aliases marked; group titles are bold while the rest of the command copy stays plain text, which keeps them scannable on a phone. Discord renders headings, bold text, code, and lists on the client but has no Markdown tables, and mobile clients cannot scroll horizontally, so pipe tables become a vertical block per row (first two columns as a bold title, remaining columns as `header: value`). Everything else is sent verbatim. Do not configure a Discord Interactions Endpoint URL, or button clicks will not arrive through the Gateway.
|
|
270
|
+
DingTalk replies prefer official AI Card streaming. If card creation fails, plain text preserves line breaks; code fences and list markers remain literal. QQ replies use official markdown and keep headings, bold text, links, and tables; only a platform rejection falls back to plain text (where tables become lists). Telegram replies are sent as Rich Messages with Markdown so headings, bold text, and tables render, falling back to plain text when that method is unavailable; do not enable Webhook on the same bot. Feishu normal replies also use card Markdown, so headings and tables render; cards are split so none holds more than five tables, with a plain-text fallback. Long replies split with structure awareness: table chunks repeat the header, code fences are re-closed, and the `(n/m)` marker only prefixes prose chunks. `/help` is grouped as getting around / sessions and workspaces / models and reasoning / tasks and delivery, with one entry per feature and the usable aliases marked; group titles are bold while the rest of the command copy stays plain text, which keeps them scannable on a phone. Discord renders headings, bold text, code, and lists on the client but has no Markdown tables, and mobile clients cannot scroll horizontally, so pipe tables become a vertical block per row (first two columns as a bold title, remaining columns as `header: value`). Everything else is sent verbatim. Do not configure a Discord Interactions Endpoint URL, or button clicks will not arrive through the Gateway. Slack also has no Markdown tables and no `#` headings, so outgoing text is converted to mrkdwn: headings become a bold whole line, tables become the same vertical block, `**bold**` becomes `*bold*`, and links become `<url|label>`, while code fences stay untouched.
|
|
271
|
+
|
|
272
|
+
### Connecting Slack
|
|
273
|
+
|
|
274
|
+
Slack uses a Socket Mode long connection, so no public URL or request URL is required:
|
|
275
|
+
|
|
276
|
+
1. Open <https://api.slack.com/apps> and choose **Create New App → From scratch**, then pick your workspace.
|
|
277
|
+
2. Under **OAuth & Permissions → Bot Token Scopes**, add at least: `chat:write` (replies), `reactions:write` (status reactions), `files:read` (receive files), `files:write` (return files), `im:history` (DMs), `channels:history` (public channels), `groups:history` (private channels), and `app_mentions:read` (@ mentions). Do not paste a user token (`xoxp-`). Multi-person DMs (mpim) are not supported.
|
|
278
|
+
3. Click **Install to Workspace** at the top of the page and copy the **Bot User OAuth Token** (`xoxb-…`).
|
|
279
|
+
4. Open **Socket Mode**, enable it, click **Generate Token and Scopes**, tick `connections:write`, and copy the **App-Level Token** (`xapp-…`, shown once).
|
|
280
|
+
5. Open **Event Subscriptions**, enable events, and under **Subscribe to bot events** add `message.im`, `message.channels`, `message.groups`, and `app_mention`.
|
|
281
|
+
6. In **Settings → IM Assistant → Slack → Add account**, paste both tokens.
|
|
282
|
+
7. Invite the bot to the channels you need with `/invite @your-bot`. Channels only respond after an @ mention; DMs work immediately.
|
|
283
|
+
|
|
284
|
+
Notes:
|
|
285
|
+
|
|
286
|
+
- **Where replies land**: DMs answer directly. Public and private channels answer inside the thread of the message. The 512 most recently joined threads are saved per account on this machine, so follow-ups still need no mention after a restart. Mention the bot again after switching bot identity, clearing the account state directory, or when a thread record is evicted. Multi-person DMs are not handled.
|
|
287
|
+
- **Commands**: Slack clients treat a halfwidth `/` as a slash command, so `/menu` must be registered in the app. Without that registration, send `!menu` or `!help`, or a fullwidth `/help`, the same way Discord does. An unknown `!hello` stays an ordinary message. DM commands still use the allowlist. A `!` command in a channel does not need a mention and is answered in a thread. Native buttons also work.
|
|
288
|
+
- **Diagnostics**: **Diagnose connection** calls `auth.test` for bot identity and reports Socket Mode state only when a connection already exists; it never opens a new connection for the check.
|
|
289
|
+
- **After changing scopes**, reinstall the app and reconnect the bot; an old Bot Token does not gain new scopes automatically.
|
|
268
290
|
|
|
269
291
|
Send commands as separate text messages; image captions remain ordinary input. Start with `/help`; individual replies also suggest related actions.
|
|
270
292
|
|
|
@@ -319,7 +341,7 @@ This repository develops in `src` and builds to `lib`:
|
|
|
319
341
|
- [src\index.ts](src/index.ts): host entry, config, and lifecycle.
|
|
320
342
|
- [src\manager.ts](src/manager.ts): channel start/stop, authenticated management API, and credential persistence.
|
|
321
343
|
- [src\engine](src/engine): session routing, slash commands, approval, splitting, and outbound push.
|
|
322
|
-
- [src\channels](src/channels): DingTalk, Feishu, Lark, WeChat, WeCom, QQ, Telegram, and
|
|
344
|
+
- [src\channels](src/channels): DingTalk, Feishu, Lark, WeChat, WeCom, QQ, Telegram, Discord, and Slack adapters.
|
|
323
345
|
- `client.js`: settings page and workspace channel sidebar.
|
|
324
346
|
- `tests\*.test.mjs`: routing, QR, credentials, QQ, delivery, and sidebar tests.
|
|
325
347
|
|
|
@@ -359,7 +381,7 @@ Sidebar tests read the built `lib/client.js`; run `npm run build` before invokin
|
|
|
359
381
|
|
|
360
382
|
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.
|
|
361
383
|
|
|
362
|
-
- Telegram, Discord, 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.
|
|
384
|
+
- Telegram, Discord, Slack, Feishu/Lark, and WeCom can attempt background delivery using a stable chat destination. DingTalk, QQ, and WeChat wait for a new message in the original chat to refresh the reply channel. Connection, expiry, and platform quotas still apply.
|
|
363
385
|
- 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.
|
|
364
386
|
- 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.
|
|
365
387
|
- 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.
|
package/README.zh-CN.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# DSH IM Connect
|
|
8
8
|
|
|
9
|
-
**把飞书、Lark、钉钉、企业微信、微信、QQ、Telegram、Discord 接到本机 DeepSeek Harness**
|
|
9
|
+
**把飞书、Lark、钉钉、企业微信、微信、QQ、Telegram、Discord、Slack 接到本机 DeepSeek Harness**
|
|
10
10
|
|
|
11
11
|
[English](README.md) · [更新日志](CHANGELOG.zh-CN.md) · [Apache-2.0](LICENSE)
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@
|
|
|
15
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
|
-
[](#-支持的渠道)
|
|
19
19
|
</div>
|
|
20
20
|
|
|
21
21
|
> DSH IM Connect 是社区维护的 DeepSeek Harness(DSH)插件,并非 DeepSeek AI 官方产品。
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
不在电脑前,也能通过常用聊天软件把任务交给本机 DSH,并在同一聊天里接收回复、回答问题和处理工具审批。
|
|
26
26
|
|
|
27
|
-
- **连接常用消息平台**:支持钉钉、飞书、Lark、微信、企业微信、QQ、Telegram 和
|
|
27
|
+
- **连接常用消息平台**:支持钉钉、飞书、Lark、微信、企业微信、QQ、Telegram、Discord 和 Slack。
|
|
28
28
|
- **多个账号分别配置**:同一平台可添加多个账号,各自选择工作区、模型、推理强度、权限和私聊准入。
|
|
29
29
|
- **手机上完成任务交互**:下任务、读回复、回答单选或多选问题;已批准用户可在私聊中批准或拒绝工具执行。
|
|
30
30
|
- **聊天记录互不混淆**:每个 IM 聊天对应独立会话,在网页工作区「频道」中回看。
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
| 私聊 · 扫码用户 | 微信 / 飞书 / Lark / QQ 扫码者自动进白名单,可直接对话 |
|
|
45
45
|
| 私聊 · 其他人 | 进入设置页待批准;不批准就不能驱动助手 |
|
|
46
46
|
| 私聊 · 扫码不返回身份 | 钉钉 / 企微的快捷绑定只返回机器人凭据,扫码者仍需在设置页批准 |
|
|
47
|
-
| 私聊 · 手动凭据 | Telegram、Discord,以及手动填写凭据的钉钉 / 企微 / QQ,所有私聊都要先批准 |
|
|
47
|
+
| 私聊 · 手动凭据 | Telegram、Discord、Slack,以及手动填写凭据的钉钉 / 企微 / QQ,所有私聊都要先批准 |
|
|
48
48
|
| 私聊缺少 userId | 拒绝 |
|
|
49
49
|
| 工具审批 | 在绑定该会话的聊天里回复「批准 / 拒绝」;群聊和私聊都可以,不用去网页。5 分钟内未回复按取消结束,期间其他文字不会进入下一轮 |
|
|
50
50
|
| 交互选择 | 在原 IM 会话回复选项序号或文字;多选用逗号分隔,也可补充自定义答案;群聊只接受任务发起者回答 |
|
|
@@ -61,7 +61,8 @@
|
|
|
61
61
|
<code>🏢 企业微信</code>
|
|
62
62
|
<code>🐧 QQ</code>
|
|
63
63
|
<code>✈️ Telegram</code>
|
|
64
|
-
<code>🎮 Discord</code
|
|
64
|
+
<code>🎮 Discord</code>
|
|
65
|
+
<code>🧩 Slack</code>
|
|
65
66
|
</p>
|
|
66
67
|
|
|
67
68
|
| 渠道 | 状态 | 接入方式 | 需要 |
|
|
@@ -74,14 +75,15 @@
|
|
|
74
75
|
| 🐧 **QQ** | ✅ 可用 | 扫码,或 AppID / AppSecret | QQ 开放平台机器人,不是个人号 |
|
|
75
76
|
| ✈️ **Telegram** | ✅ 可用 | 仅填 Bot Token | `@BotFather`;同一 Bot 不要同时开 Webhook |
|
|
76
77
|
| 🎮 **Discord** | ✅ 可用 | 仅填 Bot Token | Developer Portal 的官方 Bot。打开 Message Content Intent;文字频道和公告频道第一次 @ 后在 Thread 中继续,不必重复 @ |
|
|
78
|
+
| 🧩 **Slack** | ✅ 可用 | 填 Bot Token 与 App Token | api.slack.com 建应用并开启 Socket Mode。私聊直接回复,频道被 @ 后在该消息的线程里回复,线程内后续消息不必重复 @ |
|
|
77
79
|
|
|
78
|
-
✅ 可用 = 文字收发可用 | *微信 = 只走腾讯官方 iLink,不做逆向个人号 | 群聊都需要 @ 机器人才回复。Discord 仅文字频道和公告频道在 Bot 自己创建的 Thread 中免重复 @
|
|
80
|
+
✅ 可用 = 文字收发可用 | *微信 = 只走腾讯官方 iLink,不做逆向个人号 | 群聊都需要 @ 机器人才回复。Discord 仅文字频道和公告频道在 Bot 自己创建的 Thread 中免重复 @;Slack 在机器人已参与的消息线程中免重复 @
|
|
79
81
|
|
|
80
82
|
## 图片输入
|
|
81
83
|
|
|
82
84
|
图片输入使用与 DSH Chat 一致的模型能力和附件规则,不按模型名称猜测视觉能力:
|
|
83
85
|
|
|
84
|
-
覆盖微信、企业微信、钉钉、飞书、Lark、QQ、Telegram 和
|
|
86
|
+
覆盖微信、企业微信、钉钉、飞书、Lark、QQ、Telegram、Discord 和 Slack;具体平台消息形式和联调检查见[图片输入验收](docs/image-input.md)。
|
|
85
87
|
|
|
86
88
|
- 以当前 IM 会话实际使用的模型为准,而不是只看全局默认模型。
|
|
87
89
|
- 模型声明支持 `image` 时,将图片保存为 DSH 标准图片附件并提交给模型;会话记录保留图片引用,而不是只有本地文件路径文字。
|
|
@@ -91,7 +93,7 @@
|
|
|
91
93
|
|
|
92
94
|
## 文件输入
|
|
93
95
|
|
|
94
|
-
微信、企业微信、钉钉、飞书、Lark、QQ、Telegram、Discord 可接收普通文件,并通过 Chat 的上传服务交给当前会话。可以发送 PDF、文档、表格等文件,再让助手读取或处理;能否解析具体格式与网页 Chat 的模型、工具和文件能力一致,不承诺每种格式都能直接理解。
|
|
96
|
+
微信、企业微信、钉钉、飞书、Lark、QQ、Telegram、Discord、Slack 可接收普通文件,并通过 Chat 的上传服务交给当前会话。可以发送 PDF、文档、表格等文件,再让助手读取或处理;能否解析具体格式与网页 Chat 的模型、工具和文件能力一致,不承诺每种格式都能直接理解。
|
|
95
97
|
|
|
96
98
|
- 需要 DSH `0.1.5-rc.1`、`0.1.5-rc.2`、`0.1.5-rc.3`、`0.1.7-rc.1`、`0.1.7-rc.2`、`0.2.0-rc.1` 或 `0.2.0-rc.2` 的文件上传服务;`0.1.2-rc.1` 明确提示升级,文字、图片等既有能力不变。
|
|
97
99
|
- 单条消息最多 4 个普通文件,累计最多 20 MiB,还受渠道下载限制约束。
|
|
@@ -101,7 +103,7 @@
|
|
|
101
103
|
|
|
102
104
|
## 文件回传
|
|
103
105
|
|
|
104
|
-
微信、企业微信、钉钉、飞书、Lark、QQ、Telegram 和
|
|
106
|
+
微信、企业微信、钉钉、飞书、Lark、QQ、Telegram、Discord 和 Slack 均可回传助手产出的文件。例如:“整理成 PDF 报告,并把文件发给我。”
|
|
105
107
|
|
|
106
108
|
- 使用 Chat 支持的文件工具成功新建或修改的文件,会在回复后发送;宿主支持 `present` 时,也会发送明确交付的文件,包括已有文件。
|
|
107
109
|
- 文件访问范围与 Chat 一致,允许宿主可读取的工作区外文件。不从回复正文中猜测文件路径;通过脚本等方式生成的文件,需要助手明确 `present` 交付。
|
|
@@ -121,7 +123,7 @@
|
|
|
121
123
|
|
|
122
124
|
常用命令回复会提供相关下一步,例如 `/model` → 选择模型 / 调整推理 → 返回菜单。支持原生按钮时可点击跳转,其他情况显示可直接发送的命令。普通结果回复的导航按钮不支持数字选择,避免把聊天中的数字误当操作;只有选择菜单支持回复序号。超长卡片保留完整文字回复。
|
|
123
125
|
|
|
124
|
-
钉钉、Telegram、Discord、飞书/Lark 使用原生按钮;企业微信在按钮数量和正文符合平台限制时使用卡片,其他情况及 QQ、微信使用文字序号。平台明确拒绝或超出卡片容量时退回完整文字;网络异常导致发送结果未知时仅提示确认,避免重复发送。菜单按账号、聊天、操作者和会话隔离,15 分钟或重启后失效;执行时重新检查权限,旧按钮不能重复执行。
|
|
126
|
+
钉钉、Telegram、Discord、Slack、飞书/Lark 使用原生按钮;企业微信在按钮数量和正文符合平台限制时使用卡片,其他情况及 QQ、微信使用文字序号。平台明确拒绝或超出卡片容量时退回完整文字;网络异常导致发送结果未知时仅提示确认,避免重复发送。菜单按账号、聊天、操作者和会话隔离,15 分钟或重启后失效;执行时重新检查权限,旧按钮不能重复执行。
|
|
125
127
|
|
|
126
128
|
审批与问答复用上述原生按钮渠道:审批提供批准一次/拒绝,单选题直接点选,多选题勾选后提交;开放问题保留文字回答。审批始终留在发起任务的聊天里,不会回退到网页端;提示发送失败时按拒绝处理。5 分钟内没有批准或拒绝就按取消结束,并说明这次未执行;这段时间里的其他文字只提示先完成审批,不会送进下一轮。图片和文件仍按原消息提交,不当成审批答复。群聊里只接受任务发起者批准,私聊没有额外限制,关闭命令不影响已有审批及问答。问题不设这个超时,下一句文字仍作为答案。
|
|
127
129
|
|
|
@@ -140,13 +142,14 @@ IM 消息发起的处理结束后,会在正文和文件投递完成后给出
|
|
|
140
142
|
- 飞书 / Lark:使用处理中、完成和失败表情;等待确认沿用处理中表情,取消时撤下表情。
|
|
141
143
|
- Telegram:使用 👀 处理中、🤔 等待确认、👍 完成、👎 失败;取消时撤下表情。处理期间持续显示输入状态。
|
|
142
144
|
- Discord:使用与 Telegram 相同的表情,并编辑同一条消息显示逐步生成的回答。处理期间持续显示输入状态。取消时撤下表情。
|
|
145
|
+
- Slack:用 ✅ 完成、❌ 失败、🤔 等待确认、👀 处理中作为消息表情回应(需要 `reactions:write`);回答通过编辑同一条消息逐步生成,Slack 没有机器人输入状态。
|
|
143
146
|
- 微信:处理期间刷新输入状态,结束或等待确认时停止。企业微信、QQ 保持现有回复方式。
|
|
144
147
|
|
|
145
148
|
“已完成”表示该回合正常结束且正文、文件均已投递;停止、失败和下一条排队消息不会误标完成。状态接口受渠道权限与网络影响,更新失败不阻塞聊天;文字标签跟随网页语言设置。
|
|
146
149
|
|
|
147
150
|
## 连接诊断
|
|
148
151
|
|
|
149
|
-
账号设置中的“诊断连接”会实际调用渠道接口:微信查询配置,企微检测现有连接的 ping 回执,钉钉验证应用凭据,飞书/Lark 查询鉴权与机器人身份,QQ 查询鉴权与网关,Telegram 查询机器人身份及 Webhook 冲突,Discord 查询机器人身份及 Gateway
|
|
152
|
+
账号设置中的“诊断连接”会实际调用渠道接口:微信查询配置,企微检测现有连接的 ping 回执,钉钉验证应用凭据,飞书/Lark 查询鉴权与机器人身份,QQ 查询鉴权与网关,Telegram 查询机器人身份及 Webhook 冲突,Discord 查询机器人身份及 Gateway 地址,Slack 查询机器人身份,并在已建立 Socket Mode 连接时回报连接状态(不新建连接)。
|
|
150
153
|
|
|
151
154
|
每项显示通过、失败或未验证、耗时和处理建议。诊断不发送测试消息、不额外拉取聊天消息;单项通过不代表完整收发权限已验证。旧后端不支持诊断时会提示重启 DSH 并刷新页面。接口、各渠道能力边界与验证记录见[账号连接诊断](docs/01-当前工作/I015-命令权限与Chat命令/06-账号状态检查.md)。
|
|
152
155
|
|
|
@@ -238,7 +241,7 @@ dsh --profile web --dump-config
|
|
|
238
241
|
|
|
239
242
|
| 目标 | 操作 | 说明 |
|
|
240
243
|
| --- | --- | --- |
|
|
241
|
-
| 添加账号 | 在对应渠道点击「添加账号」,选择账号配置后扫码或填写凭据 | 同一渠道可添加多个账号;飞书 / Lark / 微信仅扫码,Telegram 和 Discord 仅填 Bot Token |
|
|
244
|
+
| 添加账号 | 在对应渠道点击「添加账号」,选择账号配置后扫码或填写凭据 | 同一渠道可添加多个账号;飞书 / Lark / 微信仅扫码,Telegram 和 Discord 仅填 Bot Token,Slack 填 Bot Token 与 App Token |
|
|
242
245
|
| 修改账号配置 | 展开渠道并选择账号,在设置弹窗中修改工作区、模型、推理强度、权限或私聊准入 | 配置只影响当前账号;保存后该账号的后续会话立即使用新配置 |
|
|
243
246
|
| 暂停接收 | 关闭账号行上的「接收消息」开关 | 凭据和账号配置保留,只暂停该账号接收新消息 |
|
|
244
247
|
| 在 IM 里下任务 | 微信 / 飞书 / Lark / QQ 扫码用户可直接私聊;钉钉 / 企微扫码者和其他用户需先批准。群聊只需 @ | 每个聊天对应一条独立频道会话 |
|
|
@@ -260,11 +263,31 @@ dsh --profile web --dump-config
|
|
|
260
263
|
|
|
261
264
|
通过 `/workspace` 新建后,`/new` 和当前会话归档后的续聊会保留所选工作区,并使用账号配置的模型、Agent 与权限预设。`/session` 接续已有会话、`/fork` 分叉则保留原会话配置。
|
|
262
265
|
|
|
266
|
+
### Slack 接入步骤
|
|
267
|
+
|
|
268
|
+
Slack 走 Socket Mode 长连接,不需要公网地址,也不用配置请求网址:
|
|
269
|
+
|
|
270
|
+
1. 打开 <https://api.slack.com/apps>,点 **Create New App → From scratch**,选择工作区。
|
|
271
|
+
2. 左侧 **OAuth & Permissions → Bot Token Scopes**,至少勾选:`chat:write`(回复)、`reactions:write`(状态表情)、`files:read`(接收文件)、`files:write`(回传文件)、`im:history`(接收私聊)、`channels:history`(接收公开频道)、`groups:history`(接收私有频道)、`app_mentions:read`(接收 @)。不要填用户令牌(`xoxp-`)。多人私聊(mpim)这次不支持。
|
|
272
|
+
3. 回到页面顶部点 **Install to Workspace**,复制 **Bot User OAuth Token**(`xoxb-` 开头)。
|
|
273
|
+
4. 左侧 **Socket Mode** 打开开关,再点 **Generate Token and Scopes**,勾选 `connections:write`,复制 **App-Level Token**(`xapp-` 开头,只显示一次)。
|
|
274
|
+
5. 左侧 **Event Subscriptions** 打开订阅,在 **Subscribe to bot events** 添加:`message.im`、`message.channels`、`message.groups`、`app_mention`。
|
|
275
|
+
6. 在「设置 → IM助理 → Slack → 添加账号」里填入上面两个令牌。
|
|
276
|
+
7. 把机器人拉进要用的频道:在频道里 `/invite @你的机器人`。频道里只有 @ 机器人才会响应,私聊可以直接说话。
|
|
277
|
+
|
|
278
|
+
配置要点:
|
|
279
|
+
|
|
280
|
+
- **回复位置**:私聊直接回复;公开频道和私有频道里,机器人在你那条消息的线程内回复。最近参与的 512 个线程按账号保存在本机,重启 DSH 后仍可继续免 @ 追问。更换机器人身份、清理账号状态目录或线程记录被淘汰后,需要重新 @。多人私聊这次不响应。
|
|
281
|
+
- **格式**:Slack 不支持 Markdown 表格和 `#` 标题,正文会转成 Slack 的 mrkdwn:标题变粗体整行,表格竖排成「粗体标题 + 表头:值」,`**粗体**` 变 `*粗体*`,链接变 `<地址|文字>`。
|
|
282
|
+
- **命令**:Slack 客户端会把半角 `/` 开头的文本当斜杠命令。要用 `/menu` 这类命令,需要在应用里登记同名的 Slash Command。不想登记时,可以像 Discord 一样发送 `!menu`、`!help`,或用全角 `/help`;未知的 `!hello` 仍是普通消息。私聊里的命令仍走私聊白名单。频道里的 `!` 命令不必再 @,回复落在线程里。也可以直接用原生按钮。
|
|
283
|
+
- **诊断**:账号里的「诊断连接」会调用 `auth.test` 校验机器人身份;Socket Mode 的连接状态只在已连接时一并回报,未连接过则只报身份,不会为此新开连接。
|
|
284
|
+
- **权限范围变更后**要重新 Install App 并重新连接机器人,旧的 Bot Token 不会自动获得新权限。
|
|
285
|
+
|
|
263
286
|
切换会话后,旧会话不再向本聊天推送输出,`/preset`、`/fork` 切换也遵循此规则。网页历史仍保留,重启 DSH 后也不会恢复旧推送。`/unbind` 查看本聊天登记的会话;`/unbind 序号或ID` 解除旧登记,`/unbind all` 仅保留当前会话。`/mute 序号或ID` 保留登记但暂停助手输出,`/unmute` 使用同一目标恢复后续输出。序号以 `/unbind` 列表为准。
|
|
264
287
|
|
|
265
288
|
通过 `/session` 显式绑定会话会恢复输出,重新选择当前会话也会解除静音。静音暂停助手正文和文件输出,审批、提问和任务状态通知仍会送达。切换或静音会丢弃排队中的流式更新和缓存文本;已经发送的半截卡片可能仍可见,但后续输出会开启新流。
|
|
266
289
|
|
|
267
|
-
钉钉回复优先走官方 AI Card 流式卡片;创建失败则回退纯文本,保留换行;代码与列表标记按原文显示。QQ 回复走官方 markdown,保留标题、加粗、链接和表格;只有平台拒绝 markdown 时才退回纯文本(那时表格降级成列表)。Telegram 回复用 Rich Message 发送 Markdown,标题、加粗和表格可渲染;该方法不可用时自动回退纯文本,同一 Bot 不要同时开 Webhook。飞书普通回复也用卡片 Markdown,标题和表格会被渲染;按表格数量拆卡,单卡最多 5 个表格,卡片被拒时回退纯文本。长回复分片会保护结构:表格分片重复表头,代码块补齐围栏,序号只加在纯文字片。`/help` 按「入口 / 会话与工作区 / 模型与推理 / 任务与交付」分组,每个功能只列一条入口,并标出可直接使用的别名;分组标题会加粗,其余命令文案保持纯文本,便于在手机上扫读。Discord 客户端会自己渲染标题、加粗、代码和列表,但不支持 Markdown 表格,手机端又无法横向滚动,所以正文里的表格会逐行竖排成「粗体标题 + 表头:值」,其余正文原样发送;不要配置 Interactions Endpoint URL,否则按钮不会从 Gateway 进来。
|
|
290
|
+
钉钉回复优先走官方 AI Card 流式卡片;创建失败则回退纯文本,保留换行;代码与列表标记按原文显示。QQ 回复走官方 markdown,保留标题、加粗、链接和表格;只有平台拒绝 markdown 时才退回纯文本(那时表格降级成列表)。Telegram 回复用 Rich Message 发送 Markdown,标题、加粗和表格可渲染;该方法不可用时自动回退纯文本,同一 Bot 不要同时开 Webhook。飞书普通回复也用卡片 Markdown,标题和表格会被渲染;按表格数量拆卡,单卡最多 5 个表格,卡片被拒时回退纯文本。长回复分片会保护结构:表格分片重复表头,代码块补齐围栏,序号只加在纯文字片。`/help` 按「入口 / 会话与工作区 / 模型与推理 / 任务与交付」分组,每个功能只列一条入口,并标出可直接使用的别名;分组标题会加粗,其余命令文案保持纯文本,便于在手机上扫读。Discord 客户端会自己渲染标题、加粗、代码和列表,但不支持 Markdown 表格,手机端又无法横向滚动,所以正文里的表格会逐行竖排成「粗体标题 + 表头:值」,其余正文原样发送;不要配置 Interactions Endpoint URL,否则按钮不会从 Gateway 进来。Slack 同样不渲染 Markdown 表格与 `#` 标题,正文会转成 mrkdwn:标题变整行粗体、表格竖排、`**粗体**` 变 `*粗体*`、链接变 `<地址|文字>`,代码块内的内容保持原样。
|
|
268
291
|
|
|
269
292
|
命令单独发送为文字,图片说明按普通消息处理。首次使用可发 `/help`,各命令回复也会给出相关操作。
|
|
270
293
|
|
|
@@ -319,7 +342,7 @@ dsh --profile web --dump-config
|
|
|
319
342
|
- [src\index.ts](src/index.ts):Host 入口、配置和生命周期。
|
|
320
343
|
- [src\manager.ts](src/manager.ts):渠道启停、已认证管理 API、凭据落盘。
|
|
321
344
|
- [src\engine](src/engine):会话路由、斜杠命令、审批、分片和回推。
|
|
322
|
-
- [src\channels](src/channels):钉钉、飞书、Lark、微信、企业微信、QQ、Telegram、Discord 适配器。
|
|
345
|
+
- [src\channels](src/channels):钉钉、飞书、Lark、微信、企业微信、QQ、Telegram、Discord、Slack 适配器。
|
|
323
346
|
- `client.js`:设置页和工作区频道侧栏。
|
|
324
347
|
- `tests\*.test.mjs`:路由、扫码、凭据、QQ、投递和侧栏测试。
|
|
325
348
|
|
|
@@ -359,7 +382,7 @@ npm test
|
|
|
359
382
|
|
|
360
383
|
从本功能启用后收到的普通 IM 消息开始记录交付状态。原任务的结果已保存、但尚未开始发送时,可在恢复连接或重启后补发最终文字和结束状态;不会重新执行问题、工具或审批,也不会补发文件。旧版本处理过的消息不回溯补发。
|
|
361
384
|
|
|
362
|
-
- Telegram、Discord、飞书/Lark、企业微信可通过稳定聊天目标后台尝试补发;钉钉、QQ、微信等待原聊天发来新消息刷新回复通道。发送仍受渠道连接、时效和配额限制。
|
|
385
|
+
- Telegram、Discord、Slack、飞书/Lark、企业微信可通过稳定聊天目标后台尝试补发;钉钉、QQ、微信等待原聊天发来新消息刷新回复通道。发送仍受渠道连接、时效和配额限制。
|
|
363
386
|
- 已尝试发送但无法确认送达时,暂停自动补发。发送 `/delivery` 查看记录;确认需要补发后发送 `/delivery retry <记录ID>`。这可能重复已收到的文字,文件请在网页原会话查看。
|
|
364
387
|
- 查询与补发仅限当前聊天的原发起人,并遵循准入和命令权限。账号停用、原会话换绑或访问权限变化会暂停补发;恢复原绑定与权限后可手动尝试。
|
|
365
388
|
- 每条记录的补发窗口为 7 天,最多保存 1000 条;满额时优先清理已送达或明确未提交的终态记录,过期记录在新消息进入时清理。后台每 30 秒分批检查,历史暂不可读或任务尚未结束时继续等待。补发不是任务自动续跑。
|
package/SECURITY.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
2. **私聊未配置即拒绝**:私聊白名单为空,或消息没有 `userId`,不处理。
|
|
9
9
|
3. **群聊不用绑定**:群聊只需 @ 机器人;不进待批准、不查白名单。
|
|
10
10
|
4. **私聊只有扫码用户免批**:微信扫码用户和飞书 / Lark 扫码用户自动进入白名单;其他私聊用户必须在设置页批准。
|
|
11
|
-
5. **群聊仍需 @ 当前机器人**:未 @ 机器人、或只 @ 其他成员的群消息直接忽略,也不会写入待批准;准确 @ 机器人后默认放行。Discord 文字频道和公告频道在首次 @ 后进入该机器人创建的 Thread,之后在这个 Thread 里不必再次 @;其他频道和创建失败的回退仍要 @。
|
|
11
|
+
5. **群聊仍需 @ 当前机器人**:未 @ 机器人、或只 @ 其他成员的群消息直接忽略,也不会写入待批准;准确 @ 机器人后默认放行。Discord 文字频道和公告频道在首次 @ 后进入该机器人创建的 Thread,之后在这个 Thread 里不必再次 @;其他频道和创建失败的回退仍要 @。Slack 在机器人已经参与的消息线程里同样不必再次 @,线程外的频道消息仍要 @;重启后已参与的线程要再 @ 一次。
|
|
12
12
|
6. **工具审批留在原聊天**:回复「批准 / 拒绝」在绑定该会话的聊天里生效,群聊里只接受任务发起者。私聊准入只决定谁能对话,不再单独卡审批;审批不会回退到网页端,提示发送失败时按拒绝处理。5 分钟无回复按取消结束,不执行该操作,也不把期间的其他文字送进下一轮。
|
|
13
13
|
7. **不恢复开放模式**:不再提供 `allowAllUsers` 或钉钉「配对 / 开放模式」。安全路径必须是默认路径。
|
|
14
14
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
- 任何人私聊或在群里 @ 机器人,都可能试图驱动本机 agent。
|
|
18
18
|
- 「批准」「yes」这类短文本若不做身份校验,会直接放行待处理的工具权限。
|
|
19
|
-
- Telegram、Discord 等凭据型机器人默认接受所有私聊,必须靠白名单拦住。
|
|
19
|
+
- Telegram、Discord、Slack 等凭据型机器人默认接受所有私聊,必须靠白名单拦住。
|
|
20
20
|
|
|
21
21
|
## 管理面
|
|
22
22
|
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="65" height="48" viewBox="0 0 65 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M41.2351 0C40.6164 1.09866 40.0607 2.2352 39.5556 3.397C34.7569 2.67719 29.8697 2.67719 25.0584 3.397C24.5658 2.2352 23.9976 1.09866 23.3788 0C18.8705 0.770324 14.4759 2.12155 10.3085 4.02841C2.04967 16.2652 -0.185531 28.1863 0.925755 39.9432C5.76238 43.517 11.1799 46.2447 16.951 47.9874C18.2517 46.2447 19.4009 44.3883 20.3859 42.4562C18.5169 41.7616 16.7111 40.8903 14.981 39.88C15.4356 39.5517 15.8776 39.2107 16.307 38.8824C26.4475 43.6559 38.1917 43.6559 48.3449 38.8824C48.7742 39.236 49.2162 39.577 49.6708 39.88C47.9408 40.9029 46.1349 41.7616 44.2533 42.4688C45.2383 44.4009 46.3875 46.2573 47.6882 48C53.4593 46.2573 58.8768 43.5422 63.7134 39.9684C65.0268 26.3299 61.4656 14.5099 54.3054 4.04104C50.1507 2.13418 45.7561 0.782952 41.2478 0.0252565L41.2351 0ZM21.8003 32.7072C18.6811 32.7072 16.0923 29.8785 16.0923 26.3804C16.0923 22.8824 18.5801 20.041 21.7876 20.041C24.9952 20.041 27.5461 22.895 27.4956 26.3804C27.4451 29.8658 24.9826 32.7072 21.8003 32.7072ZM42.8389 32.7072C39.7071 32.7072 37.1436 29.8785 37.1436 26.3804C37.1436 22.8824 39.6314 20.041 42.8389 20.041C46.0465 20.041 48.5848 22.895 48.5343 26.3804C48.4838 29.8658 46.0213 32.7072 42.8389 32.7072Z" fill="#5865F2"/>
|
|
3
|
+
</svg>
|
|
Binary file
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg width="127" height="127" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M27.2 80c0 7.3-5.9 13.2-13.2 13.2C6.7 93.2.8 87.3.8 80c0-7.3 5.9-13.2 13.2-13.2h13.2V80zm6.6 0c0-7.3 5.9-13.2 13.2-13.2 7.3 0 13.2 5.9 13.2 13.2v33c0 7.3-5.9 13.2-13.2 13.2-7.3 0-13.2-5.9-13.2-13.2V80z" fill="#E01E5A"/>
|
|
3
|
+
<path d="M47 27c-7.3 0-13.2-5.9-13.2-13.2C33.8 6.5 39.7.6 47 .6c7.3 0 13.2 5.9 13.2 13.2V27H47zm0 6.7c7.3 0 13.2 5.9 13.2 13.2 0 7.3-5.9 13.2-13.2 13.2H13.9C6.6 60.1.7 54.2.7 46.9c0-7.3 5.9-13.2 13.2-13.2H47z" fill="#36C5F0"/>
|
|
4
|
+
<path d="M99.9 46.9c0-7.3 5.9-13.2 13.2-13.2 7.3 0 13.2 5.9 13.2 13.2 0 7.3-5.9 13.2-13.2 13.2H99.9V46.9zm-6.6 0c0 7.3-5.9 13.2-13.2 13.2-7.3 0-13.2-5.9-13.2-13.2V13.8C66.9 6.5 72.8.6 80.1.6c7.3 0 13.2 5.9 13.2 13.2v33.1z" fill="#2EB67D"/>
|
|
5
|
+
<path d="M80.1 99.8c7.3 0 13.2 5.9 13.2 13.2 0 7.3-5.9 13.2-13.2 13.2-7.3 0-13.2-5.9-13.2-13.2V99.8h13.2zm0-6.6c-7.3 0-13.2-5.9-13.2-13.2 0-7.3 5.9-13.2 13.2-13.2h33.1c7.3 0 13.2 5.9 13.2 13.2 0 7.3-5.9 13.2-13.2 13.2H80.1z" fill="#ECB22E"/>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
这些文件是官方标原件,不要改色,也不要重绘后替换。
|
|
2
|
+
|
|
3
|
+
discord-symbol.svg
|
|
4
|
+
Discord 品牌页彩色 Symbol,fill 为官方 Blurple #5865F2。
|
|
5
|
+
https://discord.com/branding
|
|
6
|
+
https://cdn.prod.website-files.com/6257adef93867e50d84d30e2/66e3d80db9971f10a9757c99_Symbol.svg
|
|
7
|
+
|
|
8
|
+
slack-hash.png
|
|
9
|
+
Slack 官网 CDN 上的透明四色标,只作颜色对照,不嵌进侧栏。
|
|
10
|
+
https://a.slack-edge.com/80588/marketing/img/icons/icon_slack_hash_colored.png
|
|
11
|
+
|
|
12
|
+
slack-hash.svg
|
|
13
|
+
Slack 四色标的矢量路径,颜色与品牌规范一致(#E01E5A #36C5F0 #2EB67D #ECB22E)。侧栏和企微一样用这些 path,不用 SVG image。
|
|
14
|
+
https://upload.wikimedia.org/wikipedia/commons/d/d5/Slack_icon_2019.svg
|