@xmanrui/dsh-im 4.17.1 → 4.18.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.
Files changed (34) hide show
  1. package/README.en.md +17 -13
  2. package/README.md +16 -15
  3. package/lib/client.js +424 -246
  4. package/lib/index.js +280 -258
  5. package/package.json +7 -2
  6. package/plugin-src/client/access-policy-settings.js +5 -0
  7. package/plugin-src/client/channel-logos.js +10 -0
  8. package/plugin-src/client/channels/imessage/api.js +12 -0
  9. package/plugin-src/client/channels/imessage/index.js +45 -0
  10. package/plugin-src/client/channels/imessage/styles.js +19 -0
  11. package/plugin-src/client/channels/shared/token-api.js +1 -0
  12. package/plugin-src/client/channels/shared/token-channel.js +5 -1
  13. package/plugin-src/client/delivery-settings.js +5 -0
  14. package/plugin-src/client/i18n.js +23 -1
  15. package/plugin-src/client/index.js +20 -0
  16. package/plugin-src/client/session-channel-logos.js +2 -0
  17. package/plugin-src/client/styles.js +1 -0
  18. package/plugin-src/host/channels/imessage/index.mjs +21 -0
  19. package/plugin-src/host/channels/imessage/production.mjs +13 -0
  20. package/plugin-src/host/channels/imessage/rpc.mjs +70 -0
  21. package/plugin-src/host/channels/shared/access-policy-production.mjs +1 -1
  22. package/plugin-src/host/delivery-adapter.mjs +4 -0
  23. package/plugin-src/host/index.mjs +3 -0
  24. package/plugin-src/host/modern-harness-api.mjs +1 -1
  25. package/src/channels/imessage/config-store.mjs +24 -0
  26. package/src/channels/imessage/controller.mjs +37 -0
  27. package/src/channels/imessage/harness-client.mjs +7 -0
  28. package/src/channels/imessage/imessage-api.mjs +194 -0
  29. package/src/channels/imessage/imessage-bridge.mjs +16 -0
  30. package/src/channels/imessage/runtime.mjs +98 -0
  31. package/src/channels/imessage/state-store.mjs +3 -0
  32. package/src/channels/shared/i18n-en/shared-a.mjs +2 -2
  33. package/src/channels/shared/message-failure.mjs +5 -5
  34. package/src/channels/shared/session-channel-labels.mjs +1 -0
package/README.en.md CHANGED
@@ -36,7 +36,7 @@
36
36
 
37
37
  ## Introduction
38
38
 
39
- Connect IM bots to DeepSeek Harness by scanning a QR code, using an App Manifest, or entering existing bot credentials, and let the local Harness connect outward to a public AI Office. One plugin and one settings entry manage nine multi-bot IM channels and the AI Office Connector.
39
+ Connect IM bots to DeepSeek Harness by scanning a QR code, using an App Manifest, or entering existing bot credentials, and let the local Harness connect outward to a public AI Office. One plugin and one settings entry manage the built-in IM channels and the AI Office Connector. iMessage uses one native Messages.app identity per macOS user account; see the [iMessage channel notes](docs/imessage.md).
40
40
 
41
41
  ## Interface
42
42
 
@@ -57,22 +57,26 @@ Connect IM bots to DeepSeek Harness by scanning a QR code, using an App Manifest
57
57
  | 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; private chats stream through a Rich Message Draft and persist one rich final, groups and Topics finalize their placeholder in place, and unsupported Rich delivery falls back to ordinary text |
58
58
  | 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 |
59
59
  | 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 |
60
+ | 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 |
60
61
 
61
62
  Other IM platforms can be added through the same channel-adapter structure.
63
+ The iMessage contribution is documented separately in [the iMessage channel
64
+ notes](docs/imessage.md); it uses the native macOS Messages.app and requires no
65
+ third-party gateway.
62
66
 
