@michengai/dsh-im-connect 0.1.27 → 0.1.29
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/CHANGELOG.md +16 -0
- package/CHANGELOG.zh-CN.md +16 -0
- package/README.en.md +15 -10
- package/README.md +15 -10
- package/assets/screenshots/settings-channels.png +0 -0
- package/client.js +529 -65
- package/lib/channels/factory.d.ts +2 -0
- package/lib/channels/factory.d.ts.map +1 -1
- package/lib/channels/factory.js +22 -7
- package/lib/channels/factory.js.map +1 -1
- package/lib/channels/meta.js +3 -3
- package/lib/channels/meta.js.map +1 -1
- package/lib/client.js +529 -65
- package/lib/engine/gateway.d.ts +5 -1
- package/lib/engine/gateway.d.ts.map +1 -1
- package/lib/engine/gateway.js +33 -8
- package/lib/engine/gateway.js.map +1 -1
- package/lib/engine/router.d.ts +10 -7
- package/lib/engine/router.d.ts.map +1 -1
- package/lib/engine/router.js +47 -27
- package/lib/engine/router.js.map +1 -1
- package/lib/engine/session-id.d.ts +6 -4
- package/lib/engine/session-id.d.ts.map +1 -1
- package/lib/engine/session-id.js +4 -2
- package/lib/engine/session-id.js.map +1 -1
- package/lib/manager.d.ts +53 -6
- package/lib/manager.d.ts.map +1 -1
- package/lib/manager.js +317 -66
- package/lib/manager.js.map +1 -1
- package/package.json +1 -1
- package/src/channels/factory.ts +15 -9
- package/src/channels/meta.ts +3 -3
- package/src/engine/gateway.ts +37 -13
- package/src/engine/router.ts +53 -33
- package/src/engine/session-id.ts +10 -6
- package/src/manager.ts +340 -75
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,22 @@
|
|
|
4
4
|
|
|
5
5
|
The five most recent published versions are listed below. Git tags and GitHub Releases now mirror these entries; historical sections retain links to their original release commits.
|
|
6
6
|
|
|
7
|
+
## 0.1.29 — 2026-09-01
|
|
8
|
+
|
|
9
|
+
- Completed Host-language localization across the multi-account settings flow, including account setup, selectors, status, actions, empty states, confirmations, and actionable server errors.
|
|
10
|
+
- Localized automatically generated account names without migrating stored account data, while preserving custom account names unchanged.
|
|
11
|
+
- Fixed narrow account inspectors so concise English connection actions remain aligned on one row, with whole-button wrapping as a safe fallback.
|
|
12
|
+
|
|
13
|
+
Published package: [`@michengai/dsh-im-connect@0.1.29`](https://www.npmjs.com/package/@michengai/dsh-im-connect/v/0.1.29).
|
|
14
|
+
|
|
15
|
+
## 0.1.28 — 2026-09-01
|
|
16
|
+
|
|
17
|
+
- Added multiple isolated accounts for WeChat, WeCom, QQ, DingTalk, Feishu, Lark, and Telegram, with independent workspace, model, permission, private-access, credential, allowlist, and session state.
|
|
18
|
+
- Redesigned IM Assistant settings around channel-local account creation, persistent account selection, account-specific configuration, clear empty states, on-demand QR pairing, and responsive desktop layouts.
|
|
19
|
+
- Hardened public private chats so unapproved users cannot approve local tool calls, made legacy approval routes fail closed when an account is ambiguous, and explicitly cancelled pending approvals and questions when an account reloads.
|
|
20
|
+
|
|
21
|
+
Published package: [`@michengai/dsh-im-connect@0.1.28`](https://www.npmjs.com/package/@michengai/dsh-im-connect/v/0.1.28).
|
|
22
|
+
|
|
7
23
|
## 0.1.27 — 2026-08-31
|
|
8
24
|
|
|
9
25
|
- Routed DSH tool approvals and structured user questions through the originating IM conversation, with text replies for approvals, single-choice, multiple-choice, and custom answers.
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -4,6 +4,22 @@
|
|
|
4
4
|
|
|
5
5
|
以下记录最近发布的五个版本。Git 标签与 GitHub Release 现已和这些条目同步;历史条目继续保留原始发布提交链接。
|
|
6
6
|
|
|
7
|
+
## 0.1.29 — 2026-09-01
|
|
8
|
+
|
|
9
|
+
- 补齐多账号设置全流程的宿主语言本地化,覆盖账号配置、选择器、状态、操作、空状态、确认提示与可执行的服务端错误。
|
|
10
|
+
- 自动生成的账号名现在会随宿主语言显示,无需迁移已有数据;自定义账号名保持原样。
|
|
11
|
+
- 修复狭窄账号详情栏的英文操作按钮布局:精简连接操作文案并保持单行对齐,极窄宽度下按整颗按钮换行。
|
|
12
|
+
|
|
13
|
+
发布包:[`@michengai/dsh-im-connect@0.1.29`](https://www.npmjs.com/package/@michengai/dsh-im-connect/v/0.1.29)。
|
|
14
|
+
|
|
15
|
+
## 0.1.28 — 2026-09-01
|
|
16
|
+
|
|
17
|
+
- 微信、企业微信、QQ、钉钉、飞书、Lark 与 Telegram 现可接入多个相互隔离的账号;每个账号独立保存工作区、模型、权限、私聊准入、凭据、白名单与会话状态。
|
|
18
|
+
- 重新设计 IM 助理设置:按渠道添加账号、记住账号选择、独立编辑账号配置,并补齐空状态、按需二维码与桌面窄窗口响应式布局。
|
|
19
|
+
- 加强公开私聊安全边界:未批准用户不能审批本机工具调用;旧版审批接口在账号不明确时安全失败;账号重载会主动取消仍在等待的工具审批和结构化问题。
|
|
20
|
+
|
|
21
|
+
发布包:[`@michengai/dsh-im-connect@0.1.28`](https://www.npmjs.com/package/@michengai/dsh-im-connect/v/0.1.28)。
|
|
22
|
+
|
|
7
23
|
## 0.1.27 — 2026-08-31
|
|
8
24
|
|
|
9
25
|
- 将 DSH 工具审批和结构化用户问题路由到发起任务的 IM 会话,通过文字回复完成审批、单选、多选和自定义回答。
|
package/README.en.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# DSH IM Connect
|
|
8
8
|
|
|
9
|
-
**Connect Feishu, DingTalk, WeCom, WeChat, QQ, and Telegram to local DeepSeek Harness**
|
|
9
|
+
**Connect Feishu, Lark, DingTalk, WeCom, WeChat, QQ, and Telegram to local DeepSeek Harness**
|
|
10
10
|
|
|
11
11
|
[简体中文](README.md) · [Changelog](CHANGELOG.md) · [Apache-2.0](LICENSE)
|
|
12
12
|
|
|
@@ -23,8 +23,9 @@
|
|
|
23
23
|
## Features
|
|
24
24
|
|
|
25
25
|
- Connect DingTalk, Feishu, Lark, WeChat, WeCom, QQ, and Telegram from **Settings → IM Assistant**.
|
|
26
|
+
- Add multiple accounts under the same channel. Each account has its own workspace, model, reasoning effort, permission, private-access mode, credentials, allowlist, and session state.
|
|
26
27
|
- Each IM chat maps to an independent DSH session under the workspace **Channels** tab, never mixed into web **Tasks**.
|
|
27
|
-
- Send work
|
|
28
|
+
- Send work and read replies from the phone. When DSH needs input, handle tool approval or denial, single choice, multiple choice, and custom answers in the originating IM conversation.
|
|
28
29
|
- Bind by QR code or credentials. Secrets go into DSH `ctx.credentials`, not `channels.json`.
|
|
29
30
|
- Paste one sentence into DSH, Codex, or WorkBuddy and let that agent install the plugin locally.
|
|
30
31
|
- Groups need no binding, only a mention. In DMs, QR scanners are auto-allowed only when the platform returns their identity; everyone else must be approved on the settings page.
|
|
@@ -44,6 +45,7 @@ Inbound messages are identified before commands, tool approvals, or injection.
|
|
|
44
45
|
| DM after manual credentials | Telegram, and DingTalk / WeCom / QQ bound manually, require approval for every DM |
|
|
45
46
|
| DM without a userId | Denied |
|
|
46
47
|
| Tool approval | Only an allowlisted user in a DM can reply `Approve` / `Deny` (or `批准` / `拒绝`); group replies do not grant |
|
|
48
|
+
| Interactive choice | Reply with an option number or text in the originating IM conversation; separate multiple choices with commas or add a custom answer; only the initiating user can answer in a group |
|
|
47
49
|
|
|
48
50
|
WeChat is QR-only and DM-only, so the same WeChat account that scanned can talk immediately. A different WeChat account DMing the bot waits for settings approval.
|
|
49
51
|
|
|
@@ -73,7 +75,7 @@ WeChat is QR-only and DM-only, so the same WeChat account that scanned can talk
|
|
|
73
75
|
|
|
74
76
|
## Screenshots
|
|
75
77
|
|
|
76
|
-
|
|
78
|
+
Add accounts under each channel in **Settings → IM Assistant**. Expand a channel, select an account, and configure its workspace, model, permission, private access, and receive state independently on the right:
|
|
77
79
|
|
|
78
80
|

|
|
79
81
|
|
|
@@ -162,7 +164,7 @@ dsh plugin --profile web add @michengai/dsh-im-connect@latest --registry=https:/
|
|
|
162
164
|
dsh --profile web --dump-config
|
|
163
165
|
```
|
|
164
166
|
|
|
165
|
-
To pin a release, replace `@latest` with a version such as `@0.1.
|
|
167
|
+
To pin a release, replace `@latest` with a version such as `@0.1.28`.
|
|
166
168
|
|
|
167
169
|
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`.
|
|
168
170
|
|
|
@@ -186,17 +188,19 @@ Restart DSH Web and hard-refresh the browser. `dsh plugin ... add .` reads the p
|
|
|
186
188
|
|
|
187
189
|
## Usage
|
|
188
190
|
|
|
189
|
-
Open **Settings → IM Assistant**,
|
|
191
|
+
Open **Settings → IM Assistant**, select **Add account** under the target channel, then choose that account's workspace, model, permission, and private-access mode. The full guide is [Usage guide](docs/02-产品与业务/04-使用说明.md).
|
|
190
192
|
|
|
191
193
|
| Goal | Action | Notes |
|
|
192
194
|
| --- | --- | --- |
|
|
193
|
-
|
|
|
194
|
-
|
|
|
195
|
+
| Add an account | Select **Add account** under a channel, choose the account settings, then scan or enter credentials | The same channel can contain multiple accounts; Feishu / Lark / WeChat are QR-only, while Telegram needs a Bot Token |
|
|
196
|
+
| Change account settings | Expand the channel, select an account, then edit its workspace, model, reasoning effort, permission, or private-access mode on the right | Changes affect only that account and apply to its subsequent sessions immediately |
|
|
197
|
+
| Pause receiving | Select the account and turn off **Receive messages** on the right | Credentials and settings stay; only new inbound messages for that account pause |
|
|
195
198
|
| Send work from IM | WeChat / Feishu / Lark / QQ QR scanners can DM immediately; DingTalk / WeCom scanners and other users need approval. Groups only need a mention | Each chat has its own channel session |
|
|
196
199
|
| Split input | End with `..` to continue, `!!` to flush now | Default merge window is about 5 seconds |
|
|
197
200
|
| Start a new session | Send `/new` or `/clear` | Affects only the current IM chat |
|
|
198
201
|
| Status / help | Send `/status` or `/help` | Scoped to the current channel session |
|
|
199
202
|
| Approve a stranger DM | Open **Settings → IM Assistant** and approve or deny the pending request | Affects DM access only |
|
|
203
|
+
| Answer an interactive question | Reply with an option number or text; separate multiple choices with commas, or enter a custom answer | Multiple questions arrive in order; only the initiating user can answer in a group |
|
|
200
204
|
| Approve a tool | Reply `Approve` / `Deny` or `批准` / `拒绝` in a DM | Also accepts `yes` / `no` / `allow` / `reject`; group replies cannot grant |
|
|
201
205
|
| Review on the web | Open the workspace **Channels** tab | IM sessions never appear under **Tasks** |
|
|
202
206
|
|
|
@@ -206,13 +210,14 @@ DingTalk replies prefer official AI Card streaming and fall back to plain text.
|
|
|
206
210
|
|
|
207
211
|
| Item | Current behavior |
|
|
208
212
|
| --- | --- |
|
|
209
|
-
| Access | Groups need no binding, only a mention.
|
|
213
|
+
| Access | Groups need no binding, only a mention. Each account can allow only approved users or all DM users; approved-only is the default, and WeChat / Feishu / Lark / QQ QR scanners are added to that account's allowlist automatically |
|
|
210
214
|
| Management API | Enforces both a loopback peer and loopback host (`localhost`, `127.0.0.1`, `[::1]`); mutations require JSON and the plugin client header |
|
|
211
215
|
| Secrets | WeChat tokens and other secrets prefer DSH `ctx.credentials`; otherwise they use plaintext `%DSH_HOME%\dsh-im-connect\secrets.json`, restricted to the current user and never safe to sync or share |
|
|
212
|
-
|
|
|
216
|
+
| Account state | `channels.json` stores per-account workspace, model, permission, private access, enablement, and credential refs, not raw secrets |
|
|
213
217
|
| Browser payloads | Never include tokens, secrets, App Secrets, or internal error details |
|
|
214
218
|
| WeChat protocol | Official iLink only; no reverse-engineered personal WeChat protocol |
|
|
215
|
-
| Tool approval | Only
|
|
219
|
+
| Tool approval | Only a user on the current account's allowlist can grant or deny in a DM. Even when all DM users may chat, unapproved users cannot approve tools; approvals cannot cross conversations or come from groups |
|
|
220
|
+
| Interactive questions | Single-choice, multiple-choice, and custom questions return to the originating IM conversation; one conversation handles them in order, and only the initiating user can answer in a group |
|
|
216
221
|
|
|
217
222
|
Do not expose DSH Web beyond this machine. Permission presets use the same host sandbox-policy values as Chat; `danger-full-access` does not wrap a sandbox.
|
|
218
223
|
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# DSH IM Connect
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
**把飞书、Lark、钉钉、企业微信、微信、QQ、Telegram 接到本机 DeepSeek Harness**
|
|
10
10
|
|
|
11
11
|
[English](README.en.md) · [更新日志](CHANGELOG.zh-CN.md) · [Apache-2.0](LICENSE)
|
|
12
12
|
|
|
@@ -23,8 +23,9 @@
|
|
|
23
23
|
## 功能概览
|
|
24
24
|
|
|
25
25
|
- 在「设置 → IM助理」里连接钉钉、飞书、Lark、微信、企业微信、QQ、Telegram。
|
|
26
|
+
- 同一渠道可添加多个账号;每个账号独立选择工作区、模型、推理强度、权限和私聊准入,凭据、白名单与会话状态也按账号隔离。
|
|
26
27
|
- 每个 IM 聊天对应一条独立 DSH 会话,出现在工作区「频道」,不会混进网页「任务」。
|
|
27
|
-
-
|
|
28
|
+
- 手机里直接下任务、看回复;DSH 发起交互时,可在原 IM 会话完成工具批准 / 拒绝、单选、多选和自定义回答。
|
|
28
29
|
- 支持扫码绑定或手动填凭据;敏感字段写入 DSH `ctx.credentials`,不会进 `channels.json`。
|
|
29
30
|
- 可把一句话复制到 DSH、Codex 或 WorkBuddy,让对方代装到本机 DSH。
|
|
30
31
|
- 群聊不用绑定,@ 即可对话;私聊中,平台能返回身份的扫码用户自动放行,其他人要在设置页批准。
|
|
@@ -44,6 +45,7 @@
|
|
|
44
45
|
| 私聊 · 手动凭据 | Telegram,以及手动填写凭据的钉钉 / 企微 / QQ,所有私聊都要先批准 |
|
|
45
46
|
| 私聊缺少 userId | 拒绝 |
|
|
46
47
|
| 工具审批 | 仅白名单用户在私聊回复「批准 / 拒绝」有效;群聊里回不算 |
|
|
48
|
+
| 交互选择 | 在原 IM 会话回复选项序号或文字;多选用逗号分隔,也可补充自定义答案;群聊只接受任务发起者回答 |
|
|
47
49
|
|
|
48
50
|
微信是扫码渠道且只支持私聊,所以连上后用**同一个微信号**即可直接用。换一个微信号私聊,会出现在设置页待批准。
|
|
49
51
|
|
|
@@ -73,7 +75,7 @@
|
|
|
73
75
|
|
|
74
76
|
## 界面预览
|
|
75
77
|
|
|
76
|
-
在「设置 → IM
|
|
78
|
+
在「设置 → IM助理」按渠道添加账号。展开渠道后选择账号,在右侧独立配置工作区、模型、权限、私聊准入和接收状态:
|
|
77
79
|
|
|
78
80
|

|
|
79
81
|
|
|
@@ -162,7 +164,7 @@ dsh plugin --profile web add @michengai/dsh-im-connect@latest --registry=https:/
|
|
|
162
164
|
dsh --profile web --dump-config
|
|
163
165
|
```
|
|
164
166
|
|
|
165
|
-
需要钉死某一版时,把 `@latest` 换成具体版本,例如 `@0.1.
|
|
167
|
+
需要钉死某一版时,把 `@latest` 换成具体版本,例如 `@0.1.28`。
|
|
166
168
|
|
|
167
169
|
配置输出中应包含 `im-connect`。安装后重启 DSH Web 并在浏览器硬刷新。不要手工复制客户端文件,`dsh plugin add` 会同时应用 `cordis.patch.yml`。
|
|
168
170
|
|
|
@@ -186,17 +188,19 @@ dsh --profile web --dump-config
|
|
|
186
188
|
|
|
187
189
|
## 使用
|
|
188
190
|
|
|
189
|
-
打开「设置 → IM
|
|
191
|
+
打开「设置 → IM助理」,在目标渠道点击「添加账号」,并为该账号选择工作区、模型、权限和私聊准入。详细步骤见 [使用说明](docs/02-产品与业务/04-使用说明.md)。
|
|
190
192
|
|
|
191
193
|
| 目标 | 操作 | 说明 |
|
|
192
194
|
| --- | --- | --- |
|
|
193
|
-
|
|
|
194
|
-
|
|
|
195
|
+
| 添加账号 | 在对应渠道点击「添加账号」,选择账号配置后扫码或填写凭据 | 同一渠道可添加多个账号;飞书 / Lark / 微信仅扫码,Telegram 仅填 Bot Token |
|
|
196
|
+
| 修改账号配置 | 展开渠道并选择账号,在右侧修改工作区、模型、推理强度、权限或私聊准入 | 配置只影响当前账号;保存后该账号的后续会话立即使用新配置 |
|
|
197
|
+
| 暂停接收 | 选择账号,关闭右侧「接收消息」 | 凭据和账号配置保留,只暂停该账号接收新消息 |
|
|
195
198
|
| 在 IM 里下任务 | 微信 / 飞书 / Lark / QQ 扫码用户可直接私聊;钉钉 / 企微扫码者和其他用户需先批准。群聊只需 @ | 每个聊天对应一条独立频道会话 |
|
|
196
199
|
| 分段输入 | 结尾加 `..` 表示还有后续,`!!` 表示立即提交 | 默认约 5 秒合并窗口 |
|
|
197
200
|
| 新开会话 | 发送 `/new` 或 `/clear` | 只影响当前 IM 聊天,不影响网页任务 |
|
|
198
201
|
| 查看状态 / 帮助 | 发送 `/status` 或 `/help` | 只作用于当前频道会话 |
|
|
199
202
|
| 批准陌生人私聊 | 打开「设置 → IM助理」,在待批准列表点「批准」或「拒绝」 | 只影响私聊准入,不影响群聊 |
|
|
203
|
+
| 回答交互问题 | 直接回复选项序号或文字;多选用逗号分隔,也可以输入自定义答案 | 多个问题会按顺序发送;群聊只接受任务发起者回答 |
|
|
200
204
|
| 批准工具 | 在私聊回复「批准」或「拒绝」 | 也接受 `yes` / `no` / `allow` / `reject`;群聊无效 |
|
|
201
205
|
| 在网页里回看 | 打开工作区「频道」页签 | IM 会话不会出现在「任务」里 |
|
|
202
206
|
|
|
@@ -206,13 +210,14 @@ dsh --profile web --dump-config
|
|
|
206
210
|
|
|
207
211
|
| 项 | 当前行为 |
|
|
208
212
|
| --- | --- |
|
|
209
|
-
| 用户准入 | 群聊不用绑定,只需
|
|
213
|
+
| 用户准入 | 群聊不用绑定,只需 @。每个账号可选择「仅已批准用户」或「允许所有私聊用户」;默认仅批准用户可用,微信 / 飞书 / Lark / QQ 扫码者会自动加入该账号白名单 |
|
|
210
214
|
| 管理接口 | 强制校验本机回环来源及 Host(`localhost` / `127.0.0.1` / `[::1]`);写接口要求 JSON 和插件客户端请求头 |
|
|
211
215
|
| 敏感字段 | 包括微信 token 在内均优先写入 DSH `ctx.credentials`;没有该服务时落到 `%DSH_HOME%\dsh-im-connect\secrets.json`(明文,仅限当前用户,禁止同步或分享) |
|
|
212
|
-
|
|
|
216
|
+
| 账号状态 | `channels.json` 按账号保存工作区、模型、权限、私聊准入、启用状态和凭据引用,不保存明文 Secret |
|
|
213
217
|
| 浏览器回包 | 不返回 token、secret、App Secret 或内部异常详情 |
|
|
214
218
|
| 微信协议 | 只走腾讯官方 iLink,不使用逆向个人微信协议 |
|
|
215
|
-
| 工具批准 |
|
|
219
|
+
| 工具批准 | 仅私聊且发送者已在当前账号白名单时生效;即使账号允许所有私聊用户,未批准用户也不能审批工具,且不能跨会话或在群里批准 |
|
|
220
|
+
| 交互问题 | 单选、多选和自定义问题回到发起任务的 IM 会话;同一会话按顺序处理,群聊只接受任务发起者回答 |
|
|
216
221
|
|
|
217
222
|
不要把 DSH Web 暴露到非本机地址。权限预设与 Chat 使用相同的 Host sandbox-policy;`danger-full-access` 不套沙箱。
|
|
218
223
|
|
|
Binary file
|