dsh-im-union 0.1.0 → 0.3.1
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 +52 -1
- package/README.en.md +9 -3
- package/README.md +9 -3
- package/client.js +1407 -423
- package/dsh.plugin.json +7 -7
- package/lib/channels/dingtalk-notify.d.ts +118 -0
- package/lib/channels/dingtalk-notify.js +389 -0
- package/lib/channels/email.d.ts +195 -0
- package/lib/channels/email.js +811 -0
- package/lib/channels/matrix-e2ee.d.ts +107 -0
- package/lib/channels/matrix-e2ee.js +338 -0
- package/lib/channels/matrix.d.ts +53 -14
- package/lib/channels/matrix.js +141 -14
- package/lib/channels/meta.d.ts +5 -0
- package/lib/channels/meta.js +42 -1
- package/lib/channels/qq-notify.d.ts +133 -0
- package/lib/channels/qq-notify.js +326 -0
- package/lib/channels/registry.js +3 -0
- package/lib/client.js +1407 -423
- package/lib/engine/account-manager.d.ts +16 -2
- package/lib/engine/account-manager.js +106 -7
- package/lib/engine/gateway.d.ts +27 -0
- package/lib/engine/gateway.js +82 -3
- package/lib/host-compat/services.js +22 -7
- package/lib/host-compat/session-api.d.ts +4 -0
- package/lib/host-compat/session-api.js +76 -17
- package/lib/index.d.ts +8 -1
- package/lib/index.js +72 -4
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +15 -9
- package/src/channels/dingtalk-notify.ts +457 -0
- package/src/channels/email.ts +926 -0
- package/src/channels/matrix-e2ee.ts +368 -0
- package/src/channels/matrix.ts +164 -25
- package/src/channels/meta.ts +47 -1
- package/src/channels/qq-notify.ts +429 -0
- package/src/channels/registry.ts +3 -0
- package/src/engine/account-manager.ts +117 -8
- package/src/engine/gateway.ts +96 -2
- package/src/host-compat/services.ts +20 -6
- package/src/host-compat/session-api.ts +80 -17
- package/src/index.ts +69 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,9 +2,60 @@
|
|
|
2
2
|
|
|
3
3
|
本项目版本号遵循语义化版本;发布面与宿主兼容矩阵见 `scripts/hosts.mjs`(README 管理块同源)。
|
|
4
4
|
|
|
5
|
+
## 0.3.1(中文环境语言修复 + 投稿审查修复)
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- `@whiskeysockets/baileys` 声明为 `optionalDependencies`(^6.7.24,随包分发;离线被跳过时渠道启动明确报错不崩溃),修复 awesome 投稿审查指出的「WhatsApp 依赖不随包」问题
|
|
10
|
+
- README 双语新增「安装前提」小节:baileys 随包机制、飞书语音档需系统 ffmpeg(二进制不随包)、iMessage 仅 macOS
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- 声明面陈旧枚举串同步:`package.json` description、`dsh.plugin.json` 双语 description、`scripts/gen-locales.mjs`(及 9 语 locale 产物)中「0.2.1-alpha.3」统一改「0.2.1-rc.2」,与 hosts.mjs 12 tag 枚举对齐(管理块本就同源,此次清的是手写残留)
|
|
15
|
+
- 中文环境面板锁英文:宿主初始 HTML 是 `<html lang="en">`,i18n 启动后才改写为真实语言(真机实测 zh-CN);client 在 factory 顶层冻结语言判定,装载早于宿主 i18n → 中文环境锁死英文面。改为**取词时懒解析** `<html lang>`(`currentLang()`),未知/缺空前缀保守归 zh,其余语言缺键逐条回落 zh 词典;宿主词典层保留逐键优先(`hostDictionary`),语言判定不再走它
|
|
16
|
+
|
|
17
|
+
## 0.3.0(私聊准入 + 会话偏好 + 连接保稳)
|
|
18
|
+
|
|
19
|
+
针对真机反馈三连修:发消息无反应(白名单静默拒)、无预设/模型入口(创建参数丢失)、编辑触发替换凭据(全量重建)。
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- 私聊准入两档(对齐 IM助理):`approved`=仅白名单(缺省,D6 默认拒绝不变)/`all`=所有私聊;账号行显示「私聊全开」标签,编辑弹窗可切
|
|
24
|
+
- 拒绝可见化:私聊被拒回一次带对方 userId 的未授权提示(每用户 10 分钟冷却,防回复风暴);群聊仅在显式 @ 且开关关闭时提示一次,未 @ 保持静默
|
|
25
|
+
- 账号级会话偏好:工作区 cwd / Agent 预设 / 模型(provider+model)/ 推理等级,仅在该账号新建会话时应用;存储于 accounts.json(`session` 对象),设置页弹窗编辑(选项来自新 `/session-catalog` 目录:现有会话 cwd 去重 + sessionController.modelCatalog + agentPresets.list)
|
|
26
|
+
- createSession 主路径换 `sessionController.create`(锚点 dsh-repo packages/api/session-controller:SessionCreateRequest 收 `sessionId/cwd/agentPreset`,sessionIdHint 幂等采纳;老线回退 agents.create meta 路径);模型偏好 create 后 `selectModel` 落位,失败只降级不阻断建会话
|
|
27
|
+
- `/session-catalog` 只读目录接口(回包零凭据)
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
|
|
31
|
+
- 「发消息无反应」根因:扫码绑定后无任何代码把用户加入白名单(网关注释声称「渠道层自动入表」但渠道层未实现)→ 全部私聊被静默丢弃;现由拒绝提示 + 准入两档双路解决
|
|
32
|
+
- 编辑保存触发「替换凭据」体感:upsert 原来无条件 teardown+重连;现在仅渠道/config 变化或提供新 secret 值才重建,别名/白名单/准入/偏好编辑原位生效(`updatePolicy` 下发,不再重挂 onMessage——顺带修掉 setAllowlist 重复注册监听导致的消息双投)
|
|
33
|
+
|
|
34
|
+
## 0.2.0(设置面板重设计)
|
|
35
|
+
|
|
36
|
+
对齐 dsh-im(DSH-IM)渠道卡视觉与 dsh-im-connect(IM助理)账号手风琴两个参照系的净室重写。
|
|
37
|
+
|
|
38
|
+
### Added
|
|
39
|
+
|
|
40
|
+
- 面板 v2 骨架:头部(品牌 + 副标语 + GitHub/刷新)→ 统计条(渠道/账号/在线)→ 折叠「运行时诊断」(代际/后端/凭据/上传/产物/Connector + 渠道实现度清单)→ 渠道手风琴卡
|
|
41
|
+
- 渠道卡:品牌色块 logo(15 渠道净室简化 glyph,非官方素材)+ 「仅通知 / 仅 macOS / 规划中」标签 + 账号数 + 添加账号;未实现渠道垫底灰显
|
|
42
|
+
- 账号行:别名 + 内部键 + 状态徽章(已连接/未连接/已暂停)+ 凭据缺失提示(缺哪些键)+ 检查连接 / 编辑 / 暂停恢复 / 两步删除;白名单编辑收进折叠节,纯通知渠道自动隐藏
|
|
43
|
+
- 添加/编辑统一弹窗:微信为扫码流(先建档 skipConnect 再取码,confirmed 后别名/配置保留);其余渠道按 meta.fields 出双列表单,secret 用 password 框(留空=保持)、helpUrl 外链、必填星标
|
|
44
|
+
- 账号编辑:/accounts 回显明文 config(按 meta plain 字段白名单过滤,secret 永不回显,D4 同源)供编辑预填
|
|
45
|
+
- UI 语言按宿主 `<html lang>` 选取内置词典(9 语,缺键逐条回落 zh)
|
|
46
|
+
|
|
47
|
+
### Fixed
|
|
48
|
+
|
|
49
|
+
- client 把 plain 字段也塞进 secrets 提交,而 upsert 只入库 secret 字段——email 的 address/imapHost/smtpHost 等必填明文、飞书语音档位等全部被静默丢弃;现按字段类型归位(plain → record.config,secret → secrets)
|
|
50
|
+
|
|
51
|
+
### Changed
|
|
52
|
+
|
|
53
|
+
- 样式从内联 style 改为单 `<style data-plugin>` 注入;颜色全部走 `var(--dsw-alias-*, fallback)` 消费链(本地 `--diu-*` 别名),暗/浅色零分支,窄容器容器查询降列
|
|
54
|
+
- /state 渠道清单增发 hostRequirement(设置页打「仅 macOS」标签)
|
|
55
|
+
|
|
5
56
|
## 0.1.0(首个功能版,dist-tag=latest)
|
|
6
57
|
|
|
7
|
-
M1–M3 代码侧全量:
|
|
58
|
+
M1–M3 代码侧全量:12 渠道适配器(11 平台)+ 跨版本窄腰 + 会话引擎 + 管理面。
|
|
8
59
|
|
|
9
60
|
### Added
|
|
10
61
|
|
package/README.en.md
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
A union IM bridge for DeepSeek Harness — a clean-room reimplementation merging the capability sets of xmanrui/dsh-im and MichengAI/dsh-im-connect, with no source copied from either.
|
|
4
4
|
|
|
5
5
|
<!-- host-compat:begin — generated by scripts/sync-hosts.mjs from scripts/hosts.mjs; DO NOT EDIT -->
|
|
6
|
-
- **Supported DSH hosts:** `0.1.2-rc.1` `0.1.5-rc.1` `0.1.5-rc.2` `0.1.5-rc.3` `0.1.7-rc.1` `0.1.7-rc.2` `0.2.0-rc.1` `0.2.0-rc.2` `0.2.1-alpha.2` `0.2.1-alpha.3` `0.2.1-rc.1` (
|
|
6
|
+
- **Supported DSH hosts:** `0.1.2-rc.1` `0.1.5-rc.1` `0.1.5-rc.2` `0.1.5-rc.3` `0.1.7-rc.1` `0.1.7-rc.2` `0.2.0-rc.1` `0.2.0-rc.2` `0.2.1-alpha.2` `0.2.1-alpha.3` `0.2.1-rc.1` `0.2.1-rc.2` (12 rc/alpha releases across lines 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0 / 0.2.1)
|
|
7
7
|
<!-- host-compat:end -->
|
|
8
8
|
|
|
9
9
|
## Status
|
|
10
10
|
|
|
11
|
-
**0.1
|
|
11
|
+
**0.3.1**: all 15 channel adapters (12 platforms including email; WeCom/DingTalk/QQ each contribute two: bot + self-built app or notify tier), the cross-version narrow waist, session engine, approval/question IM loop and multi-account management are delivered (658 unit tests; host-farm smoke green on 0.1.2 / 0.1.5 / 0.1.7 / 0.2.1 lines; 0.2.1-rc.2 verified by a real desktop-profile install with double read-back, its dedicated farm cell still pending). Outstanding real-device acceptance items are registered in CHANGELOG.
|
|
12
12
|
|
|
13
13
|
Highlights:
|
|
14
14
|
|
|
15
|
-
- **Channels**: WeChat (official iLink QR bind), Feishu/Lark (long-connection, streaming cards, optional voice tier), Telegram, Discord, WeCom intelligent bot, DingTalk (stream + AI Card), QQ official bot, Slack (Socket Mode, zero SDK), WhatsApp (Baileys QR pairing), Matrix, iMessage (macOS only), WeCom self-built app (signed callback webhook), and more; unconfigured channels load nothing (lazy imports).
|
|
15
|
+
- **Channels**: WeChat (official iLink QR bind), Feishu/Lark (long-connection, streaming cards, optional voice tier requiring system ffmpeg), Telegram, Discord, WeCom intelligent bot, DingTalk (stream + AI Card, plus a custom-robot notify tier), QQ official bot (plus notify tier), Slack (Socket Mode, zero SDK), WhatsApp (Baileys QR pairing; the dependency ships as an optionalDependency), Matrix, iMessage (macOS only), WeCom self-built app (signed callback webhook), Email (IMAP/SMTP thread routing), and more; unconfigured channels load nothing (lazy imports).
|
|
16
16
|
- **In-chat loop**: 24 commands (`/help /status /new /stop /steer /model(s) /reasoning /preset(s) /session(s) /workspace(s) /fork /rename /queue /mute /unbind /goal /delivery /export /speak /menu`); tool approvals and agent questions answered in the originating chat (deny-by-default, 5-minute expiry, initiator only).
|
|
17
17
|
- **Cross-version**: settings surface auto-adapts gen1/gen2/gen3; capability probing only, never version branches.
|
|
18
18
|
|
|
@@ -24,6 +24,12 @@ dsh plugin --profile web add dsh-im-union@latest --registry=https://registry.npm
|
|
|
24
24
|
|
|
25
25
|
Then add accounts in the "IM union bridge" panel: most channels use credential binding (secrets are one-way into the vault and never echoed back); WeChat/WhatsApp use QR pairing; the WeCom self-built app channel requires pointing your callback URL (`/api/dsh-im-union/wecom-app/callback`) in its console. See `SECURITY.md` for the non-negotiable privacy red lines and `THIRD_PARTY_NOTICES.md` for the clean-room provenance.
|
|
26
26
|
|
|
27
|
+
**Install prerequisites**:
|
|
28
|
+
|
|
29
|
+
- The WhatsApp channel's `@whiskeysockets/baileys` is declared in `optionalDependencies` and installs with the package; if skipped while offline, the channel fails fast with a clear "not installed" message instead of crashing.
|
|
30
|
+
- The Feishu voice tier requires system `ffmpeg` on PATH (the transcoding binary is not shipped; it is only invoked when the voice tier is enabled).
|
|
31
|
+
- The iMessage channel is macOS only.
|
|
32
|
+
|
|
27
33
|
## Development
|
|
28
34
|
|
|
29
35
|
```sh
|
package/README.md
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
DeepSeek Harness 的 IM 联合桥——净室重写,能力合集来自社区两仓(xmanrui/dsh-im 与 MichengAI/dsh-im-connect),不复制其源码。
|
|
4
4
|
|
|
5
5
|
<!-- host-compat:begin — generated by scripts/sync-hosts.mjs from scripts/hosts.mjs; DO NOT EDIT -->
|
|
6
|
-
- **支持的 DSH 宿主:** `0.1.2-rc.1` `0.1.5-rc.1` `0.1.5-rc.2` `0.1.5-rc.3` `0.1.7-rc.1` `0.1.7-rc.2` `0.2.0-rc.1` `0.2.0-rc.2` `0.2.1-alpha.2` `0.2.1-alpha.3` `0.2.1-rc.1`(覆盖 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0 / 0.2.1 共
|
|
6
|
+
- **支持的 DSH 宿主:** `0.1.2-rc.1` `0.1.5-rc.1` `0.1.5-rc.2` `0.1.5-rc.3` `0.1.7-rc.1` `0.1.7-rc.2` `0.2.0-rc.1` `0.2.0-rc.2` `0.2.1-alpha.2` `0.2.1-alpha.3` `0.2.1-rc.1` `0.2.1-rc.2`(覆盖 0.1.2 / 0.1.5 / 0.1.7 / 0.2.0 / 0.2.1 共 12 个 rc/alpha)
|
|
7
7
|
<!-- host-compat:end -->
|
|
8
8
|
|
|
9
9
|
## 状态
|
|
10
10
|
|
|
11
|
-
**0.1
|
|
11
|
+
**0.3.1**:15 个渠道适配器(覆盖 12 个平台,含邮件;企微/钉钉/QQ 各含机器人与自建应用或推送两档)、跨版本窄腰、会话引擎、审批/提问 IM 闭环、多账号管理面均已交付(单测 658 项;宿主农场 0.1.2/0.1.5/0.1.7/0.2.1 四线冒烟全绿;0.2.1-rc.2 已按桌面 profile 装机双回读实证,农场专属格待补)。真机验收项逐项登记在 CHANGELOG;能力分期见开发仓计划台账。
|
|
12
12
|
|
|
13
13
|
能力总览:
|
|
14
14
|
|
|
15
|
-
- **渠道**:微信(官方 iLink
|
|
15
|
+
- **渠道**:微信(官方 iLink 扫码)、飞书(长连/流式卡片/语音档可选,语音需系统 ffmpeg)、Telegram、Discord、企微智能机器人(长连)、钉钉(stream+AI Card,另有自定义机器人推送档)、QQ 官方机器人(另有推送档)、Slack(Socket Mode)、WhatsApp(Baileys 扫码,依赖随包 optionalDependencies 分发)、Matrix、iMessage(仅 macOS)、企微自建应用(回调)、邮件(IMAP/SMTP 线程路由)等;未配置渠道零依赖零加载(懒 import)。
|
|
16
16
|
- **IM 内闭环**:24 命令面板(/help /status /new /stop /steer /model(s) /reasoning /preset(s) /session(s) /workspace(s) /fork /rename /queue /mute /unbind /goal /delivery /export /speak /menu);工具审批与交互提问原聊天回答(默认拒绝、5 分钟超时、发起者限定)。
|
|
17
17
|
- **跨版本**:设置面 gen1/gen2/gen3 三态自适配;能力探测优先,禁版本号分支。
|
|
18
18
|
|
|
@@ -24,6 +24,12 @@ dsh plugin --profile web add dsh-im-union@latest --registry=https://registry.npm
|
|
|
24
24
|
|
|
25
25
|
装好后在宿主侧栏/设置页的「IM 联合桥」面板添加账号:大部分渠道走凭据绑定(Bot Token/App 凭据,secret 字段只单向入库不回显);微信/WhatsApp 走扫码绑定;企微自建应用需将本插件管理面回调 URL(`/api/dsh-im-union/wecom-app/callback`)配入后台接收服务器。隐私与凭据红线见 `SECURITY.md`;第三方依赖声明见 `THIRD_PARTY_NOTICES.md`(净室重实现,不复制任何上游源码)。
|
|
26
26
|
|
|
27
|
+
**安装前提**:
|
|
28
|
+
|
|
29
|
+
- WhatsApp 渠道的 `@whiskeysockets/baileys` 已声明为 `optionalDependencies`,随包自动安装;若安装时离线被跳过,渠道启动时会明确报「未安装」并拒绝,不崩溃。
|
|
30
|
+
- 飞书语音档需要系统 `ffmpeg` 在 PATH 中(转码二进制不随包分发,仅启用语音档时才会调用)。
|
|
31
|
+
- iMessage 渠道仅 macOS 可用。
|
|
32
|
+
|
|
27
33
|
## 开发
|
|
28
34
|
|
|
29
35
|
```sh
|