@xmanrui/dsh-im 0.12.0 → 0.13.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 +43 -37
- package/README.md +45 -39
- package/lib/client.js +2 -2
- package/lib/index.js +113 -112
- package/package.json +1 -1
- package/plugin-src/client/i18n.js +1 -1
- package/plugin-src/client/index.js +1 -1
- package/scripts/verify-package.mjs +34 -0
- package/src/channels/dingtalk/dingtalk-bridge.mjs +3 -2
- package/src/channels/discord/discord-api.mjs +1 -1
- package/src/channels/feishu/bridge.mjs +3 -2
- package/src/channels/qq/qq-bridge.mjs +3 -2
- package/src/channels/shared/model-command.mjs +44 -6
- package/src/channels/shared/text-harness-bridge.mjs +3 -2
- package/src/channels/wecom/wecom-bridge.mjs +3 -2
- package/src/channels/weixin/weixin-api.mjs +1 -1
- package/src/channels/weixin/weixin-bridge.mjs +3 -2
package/README.en.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
<div align="center">
|
|
6
|
-
<p><strong>
|
|
6
|
+
<p><strong>DeepSeek Harness, always within reach</strong></p>
|
|
7
7
|
|
|
8
8
|
<p>
|
|
9
9
|
<img src="https://dsh-im-random-badge.xmanrui-dsh-im.workers.dev" alt="滑动变祖器:今天是梁子或今天是梁圣(随机)">
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
## Introduction
|
|
34
34
|
|
|
35
|
-
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.
|
|
35
|
+
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. **Every channel supports multiple bots**, each with independent connection state, workspace, and session bindings. It also supports switching workspaces and rebinding sessions.
|
|
36
36
|
|
|
37
37
|
## Interface
|
|
38
38
|
|
|
@@ -40,15 +40,17 @@ Connect IM bots to DeepSeek Harness by scanning a QR code, using an App Manifest
|
|
|
40
40
|
|
|
41
41
|
## Built-in channels
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
| Channel | Setup | Messaging and replies |
|
|
44
|
+
| --- | --- | --- |
|
|
45
|
+
| Feishu | Create a bot by QR code, or bind one with App ID + App Secret | Persistent connection for incoming messages; streaming cards show thinking, tool progress, and replies |
|
|
46
|
+
| WeChat | Scan a QR code to bind a WeChat bot | Tencent iLink long polling for sending and receiving messages |
|
|
47
|
+
| DingTalk | Create a bot by QR code, or bind one with Client ID + Client Secret | DingTalk Stream connection; streaming replies through AI Cards |
|
|
48
|
+
| WeCom | Create an intelligent bot by QR code, or bind one with Bot ID + Secret | Official WebSocket connection; native thinking state, tool progress, and streaming replies |
|
|
49
|
+
| QQ | Create a bot with mobile QQ QR scanning, or bind one with AppID + AppSecret | WebSocket connection; native typing and streaming replies in private chats, replies when mentioned in groups |
|
|
50
|
+
| 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 |
|
|
51
|
+
| Telegram | Enter a Bot Token generated by @BotFather | Bot API long polling; direct private replies, mention-or-reply group handling, and streaming through message edits |
|
|
52
|
+
| Discord | Enter a Bot Token generated in the Developer Portal | Gateway v10 connection; direct DM replies, mention-only server replies, and streaming through message edits |
|
|
53
|
+
| WhatsApp | Scan a QR code with mobile WhatsApp to link a device | WhatsApp Web connection; read receipt and typing indicator followed by the final answer |
|
|
52
54
|
|
|
53
55
|
Other IM platforms can be added through the same channel-adapter structure.
|
|
54
56
|
|
|
@@ -70,37 +72,25 @@ To try the latest code before it is published to npm, use the GitHub-source inst
|
|
|
70
72
|
npx -y github:xmanrui/dsh-im install
|
|
71
73
|
```
|
|
72
74
|
|
|
73
|
-
A GitHub-source installation fetches and builds a Git dependency directly. With pnpm 10 or newer, the profile may first need an `allowBuilds` entry in `pnpm-workspace.yaml`. Most users should prefer the stable npm release.
|
|
75
|
+
A GitHub-source installation fetches and builds a Git dependency directly. With pnpm 10 or newer, the profile may first need an `allowBuilds` entry in `pnpm-workspace.yaml`. Most users should prefer the stable npm release.
|
|
74
76
|
|
|
75
|
-
|
|
77
|
+
After installation, follow the built-in instructions on each channel page to scan a QR code or enter credentials. Secrets and Tokens are sent only to the local Harness Host and stored through its protected credential provider; status responses and bot lists never return them.
|
|
76
78
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
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.
|
|
82
|
-
|
|
83
|
-
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.
|
|
84
|
-
|
|
85
|
-
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. Image downloads add no separate scope, but they depend on the bot's existing **企业内机器人发送消息权限** permission. A manually bound app without that permission can receive an image callback but cannot exchange it for a temporary download URL.
|
|
86
|
-
|
|
87
|
-
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.
|
|
88
|
-
|
|
89
|
-
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.
|
|
90
|
-
|
|
91
|
-
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. Reading user-sent images requires the tenant scope `im:message:readonly`. Newly QR-created apps request it automatically; apps created before this upgrade must add the scope in the Feishu developer console, publish a version, and complete any required administrator approval.
|
|
92
|
-
|
|
93
|
-
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.
|
|
94
|
-
|
|
95
|
-
When a channel does not explicitly configure `agentPreset`, each new IM session inherits the Harness-wide `agent-presets.default`. Harness reads that default whenever it creates a session, so changing the setting affects only sessions created afterwards; existing sessions and sessions bound with `/session` keep their own preset. An explicit channel `agentPreset` always takes precedence for newly created sessions.
|
|
79
|
+
| Default behavior | Description |
|
|
80
|
+
| --- | --- |
|
|
81
|
+
| 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. |
|
|
82
|
+
| Agent Preset | New Sessions inherit Harness's `agent-presets.default` unless the channel explicitly overrides it. Later changes do not affect existing Sessions. |
|
|
96
83
|
|
|
97
84
|
## Bot commands
|
|
98
85
|
|
|
99
86
|
| Command | Description |
|
|
100
87
|
| --- | --- |
|
|
101
|
-
| `/
|
|
88
|
+
| `/help` | Show the commands and usage supported by the bot. |
|
|
89
|
+
| `/new` | Unbind the current chat so its next ordinary message starts a new Harness Session. |
|
|
90
|
+
| `/status` | Check the connection between the current bot and DeepSeek Harness. |
|
|
91
|
+
| `/models` | List every currently configured model with a number. |
|
|
102
92
|
| `/model` | Show the model used by the Session bound to this chat. |
|
|
103
|
-
| `/model <provider/model-id>` | Switch the model for the Session bound to this chat. |
|
|
93
|
+
| `/model <number or provider/model-id>` | Switch the model for the Session bound to this chat. |
|
|
104
94
|
| `/stop` | Immediately stop this chat's running task while preserving work that has not started. |
|
|
105
95
|
| `/steer <additional instruction>` | Inject an additional instruction into this chat's running task. |
|
|
106
96
|
| `/compact` | Immediately compact older context in the Session bound to the current chat. |
|
|
@@ -108,11 +98,18 @@ When a channel does not explicitly configure `agentPreset`, each new IM session
|
|
|
108
98
|
| `/workspacelist` | List workspace absolute paths that still exist on the current Harness Host. |
|
|
109
99
|
| `/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. |
|
|
110
100
|
| `/session <Session ID>` | Bind the current chat to an existing Harness session. |
|
|
101
|
+
| Interactive question | Reply with an option number, option label, or custom text; separate multiple choices with commas. |
|
|
102
|
+
| Remote approval | Reply with `批准` / `拒绝` / `同意` / `不同意` / `yes` / `no`. |
|
|
111
103
|
|
|
112
|
-
|
|
104
|
+
Example: send `/models`, then `/model 2` to switch to the second model in the list. Other examples: `/help`, `/new`, `/status`, `/model deepseek-official/deepseek-v4-pro`, `/steer inspect only the configuration file`, `/stop`, `/compact`, `/workspace /Users/alice/projects/my-app`, `/sessionlist 2`, `/sessionlist /Users/alice/projects/my-app`, or `/session session-id`
|
|
113
105
|
|
|
114
|
-
|
|
115
|
-
|
|
106
|
+
### Command details
|
|
107
|
+
|
|
108
|
+
- `/help` takes no arguments and never creates a Session. It returns the complete command list supported by the current bot.
|
|
109
|
+
- `/status` takes no arguments, never prompts the model, and does not change the Session binding. It confirms that the current bot can reach DeepSeek Harness.
|
|
110
|
+
- `/new` only removes the current chat's saved dsh-im Session binding; it never deletes, empties, or archives the old Session. The next ordinary message creates and binds a new Session in the current workspace. If a task is running or waiting for a question or approval, finish the interaction or use `/stop` before `/new`.
|
|
111
|
+
- `/models` takes no arguments and never creates a Session. It assigns a number to every currently configured Harness model and also shows its stable, copyable `provider/model-id`. If one provider fails, models from the remaining providers are still shown.
|
|
112
|
+
- Bare `/model` only displays the current Session model. A model can be selected by the number or exact full ID returned by `/models`, for example `/model 2`. When the chat has no Session yet, a valid switch creates and binds a blank Session without prompting the model. The switch affects only that Session; Harness also attempts to save it as the default for future Sessions, while other existing Sessions remain unchanged.
|
|
116
113
|
- A model cannot be switched while a task is running or waiting for an approval or question answer. Wait for it to finish or use `/stop` first. A Session containing images cannot switch to a model that does not accept image input.
|
|
117
114
|
- `/stop` and `/steer` control only a running task started by this chat. Even when multiple chats bind the same Session, they do not intentionally control another chat's task. `/stop` does not delete the Session or its history, preserves queued work that has not started, and is safe to repeat.
|
|
118
115
|
- `/steer` accepts text only, including multiple lines. It neither creates another Session nor starts a second task. Send an ordinary message when no task is running; while an approval or question is pending, answer it first or use `/stop`.
|
|
@@ -131,6 +128,15 @@ Examples: `/models`, `/model deepseek-official/deepseek-v4-pro`, `/steer inspect
|
|
|
131
128
|
- A successful switch clears only the current bot's old Harness session mappings and does not affect other bots.
|
|
132
129
|
- The new workspace applies to subsequent messages; a reply that has already started generating is allowed to finish.
|
|
133
130
|
|
|
131
|
+
## Other features
|
|
132
|
+
|
|
133
|
+
- **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.
|
|
134
|
+
- **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.
|
|
135
|
+
- **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.
|
|
136
|
+
- **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.
|
|
137
|
+
- **Manage multiple bots independently**: a channel can have multiple connected bots. Credentials, connection state, workspace, and chat-to-Session mappings are kept separately for every bot, so card actions do not affect sibling bots.
|
|
138
|
+
- **Streaming replies and progress**: the plugin uses each platform's available capabilities to show thinking state, tool progress, and incremental answers. Platforms without a native streaming API complete replies through message edits, card updates, or a final message.
|
|
139
|
+
|
|
134
140
|
## Design
|
|
135
141
|
|
|
136
142
|
- Registers a single **IM Bot** settings page in Harness.
|
package/README.md
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
<div align="center">
|
|
6
|
-
<p><strong
|
|
7
|
-
<p><strong>
|
|
6
|
+
<p><strong>让 DeepSeek Harness 触手可及</strong></p>
|
|
7
|
+
<p><strong>DeepSeek Harness, always within reach</strong></p>
|
|
8
8
|
|
|
9
9
|
<p>
|
|
10
10
|
<img src="https://dsh-im-random-badge.xmanrui-dsh-im.workers.dev" alt="滑动变祖器:今天是梁子或今天是梁圣(随机)">
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
|
|
34
34
|
## 简介
|
|
35
35
|
|
|
36
|
-
通过扫码、App Manifest 或已有机器人凭据把 IM 机器人接入 DeepSeek Harness。一个插件、一个设置入口,统一管理飞书、微信、钉钉、企业微信、QQ、Slack、Telegram、Discord 和 WhatsApp
|
|
36
|
+
通过扫码、App Manifest 或已有机器人凭据把 IM 机器人接入 DeepSeek Harness。一个插件、一个设置入口,统一管理飞书、微信、钉钉、企业微信、QQ、Slack、Telegram、Discord 和 WhatsApp。**每个渠道都支持接入多个机器人**,各机器人的连接状态、工作区和会话绑定彼此独立。支持切换工作区和重新绑定会话。
|
|
37
37
|
|
|
38
|
-
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.
|
|
38
|
+
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. **Every channel supports multiple bots**, each with independent connection state, workspace, and session bindings. It also supports switching workspaces and rebinding sessions.
|
|
39
39
|
|
|
40
40
|
## 界面
|
|
41
41
|
|
|
@@ -43,15 +43,17 @@ Connect IM bots to DeepSeek Harness by scanning a QR code, using an App Manifest
|
|
|
43
43
|
|
|
44
44
|
## 当前内置渠道
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
46
|
+
| 渠道 | 接入方式 | 消息与回复 |
|
|
47
|
+
| --- | --- | --- |
|
|
48
|
+
| 飞书 | 扫码创建机器人,或使用 App ID + App Secret 手动绑定 | 长连接接收消息;通过飞书流式卡片显示思考、工具进度和回答 |
|
|
49
|
+
| 微信 | 使用微信扫码绑定机器人 | 腾讯 iLink 长轮询收发消息 |
|
|
50
|
+
| 钉钉 | 扫码创建机器人,或使用 Client ID + Client Secret 手动绑定 | 钉钉 Stream 长连接;通过 AI Card 流式显示回答 |
|
|
51
|
+
| 企业微信 | 使用企业微信 App 扫码创建智能机器人,或使用 Bot ID + Secret 手动绑定 | 官方 WebSocket 长连接;原生显示“正在思考中”、工具执行进度和流式回答 |
|
|
52
|
+
| QQ | 使用手机 QQ 扫码创建机器人,或使用 AppID + AppSecret 手动绑定 | WebSocket 长连接;私聊显示“正在输入”和流式回答,群聊被 @ 后回复 |
|
|
53
|
+
| Slack | 使用预置 App Manifest 创建应用,再填写 Bot Token(`xoxb-`)和 App Token(`xapp-`) | Socket Mode 长连接;私聊直接回复,频道被 @ 后响应,优先使用官方流式消息 API |
|
|
54
|
+
| Telegram | 使用 @BotFather 生成的 Bot Token | Bot API 长轮询;私聊直接回复,群聊被提及或收到对机器人消息的回复时响应,通过编辑消息流式显示回答 |
|
|
55
|
+
| Discord | 使用 Developer Portal 生成的 Bot Token | Gateway v10 长连接;私信直接回复,服务器频道被提及时响应,通过编辑消息流式显示回答 |
|
|
56
|
+
| WhatsApp | 使用手机 WhatsApp 扫码关联设备 | WhatsApp Web 长连接;显示已读和“正在输入”,再发送最终回答 |
|
|
55
57
|
|
|
56
58
|
其他 IM 平台可继续按同一渠道适配器结构接入。
|
|
57
59
|
|
|
@@ -73,37 +75,25 @@ dsh plugin --profile web add -w @xmanrui/dsh-im
|
|
|
73
75
|
npx -y github:xmanrui/dsh-im install
|
|
74
76
|
```
|
|
75
77
|
|
|
76
|
-
GitHub 源安装会直接拉取并构建 Git 依赖;pnpm 10 及以上版本可能要求先在 profile 的 `pnpm-workspace.yaml` 中允许该依赖执行构建脚本。普通用户建议优先使用 npm 稳定版。
|
|
78
|
+
GitHub 源安装会直接拉取并构建 Git 依赖;pnpm 10 及以上版本可能要求先在 profile 的 `pnpm-workspace.yaml` 中允许该依赖执行构建脚本。普通用户建议优先使用 npm 稳定版。
|
|
77
79
|
|
|
78
|
-
|
|
80
|
+
安装后,在对应渠道页面按照内置引导完成扫码或凭据配置。所有 Secret 和 Token 只提交给本机 Harness Host,并写入受保护的凭据存储;状态接口和机器人列表不会回传这些凭据。
|
|
79
81
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
WhatsApp 页面只显示「扫码接入机器人」。打开手机 WhatsApp 的「设置 → 已关联设备 → 关联设备」,扫描 Harness 页面中的二维码即可,不需要 Meta 控制台、Cloud API、Webhook、Phone Number ID 或 Access Token。关联设备状态只保存在本机 `~/.dsh/integrations/dsh-whatsapp/auth`,浏览器只会收到一次性二维码和脱敏后的账号状态。个人账号可在 WhatsApp 的「给自己发消息」会话中直接使用;插件按消息 ID 过滤自己的回复,避免形成回复循环。
|
|
85
|
-
|
|
86
|
-
建议为机器人准备独立 WhatsApp 号码。关联个人常用账号会让发给该账号的私聊消息成为 Harness 输入;群聊只有明确提及该账号或回复该账号消息时才会触发。请只把机器人号码开放给可信联系人,并在不再使用时同时从 Harness 和手机「已关联设备」中移除。
|
|
87
|
-
|
|
88
|
-
钉钉扫码接入时,请使用已加入企业/组织且有权创建机器人的钉钉账号扫描页面二维码,再在钉钉授权页点击「一键创建新机器人」。若提示“该账号还未加入组织”,请先创建组织或换用已加入组织的账号后重新扫码。插件不设置本机二次批准流程,钉钉中的机器人可见范围就是入站访问范围,请只开放给信任的组织、群或成员。图片下载不会新增独立权限,但依赖机器人已有的“企业内机器人发送消息权限”;手动绑定的已有应用若未开启该权限,可以收到图片回调,但无法换取临时下载地址。
|
|
89
|
-
|
|
90
|
-
企业微信扫码接入时,请使用已加入企业且具有机器人创建或管理权限的企业微信账号,并在手机端确认创建智能机器人。扫码创建的是企业微信智能机器人,不是让插件直接登录个人微信账号。无论扫码还是凭据绑定,企业微信中的机器人可见范围就是入站访问范围,请只开放给信任的企业成员和群聊。
|
|
91
|
-
|
|
92
|
-
QQ 扫码接入使用腾讯 QQBot v2 官方流程。默认腾讯授权页会把接入方显示为“第三方机器人”;扫码成功后创建的是 QQ 开放平台机器人,并不是让插件直接控制个人 QQ 账号。扫码绑定只接受扫码者的消息;手动凭据无法识别扫码人,因此使用 QQ 开放平台中的机器人可见范围作为入站访问范围。
|
|
93
|
-
|
|
94
|
-
飞书扫码绑定会把扫码者作为允许使用者;手动凭据同样无法识别扫码人,因此使用飞书应用的可见范围作为入站访问范围。请在飞书开放平台中只向信任的租户、群或成员开放应用。读取用户发送的图片需要租户权限 `im:message:readonly`;新扫码创建的应用会申请该权限,升级前已存在的应用需要在飞书开放平台手动添加权限、发布版本并完成必要的管理员审批。
|
|
95
|
-
|
|
96
|
-
每个机器人维护独立的 Harness 工作区。新接入机器人会把 Harness Host 进程当时的工作目录(`process.cwd()`)记录为默认值;该路径会持久化,不会因为以后从其他目录重启 Host 而改变。设置页的机器人卡片会显示当前路径,并可直接修改。
|
|
97
|
-
|
|
98
|
-
渠道没有显式配置 `agentPreset` 时,新建的 IM 会话继承 Harness 的 `agent-presets.default` 全局默认值。Harness 会在每次创建会话时读取该默认值,因此修改设置只影响之后创建的新会话;已有会话以及通过 `/session` 绑定的会话保持自身 preset。渠道显式配置的 `agentPreset` 始终优先。
|
|
82
|
+
| 默认行为 | 说明 |
|
|
83
|
+
| --- | --- |
|
|
84
|
+
| 机器人工作区 | 每个机器人独立保存工作区。新机器人默认使用 Host 当时的工作目录;之后可在机器人卡片中修改。 |
|
|
85
|
+
| Agent Preset | 新会话默认继承 Harness 的 `agent-presets.default`;渠道显式配置优先,已有会话不受后续修改影响。 |
|
|
99
86
|
|
|
100
87
|
## 机器人命令
|
|
101
88
|
|
|
102
89
|
| 命令 | 作用 |
|
|
103
90
|
| --- | --- |
|
|
104
|
-
| `/
|
|
91
|
+
| `/help` | 显示机器人支持的命令和用法。 |
|
|
92
|
+
| `/new` | 解除当前聊天的会话绑定,让下一条普通消息开启全新 Harness 会话。 |
|
|
93
|
+
| `/status` | 检查当前机器人与 DeepSeek Harness 的连接状态。 |
|
|
94
|
+
| `/models` | 按序号列出当前配置的全部可用模型。 |
|
|
105
95
|
| `/model` | 查看当前聊天绑定会话正在使用的模型。 |
|
|
106
|
-
| `/model
|
|
96
|
+
| `/model <序号或 Provider/模型ID>` | 切换当前聊天绑定会话的模型。 |
|
|
107
97
|
| `/stop` | 立即停止当前聊天正在运行的任务,并保留尚未开始的排队消息。 |
|
|
108
98
|
| `/steer <补充指令>` | 把补充指令立即加入当前聊天正在运行的任务。 |
|
|
109
99
|
| `/compact` | 立即压缩当前聊天绑定会话的较早上下文。 |
|
|
@@ -111,11 +101,18 @@ QQ 扫码接入使用腾讯 QQBot v2 官方流程。默认腾讯授权页会把
|
|
|
111
101
|
| `/workspacelist` | 列出当前 Harness Host 上仍然存在的工作区绝对路径。 |
|
|
112
102
|
| `/sessionlist [工作区序号或绝对路径]` | 列出指定工作区登记的所有会话 ID 和标题;省略参数时使用当前工作区。 |
|
|
113
103
|
| `/session <Session ID>` | 将当前聊天绑定到指定的已有 Harness 会话。 |
|
|
104
|
+
| 交互式提问 | 回复选项序号、选项文字或自定义文字;多选时用逗号分隔。 |
|
|
105
|
+
| 远程审批 | 回复 `批准` / `拒绝` / `同意` / `不同意` / `yes` / `no`。 |
|
|
114
106
|
|
|
115
|
-
|
|
107
|
+
示例:先发送 `/models`,再发送 `/model 2` 切换到列表中的第 2 个模型。其他命令示例:`/help`、`/new`、`/status`、`/model deepseek-official/deepseek-v4-pro`、`/steer 只检查配置文件`、`/stop`、`/compact`、`/workspace /Users/alice/projects/my-app`、`/sessionlist 2`、`/sessionlist /Users/alice/projects/my-app` 或 `/session session-id`
|
|
116
108
|
|
|
117
|
-
|
|
118
|
-
|
|
109
|
+
### 命令说明
|
|
110
|
+
|
|
111
|
+
- `/help` 不需要参数,也不会创建会话;它会返回当前机器人支持的完整命令列表。
|
|
112
|
+
- `/status` 不需要参数,也不会向模型发送消息或改变会话绑定;它用于确认当前机器人能够连接 DeepSeek Harness。
|
|
113
|
+
- `/new` 只解除当前聊天在 dsh-im 中保存的会话绑定,不会删除、清空或归档旧 Session。下一条普通消息会在当前工作区创建并绑定一个新 Session。任务正在运行或等待问题、审批时,应先完成交互或使用 `/stop`,再使用 `/new`。
|
|
114
|
+
- `/models` 不需要参数,也不会创建会话。它为 Harness 当前配置的全部可用模型分配序号,同时显示可稳定复制的 `Provider/模型ID`;某个 Provider 查询失败时,其他 Provider 的结果仍会显示。
|
|
115
|
+
- `/model` 不带参数时只查看当前会话模型;带参数时接受 `/models` 列出的序号或完整模型 ID,例如 `/model 2`。完整 ID 必须精确匹配。聊天尚无会话时,有效的切换命令会创建并绑定一个空白会话,但不会触发模型回复。切换只影响当前会话;Harness 还会尝试把它保存为以后新会话的默认模型,已有其他会话不受影响。
|
|
119
116
|
- 正在运行任务或等待审批、问题回答时不能切换模型;请等待完成,或先使用 `/stop`。含图片的会话无法切换到不支持图片输入的模型。
|
|
120
117
|
- `/stop` 和 `/steer` 只控制当前聊天自己发起的运行任务,即使多个聊天绑定同一个 Session,也不会有意控制其他聊天的任务。`/stop` 不删除会话或历史,并保留尚未开始的排队消息;重复发送是安全的。
|
|
121
118
|
- `/steer` 只接受文字,可包含多行;它不会创建新会话或第二个任务。没有运行任务时请直接发送普通消息;等待审批或问题回答时请先处理交互,或使用 `/stop`。
|
|
@@ -134,6 +131,15 @@ QQ 扫码接入使用腾讯 QQBot v2 官方流程。默认腾讯授权页会把
|
|
|
134
131
|
- 切换成功后只清除当前机器人的旧 Harness 会话映射,不影响其他机器人。
|
|
135
132
|
- 新工作区对后续消息生效;已经开始生成的回复会继续完成。
|
|
136
133
|
|
|
134
|
+
## 其它功能
|
|
135
|
+
|
|
136
|
+
- **图片识别**:九个内置渠道都可以把 JPEG、PNG、WebP,以及以图片文件方式发送的 GIF 交给 Harness;图片可以附带文字说明。单张图片上限为 5 MB,单条消息中的图片总大小上限为 20 MB。
|
|
137
|
+
- **在机器人卡片切换工作区**:设置页中的每张机器人卡片都会显示当前 Harness 工作区。可以直接填写已有目录的绝对路径,也可以打开目录选择器。切换只清除该机器人的旧聊天映射,不会删除、清空或归档旧 Session;已经开始的回复可以继续完成,后续消息使用新工作区。
|
|
138
|
+
- **检查连接并发送测试消息**:机器人在线时,点击卡片上的「检查连接」会检查平台连接,并向该机器人最近记录的私聊发送一条“DeepSeek Harness 连接测试成功”消息;WhatsApp 会发送到账号自聊。测试消息不会创建 Harness Session,也不会调用模型。机器人必须至少收到过一条私聊才能记住测试目标,否则页面会提示尚无可用的测试会话。
|
|
139
|
+
- **重试连接和移除接入**:机器人离线时,卡片上的操作会变为「重试连接」;不再使用时可以点击「移除接入」。这些操作都只作用于所选机器人,不影响其他机器人或渠道。
|
|
140
|
+
- **多机器人独立管理**:同一渠道可以接入多个机器人。每个机器人分别保存凭据、连接状态、工作区和聊天会话映射,卡片上的工作区、连接检查、重试和移除操作互不影响。
|
|
141
|
+
- **流式回复和进度提示**:插件会按各平台能力显示正在思考、工具执行和逐步生成的回答;不支持原生流式接口的平台会通过编辑消息、卡片更新或最终消息完成回复。
|
|
142
|
+
|
|
137
143
|
## 设计
|
|
138
144
|
|
|
139
145
|
- Harness 中只注册一个「IM机器人」设置页;
|
package/lib/client.js
CHANGED
|
@@ -383,7 +383,7 @@ var EN = Object.freeze({
|
|
|
383
383
|
"IM\u673A\u5668\u4EBA": "IM bots",
|
|
384
384
|
"IM\u673A\u5668\u4EBA\u8BBE\u7F6E": "IM bot settings",
|
|
385
385
|
"IM \u6E20\u9053": "IM channels",
|
|
386
|
-
"\u8BA9\
|
|
386
|
+
"\u8BA9 DeepSeek Harness \u89E6\u624B\u53EF\u53CA": "DeepSeek Harness, always within reach",
|
|
387
387
|
"\u5E2E\u52A9\u4E0E\u53CD\u9988 \xB7 \u524D\u5F80 GitHub": "Help & feedback \xB7 Open GitHub",
|
|
388
388
|
"\u5FAE\u4FE1": "WeChat",
|
|
389
389
|
"\u98DE\u4E66": "Feishu",
|
|
@@ -8607,7 +8607,7 @@ function IMSettingsTab({
|
|
|
8607
8607
|
width: 48,
|
|
8608
8608
|
height: 48
|
|
8609
8609
|
}),
|
|
8610
|
-
h2("p", null, "\u8BA9\
|
|
8610
|
+
h2("p", null, "\u8BA9 DeepSeek Harness \u89E6\u624B\u53EF\u53CA")
|
|
8611
8611
|
),
|
|
8612
8612
|
h2(
|
|
8613
8613
|
"span",
|