63
67
  Feishu group chats accept messages from other bots that explicitly mention the current bot by default, with no extra setting. Messages without that mention, mentions of only other members or everyone, self-sent messages, and bot DMs are still ignored, even in all-message mode. Group allowlists and command permissions still apply. The app needs the `im:message.group_at_msg.include_bot:readonly` tenant scope. New apps request it through the QR flow; existing or manually connected apps can use **Complete permissions** or `/repair` in a direct chat, scan the QR code, and complete any publication or approval required by Feishu. See the [Feishu message-event permissions](https://open.feishu.cn/document/server-docs/im-v1/message/events/receive).
64
68
 
65
- All nine built-in channels can send JPEG, PNG, and WebP images, plus GIFs sent as image files, with optional captions to Harness. Each image is limited to 5 MB, and images in one message are limited to 20 MB in total. 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.
69
+ 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. Each image is limited to 5 MB, and images in one message are limited to 20 MB in total. 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.
66
70
 
67
71
  ### Results after a reply timeout
68
72
 
69
- All nine 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.
73
+ 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.
70
74
 
71
75
  Channel permissions and quotas still apply. Definite send failures allow up to three attempts; uncertain delivery is retained without automatic retries to avoid duplicate messages. Recovery covers final text and terminal notices, without replaying questions, approvals, or file-tool calls. See the [deferred delivery notes](docs/deferred-delivery.md).
72
76
 
73
77
  ### Result-file and image delivery
74
78
 
75
- All nine built-in channels can return any file readable by Harness as a native channel attachment. Existing files and files created by the current task can both be sent directly. The capability is available to every connected bot by default, with no switch or per-bot allowlist, while existing text, image, streaming, command, and Session behavior remains unchanged.
79
+ Built-in channels with file delivery support can return any file readable by Harness as a native channel attachment. Existing files and files created by the current task can both be sent directly. The capability is available to every connected bot by default, with no switch or per-bot allowlist, while existing text, image, streaming, command, and Session behavior remains unchanged. iMessage's MVP does not support files or attachments.
76
80
 
77
81
  After the model calls the file-return tool, the plugin hands the specified file to the channel's native API. Images prefer native image messages; if a channel does not support or definitively rejects image delivery, the plugin falls back to a file attachment, while an uncertain result never triggers a duplicate fallback. The plugin adds no rules for file origin, creation time, workspace boundary, extension, content, count, size, or lifetime; the file only needs to exist and be readable. A channel may still reject delivery according to its own permissions, quota, file capability, or account tier, and the plugin reports that provider result.
78
82
 
@@ -131,11 +135,11 @@ Use the proxy URL required by your network and restart the Host after changing i
131
135
  | Default behavior | Description |
132
136
  | --- | --- |
133
137
  | Bot workspace | Each bot stores its workspace independently. New bots start with the Host's current working directory, which can later be changed from the bot card. |
134
- | Model | Every bot in all nine IM channels can choose a model directly below its workspace, or follow the Host default. A change applies only to later new Sessions; send `/new` and then an ordinary message in the current chat to use it. |
138
+ | Model | Every bot in each IM channel can choose a model directly below its workspace, or follow the Host default. A change applies only to later new Sessions; send `/new` and then an ordinary message in the current chat to use it. |
135
139
  | Reasoning effort | Explicitly choose an effort supported by the selected model, or follow the model default. Levels, descriptions, and defaults come from DSH. Switching models restores the new model's default effort. Each bot saves its own choice, which applies only to later new Sessions. |
136
140
  | Agent Preset | Each bot can choose an Agent Preset on its settings card. When none is chosen, new Sessions follow the Host's `agent-presets.default`. A channel-level `config.agentPreset` is only the default for later new bots on that channel. Changing the preset never modifies or clears existing Sessions; if the current chat already has a Session, send `/new` and then a regular message to create one with the new selection. |
137
141
  | Context enhancement | Open settings from a bot card to enable groups and DMs independently. Both switches default to off, including for existing bots after an upgrade. |
138
- | Session channel identity | Sessions from all nine IM channels and AI Office on the local Host are marked with their source. The Web Session list and search results display channel logos in place of prefixes such as “WeChat ·”, preserving DSH's automatic title generation and updates. Existing Sessions receive the prefix when next loaded. |
142
+ | Session channel identity | Sessions from the local Host's IM channels and AI Office are marked with their source. The Web Session list and search results display channel logos in place of prefixes such as “WeChat ·”, preserving DSH's automatic title generation and updates. Existing Sessions receive the prefix when next loaded. |
139
143
 
140
144
  Channel prefixes are appended after DSH produces a title, preserving its complete text and automatic/manual source without pinning automatic titles or making additional model calls. Regeneration, refresh, and restarts do not stack prefixes; actual manual renames retain DSH's normal pinning behavior. This feature uses the current Host's Session events; an explicit remote `harnessBaseUrl` requires the plugin on the destination Host.
141
145
 
@@ -143,11 +147,11 @@ Logos are a dsh-im browser enhancement and require no changes to DSH. The adapte
143
147
 
144
148
  ### Proactive delivery
145
149
 
146
- All nine IM channels can proactively send text through a stable `botId + targetId` pair. Bot settings support choosing a known conversation or entering a target manually, testing the current route before saving, and copying call parameters. HTTP POST, same-Host plugins, and Connection RPC share the same target configuration and delivery core.
150
+ IM channels with proactive delivery support can send text through a stable `botId + targetId` pair. Bot settings support choosing a known conversation or entering a target manually, testing the current route before saving, and copying call parameters. HTTP POST, same-Host plugins, and Connection RPC share the same target configuration and delivery core.
147
151
 
148
152
  Saved direct-message targets also offer an opt-in **Two-way Session sync** switch. Once enabled, user text submitted from DSH Web/CLI and the final assistant text in that DM's current Session are mirrored back to the DM; ordinary IM prompts and `/steer` are not duplicated. The switch follows the current Session across `/session`, `/new`, and workspace changes. The first version supports text DMs on the current Host only; groups, Topics, Threads, and explicit remote `harnessBaseUrl` connections are unavailable.
149
153
 
150
- See the [Proactive Delivery Guide](PROACTIVE_DELIVERY.en.md) ([简体中文](PROACTIVE_DELIVERY.md)) for setup steps, native fields for all nine channels, complete call examples, management endpoints, error codes, and troubleshooting.
154
+ See the [Proactive Delivery Guide](PROACTIVE_DELIVERY.en.md) ([简体中文](PROACTIVE_DELIVERY.md)) for setup steps, native fields for each supported channel, complete call examples, management endpoints, error codes, and troubleshooting.
151
155
 
152
156
  ### Context enhancement
153
157
 
@@ -206,9 +210,9 @@ DingTalk menus use a shared template built into the plugin; no template setup is
206
210
 
207
211
  ## Other features
208
212
 
209
- - **Image understanding**: all nine built-in channels can send JPEG, PNG, WebP, and GIF files sent as images to Harness, with an optional text description. Each image is limited to 5 MB, and all images in one message are limited to 20 MB in total.
213
+ - **Image understanding**: built-in channels with image input support can send JPEG, PNG, WebP, and GIF files sent as images to Harness, with an optional text description. Each image is limited to 5 MB, and all images in one message are limited to 20 MB in total. iMessage's MVP supports text DMs only.
210
214
  - **Switch workspaces from a bot card**: every bot card on the settings page shows its current Harness workspace. Enter an existing absolute directory path directly or open the directory picker. Switching clears only that bot's old chat mappings; it never deletes, empties, or archives old Sessions. Replies already in progress may finish, while later messages use the new workspace.
211
- - **Choose a model and reasoning effort from a bot card**: every bot card in all nine IM channels offers model and effort controls below the workspace, with DSH-style provider groups, descriptions, and checkmarks. Select an available model and one of its supported efforts, or use the model default. Leaving the model unset follows the Host default. Settings are stored per bot and used only for later new Sessions; existing Sessions and replies already in progress are unchanged.
215
+ - **Choose a model and reasoning effort from a bot card**: every bot card in each IM channel offers model and effort controls below the workspace, with DSH-style provider groups, descriptions, and checkmarks. Select an available model and one of its supported efforts, or use the model default. Leaving the model unset follows the Host default. Settings are stored per bot and used only for later new Sessions; existing Sessions and replies already in progress are unchanged.
212
216
  - **Choose an Agent Preset from a bot card**: every bot card can select one of the Host's existing Agent Presets, or follow the Host default. The change applies only to that bot and only to later new Sessions; existing Sessions and replies already in progress are left unchanged.
213
217
  - **Check the connection and send a test message**: when a bot is online, clicking **Check connection** verifies the platform connection and sends a “DeepSeek Harness connection test succeeded” message to the bot's most recently remembered direct conversation; WhatsApp uses the account's self-chat. The test neither creates a Harness Session nor invokes the model. The bot must have received at least one direct message before it has a remembered test target; otherwise the page reports that no test conversation is available yet.
214
218
  - **Retry a connection or remove an integration**: when a bot is offline, its card action changes to **Retry connection**. Use **Remove integration** when the bot is no longer needed. Each action affects only the selected bot and leaves other bots and channels unchanged.
@@ -217,10 +221,10 @@ DingTalk menus use a shared template built into the plugin; no template setup is
217
221
 
218
222
  ## Design
219
223
 
220
- - Registers one top-level **IM Bot** settings page containing nine IM channels and one AI Office Connector.
221
- - Maintains the Host, client, and runtime sources for all nine channels and the Office Connector in this repository without external standalone plugins.
224
+ - Registers one top-level **IM Bot** settings page containing the built-in IM channels and one AI Office Connector.
225
+ - Maintains the Host, client, and runtime sources for the built-in channels and the Office Connector in this repository without external standalone plugins.
222
226
  - Follows the DeepSeek Harness language preference and switches the settings UI live between Chinese and English. Bot chat messages follow the Host's `language` config (Chinese by default; `en` switches them to English), with Chinese always as the fallback so untranslated text is sent verbatim.
223
- - Uses logos for WeChat, Feishu, DingTalk, WeCom, QQ, Slack, Telegram, Discord, WhatsApp, and AI Office navigation without enable/disable switches.
227
+ - Uses logos for WeChat, Feishu, DingTalk, WeCom, QQ, Slack, Telegram, Discord, WhatsApp, iMessage, and AI Office navigation without enable/disable switches.
224
228
  - Keeps RPC endpoints, credentials, connection supervision, and session mappings isolated by IM channel; the Office Connector separately owns Device credentials, Job leases, approval waits, and concurrency limits.
225
229
  - Returns only QR codes, the public Slack Manifest, redacted status data, and access modes or allowlist identifiers explicitly saved for the current Telegram or WhatsApp bot. 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, AI Office Device Tokens, or other raw user identifiers observed from platform messages.
226
230
 
package/README.md CHANGED
@@ -37,9 +37,9 @@
37
37
 
38
38
  ## 简介
39
39
 
40
- 通过扫码、App Manifest 或已有机器人凭据把 IM 机器人接入 DeepSeek Harness,并让本机 Harness 主动连接公网 AI Office。一个插件、一个设置入口,统一管理十种 IM 渠道和 AI Office Connector。**每个 IM 渠道都支持接入多个机器人**,各机器人的连接状态、工作区、模型和会话绑定彼此独立。
40
+ 通过扫码、App Manifest 或已有机器人凭据把 IM 机器人接入 DeepSeek Harness,并让本机 Harness 主动连接公网 AI Office。一个插件、一个设置入口,统一管理内置 IM 渠道和 AI Office Connector。**每个 IM 渠道都支持接入多个机器人**,各机器人的连接状态、工作区、模型和会话绑定彼此独立;iMessage 是本机 Messages.app 身份接入的例外,详见[iMessage 渠道说明](docs/imessage.md)。
41
41
 
42
- Connect IM bots to DeepSeek Harness by scanning a QR code, using an App Manifest, or entering existing bot credentials, and let the local Harness connect outward to a public AI Office. One plugin and one settings entry manage nine multi-bot IM channels and the AI Office Connector.
42
+ Connect IM bots to DeepSeek Harness by scanning a QR code, using an App Manifest, or entering existing bot credentials, and let the local Harness connect outward to a public AI Office. One plugin and one settings entry manage the built-in IM channels and the AI Office Connector.
43
43
 
44
44
  ## 界面
45
45
 
@@ -61,6 +61,7 @@ Connect IM bots to DeepSeek Harness by scanning a QR code, using an App Manifest
61
61
  | Telegram | 使用 @BotFather 生成的 Bot Token | Bot API 长轮询;默认私聊直接响应、群聊被提及或回复时响应,也可为每个机器人独立启用私聊白名单安全模式;私聊通过 Rich Message Draft 流式预览并持久化最终富消息,群聊和 Topic 原位完成占位消息,平台不支持时回退为普通文字 |
62
62
  | Discord | 使用 Developer Portal 生成的 Bot Token | Gateway v10 长连接;私信直接回复;服务器文字/公告频道首次 @ 后创建原生 Thread,后续在线程中无需重复 @,并通过编辑消息流式显示回答 |
63
63
  | WhatsApp | 使用手机 WhatsApp 扫码关联设备 | WhatsApp Web 长连接;默认仅响应账号自聊,也可切换到指定联系人或开放响应模式;显示已读和“正在输入”,通过每秒编辑同一条消息显示工具进度和逐步生成的回答,长回复自动分段,编辑失败时回退为完整文字回复 |
64
+ | iMessage | 在 macOS Messages.app 中登录 iMessage,并按[渠道说明](docs/imessage.md)授予本机权限 | 使用 macOS 原生 Messages.app 收发文本私聊;不依赖 BlueBubbles;每个 macOS 用户账户使用一个本机 iMessage 身份 |
64
65
 
65
66
  企业微信自建应用的回调基址、代理地址和企业可信 IP 配置,见[企业微信自建应用接入说明](docs/企业微信自建应用接入.md)。
66
67
 
@@ -68,17 +69,17 @@ Connect IM bots to DeepSeek Harness by scanning a QR code, using an App Manifest
68
69
 
69
70
  飞书群聊默认接收其他机器人明确 @ 当前机器人的消息,无需额外开关;未 @、仅 @ 其他成员或全体、机器人自身发送的消息和机器人私聊消息仍会忽略,即使群聊响应方式设为“全部”。消息仍受群聊白名单与命令权限约束。飞书应用需要租户权限 `im:message.group_at_msg.include_bot:readonly`(“获取群组中其他机器人和用户@当前机器人的消息”);扫码新建应用会默认申请,已有或手动绑定的应用可点击“补全权限”或私聊执行 `/repair`,扫码并完成飞书要求的发布审批后生效。详见[飞书接收消息权限说明](https://open.feishu.cn/document/server-docs/im-v1/message/events/receive)。
70
71
 
71
- 十个内置渠道均支持把 JPEG、PNG、WebP 图片,以及以图片文件方式发送的 GIF,连同可选文字说明发送给 Harness;单张图片上限为 5 MB,单条消息中的图片总大小上限为 20 MB。飞书下载用户消息中的图片或文件需要租户权限 `im:message:readonly`,确认页将其显示为“获取单聊、群组消息”;飞书目前没有为该下载接口提供仅限图片的更窄权限。扫码新建的应用会默认申请;已有或手动绑定的应用可私聊机器人执行 `/repair`,或在「IM机器人」设置页点击“补全权限”,扫码增量补全该权限、上传机器人图片或文件所需的 `im:resource`、原生命令面板所需的 `application:app_slash_command:read` / `write`,以及卡片回调。
72
+ 支持图片输入的内置渠道均支持把 JPEG、PNG、WebP 图片,以及以图片文件方式发送的 GIF,连同可选文字说明发送给 Harness;单张图片上限为 5 MB,单条消息中的图片总大小上限为 20 MB。iMessage 首版仅支持文本私聊,不包含在图片能力中。飞书下载用户消息中的图片或文件需要租户权限 `im:message:readonly`,确认页将其显示为“获取单聊、群组消息”;飞书目前没有为该下载接口提供仅限图片的更窄权限。扫码新建的应用会默认申请;已有或手动绑定的应用可私聊机器人执行 `/repair`,或在「IM机器人」设置页点击“补全权限”,扫码增量补全该权限、上传机器人图片或文件所需的 `im:resource`、原生命令面板所需的 `application:app_slash_command:read` / `write`,以及卡片回调。
72
73
 
73
74
  ### 超时后的结果补发
74
75
 
75
- 十个渠道共用超时任务跟踪:收到“等待模型回复超时”后,插件会继续检查原任务,完成后向原聊天或线程补发最终文字;插件重启或连接恢复后也会继续检查。`/stop` 只停止当前聊天提交的对应回合,切换会话后不再向该聊天补发旧会话的结果。无需新增设置,正常回复流程保持原样。
76
+ 已接入的 IM 渠道共用超时任务跟踪:收到“等待模型回复超时”后,插件会继续检查原任务,完成后向原聊天或线程补发最终文字;插件重启或连接恢复后也会继续检查。`/stop` 只停止当前聊天提交的对应回合,切换会话后不再向该聊天补发旧会话的结果。无需新增设置,正常回复流程保持原样。
76
77
 
77
78
  补发仍受渠道发送权限和配额限制。明确发送失败最多尝试三次;发送结果不确定时保留记录并停止自动重试,避免重复消息。此机制恢复文字结果和终态通知,不重放问题、审批或文件工具调用。详见[延迟交付说明](docs/deferred-delivery.md)。
78
79
 
79
80
  ### 结果文件与图片回传
80
81
 
81
- 十个内置渠道均已实现把 Harness 可读取的文件作为渠道原生附件回传。已有文件和当前任务新生成的文件都可以直接发送;该能力对所有已连接机器人默认可用,无需开关或机器人白名单,原有文字、图片、流式回复、命令和会话行为保持不变。
82
+ 支持文件回传的内置渠道均可把 Harness 可读取的文件作为渠道原生附件回传。已有文件和当前任务新生成的文件都可以直接发送;该能力对所有已连接机器人默认可用,无需开关或机器人白名单,原有文字、图片、流式回复、命令和会话行为保持不变。iMessage 首版不支持文件或附件回传。
82
83
 
83
84
  模型调用文件回传工具后,插件把指定文件交给当前渠道的原生接口。图片会优先以原生图片消息呈现;渠道不支持或明确拒绝图片发送时自动回退为文件附件,发送结果不确定时不会补发文件造成重复消息。插件不额外设置文件来源、创建时间、工作区边界、扩展名、内容、数量、大小或有效期规则;文件只需真实存在且可读取。渠道平台仍可能依据自身权限、配额、文件能力或账号等级拒绝发送,插件会按平台返回结果提示。
84
85
 
@@ -137,11 +138,11 @@ dsh web
137
138
  | 默认行为 | 说明 |
138
139
  | --- | --- |
139
140
  | 机器人工作区 | 每个机器人独立保存工作区。新机器人默认使用 Host 当时的工作目录;之后可在机器人卡片中修改。 |
140
- | 模型 | 九个 IM 渠道的每个机器人都可在工作区下方独立选择模型;未选择时跟随 Host 默认。切换只影响之后新建的会话;当前聊天先发送 `/new`,再发送普通消息才会使用新选择。 |
141
+ | 模型 | 每个 IM 渠道的每个机器人都可在工作区下方独立选择模型;未选择时跟随 Host 默认。切换只影响之后新建的会话;当前聊天先发送 `/new`,再发送普通消息才会使用新选择。 |
141
142
  | 思考强度 | 在模型下方显式选择该模型支持的思考强度,或跟随模型默认。档位、说明和默认值来自 DSH;切换模型后恢复新模型默认强度。每个机器人独立保存,只影响之后新建的会话。 |
142
143
  | Agent Preset | 每个机器人可在设置页卡片中选择 Agent Preset。未选择时跟随 Host 的 `agent-presets.default`;渠道级 `config.agentPreset` 只作为该渠道之后新接入机器人的默认值。切换不会修改或清空已有会话;若当前聊天已有会话,需先发送 `/new`,再发送一条普通消息,才会按新选择创建会话。 |
143
144
  | 上下文增强 | 从机器人卡片打开设置,分别决定群聊、私聊是否增强;两个开关默认均关闭,旧机器人升级后也不会自动开启。 |
144
- | 会话渠道标识 | 本机 Host 的九个 IM 渠道与 AI Office 会话自动标记来源。Web 会话列表和搜索结果将「微信 ·」等前缀显示为渠道 Logo;保留 DSH 原有的自动标题生成与更新。已有会话在下次加载时补上。 |
145
+ | 会话渠道标识 | 本机 Host IM 渠道与 AI Office 会话自动标记来源。Web 会话列表和搜索结果将「微信 ·」等前缀显示为渠道 Logo;保留 DSH 原有的自动标题生成与更新。已有会话在下次加载时补上。 |
145
146
 
146
147
  渠道前缀在 DSH 生成标题后追加,完整保留原始标题与自动/手动来源,不会将自动标题锁定为手动命名,也不会额外调用模型。重复生成、刷新或重启不会叠加前缀;真实的手动命名仍遵循 DSH 原有的锁定规则。此功能由当前 Host 的会话事件驱动,显式连接远程 `harnessBaseUrl` 时需在目标 Host 上安装该插件。
147
148
 
@@ -149,11 +150,11 @@ Logo 由 dsh-im 的浏览器适配显示,无需修改 DSH。适配保留原始
149
150
 
150
151
  ### 主动投递
151
152
 
152
- 九个 IM 渠道都可以使用稳定的 `botId + targetId` 主动发送文字消息。机器人设置页支持从已聊会话选择或手工填写目标、保存前测试当前路由,以及复制调用参数;HTTP POST、同 Host 插件和 Connection RPC 共用同一目标配置与投递核心。
153
+ 支持主动投递的 IM 渠道可以使用稳定的 `botId + targetId` 主动发送文字消息。机器人设置页支持从已聊会话选择或手工填写目标、保存前测试当前路由,以及复制调用参数;HTTP POST、同 Host 插件和 Connection RPC 共用同一目标配置与投递核心。
153
154
 
154
155
  已保存的私聊目标还可以开启默认关闭的「会话双向同步」。开启后,DSH Web/CLI 在该私聊当前 Session 中发送的用户文字和最终助手文字会同步回私聊;IM 侧原有提问与 `/steer` 不会重复。开关自动跟随 `/session`、`/new` 和工作区切换后的当前 Session。首版仅支持当前 Host 的私聊文字;群聊、Topic、Thread 与显式远程 `harnessBaseUrl` 不支持。
155
156
 
156
- 设置步骤、九渠道字段、完整调用示例、管理端点、错误码与排错说明请查看[《主动投递使用指南》](PROACTIVE_DELIVERY.md)([English](PROACTIVE_DELIVERY.en.md))。
157
+ 设置步骤、各渠道字段、完整调用示例、管理端点、错误码与排错说明请查看[《主动投递使用指南》](PROACTIVE_DELIVERY.md)([English](PROACTIVE_DELIVERY.en.md))。
157
158
 
158
159
  ### 上下文增强
159
160
 
@@ -212,9 +213,9 @@ Logo 由 dsh-im 的浏览器适配显示,无需修改 DSH。适配保留原始
212
213
 
213
214
  ## 其它功能
214
215
 
215
- - **图片识别**:九个内置渠道都可以把 JPEG、PNG、WebP,以及以图片文件方式发送的 GIF 交给 Harness;图片可以附带文字说明。单张图片上限为 5 MB,单条消息中的图片总大小上限为 20 MB。
216
+ - **图片识别**:支持图片输入的内置渠道都可以把 JPEG、PNG、WebP,以及以图片文件方式发送的 GIF 交给 Harness;图片可以附带文字说明。单张图片上限为 5 MB,单条消息中的图片总大小上限为 20 MB。iMessage 首版仅支持文本私聊。
216
217
  - **在机器人卡片切换工作区**:设置页中的每张机器人卡片都会显示当前 Harness 工作区。可以直接填写已有目录的绝对路径,也可以打开目录选择器。切换只清除该机器人的旧聊天映射,不会删除、清空或归档旧 Session;已经开始的回复可以继续完成,后续消息使用新工作区。
217
- - **在机器人卡片选择模型与思考强度**:九个 IM 渠道的每张机器人卡片都在工作区下方提供模型与思考强度入口,采用 DSH 风格的分组列表、档位说明和选中标记。先选择 Host 当前可用模型,再选择其支持的强度,或跟随模型默认;未选模型时整体跟随 Host 默认。设置按机器人独立保存,只用于之后新建的 Session;已有 Session 和正在生成的回复不受影响。
218
+ - **在机器人卡片选择模型与思考强度**:每个 IM 渠道的每张机器人卡片都在工作区下方提供模型与思考强度入口,采用 DSH 风格的分组列表、档位说明和选中标记。先选择 Host 当前可用模型,再选择其支持的强度,或跟随模型默认;未选模型时整体跟随 Host 默认。设置按机器人独立保存,只用于之后新建的 Session;已有 Session 和正在生成的回复不受影响。
218
219
  - **在机器人卡片选择 Agent Preset**:设置页中的每张机器人卡片都可以选择 Host 已有的 Agent Preset,或跟随 Host 默认。切换只作用于该机器人,并且只影响之后新建的会话;已有会话和正在生成的回复不受影响。
219
220
  - **检查连接并发送测试消息**:机器人在线时,点击卡片上的「检查连接」会检查平台连接,并向该机器人最近记录的私聊发送一条“DeepSeek Harness 连接测试成功”消息;WhatsApp 会发送到账号自聊。测试消息不会创建 Harness Session,也不会调用模型。机器人必须至少收到过一条私聊才能记住测试目标,否则页面会提示尚无可用的测试会话。
220
221
  - **重试连接和移除接入**:机器人离线时,卡片上的操作会变为「重试连接」;不再使用时可以点击「移除接入」。这些操作都只作用于所选机器人,不影响其他机器人或渠道。
@@ -223,11 +224,11 @@ Logo 由 dsh-im 的浏览器适配显示,无需修改 DSH。适配保留原始
223
224
 
224
225
  ## 设计
225
226
 
226
- - Harness 一级设置菜单中只注册一个「IM机器人」设置页,其中包含九个 IM 渠道和一个 AI Office Connector;
227
- - 九个渠道及 Office Connector 的 Host、客户端与运行时源码都在本仓库维护,不依赖外部独立插件;
227
+ - Harness 一级设置菜单中只注册一个「IM机器人」设置页,其中包含内置 IM 渠道和一个 AI Office Connector;
228
+ - 内置渠道及 Office Connector 的 Host、客户端与运行时源码都在本仓库维护,不依赖外部独立插件;
228
229
  - 设置页跟随 DeepSeek Harness 的语言选择,在中文和 English 之间即时切换;机器人发出的聊天消息跟随 Host 的 `language` 配置(默认中文;设为 `en` 即为英文),中文始终为兜底,未收录的文案原样输出;
229
- - 左侧使用 Logo 切换微信、飞书、钉钉、企业微信、QQ、Slack、Telegram、Discord、WhatsApp 和 AI Office,不使用启用/停用开关;
230
- - 九个 IM 渠道保持独立的 RPC、凭据、连接监督和会话映射;Office Connector 另行维护设备凭据、Job 租约、审批等待与并发上限;
230
+ - 左侧使用 Logo 切换微信、飞书、钉钉、企业微信、企业微信应用、QQ、Slack、Telegram、Discord、WhatsApp、iMessage 和 AI Office,不使用启用/停用开关;
231
+ - IM 渠道保持独立的 RPC、凭据、连接监督和会话映射;Office Connector 另行维护设备凭据、Job 租约、审批等待与并发上限;
231
232
  - 浏览器只获得二维码、Manifest、脱敏状态,以及用户为当前 Telegram 或 WhatsApp 机器人主动保存的访问模式和白名单标识;手动输入的 Secret 或 Token 仅单向提交给本机 Host,任何 RPC 响应都不会返回 App Secret、`bot_token`、钉钉 `client_secret`、企业微信 Secret、QQ `app_secret`、Slack Bot/App Token、Telegram/Discord Bot Token、WhatsApp 关联设备密钥、AI Office Device Token,或从平台消息中观察到的其他原始用户标识。
232
233
 
233
234
  ## 本地开发