@michengai/dsh-im-connect 0.1.40 → 0.1.41
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 +15 -5
- package/CHANGELOG.zh-CN.md +15 -5
- package/README.en.md +26 -6
- package/README.md +28 -8
- package/client.js +159 -97
- package/lib/channels/dingtalk.d.ts.map +1 -1
- package/lib/channels/dingtalk.js +4 -2
- package/lib/channels/dingtalk.js.map +1 -1
- package/lib/client.js +159 -97
- package/lib/engine/chat-commands.d.ts +30 -0
- package/lib/engine/chat-commands.d.ts.map +1 -0
- package/lib/engine/chat-commands.js +451 -0
- package/lib/engine/chat-commands.js.map +1 -0
- package/lib/engine/command-locale.d.ts +6 -0
- package/lib/engine/command-locale.d.ts.map +1 -0
- package/lib/engine/command-locale.js +21 -0
- package/lib/engine/command-locale.js.map +1 -0
- package/lib/engine/command-messages.d.ts +214 -0
- package/lib/engine/command-messages.d.ts.map +1 -0
- package/lib/engine/command-messages.js +214 -0
- package/lib/engine/command-messages.js.map +1 -0
- package/lib/engine/command-permissions.d.ts +15 -0
- package/lib/engine/command-permissions.d.ts.map +1 -0
- package/lib/engine/command-permissions.js +39 -0
- package/lib/engine/command-permissions.js.map +1 -0
- package/lib/engine/command-replies.d.ts +12 -0
- package/lib/engine/command-replies.d.ts.map +1 -0
- package/lib/engine/command-replies.js +36 -0
- package/lib/engine/command-replies.js.map +1 -0
- package/lib/engine/gateway.d.ts +6 -1
- package/lib/engine/gateway.d.ts.map +1 -1
- package/lib/engine/gateway.js +59 -32
- package/lib/engine/gateway.js.map +1 -1
- package/lib/engine/merge.d.ts +2 -0
- package/lib/engine/merge.d.ts.map +1 -1
- package/lib/engine/merge.js +2 -0
- package/lib/engine/merge.js.map +1 -1
- package/lib/engine/router.d.ts +14 -4
- package/lib/engine/router.d.ts.map +1 -1
- package/lib/engine/router.js +125 -49
- package/lib/engine/router.js.map +1 -1
- package/lib/engine/session-id.d.ts +5 -0
- package/lib/engine/session-id.d.ts.map +1 -1
- package/lib/engine/session-id.js.map +1 -1
- package/lib/engine/session-store.d.ts.map +1 -1
- package/lib/engine/session-store.js +10 -1
- package/lib/engine/session-store.js.map +1 -1
- package/lib/manager.d.ts +7 -0
- package/lib/manager.d.ts.map +1 -1
- package/lib/manager.js +57 -9
- package/lib/manager.js.map +1 -1
- package/package.json +1 -1
- package/src/channels/dingtalk.ts +4 -2
- package/src/engine/chat-commands.ts +404 -0
- package/src/engine/command-locale.ts +20 -0
- package/src/engine/command-messages.ts +297 -0
- package/src/engine/command-permissions.ts +35 -0
- package/src/engine/command-replies.ts +37 -0
- package/src/engine/gateway.ts +50 -32
- package/src/engine/merge.ts +4 -0
- package/src/engine/router.ts +115 -50
- package/src/engine/session-id.ts +5 -0
- package/src/engine/session-store.ts +4 -1
- package/src/manager.ts +56 -10
package/CHANGELOG.md
CHANGED
|
@@ -4,13 +4,23 @@
|
|
|
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.41 - 2026-09-10
|
|
8
|
+
|
|
9
|
+
- Add independent command switches for private and group chats on each account. Normal chat remains available when commands are disabled, and existing private-chat admission rules still apply.
|
|
10
|
+
- Manage sessions, workspaces, models, and reasoning levels from IM. View history, rename or fork sessions, stop tasks, add instructions, and manage queued messages. `/help` also lists the Chat extension commands currently available.
|
|
11
|
+
- Improve account settings with full-width channel cards, settings dialogs, and receive-message switches on account rows. Add Agent preset selection and fix the unresponsive Add Workspace action.
|
|
12
|
+
- Fix previous sessions failing to open on the web after `/new`, and missing replies after switching workspaces. New sessions use the selected workspace and account settings while preserving previous sessions.
|
|
13
|
+
- Make command replies clearer with results, current settings, and suggested next actions. Lists identify archived sessions and sessions connected to another chat. Support Chinese and English using the language saved in web settings.
|
|
14
|
+
- Preserve line breaks in DingTalk command replies. If AI Card creation fails, replies fall back to plain text with line breaks intact.
|
|
15
|
+
- Restart DSH and refresh the page after upgrading.
|
|
16
|
+
|
|
7
17
|
## 0.1.40 - 2026-09-10
|
|
8
18
|
|
|
9
|
-
- Fix #12:
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
19
|
+
- Fix #12: previous sessions stay in the channel list after `/new`, `/clear`, or a workspace change. Open, rename, or archive them without changing the new session used by your current chat.
|
|
20
|
+
- After upgrading, automatically restore historical sessions whose local chat logs are still available and whose channel can be identified, while preserving their archive status.
|
|
21
|
+
- Session names follow DSH title updates without overwriting manually set names. New sessions use the first message or attachment name by default.
|
|
22
|
+
- Fix session entries disappearing when archiving or deletion fails, and deleted sessions remaining in the list.
|
|
23
|
+
- Restart DSH and refresh the page after upgrading.
|
|
14
24
|
|
|
15
25
|
## 0.1.39 - 2026-09-09
|
|
16
26
|
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -4,13 +4,23 @@
|
|
|
4
4
|
|
|
5
5
|
以下记录最近发布的五个版本。Git 标签与 GitHub Release 现已和这些条目同步;历史条目继续保留原始发布提交链接。
|
|
6
6
|
|
|
7
|
+
## 0.1.41 - 2026-09-10
|
|
8
|
+
|
|
9
|
+
- 新增每账号独立的私聊、群聊命令开关。关闭命令后仍可正常聊天;私聊继续遵循原有准入规则。
|
|
10
|
+
- 在 IM 中管理会话、工作区、模型和推理等级,查看历史、改名、分叉,以及停止任务、补充指令和管理队列;`/help` 同时展示当前可用的 Chat 扩展命令。
|
|
11
|
+
- 优化账号设置:渠道卡片铺满内容区,账号设置通过弹窗修改,接收消息开关移到账号行;支持选择 Agent 预设,并修复添加工作区无响应的问题。
|
|
12
|
+
- 修复 `/new` 后旧会话在网页无法直接打开,以及切换工作区后新会话不回传回复的问题。新建会话沿用所选工作区和账号配置,旧会话继续保留。
|
|
13
|
+
- 命令回复补充清晰的结果、当前配置和下一步操作,列表标记归档及占用状态。支持跟随网页保存的中英文语言选择。
|
|
14
|
+
- 修复钉钉命令回复换行被合并的问题;AI 卡片创建失败时以纯文本保留回复换行。
|
|
15
|
+
- 升级后请重启 DSH 并刷新页面。
|
|
16
|
+
|
|
7
17
|
## 0.1.40 - 2026-09-10
|
|
8
18
|
|
|
9
|
-
- 修复 #12
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
19
|
+
- 修复 #12:使用 `/new`、`/clear` 或切换工作区后,旧会话仍保留在渠道列表,可继续打开、改名和归档,不影响当前聊天使用的新会话。
|
|
20
|
+
- 升级后,自动找回本机仍有聊天记录且能够识别所属渠道的历史会话,并保留原有归档状态。
|
|
21
|
+
- 会话名称跟随 DSH 标题更新,手动设置的名称不会被自动覆盖;新会话默认使用首条消息或附件名称。
|
|
22
|
+
- 修复归档、删除失败时会话入口消失,以及已删除会话仍残留在列表中的问题。
|
|
23
|
+
- 升级后请重启 DSH 并刷新页面。
|
|
14
24
|
|
|
15
25
|
## 0.1.39 - 2026-09-09
|
|
16
26
|
|
package/README.en.md
CHANGED
|
@@ -87,7 +87,7 @@ The receive paths cover WeChat, WeCom, DingTalk, Feishu, Lark, QQ, and Telegram.
|
|
|
87
87
|
|
|
88
88
|
## Screenshots
|
|
89
89
|
|
|
90
|
-
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
|
|
90
|
+
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 in its settings dialog:
|
|
91
91
|
|
|
92
92
|

