@xmanrui/dsh-im 5.0.2 → 5.1.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 +11 -1
- package/README.md +11 -1
- package/lib/client.js +654 -495
- package/lib/index.js +318 -294
- package/package.json +1 -1
- package/plugin-src/client/channels/feishu/group-settings.js +10 -9
- package/plugin-src/client/channels/feishu/index.js +3 -3
- package/plugin-src/client/global-settings.js +29 -24
- package/plugin-src/client/group-history-settings.js +72 -0
- package/plugin-src/client/i18n.js +19 -3
- package/plugin-src/client/styles.js +12 -4
- package/plugin-src/host/channels/feishu/production.mjs +2 -0
- package/plugin-src/host/channels/feishu/rpc.mjs +5 -4
- package/plugin-src/host/channels/qq/production.mjs +2 -0
- package/plugin-src/host/channels/shared/production.mjs +2 -0
- package/plugin-src/host/channels/slack/production.mjs +2 -0
- package/plugin-src/host/channels/whatsapp/production.mjs +2 -0
- package/plugin-src/host/group-history-rpc.mjs +22 -0
- package/plugin-src/host/group-history-runtime.mjs +21 -0
- package/plugin-src/host/inbound-ttl-rpc.mjs +6 -2
- package/plugin-src/host/index.mjs +4 -1
- package/src/channels/discord/discord-runtime.mjs +8 -0
- package/src/channels/feishu/bridge.mjs +23 -1
- package/src/channels/feishu/feishu-runtime.mjs +5 -0
- package/src/channels/feishu/multi-bot-controller.mjs +17 -3
- package/src/channels/feishu/plugin-controller.mjs +2 -0
- package/src/channels/feishu/repair-manager.mjs +2 -1
- package/src/channels/qq/qq-bridge.mjs +19 -0
- package/src/channels/qq/qq-runtime.mjs +4 -0
- package/src/channels/shared/conversation-state-store.mjs +1 -0
- package/src/channels/shared/group-history-access.mjs +133 -0
- package/src/channels/shared/group-history-store.mjs +383 -0
- package/src/channels/shared/group-history.mjs +56 -0
- package/src/channels/shared/harness-client.mjs +3 -0
- package/src/channels/shared/i18n-en/feishu.mjs +2 -2
- package/src/channels/shared/semantic/artifact.mjs +19 -6
- package/src/channels/shared/text-harness-bridge.mjs +1 -0
- package/src/channels/slack/manifest.mjs +2 -0
- package/src/channels/slack/slack-runtime.mjs +10 -2
- package/src/channels/telegram/telegram-runtime.mjs +7 -0
- package/src/channels/whatsapp/state-store.mjs +34 -1
- package/src/channels/whatsapp/whatsapp-runtime.mjs +42 -3
package/README.en.md
CHANGED
|
@@ -70,10 +70,12 @@ Connect IM bots to DeepSeek Harness by scanning a QR code, using an App Manifest
|
|
|
70
70
|
| Slack | Create an app from the bundled App Manifest, then enter a Bot Token (`xoxb-`) and App Token (`xapp-`) | Socket Mode connection; direct DM replies, mention-only channel replies, and preferred native streaming API |
|
|
71
71
|
| Telegram | Enter a Bot Token generated by @BotFather | Bot API long polling; DMs work by default and groups respond to mentions or replies, while each bot can optionally enable a private-DM allowlist; with thinking traces off, private chats, groups, and Topics edit a placeholder for progress and finalize rich replies in place, avoiding Drafts that block the Android private-chat composer; unsupported Rich delivery falls back to ordinary text |
|
|
72
72
|
| Discord | Enter a Bot Token generated in the Developer Portal | Gateway v10 connection; direct DM replies; the first mention in a server text or announcement channel creates a native Thread, where follow-up messages no longer need to mention the bot; replies stream through message edits |
|
|
73
|
-
| WhatsApp | Scan a QR code with mobile WhatsApp to link a device | WhatsApp Web connection; self-chat only by default, with optional selected-contact and open-response modes; read receipt and typing indicator, with tool progress and incremental answers shown by editing one message at one-second intervals; long replies split automatically and failed edits fall back to a complete text reply |
|
|
73
|
+
| WhatsApp | Scan a QR code with mobile WhatsApp to link a device | WhatsApp Web connection; self-chat only by default, with optional selected-contact and open-response modes; groups require a mention or a reply to a bot message, including for the linked account; read receipt and typing indicator, with tool progress and incremental answers shown by editing one message at one-second intervals; long replies split automatically and failed edits fall back to a complete text reply |
|
|
74
74
|
| iMessage | Sign in to iMessage in macOS Messages.app and grant the local permissions described in the [channel notes](docs/imessage.md) | Native macOS Messages.app transport for text DMs; no BlueBubbles or third-party gateway; one local iMessage identity per macOS user account |
|
|
75
75
|
| Matrix (experimental) | Enter the homeserver URL plus an access token, or a user id with a password | CS API long polling; DMs are answered directly and rooms answer when the bot is @-mentioned, with thread replies, allowlisted HTML, edit-based streaming, and image/result-file delivery; includes experimental room-message encryption/decryption, subject to the limits below |
|
|
76
76
|
|
|
77
|
+
WhatsApp retains the identifiers of the latest 2,000 bot messages sent to groups, so replies to those messages still work after a restart. Replies to older messages outside that history, including unrecorded messages sent before upgrading, do not wake the bot; mention the bot or reply to one of its new messages instead.
|
|
78
|
+
|
|
77
79
|
Matrix encryption is currently for non-sensitive testing only. The default optional mode attempts to start the crypto engine and skips incoming encrypted messages if it fails; required mode refuses to connect when crypto startup fails. Interactive device verification, key backup, SSSS, and attachment-content encryption are not implemented. This release has not been validated against a live homeserver/Element setup; do not treat it as a complete end-to-end confidentiality guarantee.
|
|
78
80
|
|
|
79
81
|
Other IM platforms can be added through the same channel-adapter structure.
|
|
@@ -87,6 +89,14 @@ Feishu group chats accept messages from other bots that explicitly mention the c
|
|
|
87
89
|
|
|
88
90
|
Built-in channels with image input support can send JPEG, PNG, and WebP images, plus GIFs sent as image files, with optional captions to Harness. By default, original images can be up to 30 MB each, with up to 20 images per message. Originals are saved in the Session workspace; model copies are resized or compressed to 5 MB each and 20 MB total. Images that still exceed the budget, or are rejected by a non-vision model, are delivered as workspace files. These four limits can be changed under General settings → Attachments → Image input for subsequent messages. Originals follow attachment retention settings. Higher model limits increase request size, latency and model cost, and remain subject to platform and Host limits. iMessage's MVP supports text DMs only. Downloading images or files from Feishu user messages requires the `im:message:readonly` tenant scope, shown on the confirmation page as **Read direct and group messages**; Feishu currently offers no narrower image-only scope for that download endpoint. Apps created through the built-in QR flow request it by default; for existing or manually connected apps, click **Complete permissions** on the IM Bot settings page and scan the QR code to incrementally add that scope, `im:resource` for uploading bot-sent images or files, `application:app_slash_command:read` / `write` for the native command panel, and the card callback.
|
|
89
91
|
|
|
92
|
+
### Shared group messages and files
|
|
93
|
+
|
|
94
|
+
WhatsApp, Feishu, Telegram, Discord, Slack, and QQ can automatically save received group messages and attachments, including messages without mentions when the platform permits delivery. Recording is enabled by default and does not itself trigger a model reply. Mention a bot in the group to search records, summarize discussions, or read files on demand.
|
|
95
|
+
|
|
96
|
+
Records are shared by group, independently of bots, AI Sessions, and workspaces. Retention defaults to a rolling **14 days**, configurable under **DSH Settings → IM Bots → gear icon, General settings → General**. Only received content is saved; full history is not backfilled. QQ archives are currently isolated by app, and Discord threads have separate archives.
|
|
97
|
+
|
|
98
|
+
See the [group history and shared files guide](docs/group-history.en.md) for all six platforms' permissions and setup steps, query examples, storage, file limits, and troubleshooting. Live tests passed for text and text-file attachments on WhatsApp, Feishu, and QQ. Telegram text passed, with files still untested; Discord and Slack await live group verification.
|
|
99
|
+
|
|
90
100
|
### Results after a reply timeout
|
|
91
101
|
|
|
92
102
|
Connected IM channels share deferred task tracking. After a model reply timeout, the plugin keeps checking the original task and delivers its final text to the original chat or thread. Checks resume after a plugin restart or reconnection. `/stop` only stops the matching turn submitted by that chat; changing the bound Session prevents old results from being delivered there. No new setting is required, and normal replies keep their existing flow.
|
package/README.md
CHANGED
|
@@ -74,10 +74,12 @@ Connect IM bots to DeepSeek Harness by scanning a QR code, using an App Manifest
|
|
|
74
74
|
| Slack | 使用预置 App Manifest 创建应用,再填写 Bot Token(`xoxb-`)和 App Token(`xapp-`) | Socket Mode 长连接;私聊直接回复,频道被 @ 后响应,优先使用官方流式消息 API |
|
|
75
75
|
| Telegram | 使用 @BotFather 生成的 Bot Token | Bot API 长轮询;默认私聊直接响应、群聊被提及或回复时响应,也可为每个机器人独立启用私聊白名单安全模式;关闭思考过程留痕时,私聊、群聊和 Topic 均通过占位消息编辑展示进度并原位完成富文本回复,避免 Android 私聊 Draft 占用发送入口,平台不支持富文本时回退为普通文字 |
|
|
76
76
|
| Discord | 使用 Developer Portal 生成的 Bot Token | Gateway v10 长连接;私信直接回复;服务器文字/公告频道首次 @ 后创建原生 Thread,后续在线程中无需重复 @,并通过编辑消息流式显示回答 |
|
|
77
|
-
| WhatsApp | 使用手机 WhatsApp 扫码关联设备 | WhatsApp Web
|
|
77
|
+
| WhatsApp | 使用手机 WhatsApp 扫码关联设备 | WhatsApp Web 长连接;默认仅响应账号自聊,也可切换到指定联系人或开放响应模式;群聊仅在被 @ 或回复机器人消息时触发,主人普通发言不触发;显示已读和“正在输入”,通过每秒编辑同一条消息显示工具进度和逐步生成的回答,长回复自动分段,编辑失败时回退为完整文字回复 |
|
|
78
78
|
| iMessage | 在 macOS Messages.app 中登录 iMessage,并按[渠道说明](docs/imessage.md)授予本机权限 | 使用 macOS 原生 Messages.app 收发文本私聊;不依赖 BlueBubbles;每个 macOS 用户账户使用一个本机 iMessage 身份 |
|
|
79
79
|
| Matrix(实验功能) | 填写 homeserver 地址,并提供访问令牌,或用户 ID 与密码 | CS API 长轮询接收;私聊直接回复,房间被 @ 后响应,支持线程回复、HTML 白名单富文本与编辑式流式输出,可回传图片和结果文件;包含实验性房间消息加解密,限制见下文 |
|
|
80
80
|
|
|
81
|
+
WhatsApp 会保存最近 2,000 条机器人群消息的标识,重启后仍可通过引用这些消息唤醒机器人。升级前未记录或已超出保留范围的历史消息不会作为唤醒依据;请 @ 机器人或回复其新消息。
|
|
82
|
+
|
|
81
83
|
Matrix 加密目前仅供非敏感测试:默认 optional 模式尝试启动加密引擎,失败时跳过收到的加密消息;required 模式在引擎启动失败时拒绝连接。尚未实现交互式设备验证、密钥备份、SSSS 或媒体附件内容加密,本次发布未验证真实 homeserver/Element 互通,请勿将其视为完整的端到端保密保障。
|
|
82
84
|
|
|
83
85
|
企业微信自建应用的回调基址、代理地址和企业可信 IP 配置,见[企业微信自建应用接入说明](docs/企业微信自建应用接入.md)。
|
|
@@ -90,6 +92,14 @@ Matrix 加密目前仅供非敏感测试:默认 optional 模式尝试启动加
|
|
|
90
92
|
|
|
91
93
|
支持图片输入的内置渠道均支持把 JPEG、PNG、WebP 图片,以及以图片文件方式发送的 GIF,连同可选文字说明发送给 Harness;默认每张原图最多接收 30 MB、每条消息最多 20 张;原图保存到会话工作区,模型副本自动缩放或压缩到单张 5 MB、总计 20 MB 以内,仍超限或模型不支持图片时按文件交给模型处理。这四项限制可在「通用设置 → 附件 → 图片输入」调整,对后续消息生效;原图沿用附件保留时长。调高模型输入上限会增加请求体积、处理耗时和模型成本,也仍受平台及宿主限制。iMessage 首版仅支持文本私聊,不包含在图片能力中。飞书下载用户消息中的图片或文件需要租户权限 `im:message:readonly`,确认页将其显示为“获取单聊、群组消息”;飞书目前没有为该下载接口提供仅限图片的更窄权限。扫码新建的应用会默认申请;已有或手动绑定的应用可私聊机器人执行 `/repair`,或在「IM机器人」设置页点击“补全权限”,扫码增量补全该权限、上传机器人图片或文件所需的 `im:resource`、原生命令面板所需的 `application:app_slash_command:read` / `write`,以及卡片回调。
|
|
92
94
|
|
|
95
|
+
### 群聊天记录与群文件
|
|
96
|
+
|
|
97
|
+
WhatsApp、飞书、Telegram、Discord、Slack、QQ 支持自动保存实际收到的群消息和附件,包括平台允许接收的未 @ 消息。采集默认开启,保存本身不触发模型回复;在群内 @ 机器人即可按需查询聊天记录、总结讨论或读取文件。
|
|
98
|
+
|
|
99
|
+
记录按群共享,独立于机器人、AI 会话和工作区,默认滚动保留 **14 天**。可在 **DSH 设置 → IM机器人 → 齿轮「通用设置」→ 通用** 修改保留天数。只保存实际接收的内容,不回填完整历史;QQ 当前按应用来源隔离,Discord 线程独立保存。
|
|
100
|
+
|
|
101
|
+
详见[群消息记录与群文件使用指南](docs/group-history.md):包含六渠道权限与设置步骤、查询示例、存储位置、文件限制和排查方法。WhatsApp、飞书、QQ 已完成文字及文本附件实测;Telegram 已完成文字实测,文件暂未验证;Discord、Slack 待真实群验收。
|
|
102
|
+
|
|
93
103
|
### 超时后的结果补发
|
|
94
104
|
|
|
95
105
|
已接入的 IM 渠道共用超时任务跟踪:收到“等待模型回复超时”后,插件会继续检查原任务,完成后向原聊天或线程补发最终文字;插件重启或连接恢复后也会继续检查。`/stop` 只停止当前聊天提交的对应回合,切换会话后不再向该聊天补发旧会话的结果。无需新增设置,正常回复流程保持原样。
|