@michengai/dsh-im-connect 0.1.1 → 0.1.3
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 +224 -0
- package/README.md +204 -20
- package/assets/branding/dsh-banner.png +0 -0
- package/assets/screenshots/dingtalk-chat.jpg +0 -0
- package/assets/screenshots/feishu-chat.jpg +0 -0
- package/assets/screenshots/qq-chat.jpg +0 -0
- package/assets/screenshots/settings-channels.png +0 -0
- package/assets/screenshots/telegram-chat.jpg +0 -0
- package/assets/screenshots/wecom-chat.jpg +0 -0
- package/assets/screenshots/wecom-qr.png +0 -0
- package/assets/screenshots/weixin-chat.jpg +0 -0
- package/assets/screenshots/workspace-channels.png +0 -0
- package/package.json +19 -5
package/README.en.md
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/branding/dsh-banner.png" alt="DSH IM Connect" width="100%">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<div align="center">
|
|
6
|
+
|
|
7
|
+
# DSH IM Connect
|
|
8
|
+
|
|
9
|
+
**Connect Feishu, DingTalk, WeCom, WeChat, QQ, and Telegram to local DeepSeek Harness**
|
|
10
|
+
|
|
11
|
+
[简体中文](README.md) · [Apache-2.0](LICENSE)
|
|
12
|
+
|
|
13
|
+
[](LICENSE)
|
|
14
|
+
[](https://www.npmjs.com/package/@michengai/dsh-im-connect)
|
|
15
|
+
[](https://github.com/MichengAI/dsh-im-connect)
|
|
16
|
+
[](https://nodejs.org/)
|
|
17
|
+
[](#-supported-channels)
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
> DSH IM Connect is a community-maintained DeepSeek Harness (DSH) plugin, not an official DeepSeek AI product.
|
|
21
|
+
|
|
22
|
+
## Features
|
|
23
|
+
|
|
24
|
+
- Connect DingTalk, Feishu, Lark, WeChat, WeCom, QQ, and Telegram from **Settings → IM Assistant**.
|
|
25
|
+
- Each IM chat maps to an independent DSH session under the workspace **Channels** tab, never mixed into web **Tasks**.
|
|
26
|
+
- Send work, read replies, and approve tools from the phone; model and permission follow the local DSH profile.
|
|
27
|
+
- Bind by QR code or credentials. Secrets go into DSH `ctx.credentials`, not `channels.json`.
|
|
28
|
+
- Paste one sentence into DSH, Codex, or WorkBuddy and let that agent install the plugin locally.
|
|
29
|
+
|
|
30
|
+
## 📡 Supported channels
|
|
31
|
+
|
|
32
|
+
<p align="center">
|
|
33
|
+
<code>🔔 DingTalk</code>
|
|
34
|
+
<code>🐦 Feishu</code>
|
|
35
|
+
<code>🌐 Lark</code>
|
|
36
|
+
<code>💬 WeChat</code>
|
|
37
|
+
<code>🏢 WeCom</code>
|
|
38
|
+
<code>🐧 QQ</code>
|
|
39
|
+
<code>✈️ Telegram</code>
|
|
40
|
+
</p>
|
|
41
|
+
|
|
42
|
+
| Channel | Status | How to connect | You need |
|
|
43
|
+
|---|---|---|---|
|
|
44
|
+
| 🔔 **DingTalk** | ✅ Ready | QR, or Client ID / Secret | DingTalk open-platform bot; replies prefer AI Card |
|
|
45
|
+
| 🐦 **Feishu** | ✅ Ready | QR only; creates the bot automatically | Feishu account |
|
|
46
|
+
| 🌐 **Lark** | ✅ Ready | QR only | Lark account |
|
|
47
|
+
| 💬 **WeChat** | ✅ Ready* | Official iLink QR | Dedicated account recommended; DM only |
|
|
48
|
+
| 🏢 **WeCom** | ✅ Ready | QR (recommended), or Bot ID / Secret | WeCom intelligent bot |
|
|
49
|
+
| 🐧 **QQ** | ✅ Ready | QR, or AppID / AppSecret | QQ Open Platform bot, not a personal QQ account |
|
|
50
|
+
| ✈️ **Telegram** | ✅ Ready | Bot Token only | `@BotFather`; do not enable Webhook on the same bot |
|
|
51
|
+
|
|
52
|
+
✅ Ready = text in and out works | *WeChat = official iLink only, no reverse-engineered personal protocol | Groups still require an @ mention
|
|
53
|
+
|
|
54
|
+
## Screenshots
|
|
55
|
+
|
|
56
|
+
Connect channels in **Settings → IM Assistant**. Unconnected cards show **Configure**; connected cards show a toggle and status:
|
|
57
|
+
|
|
58
|
+

|
|
59
|
+
|
|
60
|
+
The workspace splits **Tasks** and **Channels**. IM sessions appear only under **Channels**:
|
|
61
|
+
|
|
62
|
+

|
|
63
|
+
|
|
64
|
+
WeCom and other QR channels support scan-to-bind:
|
|
65
|
+
|
|
66
|
+

|
|
67
|
+
|
|
68
|
+
After connecting, drive the local assistant from each IM:
|
|
69
|
+
|
|
70
|
+
<p align="center">
|
|
71
|
+
<img src="assets/screenshots/wecom-chat.jpg" width="220" alt="WeCom chat">
|
|
72
|
+
<img src="assets/screenshots/weixin-chat.jpg" width="220" alt="WeChat chat">
|
|
73
|
+
<img src="assets/screenshots/dingtalk-chat.jpg" width="220" alt="DingTalk chat">
|
|
74
|
+
</p>
|
|
75
|
+
<p align="center">
|
|
76
|
+
<img src="assets/screenshots/feishu-chat.jpg" width="220" alt="Feishu chat">
|
|
77
|
+
<img src="assets/screenshots/qq-chat.jpg" width="220" alt="QQ chat">
|
|
78
|
+
<img src="assets/screenshots/telegram-chat.jpg" width="220" alt="Telegram chat">
|
|
79
|
+
</p>
|
|
80
|
+
|
|
81
|
+
## Prerequisites
|
|
82
|
+
|
|
83
|
+
- A working DeepSeek Harness Web installation with `dsh` available in PowerShell.
|
|
84
|
+
- Examples use the `web` profile; replace it with the target profile.
|
|
85
|
+
- Source installation and development require Node.js 22+. npm installation does not require running `npm install` in an arbitrary directory.
|
|
86
|
+
- After install, restart `dsh web` and hard-refresh the browser before opening **Settings → IM Assistant**.
|
|
87
|
+
|
|
88
|
+
## Installation
|
|
89
|
+
|
|
90
|
+
`dsh plugin add` forwards to `pnpm add` in the profile directory. Without a version and official registry, a local mirror or minimum-release-age policy can leave you on an older build.
|
|
91
|
+
|
|
92
|
+
### Ask another agent to install it
|
|
93
|
+
|
|
94
|
+
This plugin runs inside DeepSeek Harness Web. Copy one of the sentences below into DSH, Codex, or WorkBuddy and let that agent install it into your local `web` profile.
|
|
95
|
+
|
|
96
|
+
From npm:
|
|
97
|
+
|
|
98
|
+
```text
|
|
99
|
+
Install the latest DSH plugin @michengai/dsh-im-connect into my local web profile using the official npm registry: dsh plugin --profile web add @michengai/dsh-im-connect@latest --registry=https://registry.npmjs.org/. Then run dsh --profile web --dump-config, confirm im-connect is mounted, and remind me to restart DSH Web, hard-refresh the browser, and open Settings → IM Assistant.
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
From source:
|
|
103
|
+
|
|
104
|
+
```text
|
|
105
|
+
Install the DSH plugin from source at https://github.com/MichengAI/dsh-im-connect: clone it, run npm install and npm test, then run dsh plugin --profile web add . from that directory. Do not copy lib by itself. Then run dsh --profile web --dump-config, confirm im-connect is mounted, and remind me to restart DSH Web, hard-refresh the browser, and open Settings → IM Assistant.
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
| Product | How to use it |
|
|
109
|
+
| --- | --- |
|
|
110
|
+
| DSH | Send one of the sentences above to the current session. |
|
|
111
|
+
| Codex | Send one of the sentences above to Codex and let it install locally. |
|
|
112
|
+
| WorkBuddy | Send one of the sentences above to WorkBuddy; for a source install you can also paste `https://github.com/MichengAI/dsh-im-connect`. |
|
|
113
|
+
|
|
114
|
+
Codex and WorkBuddy only install the plugin. After that, open DSH Web and use **Settings → IM Assistant**.
|
|
115
|
+
|
|
116
|
+
You can also run the same npm command yourself:
|
|
117
|
+
|
|
118
|
+
```powershell
|
|
119
|
+
dsh plugin --profile web add @michengai/dsh-im-connect@latest --registry=https://registry.npmjs.org/
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
If `dsh` is not on PATH, replace the leading `dsh` with `npx --yes @deepseek-ai/dsh`.
|
|
123
|
+
|
|
124
|
+
### Install the latest package from the official npm registry
|
|
125
|
+
|
|
126
|
+
Run this from any PowerShell directory:
|
|
127
|
+
|
|
128
|
+
```powershell
|
|
129
|
+
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
130
|
+
$OutputEncoding = [System.Text.Encoding]::UTF8
|
|
131
|
+
dsh plugin --profile web add @michengai/dsh-im-connect@latest --registry=https://registry.npmjs.org/
|
|
132
|
+
dsh --profile web --dump-config
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
To pin a release, replace `@latest` with a version such as `@0.1.1`.
|
|
136
|
+
|
|
137
|
+
The configuration output should contain `im-connect`. Restart DSH Web and hard-refresh the browser. Do not copy client files manually: `dsh plugin add` also applies `cordis.patch.yml`.
|
|
138
|
+
|
|
139
|
+
### Install from source
|
|
140
|
+
|
|
141
|
+
Use this for debugging or unpublished changes. The cloned directory becomes the plugin source path:
|
|
142
|
+
|
|
143
|
+
```powershell
|
|
144
|
+
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
145
|
+
$OutputEncoding = [System.Text.Encoding]::UTF8
|
|
146
|
+
Set-Location D:\Repository\deepseek-harness-plugin
|
|
147
|
+
git clone https://github.com/MichengAI/dsh-im-connect.git
|
|
148
|
+
Set-Location .\dsh-im-connect
|
|
149
|
+
npm install
|
|
150
|
+
npm test
|
|
151
|
+
dsh plugin --profile web add .
|
|
152
|
+
dsh --profile web --dump-config
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Restart DSH Web and hard-refresh the browser. `dsh plugin ... add .` reads the package metadata and `cordis.patch.yml`; do not install by copying `lib` directly.
|
|
156
|
+
|
|
157
|
+
## Usage
|
|
158
|
+
|
|
159
|
+
Open **Settings → IM Assistant**, choose the workspace, permission, and model, then connect a channel. The full guide is [使用说明](docs/02-产品与业务/04-使用说明.md).
|
|
160
|
+
|
|
161
|
+
| Goal | Action | Notes |
|
|
162
|
+
| --- | --- | --- |
|
|
163
|
+
| Connect a channel | Select **Configure** on an unconnected card, then scan or enter credentials | Feishu / Lark / WeChat are QR-only; Telegram needs a Bot Token |
|
|
164
|
+
| Pause receiving | Turn off the connected-card toggle | Credentials stay; inbound messages pause |
|
|
165
|
+
| Send work from IM | Type in a DM; in groups, mention the bot | Each chat has its own channel session |
|
|
166
|
+
| Split input | End with `..` to continue, `!!` to flush now | Default merge window is about 5 seconds |
|
|
167
|
+
| Start a new session | Send `/new` or `/clear` | Affects only the current IM chat |
|
|
168
|
+
| Status / help | Send `/status` or `/help` | Scoped to the current channel session |
|
|
169
|
+
| Approve a tool | Reply `批准` or `拒绝` | Also accepts `yes` / `no` / `allow` / `reject` |
|
|
170
|
+
| Review on the web | Open the workspace **Channels** tab | IM sessions never appear under **Tasks** |
|
|
171
|
+
|
|
172
|
+
DingTalk replies prefer official AI Card streaming and fall back to plain text. Do not enable Webhook on the same Telegram bot.
|
|
173
|
+
|
|
174
|
+
## Permissions and safety limits
|
|
175
|
+
|
|
176
|
+
| Item | Current behavior |
|
|
177
|
+
| --- | --- |
|
|
178
|
+
| Access | Open. Anyone in a DM or group can drive the assistant; groups still require a mention |
|
|
179
|
+
| Management API | Loopback only (`localhost`, `127.0.0.1`, `[::1]`) |
|
|
180
|
+
| Secrets | Prefer DSH `ctx.credentials`; otherwise `%DSH_HOME%\dsh-im-connect\secrets.json` |
|
|
181
|
+
| Channel state | `channels.json` stores enablement and credential refs, not raw secrets |
|
|
182
|
+
| Browser payloads | Never include tokens, secrets, App Secrets, or raw user identifiers |
|
|
183
|
+
| WeChat protocol | Official iLink only; no reverse-engineered personal WeChat protocol |
|
|
184
|
+
| Tool approval | Reply in the same IM chat; cross-chat approval is rejected |
|
|
185
|
+
|
|
186
|
+
Do not expose DSH Web beyond this machine. Permission presets follow the host sandbox-policy; `full-access` does not wrap a sandbox.
|
|
187
|
+
|
|
188
|
+
## Secondary development
|
|
189
|
+
|
|
190
|
+
This repository develops in `src` and builds to `lib`:
|
|
191
|
+
|
|
192
|
+
- [src\index.ts](src/index.ts): host entry, config, and lifecycle.
|
|
193
|
+
- [src\manager.ts](src/manager.ts): channel start/stop, loopback API, and credential persistence.
|
|
194
|
+
- [src\engine](src/engine): session routing, slash commands, approval, splitting, and outbound push.
|
|
195
|
+
- [src\channels](src/channels): DingTalk, Feishu, Lark, WeChat, WeCom, QQ, and Telegram adapters.
|
|
196
|
+
- `client.js`: settings page and workspace channel sidebar.
|
|
197
|
+
- `tests\*.test.mjs`: routing, QR, credentials, QQ, delivery, and sidebar tests.
|
|
198
|
+
|
|
199
|
+
After changing the source, test and install from the local directory:
|
|
200
|
+
|
|
201
|
+
```powershell
|
|
202
|
+
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
203
|
+
$OutputEncoding = [System.Text.Encoding]::UTF8
|
|
204
|
+
npm test
|
|
205
|
+
dsh plugin --profile web add .
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
When changing channel or session logic, keep the engine platform-agnostic, keep adapters from creating agents, and keep web tasks separate from IM channels.
|
|
209
|
+
|
|
210
|
+
## Validation
|
|
211
|
+
|
|
212
|
+
```powershell
|
|
213
|
+
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
214
|
+
$OutputEncoding = [System.Text.Encoding]::UTF8
|
|
215
|
+
npm test
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
`prepublishOnly` runs the tests before publishing.
|
|
219
|
+
|
|
220
|
+
## Documentation and license
|
|
221
|
+
|
|
222
|
+
Project status, usage boundaries, architecture, and iteration records begin at the [documentation entry point](docs/00-交接入口/00-阅读导航.md). The detailed operational guide is [使用说明](docs/02-产品与业务/04-使用说明.md).
|
|
223
|
+
|
|
224
|
+
Licensed under [Apache License 2.0](LICENSE).
|
package/README.md
CHANGED
|
@@ -1,40 +1,224 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/branding/dsh-banner.png" alt="DSH IM Connect" width="100%">
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
<div align="center">
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
# DSH IM Connect
|
|
8
|
+
|
|
9
|
+
**把飞书、钉钉、企业微信、微信、QQ、Telegram 接到本机 DeepSeek Harness**
|
|
10
|
+
|
|
11
|
+
[English](README.en.md) · [Apache-2.0](LICENSE)
|
|
12
|
+
|
|
13
|
+
[](LICENSE)
|
|
14
|
+
[](https://www.npmjs.com/package/@michengai/dsh-im-connect)
|
|
15
|
+
[](https://github.com/MichengAI/dsh-im-connect)
|
|
16
|
+
[](https://nodejs.org/)
|
|
17
|
+
[](#-支持的渠道)
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
> DSH IM Connect 是社区维护的 DeepSeek Harness(DSH)插件,并非 DeepSeek AI 官方产品。
|
|
21
|
+
|
|
22
|
+
## 功能概览
|
|
23
|
+
|
|
24
|
+
- 在「设置 → IM助理」里连接钉钉、飞书、Lark、微信、企业微信、QQ、Telegram。
|
|
25
|
+
- 每个 IM 聊天对应一条独立 DSH 会话,出现在工作区「频道」,不会混进网页「任务」。
|
|
26
|
+
- 手机里直接下任务、看回复、批准工具;模型和权限跟随本机 DSH。
|
|
27
|
+
- 支持扫码绑定或手动填凭据;敏感字段写入 DSH `ctx.credentials`,不会进 `channels.json`。
|
|
28
|
+
- 可把一句话复制到 DSH、Codex 或 WorkBuddy,让对方代装到本机 DSH。
|
|
29
|
+
|
|
30
|
+
## 📡 支持的渠道
|
|
31
|
+
|
|
32
|
+
<p align="center">
|
|
33
|
+
<code>🔔 钉钉</code>
|
|
34
|
+
<code>🐦 飞书</code>
|
|
35
|
+
<code>🌐 Lark</code>
|
|
36
|
+
<code>💬 微信</code>
|
|
37
|
+
<code>🏢 企业微信</code>
|
|
38
|
+
<code>🐧 QQ</code>
|
|
39
|
+
<code>✈️ Telegram</code>
|
|
40
|
+
</p>
|
|
41
|
+
|
|
42
|
+
| 渠道 | 状态 | 接入方式 | 需要 |
|
|
43
|
+
|---|---|---|---|
|
|
44
|
+
| 🔔 **钉钉** | ✅ 可用 | 扫码,或 Client ID / Secret | 钉钉开放平台机器人;回复优先走 AI Card |
|
|
45
|
+
| 🐦 **飞书** | ✅ 可用 | 仅扫码,自动创建机器人 | 飞书账号 |
|
|
46
|
+
| 🌐 **Lark** | ✅ 可用 | 仅扫码 | Lark 国际版账号 |
|
|
47
|
+
| 💬 **微信** | ✅ 可用* | 官方 iLink 扫码 | 建议专用小号;仅私聊 |
|
|
48
|
+
| 🏢 **企业微信** | ✅ 可用 | 扫码(推荐),或 Bot ID / Secret | 企业微信智能机器人 |
|
|
49
|
+
| 🐧 **QQ** | ✅ 可用 | 扫码,或 AppID / AppSecret | QQ 开放平台机器人,不是个人号 |
|
|
50
|
+
| ✈️ **Telegram** | ✅ 可用 | 仅填 Bot Token | `@BotFather`;同一 Bot 不要同时开 Webhook |
|
|
51
|
+
|
|
52
|
+
✅ 可用 = 文字收发可用 | *微信 = 只走腾讯官方 iLink,不做逆向个人号 | 群聊都需要 @ 机器人才回复
|
|
53
|
+
|
|
54
|
+
## 界面预览
|
|
55
|
+
|
|
56
|
+
在「设置 → IM助理」连接渠道。未连接显示「配置」,已连接显示开关和状态:
|
|
57
|
+
|
|
58
|
+

|
|
59
|
+
|
|
60
|
+
工作区左侧「任务 / 频道」分列。IM 会话只出现在「频道」:
|
|
61
|
+
|
|
62
|
+

|
|
63
|
+
|
|
64
|
+
企业微信等渠道支持扫码快捷绑定:
|
|
65
|
+
|
|
66
|
+

|
|
67
|
+
|
|
68
|
+
连上后,可在各 IM 里直接驱动本机助手:
|
|
69
|
+
|
|
70
|
+
<p align="center">
|
|
71
|
+
<img src="assets/screenshots/wecom-chat.jpg" width="220" alt="企业微信对话">
|
|
72
|
+
<img src="assets/screenshots/weixin-chat.jpg" width="220" alt="微信对话">
|
|
73
|
+
<img src="assets/screenshots/dingtalk-chat.jpg" width="220" alt="钉钉对话">
|
|
74
|
+
</p>
|
|
75
|
+
<p align="center">
|
|
76
|
+
<img src="assets/screenshots/feishu-chat.jpg" width="220" alt="飞书对话">
|
|
77
|
+
<img src="assets/screenshots/qq-chat.jpg" width="220" alt="QQ 对话">
|
|
78
|
+
<img src="assets/screenshots/telegram-chat.jpg" width="220" alt="Telegram 对话">
|
|
79
|
+
</p>
|
|
80
|
+
|
|
81
|
+
## 前置条件
|
|
82
|
+
|
|
83
|
+
- 已可正常运行 DeepSeek Harness Web,且可在 PowerShell 中使用 `dsh`。
|
|
84
|
+
- 以下示例使用 `web` profile;请替换为实际目标 profile。
|
|
85
|
+
- 从源码安装或二次开发需要 Node.js 22+;仅从 npm 安装无需在任意目录执行 `npm install`。
|
|
86
|
+
- 安装后必须重启 `dsh web`,并在浏览器硬刷新,才能看到「设置 → IM助理」。
|
|
6
87
|
|
|
7
88
|
## 安装
|
|
8
89
|
|
|
90
|
+
`dsh plugin add` 会转发到 profile 目录里的 `pnpm add`。不写版本、不指定官方源时,本机镜像和最短发布间隔可能让你停在旧版。
|
|
91
|
+
|
|
92
|
+
### 交给其他 Agent 一句话安装
|
|
93
|
+
|
|
94
|
+
本插件运行在 DeepSeek Harness Web 里。把下面其中一句复制到 DSH、Codex 或 WorkBuddy,让它代你安装到本机 `web` profile。
|
|
95
|
+
|
|
96
|
+
从 npm 安装:
|
|
97
|
+
|
|
98
|
+
```text
|
|
99
|
+
请把 DSH 插件 @michengai/dsh-im-connect 最新版装进本机 web profile,使用官方 npm 源执行:dsh plugin --profile web add @michengai/dsh-im-connect@latest --registry=https://registry.npmjs.org/。装完执行 dsh --profile web --dump-config,确认已挂载 im-connect,并提醒我重启 DSH Web 后硬刷新浏览器,打开「设置 → IM助理」。
|
|
9
100
|
```
|
|
10
|
-
|
|
101
|
+
|
|
102
|
+
从源码安装:
|
|
103
|
+
|
|
104
|
+
```text
|
|
105
|
+
请从 https://github.com/MichengAI/dsh-im-connect 安装 DSH 插件:克隆仓库,执行 npm install 和 npm test,再在该目录执行 dsh plugin --profile web add .。不要只复制 lib。然后执行 dsh --profile web --dump-config,确认已挂载 im-connect,并提醒我重启 DSH Web 后硬刷新浏览器,打开「设置 → IM助理」。
|
|
11
106
|
```
|
|
12
107
|
|
|
13
|
-
|
|
108
|
+
| 产品 | 怎么用 |
|
|
109
|
+
| --- | --- |
|
|
110
|
+
| DSH | 把上面其中一句发给当前会话。 |
|
|
111
|
+
| Codex | 把上面其中一句发给 Codex,让它在本机执行安装。 |
|
|
112
|
+
| WorkBuddy | 把上面其中一句发给 WorkBuddy;源码安装也可同时粘贴仓库地址 `https://github.com/MichengAI/dsh-im-connect`。 |
|
|
113
|
+
|
|
114
|
+
Codex 和 WorkBuddy 只负责代装;装好后仍要打开 DSH Web 使用「设置 → IM助理」。
|
|
14
115
|
|
|
15
|
-
|
|
116
|
+
也可以自己执行同一条 npm 命令:
|
|
16
117
|
|
|
118
|
+
```powershell
|
|
119
|
+
dsh plugin --profile web add @michengai/dsh-im-connect@latest --registry=https://registry.npmjs.org/
|
|
17
120
|
```
|
|
18
|
-
|
|
121
|
+
|
|
122
|
+
未把 `dsh` 装进 PATH 时,把开头的 `dsh` 换成 `npx --yes @deepseek-ai/dsh`。
|
|
123
|
+
|
|
124
|
+
### 从官方 npm 安装最新版
|
|
125
|
+
|
|
126
|
+
在任意 PowerShell 目录执行:
|
|
127
|
+
|
|
128
|
+
```powershell
|
|
129
|
+
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
130
|
+
$OutputEncoding = [System.Text.Encoding]::UTF8
|
|
131
|
+
dsh plugin --profile web add @michengai/dsh-im-connect@latest --registry=https://registry.npmjs.org/
|
|
132
|
+
dsh --profile web --dump-config
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
需要钉死某一版时,把 `@latest` 换成具体版本,例如 `@0.1.1`。
|
|
136
|
+
|
|
137
|
+
配置输出中应包含 `im-connect`。安装后重启 DSH Web 并在浏览器硬刷新。不要手工复制客户端文件,`dsh plugin add` 会同时应用 `cordis.patch.yml`。
|
|
138
|
+
|
|
139
|
+
### 从源码安装
|
|
140
|
+
|
|
141
|
+
适用于调试或使用未发布改动。克隆后的本地路径就是插件安装路径:
|
|
142
|
+
|
|
143
|
+
```powershell
|
|
144
|
+
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
145
|
+
$OutputEncoding = [System.Text.Encoding]::UTF8
|
|
146
|
+
Set-Location D:\Repository\deepseek-harness-plugin
|
|
147
|
+
git clone https://github.com/MichengAI/dsh-im-connect.git
|
|
148
|
+
Set-Location .\dsh-im-connect
|
|
149
|
+
npm install
|
|
150
|
+
npm test
|
|
151
|
+
dsh plugin --profile web add .
|
|
152
|
+
dsh --profile web --dump-config
|
|
19
153
|
```
|
|
20
154
|
|
|
21
|
-
|
|
155
|
+
完成后重启 DSH Web 并硬刷新浏览器。`dsh plugin ... add .` 会读取当前目录的包信息和 `cordis.patch.yml`;不要改为直接复制 `lib` 目录。
|
|
156
|
+
|
|
157
|
+
## 使用
|
|
158
|
+
|
|
159
|
+
打开「设置 → IM助理」,先选工作区、权限和模型,再连接渠道。详细步骤见 [使用说明](docs/02-产品与业务/04-使用说明.md)。
|
|
160
|
+
|
|
161
|
+
| 目标 | 操作 | 说明 |
|
|
162
|
+
| --- | --- | --- |
|
|
163
|
+
| 连接渠道 | 未连接卡片点「配置」,扫码或填写凭据 | 飞书 / Lark / 微信仅扫码;Telegram 仅填 Bot Token |
|
|
164
|
+
| 暂停接收 | 关闭已连接卡片上的开关 | 凭据保留,只是暂时不收消息 |
|
|
165
|
+
| 在 IM 里下任务 | 私聊直接发文字;群聊需要 @ 机器人 | 每个聊天对应一条独立频道会话 |
|
|
166
|
+
| 分段输入 | 结尾加 `..` 表示还有后续,`!!` 表示立即提交 | 默认约 5 秒合并窗口 |
|
|
167
|
+
| 新开会话 | 发送 `/new` 或 `/clear` | 只影响当前 IM 聊天,不影响网页任务 |
|
|
168
|
+
| 查看状态 / 帮助 | 发送 `/status` 或 `/help` | 只作用于当前频道会话 |
|
|
169
|
+
| 批准工具 | 回复「批准」或「拒绝」 | 也接受 `yes` / `no` / `allow` / `reject` |
|
|
170
|
+
| 在网页里回看 | 打开工作区「频道」页签 | IM 会话不会出现在「任务」里 |
|
|
22
171
|
|
|
23
|
-
|
|
172
|
+
钉钉回复优先走官方 AI Card 流式卡片;创建失败则回退普通文本。Telegram 同一 Bot 不要同时开 Webhook。
|
|
24
173
|
|
|
25
|
-
|
|
26
|
-
- `/help` `/status` `/new` `/clear`
|
|
27
|
-
- 默认跟随当前网页模型;企业内部默认放行,群聊仍需 @ 才会回复
|
|
28
|
-
- 需要工具批准时,在聊天里回「批准」或「拒绝」
|
|
29
|
-
- 钉钉回复走官方 AI Card 流式卡片;创建失败则回退普通文本
|
|
174
|
+
## 权限与安全边界
|
|
30
175
|
|
|
31
|
-
|
|
176
|
+
| 项 | 当前行为 |
|
|
177
|
+
| --- | --- |
|
|
178
|
+
| 用户准入 | 全放开。私聊和群聊都可驱动助手;群聊仍只响应 @ |
|
|
179
|
+
| 管理接口 | 仅本机回环(`localhost` / `127.0.0.1` / `[::1]`) |
|
|
180
|
+
| 敏感字段 | 优先写入 DSH `ctx.credentials`;没有该服务时落到 `%DSH_HOME%\dsh-im-connect\secrets.json` |
|
|
181
|
+
| 渠道状态 | `channels.json` 只保存启用状态和凭据引用,不保存明文 Secret |
|
|
182
|
+
| 浏览器回包 | 不返回 token、secret、App Secret 或原始用户标识 |
|
|
183
|
+
| 微信协议 | 只走腾讯官方 iLink,不使用逆向个人微信协议 |
|
|
184
|
+
| 工具批准 | 在对应 IM 聊天里回复,不能跨会话批准 |
|
|
32
185
|
|
|
33
|
-
|
|
186
|
+
不要把 DSH Web 暴露到非本机地址。权限预设依赖 Host 的 sandbox-policy;`full-access` 不套沙箱。
|
|
34
187
|
|
|
188
|
+
## 二次开发
|
|
189
|
+
|
|
190
|
+
本仓库用 `src` 开发,构建到 `lib`:
|
|
191
|
+
|
|
192
|
+
- [src\index.ts](src/index.ts):Host 入口、配置和生命周期。
|
|
193
|
+
- [src\manager.ts](src/manager.ts):渠道启停、本机 API、凭据落盘。
|
|
194
|
+
- [src\engine](src/engine):会话路由、斜杠命令、审批、分片和回推。
|
|
195
|
+
- [src\channels](src/channels):钉钉、飞书、Lark、微信、企业微信、QQ、Telegram 适配器。
|
|
196
|
+
- `client.js`:设置页和工作区频道侧栏。
|
|
197
|
+
- `tests\*.test.mjs`:路由、扫码、凭据、QQ、投递和侧栏测试。
|
|
198
|
+
|
|
199
|
+
修改后运行测试并以本地目录安装验证:
|
|
200
|
+
|
|
201
|
+
```powershell
|
|
202
|
+
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
203
|
+
$OutputEncoding = [System.Text.Encoding]::UTF8
|
|
204
|
+
npm test
|
|
205
|
+
dsh plugin --profile web add .
|
|
35
206
|
```
|
|
207
|
+
|
|
208
|
+
修改渠道或会话逻辑时,必须保持:引擎不写死平台名、渠道不创建 agent、网页任务与 IM 频道分列。
|
|
209
|
+
|
|
210
|
+
## 验证
|
|
211
|
+
|
|
212
|
+
```powershell
|
|
213
|
+
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
214
|
+
$OutputEncoding = [System.Text.Encoding]::UTF8
|
|
36
215
|
npm test
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
`prepublishOnly` 会在发布前自动执行测试。
|
|
219
|
+
|
|
220
|
+
## 项目文档与许可证
|
|
221
|
+
|
|
222
|
+
项目状态、使用边界、技术架构和迭代记录从[文档交接入口](docs/00-交接入口/00-阅读导航.md)开始。详细操作说明见 [使用说明](docs/02-产品与业务/04-使用说明.md)。
|
|
223
|
+
|
|
224
|
+
本项目采用 [Apache License 2.0](LICENSE)。
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@michengai/dsh-im-connect",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "DeepSeek Harness IM 助理:把本机 agent 接到微信、企微、钉钉、飞书、QQ、Telegram,会话与网页任务分列。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -19,27 +19,41 @@
|
|
|
19
19
|
"src",
|
|
20
20
|
"client.js",
|
|
21
21
|
"cordis.patch.yml",
|
|
22
|
-
"
|
|
22
|
+
"assets",
|
|
23
|
+
"README.md",
|
|
24
|
+
"README.en.md"
|
|
23
25
|
],
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/MichengAI/dsh-im-connect.git"
|
|
29
|
+
},
|
|
30
|
+
"bugs": {
|
|
31
|
+
"url": "https://github.com/MichengAI/dsh-im-connect/issues"
|
|
32
|
+
},
|
|
33
|
+
"homepage": "https://github.com/MichengAI/dsh-im-connect#readme",
|
|
24
34
|
"scripts": {
|
|
25
35
|
"build": "tsc -p tsconfig.json && node scripts/copy-client.mjs",
|
|
26
36
|
"test": "npm run build && node --test tests/*.test.mjs",
|
|
27
37
|
"prepublishOnly": "npm test"
|
|
28
38
|
},
|
|
29
|
-
"license": "
|
|
39
|
+
"license": "Apache-2.0",
|
|
30
40
|
"engines": {
|
|
31
41
|
"node": ">=22.19"
|
|
32
42
|
},
|
|
33
43
|
"dependencies": {
|
|
34
|
-
"@deepseek-ai/cordis": "^4.0.1",
|
|
35
|
-
"@deepseek-ai/schemastery": "^3.18.1",
|
|
36
44
|
"@larksuiteoapi/node-sdk": "^1.36.0",
|
|
37
45
|
"@tencent-connect/qqbot-connector": "^1.2.0",
|
|
38
46
|
"@wecom/aibot-node-sdk": "^1.0.7",
|
|
39
47
|
"dingtalk-stream": "^2.1.4",
|
|
40
48
|
"qrcode": "^1.5.4"
|
|
41
49
|
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
52
|
+
"@deepseek-ai/schemastery": "^3.18.1"
|
|
53
|
+
},
|
|
42
54
|
"devDependencies": {
|
|
55
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
56
|
+
"@deepseek-ai/schemastery": "^3.18.1",
|
|
43
57
|
"@types/node": "^22.10.0",
|
|
44
58
|
"@types/qrcode": "^1.5.6",
|
|
45
59
|
"typescript": "^5.9.2"
|