|
|
93
93
|
|
|
@@ -172,20 +172,40 @@ Open **Settings → IM Assistant**, select **Add account** under the target chan
|
|
|
172
172
|
| Goal | Action | Notes |
|
|
173
173
|
| --- | --- | --- |
|
|
174
174
|
| 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 |
|
|
175
|
-
| Change account settings | Expand the channel, select an account, then edit its workspace, model, reasoning effort, permission, or private-access mode
|
|
176
|
-
| Pause receiving |
|
|
175
|
+
| Change account settings | Expand the channel, select an account, then edit its workspace, model, reasoning effort, permission, or private-access mode in its settings dialog | Changes affect only that account and apply to its subsequent sessions immediately |
|
|
176
|
+
| Pause receiving | Turn off **Receive messages** on the account row | Credentials and settings stay; only new inbound messages for that account pause |
|
|
177
177
|
| 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 |
|
|
178
178
|
| Split input | End with `..` to continue, `!!` to flush now | Default merge window is about 5 seconds |
|
|
179
179
|
| Start a new session | Send `/new` or `/clear` | Creates and switches the current IM session; previous sessions stay in the Channels list without affecting web tasks |
|
|
180
|
-
| Status / help | Send `/status` or `/help` |
|
|
180
|
+
| Status / help | Send `/status` or `/help` | Current session and dynamically discovered Chat commands |
|
|
181
|
+
| Agent preset | Choose **Agent preset** when adding or editing an account | Uses the Chat roster; changes apply to new sessions while previous sessions keep their preset |
|
|
182
|
+
| Command permissions | Open Settings on the account row and toggle DM/group commands | Admission is checked first; disabling commands keeps conversation and approval/question replies available |
|
|
183
|
+
| Sessions / workspaces | `/sessions`, `/session <number or ID>`; `/workspaces`, `/workspace <number or ID>` | Resume ordinary Chat sessions; workspace selection creates a session without changing account defaults |
|
|
184
|
+
| Task controls | `/stop`, `/steer <text>`, `/queue` | Stop, provide instructions, or inspect the queue; stopping preserves Host queued messages |
|
|
185
|
+
| Model / reasoning | `/models`, `/model <number or provider/model>`, `/reasoning [effort or --default]` | Changes the current selection and updates the Host default for subsequent Chat sessions |
|
|
186
|
+
| Session management | `/history`, `/rename <title>`, `/fork` | Recent text history, rename, or fork and switch |
|
|
181
187
|
| Approve a stranger DM | Open **Settings → IM Assistant** and approve or deny the pending request | Affects DM access only |
|
|
182
188
|
| 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 |
|
|
183
189
|
| Approve a tool | Reply `Approve` / `Deny` or `批准` / `拒绝` in a DM | Also accepts `yes` / `no` / `allow` / `reject`; group replies cannot grant |
|
|
184
190
|
| Review on the web | Open the workspace **Channels** tab | IM sessions never appear under **Tasks** |
|
|
185
191
|
|
|
186
|
-
|
|
192
|
+
After `/workspace`, `/new` and continuing after archiving the current session keep the selected workspace and use the account model, Agent preset, and permission preset. `/session` and `/fork` preserve the original session configuration.
|
|
187
193
|
|
|
188
|
-
|
|
194
|
+
DingTalk replies prefer official AI Card streaming. If card creation fails, plain text preserves line breaks; code fences and list markers remain literal. Do not enable Webhook on the same Telegram bot.
|
|
195
|
+
|
|
196
|
+
Send commands as separate text messages; image captions remain ordinary input. Start with `/help`; individual replies also suggest related actions.
|
|
197
|
+
|
|
198
|
+
- Sessions and workspaces: list numbers expire after 15 minutes. Archived sessions are marked; restore them on the web first. Finish running tasks and pending interactions before switching.
|
|
199
|
+
- Models: as in Chat, `/model` and `/reasoning` also attempt to save the default for future sessions. Other existing sessions are not changed.
|
|
200
|
+
- Stopping and queues: `/stop` submits a stop request and keeps queued messages. Pause an active goal separately with `/goal pause`. Use `/queue` to view and manage queued messages.
|
|
201
|
+
- Forking: `/fork` requires at least one completed turn. If a fork was created but switching failed, follow the session ID and recovery instructions in the reply.
|
|
202
|
+
- Permissions and export: `/permission` settings survive session restoration. Run `/export` in web Chat; IM does not return ZIP files yet.
|
|
203
|
+
|
|
204
|
+
Command replies support Chinese and English and follow the language explicitly saved in web settings. With no preference or an unavailable language service, they default to Chinese. Dynamic names, paths, user content, and extension results remain unchanged. Tool approvals, interactive questions, and some channel errors are not yet fully localized.
|
|
205
|
+
|
|
206
|
+
## Permissions and security boundaries
|
|
207
|
+
|
|
208
|
+
Command permission does not grant DM admission or replace tool approval. Enabled users can inspect and resume ordinary Chat sessions and execute registered Host commands. Each account has independent DM/group switches without user IDs; legacy configurations default to enabled for compatibility.
|
|
189
209
|
|
|
190
210
|
| Item | Current behavior |
|
|
191
211
|
| --- | --- |
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
<div align="center">
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
# DSH IM Connect
|
|
8
8
|
|
|
9
9
|
**把飞书、Lark、钉钉、企业微信、微信、QQ、Telegram 接到本机 DeepSeek Harness**
|
|
10
10
|
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
入站消息先看发送者,再处理命令、工具审批和注入。
|
|
37
37
|
|
|
38
38
|
| 场景 | 行为 |
|
|
39
|
-
|
|
39
|
+
| --- | --- |
|
|
40
40
|
| 群聊未 @ 当前机器人 | 忽略,不回复、不进待批准;只 @ 其他成员也不触发 |
|
|
41
41
|
| 群聊已准确 @ 当前机器人 | 不用绑定,任何人都可以下任务 |
|
|
42
42
|
| 私聊 · 扫码用户 | 微信 / 飞书 / Lark / QQ 扫码者自动进白名单,可直接对话 |
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
</p>
|
|
63
63
|
|
|
64
64
|
| 渠道 | 状态 | 接入方式 | 需要 |
|
|
65
|
-
|
|
65
|
+
| --- | --- | --- | --- |
|
|
66
66
|
| 🔔 **钉钉** | ✅ 可用 | 扫码,或 Client ID / Secret | 钉钉开放平台机器人;回复优先走 AI Card |
|
|
67
67
|
| 🐦 **飞书** | ✅ 可用 | 仅扫码,自动创建机器人 | 飞书账号 |
|
|
68
68
|
| 🌐 **Lark** | ✅ 可用 | 仅扫码 | Lark 国际版账号 |
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
|
|
88
88
|
## 界面预览
|
|
89
89
|
|
|
90
|
-
在「设置 → IM
|
|
90
|
+
在「设置 → IM助理」按渠道添加账号。展开渠道后,点击账号行上的设置按钮配置工作区、模型、权限和私聊准入;接收消息开关位于账号行:
|
|
91
91
|
|
|
92
92
|

