@xmanrui/dsh-im 0.11.0 → 0.12.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 +34 -6
- package/README.md +34 -6
- package/lib/index.js +133 -124
- package/package.json +31 -2
- package/plugin-src/host/channels/dingtalk/production.mjs +7 -0
- package/plugin-src/host/channels/feishu/production.mjs +7 -0
- package/plugin-src/host/channels/qq/production.mjs +7 -0
- package/plugin-src/host/channels/shared/production.mjs +7 -0
- package/plugin-src/host/channels/slack/production.mjs +7 -0
- package/plugin-src/host/channels/wecom/production.mjs +7 -0
- package/plugin-src/host/channels/weixin/production.mjs +7 -0
- package/plugin-src/host/channels/whatsapp/production.mjs +7 -0
- package/plugin-src/host/harness-session-coordinator.mjs +134 -0
- package/src/channels/dingtalk/dingtalk-bridge.mjs +81 -0
- package/src/channels/discord/discord-api.mjs +1 -1
- package/src/channels/feishu/bridge.mjs +81 -0
- package/src/channels/qq/qq-bridge.mjs +84 -0
- package/src/channels/shared/bot-workspace-store.mjs +45 -1
- package/src/channels/shared/control-command.mjs +84 -0
- package/src/channels/shared/harness-approval.mjs +4 -0
- package/src/channels/shared/harness-client.mjs +336 -29
- package/src/channels/shared/model-command.mjs +314 -0
- package/src/channels/shared/session-binding-lock.mjs +40 -0
- package/src/channels/shared/text-harness-bridge.mjs +81 -0
- package/src/channels/shared/workspace-session.mjs +21 -9
- package/src/channels/wecom/wecom-bridge.mjs +75 -0
- package/src/channels/weixin/weixin-api.mjs +1 -1
- package/src/channels/weixin/weixin-bridge.mjs +81 -0
package/README.en.md
CHANGED
|
@@ -6,9 +6,23 @@
|
|
|
6
6
|
<p><strong>Connect IM bots to DeepSeek Harness with ease</strong></p>
|
|
7
7
|
|
|
8
8
|
<p>
|
|
9
|
+
<img src="https://dsh-im-random-badge.xmanrui-dsh-im.workers.dev" alt="滑动变祖器:今天是梁子或今天是梁圣(随机)">
|
|
9
10
|
<a href="LICENSE"><img src="https://img.shields.io/github/license/xmanrui/dsh-im" alt="MIT license"></a>
|
|
10
11
|
<img src="https://img.shields.io/badge/agent-DeepSeek%20Harness-5865f2" alt="DeepSeek Harness">
|
|
11
|
-
<
|
|
12
|
+
<a href="https://dshfind.com/zh/plugins/xmanrui/dsh-im?ref=badge"><img src="https://dshfind.com/api/badge/xmanrui/dsh-im?lang=zh" alt="dshfind"></a>
|
|
13
|
+
<a href="https://dshfind.com/zh/plugins/xmanrui/dsh-im"><img src="https://img.shields.io/badge/dshfind-%E5%88%86%E7%B1%BB%E7%AC%AC%E4%B8%80-d97706" alt="dshfind: 分类第一"></a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p>
|
|
17
|
+
<img src="https://img.shields.io/badge/%E5%BE%AE%E4%BF%A1-07C160?logo=wechat&logoColor=white" alt="微信">
|
|
18
|
+
<img src="https://img.shields.io/badge/%E9%A3%9E%E4%B9%A6-3370FF?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI%2BPHBhdGggZmlsbD0iI2ZmZiIgZD0iTTcuMiA0LjVoNy42YzEuMiAwIDIuMS41NSAyLjcgMS41OCAxLjA1IDEuOCAxLjU1IDMuNDUgMS41OCA0Ljk1LTIuMDQtLjYyLTQuMi0uMTUtNi4yMiAxLjQ1QzExLjMgOS43IDkuNDIgNy4wNCA3LjIgNC41WiIvPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0xMC44IDEzLjU1YzMuMy0yLjkzIDUuNzItNC4yNCA5LjQ3LTIuNTItMS4yIDEuNDUtMi4yNyA0LjE4LTMuODYgNS40My0xLjY3IDEuMzEtMy45LjUtNS42MS0uNjR2LTIuMjdaIi8%2BPHBhdGggZmlsbD0iI2ZmZiIgZD0iTTQuNCA4LjM1YzMuNDcgMy42MSA3LjI1IDYuMSAxMC4zMyA1LjcgMS4wNi0uM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MS4xNiAwIDAgMS0xLjY0LTEuNjRaTTE1LjI1IDE4Ljc1YS45Mi45MiAwIDEgMSAxLjMgMS4zLjkyLjkyIDAgMCAxLTEuMy0xLjNaIi8%2BPC9zdmc%2B" alt="企业微信">
|
|
21
|
+
<img src="https://img.shields.io/badge/QQ-1EBAFC?logo=qq&logoColor=white" alt="QQ">
|
|
22
|
+
<img src="https://img.shields.io/badge/Slack-4A154B?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI%2BPHBhdGggZmlsbD0iI2ZmZiIgZD0iTTYgMTVhMiAyIDAgMSAxLTItMmgydjJabTEgMGEyIDIgMCAxIDEgNCAwdjVhMiAyIDAgMSAxLTQgMHYtNVptMi04YTIgMiAwIDEgMSAyLTJ2Mkg5Wm0wIDFhMiAyIDAgMSAxIDAgNEg0YTIgMiAwIDEgMSAwLTRoNVptOCAyYTIgMiAwIDEgMSAyIDJoLTJ2LTJabS0xIDBhMiAyIDAgMSAxLTQgMFY1YTIgMiAwIDEgMSA0IDB2NVptLTIgOGEyIDIgMCAxIDEtMiAydi0yaDJabTAtMWEyIDIgMCAxIDEgMC00aDVhMiAyIDAgMSAxIDAgNGgtNVoiLz48L3N2Zz4%3D" alt="Slack">
|
|
23
|
+
<img src="https://img.shields.io/badge/Telegram-26A5E4?logo=telegram&logoColor=white" alt="Telegram">
|
|
24
|
+
<img src="https://img.shields.io/badge/Discord-5865F2?logo=discord&logoColor=white" alt="Discord">
|
|
25
|
+
<img src="https://img.shields.io/badge/WhatsApp-25D366?logo=whatsapp&logoColor=white" alt="WhatsApp">
|
|
12
26
|
</p>
|
|
13
27
|
|
|
14
28
|
<p><a href="README.md">简体中文</a> · <strong>English</strong></p>
|
|
@@ -42,17 +56,21 @@ All nine built-in channels can send JPEG, PNG, and WebP images, plus GIFs sent a
|
|
|
42
56
|
|
|
43
57
|
## Installation
|
|
44
58
|
|
|
59
|
+
Install the published stable release from npm (recommended):
|
|
60
|
+
|
|
45
61
|
```sh
|
|
46
|
-
|
|
62
|
+
dsh plugin --profile web add -w @xmanrui/dsh-im
|
|
47
63
|
```
|
|
48
64
|
|
|
49
|
-
|
|
65
|
+
Restart `dsh web`, then open **Settings → Plugins → IM Bot**.
|
|
66
|
+
|
|
67
|
+
To try the latest code before it is published to npm, use the GitHub-source installer instead:
|
|
50
68
|
|
|
51
69
|
```sh
|
|
52
|
-
|
|
70
|
+
npx -y github:xmanrui/dsh-im install
|
|
53
71
|
```
|
|
54
72
|
|
|
55
|
-
|
|
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. The GitHub installer replaces directly installed `dsh-feishu`, `dsh-weixin`, and `dsh-dingtalk` entries in the profile with `dsh-im` without deleting channel data.
|
|
56
74
|
|
|
57
75
|
Feishu, QQ, DingTalk, and WeCom each provide two entry points. The blue **QR access** action uses the platform QR flow; the key-marked, outlined **Manual access** action immediately to its right connects an existing bot application. Feishu and QQ use App ID + App Secret and AppID + AppSecret respectively, DingTalk uses Client ID + Client Secret, and WeCom uses Bot ID + Secret. Secrets are sent only to the local Harness Host and stored through its protected credential provider; status responses and bot lists never return them.
|
|
58
76
|
|
|
@@ -80,14 +98,24 @@ When a channel does not explicitly configure `agentPreset`, each new IM session
|
|
|
80
98
|
|
|
81
99
|
| Command | Description |
|
|
82
100
|
| --- | --- |
|
|
101
|
+
| `/models` | List every currently configured model, grouped by provider. |
|
|
102
|
+
| `/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. |
|
|
104
|
+
| `/stop` | Immediately stop this chat's running task while preserving work that has not started. |
|
|
105
|
+
| `/steer <additional instruction>` | Inject an additional instruction into this chat's running task. |
|
|
83
106
|
| `/compact` | Immediately compact older context in the Session bound to the current chat. |
|
|
84
107
|
| `/workspace <absolute workspace path>` | Switch the current bot's Harness workspace. |
|
|
85
108
|
| `/workspacelist` | List workspace absolute paths that still exist on the current Harness Host. |
|
|
86
109
|
| `/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. |
|
|
87
110
|
| `/session <Session ID>` | Bind the current chat to an existing Harness session. |
|
|
88
111
|
|
|
89
|
-
Examples: `/compact`, `/workspace /Users/alice/projects/my-app`, `/sessionlist 2`, `/sessionlist /Users/alice/projects/my-app`, or `/session session-id`
|
|
112
|
+
Examples: `/models`, `/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`
|
|
90
113
|
|
|
114
|
+
- `/models` takes no arguments and never creates a Session. It lists every currently configured Harness model using stable, copyable `provider/model-id` values. If one provider fails, models from the remaining providers are still shown.
|
|
115
|
+
- Bare `/model` only displays the current Session model. `/model <provider/model-id>` accepts an exact value returned by `/models`. 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
|
+
- 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
|
+
- `/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
|
+
- `/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`.
|
|
91
119
|
- `/compact` acts only on the Harness Session already bound to the current chat and is never sent to the model. The bot reports the applicable status when the chat has no Session yet, the Session is generating a reply, or there is no compactable history.
|
|
92
120
|
- The path must be an existing absolute directory. The bot returns an actionable error and the correct usage when validation fails.
|
|
93
121
|
- `/workspacelist` takes no arguments. It combines the Harness global registry with the current bot's path. When that current path still exists and is safe to display, it appears first and is marked as current. Any listed path can be copied directly into `/workspace`.
|
package/README.md
CHANGED
|
@@ -7,9 +7,23 @@
|
|
|
7
7
|
<p><strong>Connect IM bots to DeepSeek Harness with ease</strong></p>
|
|
8
8
|
|
|
9
9
|
<p>
|
|
10
|
+
<img src="https://dsh-im-random-badge.xmanrui-dsh-im.workers.dev" alt="滑动变祖器:今天是梁子或今天是梁圣(随机)">
|
|
10
11
|
<a href="LICENSE"><img src="https://img.shields.io/github/license/xmanrui/dsh-im" alt="MIT 许可证"></a>
|
|
11
12
|
<img src="https://img.shields.io/badge/agent-DeepSeek%20Harness-5865f2" alt="DeepSeek Harness">
|
|
12
|
-
<
|
|
13
|
+
<a href="https://dshfind.com/zh/plugins/xmanrui/dsh-im?ref=badge"><img src="https://dshfind.com/api/badge/xmanrui/dsh-im?lang=zh" alt="dshfind"></a>
|
|
14
|
+
<a href="https://dshfind.com/zh/plugins/xmanrui/dsh-im"><img src="https://img.shields.io/badge/dshfind-%E5%88%86%E7%B1%BB%E7%AC%AC%E4%B8%80-d97706" alt="dshfind: 分类第一"></a>
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
<p>
|
|
18
|
+
<img src="https://img.shields.io/badge/%E5%BE%AE%E4%BF%A1-07C160?logo=wechat&logoColor=white" alt="微信">
|
|
19
|
+
<img src="https://img.shields.io/badge/%E9%A3%9E%E4%B9%A6-3370FF?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI%2BPHBhdGggZmlsbD0iI2ZmZiIgZD0iTTcuMiA0LjVoNy42YzEuMiAwIDIuMS41NSAyLjcgMS41OCAxLjA1IDEuOCAxLjU1IDMuNDUgMS41OCA0Ljk1LTIuMDQtLjYyLTQuMi0uM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OTJjMS4xNyAwIDIuMjgtLjIyIDMuMjgtLjYyIi8%2BPHBhdGggZmlsbD0iI2ZmZiIgZD0iTTE2LjEgMTUuMTVjLjctLjcgMS44My0uNyAyLjUzIDBzLjcgMS44MyAwIDIuNTMtMS44My43LTIuNTMgMC0uNy0xLjgzIDAtMi41M1pNMTkuMjUgMTMuNDVhMS4zNiAxLjM2IDAgMSAxIDEuOTIgMS45MiAxLjM2IDEuMzYgMCAwIDEtMS45Mi0xLjkyWk0xOS41NSAxOC4wNWExLjE2IDEuMTYgMCAxIDEgMS42NCAxLjY0IDEuMTYgMS4xNiAwIDAgMS0xLjY0LTEuNjRaTTE1LjI1IDE4Ljc1YS45Mi45MiAwIDEgMSAxLjMgMS4zLjkyLjkyIDAgMCAxLTEuMy0xLjNaIi8%2BPC9zdmc%2B" alt="企业微信">
|
|
22
|
+
<img src="https://img.shields.io/badge/QQ-1EBAFC?logo=qq&logoColor=white" alt="QQ">
|
|
23
|
+
<img src="https://img.shields.io/badge/Slack-4A154B?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI%2BPHBhdGggZmlsbD0iI2ZmZiIgZD0iTTYgMTVhMiAyIDAgMSAxLTItMmgydjJabTEgMGEyIDIgMCAxIDEgNCAwdjVhMiAyIDAgMSAxLTQgMHYtNVptMi04YTIgMiAwIDEgMSAyLTJ2Mkg5Wm0wIDFhMiAyIDAgMSAxIDAgNEg0YTIgMiAwIDEgMSAwLTRoNVptOCAyYTIgMiAwIDEgMSAyIDJoLTJ2LTJabS0xIDBhMiAyIDAgMSAxLTQgMFY1YTIgMiAwIDEgMSA0IDB2NVptLTIgOGEyIDIgMCAxIDEtMiAydi0yaDJabTAtMWEyIDIgMCAxIDEgMC00aDVhMiAyIDAgMSAxIDAgNGgtNVoiLz48L3N2Zz4%3D" alt="Slack">
|
|
24
|
+
<img src="https://img.shields.io/badge/Telegram-26A5E4?logo=telegram&logoColor=white" alt="Telegram">
|
|
25
|
+
<img src="https://img.shields.io/badge/Discord-5865F2?logo=discord&logoColor=white" alt="Discord">
|
|
26
|
+
<img src="https://img.shields.io/badge/WhatsApp-25D366?logo=whatsapp&logoColor=white" alt="WhatsApp">
|
|
13
27
|
</p>
|
|
14
28
|
|
|
15
29
|
<p><strong>简体中文</strong> · <a href="README.en.md">English</a></p>
|
|
@@ -45,17 +59,21 @@ Connect IM bots to DeepSeek Harness by scanning a QR code, using an App Manifest
|
|
|
45
59
|
|
|
46
60
|
## 安装
|
|
47
61
|
|
|
62
|
+
推荐从 npm 安装已发布的稳定版本:
|
|
63
|
+
|
|
48
64
|
```sh
|
|
49
|
-
|
|
65
|
+
dsh plugin --profile web add -w @xmanrui/dsh-im
|
|
50
66
|
```
|
|
51
67
|
|
|
52
|
-
|
|
68
|
+
重启 `dsh web`,然后打开「设置 → 插件 → IM机器人」。
|
|
69
|
+
|
|
70
|
+
如需试用尚未发布到 npm 的最新代码,可以改用 GitHub 源安装器:
|
|
53
71
|
|
|
54
72
|
```sh
|
|
55
|
-
|
|
73
|
+
npx -y github:xmanrui/dsh-im install
|
|
56
74
|
```
|
|
57
75
|
|
|
58
|
-
|
|
76
|
+
GitHub 源安装会直接拉取并构建 Git 依赖;pnpm 10 及以上版本可能要求先在 profile 的 `pnpm-workspace.yaml` 中允许该依赖执行构建脚本。普通用户建议优先使用 npm 稳定版。GitHub 安装器会用 `dsh-im` 替换 profile 中直接安装的 `dsh-feishu`、`dsh-weixin` 和 `dsh-dingtalk`,但不删除任何渠道数据;原有渠道凭据和扫码绑定会继续使用。
|
|
59
77
|
|
|
60
78
|
飞书、QQ、钉钉和企业微信页面都提供两种入口:带二维码图标的蓝色「扫码接入机器人」按钮走平台官方扫码流程,右侧带钥匙图标的白色描边「手动接入」按钮连接已经创建的机器人应用。飞书和 QQ 分别填写 App ID + App Secret、AppID + AppSecret;钉钉填写官方 Client ID + Client Secret;企业微信填写官方 Bot ID + Secret。Secret 只提交给本机 Harness Host,并写入受保护的凭据存储;状态接口和机器人列表不会回传 Secret。
|
|
61
79
|
|
|
@@ -83,14 +101,24 @@ QQ 扫码接入使用腾讯 QQBot v2 官方流程。默认腾讯授权页会把
|
|
|
83
101
|
|
|
84
102
|
| 命令 | 作用 |
|
|
85
103
|
| --- | --- |
|
|
104
|
+
| `/models` | 按 Provider 列出当前配置的全部可用模型。 |
|
|
105
|
+
| `/model` | 查看当前聊天绑定会话正在使用的模型。 |
|
|
106
|
+
| `/model <Provider/模型ID>` | 切换当前聊天绑定会话的模型。 |
|
|
107
|
+
| `/stop` | 立即停止当前聊天正在运行的任务,并保留尚未开始的排队消息。 |
|
|
108
|
+
| `/steer <补充指令>` | 把补充指令立即加入当前聊天正在运行的任务。 |
|
|
86
109
|
| `/compact` | 立即压缩当前聊天绑定会话的较早上下文。 |
|
|
87
110
|
| `/workspace <工作区绝对路径>` | 切换当前机器人的 Harness 工作区。 |
|
|
88
111
|
| `/workspacelist` | 列出当前 Harness Host 上仍然存在的工作区绝对路径。 |
|
|
89
112
|
| `/sessionlist [工作区序号或绝对路径]` | 列出指定工作区登记的所有会话 ID 和标题;省略参数时使用当前工作区。 |
|
|
90
113
|
| `/session <Session ID>` | 将当前聊天绑定到指定的已有 Harness 会话。 |
|
|
91
114
|
|
|
92
|
-
示例:`/compact`、`/workspace /Users/alice/projects/my-app`、`/sessionlist 2`、`/sessionlist /Users/alice/projects/my-app` 或 `/session session-id`
|
|
115
|
+
示例:`/models`、`/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`
|
|
93
116
|
|
|
117
|
+
- `/models` 不需要参数,也不会创建会话。它列出 Harness 当前配置的全部可用模型,使用可稳定复制的 `Provider/模型ID`;某个 Provider 查询失败时,其他 Provider 的结果仍会显示。
|
|
118
|
+
- `/model` 不带参数时只查看当前会话模型;带完整模型 ID 时只接受 `/models` 列出的精确值。聊天尚无会话时,有效的切换命令会创建并绑定一个空白会话,但不会触发模型回复。切换只影响当前会话;Harness 还会尝试把它保存为以后新会话的默认模型,已有其他会话不受影响。
|
|
119
|
+
- 正在运行任务或等待审批、问题回答时不能切换模型;请等待完成,或先使用 `/stop`。含图片的会话无法切换到不支持图片输入的模型。
|
|
120
|
+
- `/stop` 和 `/steer` 只控制当前聊天自己发起的运行任务,即使多个聊天绑定同一个 Session,也不会有意控制其他聊天的任务。`/stop` 不删除会话或历史,并保留尚未开始的排队消息;重复发送是安全的。
|
|
121
|
+
- `/steer` 只接受文字,可包含多行;它不会创建新会话或第二个任务。没有运行任务时请直接发送普通消息;等待审批或问题回答时请先处理交互,或使用 `/stop`。
|
|
94
122
|
- `/compact` 只作用于当前聊天已经绑定的 Harness 会话,不会把命令发送给模型。当前聊天尚未创建会话、会话正在生成回复或没有可压缩历史时,机器人会直接返回对应状态。
|
|
95
123
|
- 只接受已经存在的绝对目录;路径无效时机器人会返回具体提示和正确用法。
|
|
96
124
|
- `/workspacelist` 不需要参数。它合并 Harness 全局登记项与当前机器人的路径;当前路径仍存在且可安全显示时会排在首位并标记为“当前”。结果可直接复制到 `/workspace` 命令。
|