|
|
93
93
|
|
|
@@ -172,21 +172,41 @@ dsh --profile web --dump-config
|
|
|
172
172
|
| 目标 | 操作 | 说明 |
|
|
173
173
|
| --- | --- | --- |
|
|
174
174
|
| 添加账号 | 在对应渠道点击「添加账号」,选择账号配置后扫码或填写凭据 | 同一渠道可添加多个账号;飞书 / Lark / 微信仅扫码,Telegram 仅填 Bot Token |
|
|
175
|
-
| 修改账号配置 |
|
|
176
|
-
| 暂停接收 |
|
|
175
|
+
| 修改账号配置 | 展开渠道并选择账号,在设置弹窗中修改工作区、模型、推理强度、权限或私聊准入 | 配置只影响当前账号;保存后该账号的后续会话立即使用新配置 |
|
|
176
|
+
| 暂停接收 | 关闭账号行上的「接收消息」开关 | 凭据和账号配置保留,只暂停该账号接收新消息 |
|
|
177
177
|
| 在 IM 里下任务 | 微信 / 飞书 / Lark / QQ 扫码用户可直接私聊;钉钉 / 企微扫码者和其他用户需先批准。群聊只需 @ | 每个聊天对应一条独立频道会话 |
|
|
178
178
|
| 分段输入 | 结尾加 `..` 表示还有后续,`!!` 表示立即提交 | 默认约 5 秒合并窗口 |
|
|
179
179
|
| 新开会话 | 发送 `/new` 或 `/clear` | 新建并切换当前 IM 会话;旧会话保留在频道列表,不影响网页任务 |
|
|
180
|
-
| 查看状态 / 帮助 | 发送 `/status` 或 `/help` |
|
|
180
|
+
| 查看状态 / 帮助 | 发送 `/status` 或 `/help` | 查看当前会话及动态 Chat 命令 |
|
|
181
|
+
| Agent 预设 | 在新增或编辑账号弹窗选择「Agent 预设」 | 使用 Chat 的预设名册;更改后新会话使用新预设,旧会话保持原预设 |
|
|
182
|
+
| 命令权限 | 点击账号右侧「设置」,调整私聊、群聊命令开关 | 先准入,再判断命令权限;关闭后仍可正常对话和回答审批、问题 |
|
|
183
|
+
| 会话 / 工作区 | `/sessions`、`/session <序号或ID>`;`/workspaces`、`/workspace <序号或ID>` | 可接续普通 Chat 会话;选择工作区会新建会话,不修改账号默认配置 |
|
|
184
|
+
| 任务控制 | `/stop`、`/steer <内容>`、`/queue` | 停止、补充指令、查看队列;停止保留 Host 排队消息 |
|
|
185
|
+
| 模型 / 推理 | `/models`、`/model <序号或provider/model>`、`/reasoning [等级或 --default]` | 修改当前选择,并更新宿主后续 Chat 新会话的默认选择 |
|
|
186
|
+
| 会话管理 | `/history`、`/rename <名称>`、`/fork` | 最近文字对话、改名、分叉并切换 |
|
|
181
187
|
| 批准陌生人私聊 | 打开「设置 → IM助理」,在待批准列表点「批准」或「拒绝」 | 只影响私聊准入,不影响群聊 |
|
|
182
188
|
| 回答交互问题 | 直接回复选项序号或文字;多选用逗号分隔,也可以输入自定义答案 | 多个问题会按顺序发送;群聊只接受任务发起者回答 |
|
|
183
189
|
| 批准工具 | 在私聊回复「批准」或「拒绝」 | 也接受 `yes` / `no` / `allow` / `reject`;群聊无效 |
|
|
184
190
|
| 在网页里回看 | 打开工作区「频道」页签 | IM 会话不会出现在「任务」里 |
|
|
185
191
|
|
|
186
|
-
|
|
192
|
+
通过 `/workspace` 新建后,`/new` 和当前会话归档后的续聊会保留所选工作区,并使用账号配置的模型、Agent 与权限预设。`/session` 接续已有会话、`/fork` 分叉则保留原会话配置。
|
|
193
|
+
|
|
194
|
+
钉钉回复优先走官方 AI Card 流式卡片;创建失败则回退纯文本,保留换行;代码与列表标记按原文显示。Telegram 同一 Bot 不要同时开 Webhook。
|
|
195
|
+
|
|
196
|
+
命令单独发送为文字,图片说明按普通消息处理。首次使用可发 `/help`,各命令回复也会给出相关操作。
|
|
197
|
+
|
|
198
|
+
- 会话与工作区:列表序号 15 分钟内有效;归档项在列表中标记,需要先在网页恢复。切换前完成运行任务和待处理交互。
|
|
199
|
+
- 模型:`/model`、`/reasoning` 与 Chat 一致,也会尝试保存后续新会话的默认选择;已有其他会话不主动修改。
|
|
200
|
+
- 停止与队列:`/stop` 先提交停止请求,保留队列;活跃目标另用 `/goal pause` 暂停。发 `/queue` 查看和管理排队消息。
|
|
201
|
+
- 分叉:`/fork` 需要至少一个完整回合。已创建但未切换时,按回复中的会话 ID 和恢复指引接续。
|
|
202
|
+
- 权限与导出:`/permission` 设置在恢复会话时保留;`/export` 在网页 Chat 中导出,IM 暂不回传 ZIP 文件。
|
|
203
|
+
|
|
204
|
+
命令回复支持中英文,并跟随网页中明确保存的语言选择;未指定语言或语言服务不可用时使用中文。动态名称、路径、用户内容与宿主扩展结果保持原文。工具审批、交互问答和部分渠道错误尚未全部国际化。
|
|
187
205
|
|
|
188
206
|
## 权限与安全边界
|
|
189
207
|
|
|
208
|
+
命令权限不授予私聊准入,也不替代工具审批。开启命令的用户可查看、接续普通 Chat 会话并执行宿主注册命令。每账号独立设置私聊、群聊开关,不需要用户 ID;旧配置缺少该字段时默认开启以保持兼容。
|
|
209
|
+
|
|
190
210
|
| 项 | 当前行为 |
|
|
191
211
|
| --- | --- |
|
|
192
212
|
| 用户准入 | 群聊不用绑定,只需 @。每个账号可选择「仅已批准用户」或「允许所有私聊用户」;默认仅批准用户可用,微信 / 飞书 / Lark / QQ 扫码者会自动加入该账号白名单 |
|