@jeik/dingtalk-connector 0.8.28 → 0.8.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 +30 -31
- package/README.en.md +36 -71
- package/README.md +46 -74
- package/dist/{background-work-Cxb4b-91.mjs → background-work-DkaSDqWk.mjs} +12 -1
- package/dist/card-content-cache-C7-XHhHw.mjs +2 -0
- package/dist/{card-content-cache-bDQFz2u8.mjs → card-content-cache-DT_OYThh.mjs} +15 -1
- package/dist/chunk-upload-BKM1y4Ba.mjs +2 -0
- package/dist/{chunk-upload-BE71drPg.mjs → chunk-upload-CIU5G_ay.mjs} +1 -1
- package/dist/{common-BZiVgd3A.mjs → common-BfIYs1yC.mjs} +3 -3
- package/dist/{common-DgL28gCZ.mjs → common-C0Oaf0z-.mjs} +1 -1
- package/dist/{connection-CZ7ZoN5_.mjs → connection-obtrPkj4.mjs} +56 -65
- package/dist/entry-bundled.mjs +1 -1
- package/dist/{gateway-methods-kNX3qvqw.mjs → gateway-methods-BdcpfxEZ.mjs} +1 -1
- package/dist/gateway-methods-DQ6TwOAr.mjs +2 -0
- package/dist/index.mjs +2 -2
- package/dist/{logger-mZ9OSbmD.mjs → logger-CnBTcwyq.mjs} +16 -2
- package/dist/logger-D8H2IcYz.mjs +2 -0
- package/dist/{media-BqpUGCni.mjs → media-DDtX37T2.mjs} +1 -1
- package/dist/{media-DnQB2BrL.mjs → media-g8tJtpfU.mjs} +29 -20
- package/dist/{message-handler-B1usz1wb.mjs → message-handler-BrO2i7tg.mjs} +26 -30
- package/dist/{messaging-DVS3UKOp.mjs → messaging-CK0Wz3Ze.mjs} +18 -20
- package/dist/{runtime-A6G7WAWn.mjs → runtime-DbqGRyhI.mjs} +6 -5
- package/dist/{utils-Bjh4r_qS.mjs → utils-Bwz2Fls_.mjs} +1 -1
- package/docs/RELEASE_NOTES_V0.8.28.md +4 -4
- package/docs/RELEASE_NOTES_V0.8.29.md +57 -0
- package/openclaw.plugin.json +9 -5
- package/package.json +1 -1
- package/src/config/schema.ts +2 -1
- package/src/core/connection.ts +90 -113
- package/src/core/message-handler.ts +24 -16
- package/src/reply-dispatcher.ts +14 -20
- package/src/services/media.ts +60 -27
- package/src/services/messaging/card-content-cache.ts +11 -6
- package/src/services/messaging.ts +52 -38
- package/src/utils/background-work.ts +3 -1
- package/src/utils/logger.ts +23 -2
- package/dist/card-content-cache-c4Ls96eJ.mjs +0 -2
- package/dist/chunk-upload-PwhogwfE.mjs +0 -2
- package/dist/gateway-methods-BkI1gKaC.mjs +0 -2
- package/dist/logger-BmJkQkm1.mjs +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,53 +5,52 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
-
## [0.8.
|
|
8
|
+
## [0.8.29] - 2026-07-25
|
|
9
9
|
|
|
10
10
|
### 主题
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
正式版加固:默认日志更轻、排障只靠配置 `debug: true`;继承 0.8.28 连接/消息/错误卡能力。
|
|
13
13
|
|
|
14
|
-
###
|
|
14
|
+
### 变更
|
|
15
15
|
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
- 空回复时的友好提示(尤其是群聊配置不当的情况)
|
|
16
|
+
- 🧹 **默认静默诊断刷屏** — 无图文本回复不再输出 LocalImage / MediaIdTrace / CardCache / Quote 成功路径
|
|
17
|
+
- 🔍 **debug 配置统一开关** — 顶层或账号 `"debug": true` 打开连接摘要、图片 mediaId、引用回填、队列计数等详细日志;**不再依赖环境变量**
|
|
18
|
+
- 📚 **文档** — 安装命令精简为三条递进指导;README 中英同步至 0.8.29
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
### 继承(0.8.28)
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
- 基于官方 0.8.24 的长连接更稳、消息少丢、模型错误中文定稿、本仓库独有答案卡/图片能力
|
|
24
23
|
|
|
25
|
-
|
|
26
|
-
- 只有钉钉确认「这条连接可以收机器人消息」之后,才对外显示已连接
|
|
27
|
-
- 连不上会自动多试几轮,而不是假装在线
|
|
28
|
-
- 正常使用时尽量不乱拆连接,减少「连发好几条消息完全没反应」
|
|
24
|
+
### 安装
|
|
29
25
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
- 单条任务卡住太久会自动放开队列,避免后面消息永远等不到
|
|
26
|
+
```bash
|
|
27
|
+
# 1)装最新
|
|
28
|
+
openclaw plugins install @jeik/dingtalk-connector --force && openclaw gateway restart
|
|
34
29
|
|
|
35
|
-
|
|
36
|
-
-
|
|
37
|
-
- 减少卡在「正在召唤大模型…」或莫名「思考完成」却看不到原因的情况
|
|
38
|
-
- 错误结束后继续发消息,响应能力明显好于旧版
|
|
30
|
+
# 2)若不是最新,指定版本
|
|
31
|
+
openclaw plugins install @jeik/dingtalk-connector@0.8.29 --force && openclaw gateway restart
|
|
39
32
|
|
|
40
|
-
|
|
41
|
-
-
|
|
33
|
+
# 3)仍失败时走 npm 官方源
|
|
34
|
+
NPM_CONFIG_REGISTRY=https://registry.npmjs.org openclaw plugins install @jeik/dingtalk-connector@0.8.29 --force && openclaw gateway restart
|
|
35
|
+
```
|
|
42
36
|
|
|
43
|
-
|
|
37
|
+
## [0.8.28] - 2026-07-25
|
|
44
38
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
### 主题
|
|
40
|
+
|
|
41
|
+
基于**官方最新 0.8.24**,并保留**本仓库独有**优化:连接更稳、消息少丢、错误提示更清楚。
|
|
42
|
+
|
|
43
|
+
### 本版重点
|
|
49
44
|
|
|
50
|
-
|
|
45
|
+
- 长连接:能收消息才显示已连接;少假死误重连
|
|
46
|
+
- 消息:进队后再 ACK;排队反馈更及时
|
|
47
|
+
- 错误:503 / 欠费 / 无通道等中文定稿,少卡「正在召唤大模型」
|
|
48
|
+
- 本仓库独有:答案卡、图片全路径、首响等
|
|
49
|
+
|
|
50
|
+
### 安装
|
|
51
51
|
|
|
52
52
|
```bash
|
|
53
|
-
openclaw plugins install @jeik/dingtalk-connector@0.8.28 --force
|
|
54
|
-
openclaw gateway restart
|
|
53
|
+
openclaw plugins install @jeik/dingtalk-connector@0.8.28 --force && openclaw gateway restart
|
|
55
54
|
```
|
|
56
55
|
|
|
57
56
|
## [0.8.26] - 2026-07-25
|
package/README.en.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
<img alt="DingTalk" src="https://raw.githubusercontent.com/DingTalk-Real-AI/dingtalk-openclaw-connector/main/docs/images/dingtalk.svg" width="72" height="72" />
|
|
3
3
|
<h1>dingtalk-openclaw-connector(Community Maintained Fork)</h1>
|
|
4
4
|
<p>Community-enhanced fork based on official <strong>v0.8.24</strong>: adopts official long-connection improvements, plus stronger message delivery, queue feedback, and error-card UX.<br/>
|
|
5
|
-
Keeps
|
|
5
|
+
Keeps <strong>this repo’s unique</strong> extras (images, answer cards, first-response UX) and continues to fix issues not yet covered upstream.</p>
|
|
6
6
|
|
|
7
|
-
<p><strong>Current release: <a href="https://www.npmjs.com/package/@jeik/dingtalk-connector">@jeik/dingtalk-connector</a> v0.8.
|
|
7
|
+
<p><strong>Current release: <a href="https://www.npmjs.com/package/@jeik/dingtalk-connector">@jeik/dingtalk-connector</a> v0.8.29</strong></p>
|
|
8
8
|
|
|
9
9
|
<p>
|
|
10
10
|
<a href="https://www.npmjs.com/package/@jeik/dingtalk-connector"><img src="https://img.shields.io/npm/v/@jeik/dingtalk-connector.svg?style=flat&colorA=18181B&colorB=28CF8D" alt="npm version" /></a>
|
|
@@ -23,45 +23,31 @@
|
|
|
23
23
|
|
|
24
24
|
## 🔧 Recent Updates
|
|
25
25
|
|
|
26
|
-
### 🚀 v0.8.
|
|
26
|
+
### 🚀 v0.8.29 · 2026-07-25 (current)
|
|
27
27
|
|
|
28
|
-
**Theme:
|
|
28
|
+
**Theme: production hardening · quieter logs · debug config only**
|
|
29
29
|
|
|
30
|
-
Built on
|
|
31
|
-
|
|
32
|
-
#### From official 0.8.24
|
|
33
|
-
|
|
34
|
-
- More reliable long-connection setup and keepalive (fewer “connected but silent” cases)
|
|
35
|
-
- Long AI runs less likely to get cut mid-task by connection flapping
|
|
36
|
-
- Cleaner console logs for easier ops
|
|
37
|
-
|
|
38
|
-
#### Extra community improvements (what you’ll notice)
|
|
30
|
+
Built on **0.8.28** (steadier connection / fewer lost messages / clearer error cards):
|
|
39
31
|
|
|
40
32
|
| Experience | Effect |
|
|
41
33
|
|------------|--------|
|
|
42
|
-
|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
| ⚠️ **Model failures** |
|
|
46
|
-
| 🃏 **
|
|
34
|
+
| 🧹 **Quieter by default** | No LocalImage / MediaIdTrace / CardCache spam on normal text replies |
|
|
35
|
+
| 🔍 **Simple debug** | Set `"debug": true` for connection, image, quote, and queue diagnostics (no env vars) |
|
|
36
|
+
| 🔗 **Connection / queue** | Connected only when messages can be received; better multi-send and post-error recovery |
|
|
37
|
+
| ⚠️ **Model failures** | 503 / billing / no-channel settle to clear Chinese cards instead of spinning forever |
|
|
38
|
+
| 🃏 **This repo’s unique extras** | Answer cards, full image paths, first-response UX remain |
|
|
47
39
|
|
|
48
40
|
```bash
|
|
49
|
-
|
|
41
|
+
openclaw plugins install @jeik/dingtalk-connector --force && openclaw gateway restart
|
|
50
42
|
```
|
|
51
43
|
|
|
52
|
-
### 📦 v0.8.
|
|
53
|
-
|
|
54
|
-
Stricter outbound target ID rules (keep `==` suffixes and case).
|
|
55
|
-
|
|
56
|
-
### 📦 v0.8.25 · 2026-07-24
|
|
57
|
-
|
|
58
|
-
Sender role/title identity; bare DingTalk IDs as direct chat.
|
|
44
|
+
### 📦 v0.8.28 · 2026-07-25
|
|
59
45
|
|
|
60
|
-
|
|
46
|
+
Official 0.8.24-aligned connection & delivery hardening (included in 0.8.29).
|
|
61
47
|
|
|
62
|
-
|
|
48
|
+
### 📦 v0.8.26 / 0.8.25 and earlier
|
|
63
49
|
|
|
64
|
-
|
|
50
|
+
Target ID rules, sender identity, answer cards, image fixes — see [CHANGELOG.md](CHANGELOG.md).
|
|
65
51
|
|
|
66
52
|
---
|
|
67
53
|
|
|
@@ -232,68 +218,43 @@ Community contributions (features & bug fixes) are always welcome — submit a P
|
|
|
232
218
|
|
|
233
219
|
| Item | Description |
|
|
234
220
|
|------|-------------|
|
|
235
|
-
| Base |
|
|
236
|
-
| Fixes |
|
|
221
|
+
| Base | Aligned with official **v0.8.24** long-connection work + this repo’s unique extras |
|
|
222
|
+
| Fixes | Silent connection, lost messages, stuck error cards, grey images, etc. |
|
|
237
223
|
| Maintenance | Community maintained, continuously tracking official updates |
|
|
238
224
|
|
|
239
225
|
---
|
|
240
226
|
|
|
241
227
|
## Requirements & Installation
|
|
242
228
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
-
|
|
246
|
-
-
|
|
247
|
-
|
|
248
|
-
> If below this version, upgrade with: `npm install -g openclaw`
|
|
249
|
-
|
|
250
|
-
---
|
|
251
|
-
|
|
252
|
-
## Installation
|
|
253
|
-
|
|
254
|
-
> Same channel id as the official plugin (`dingtalk-connector`); `--force` overwrites in place — **no uninstall** needed.
|
|
255
|
-
> **Current stable: `0.8.21-fix31`** (npm `latest`). Always run `openclaw gateway restart` after install/upgrade.
|
|
256
|
-
|
|
257
|
-
### Option 1: npm (recommended)
|
|
229
|
+
- **OpenClaw** installed and running ([website](https://openclaw.ai/))
|
|
230
|
+
- **Version**: OpenClaw ≥ **2026.4.9** (`openclaw -v`)
|
|
231
|
+
- Same channel id as official (`dingtalk-connector`); `--force` overwrites — **no uninstall** needed
|
|
232
|
+
- Always `openclaw gateway restart` after install/upgrade
|
|
258
233
|
|
|
259
234
|
Package: [`@jeik/dingtalk-connector`](https://www.npmjs.com/package/@jeik/dingtalk-connector)
|
|
260
235
|
|
|
261
|
-
|
|
236
|
+
### Three install commands (try in order)
|
|
262
237
|
|
|
263
238
|
```bash
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
# force overwrite when a local dingtalk-connector already exists
|
|
267
|
-
npx -y @jeik/dingtalk-connector install --force
|
|
268
|
-
```
|
|
239
|
+
# 1) Install latest
|
|
240
|
+
openclaw plugins install @jeik/dingtalk-connector --force && openclaw gateway restart
|
|
269
241
|
|
|
270
|
-
|
|
242
|
+
# 2) If you did not get the latest, pin the version
|
|
243
|
+
openclaw plugins install @jeik/dingtalk-connector@0.8.29 --force && openclaw gateway restart
|
|
271
244
|
|
|
272
|
-
|
|
273
|
-
openclaw plugins install @jeik/dingtalk-connector --force
|
|
274
|
-
openclaw gateway restart
|
|
245
|
+
# 3) If it still fails, force the official npm registry
|
|
246
|
+
NPM_CONFIG_REGISTRY=https://registry.npmjs.org openclaw plugins install @jeik/dingtalk-connector@0.8.29 --force && openclaw gateway restart
|
|
275
247
|
```
|
|
276
248
|
|
|
277
|
-
|
|
249
|
+
> Optional QR wizard: `npx @jeik/dingtalk-connector install --force`
|
|
278
250
|
|
|
279
|
-
|
|
280
|
-
openclaw plugins install @jeik/dingtalk-connector --force
|
|
281
|
-
openclaw gateway restart
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
### Option 2: Local tgz / from source (dev / offline)
|
|
251
|
+
### Local tgz / from source (dev / offline)
|
|
285
252
|
|
|
286
253
|
```bash
|
|
287
254
|
git clone https://github.com/jeikl/dingtalk-openclaw-connector-fix-Community.git
|
|
288
255
|
cd dingtalk-openclaw-connector-fix-Community
|
|
289
|
-
# optional: pin a release (this is a git tag, not a branch)
|
|
290
|
-
# git fetch --tags && git checkout v0.8.21-fix31
|
|
291
|
-
|
|
292
256
|
npm install && npm run build && npm pack
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
openclaw plugins install ./jeik-dingtalk-connector-0.8.21-fix31.tgz --force
|
|
296
|
-
openclaw gateway restart
|
|
257
|
+
openclaw plugins install ./jeik-dingtalk-connector-0.8.29.tgz --force && openclaw gateway restart
|
|
297
258
|
```
|
|
298
259
|
|
|
299
260
|
### Smoke check
|
|
@@ -301,9 +262,13 @@ openclaw gateway restart
|
|
|
301
262
|
```bash
|
|
302
263
|
openclaw -v
|
|
303
264
|
openclaw plugins list
|
|
304
|
-
# Send a DingTalk message —
|
|
265
|
+
# Send a DingTalk message — first “summoning model…”, then streaming / answer card
|
|
305
266
|
```
|
|
306
267
|
|
|
268
|
+
### Debug logs
|
|
269
|
+
|
|
270
|
+
Set `"debug": true` under `channels.dingtalk-connector` (or a specific account), then restart the gateway. No environment variables required.
|
|
271
|
+
|
|
307
272
|
---
|
|
308
273
|
|
|
309
274
|
## Usage Guide
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<p>基于官方最新 <strong>v0.8.24</strong> 的社区增强版:吸收官方长连接改进,并重点优化消息接收、排队反馈与模型错误展示。<br/>
|
|
5
5
|
保留社区在图片、答案卡、首响体验上的增强,持续修官方暂未覆盖的实际使用问题。</p>
|
|
6
6
|
|
|
7
|
-
<p><strong
|
|
7
|
+
<p><strong>当前正式版:<a href="https://www.npmjs.com/package/@jeik/dingtalk-connector">@jeik/dingtalk-connector</a> v0.8.29</strong></p>
|
|
8
8
|
|
|
9
9
|
<p>
|
|
10
10
|
<a href="https://www.npmjs.com/package/@jeik/dingtalk-connector"><img src="https://img.shields.io/npm/v/@jeik/dingtalk-connector.svg?style=flat&colorA=18181B&colorB=28CF8D" alt="npm version" /></a>
|
|
@@ -23,45 +23,31 @@
|
|
|
23
23
|
|
|
24
24
|
## 🔧 最近更新
|
|
25
25
|
|
|
26
|
-
### 🚀 v0.8.
|
|
26
|
+
### 🚀 v0.8.29 · 2026-07-25(当前正式版)
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
**主题:正式加固 · 日志更干净 · 排障只开 debug**
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
#### 基于官方 0.8.24 吸收了什么
|
|
33
|
-
|
|
34
|
-
- 更稳妥的长连接建立与保活方式,减少假死、误重连
|
|
35
|
-
- 机器人处理长任务时连接不易被中途掐断
|
|
36
|
-
- 控制台少刷无用日志,排障更清爽
|
|
37
|
-
|
|
38
|
-
#### 社区本版额外优化(你会感受到的效果)
|
|
30
|
+
在 **0.8.28**(连接更稳 / 消息少丢 / 错误卡可定稿)基础上再打磨:
|
|
39
31
|
|
|
40
32
|
| 体验 | 效果 |
|
|
41
33
|
|------|------|
|
|
42
|
-
|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
| ⚠️
|
|
46
|
-
| 🃏
|
|
34
|
+
| 🧹 **默认日志更轻** | 无图正常回复不再刷 LocalImage / MediaIdTrace / CardCache |
|
|
35
|
+
| 🔍 **排障更简单** | 配置 `"debug": true` 即输出连接、图片、引用、队列详细日志(无需环境变量) |
|
|
36
|
+
| 🔗 **连接 / 队列** | 继承 0.8.28:能收消息才算在线;连发、错误后再发更稳;排队反馈更及时 |
|
|
37
|
+
| ⚠️ **模型故障** | 503 / 欠费 / 无通道等更容易定格中文错误,少卡「正在召唤大模型」 |
|
|
38
|
+
| 🃏 **本仓库独有** | 答案卡、图片全路径、首响体验等继续保留 |
|
|
47
39
|
|
|
48
40
|
```bash
|
|
49
|
-
|
|
41
|
+
openclaw plugins install @jeik/dingtalk-connector --force && openclaw gateway restart
|
|
50
42
|
```
|
|
51
43
|
|
|
52
|
-
### 📦 v0.8.
|
|
53
|
-
|
|
54
|
-
目标 ID 填写约束(保留 `==` 等后缀与大小写)。
|
|
44
|
+
### 📦 v0.8.28 · 2026-07-25
|
|
55
45
|
|
|
56
|
-
|
|
46
|
+
基于官方 0.8.24 的长连接与消息体验加固(当前能力已并入 0.8.29)。
|
|
57
47
|
|
|
58
|
-
|
|
48
|
+
### 📦 v0.8.26 / 0.8.25 及更早
|
|
59
49
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
答案卡、图片全路径修复、流式定稿、中文错误映射等——详见 [CHANGELOG.md](CHANGELOG.md)。
|
|
63
|
-
|
|
64
|
-
完整说明:[CHANGELOG.md](CHANGELOG.md) · [FIXES.md](FIXES.md)
|
|
50
|
+
目标 ID 约束、发送人身份、答案卡、图片修复等——详见 [CHANGELOG.md](CHANGELOG.md)。
|
|
65
51
|
|
|
66
52
|
---
|
|
67
53
|
|
|
@@ -197,9 +183,23 @@ npx -y @jeik/dingtalk-connector@0.8.28 install --force && openclaw gateway resta
|
|
|
197
183
|
| `answerCardTemplateId` | string | `d246b7f5-1783-4e9b-bb46-bef52d63050e.schema` | 答案静态卡模板 |
|
|
198
184
|
| `messageAnswerCard` | boolean | **true** | message 工具正文走答案静态卡;`false`=普通消息 |
|
|
199
185
|
| `messageImageMd` | boolean | **false** | message 图文:`false` 文图分开;`true` 可合并 markdown |
|
|
186
|
+
| `debug` | boolean | **false** | 详细诊断日志(连接/图片 mediaId/引用回填/队列)。**日常关闭**;排障时顶层或某账号设 `true`,改完 `openclaw gateway restart` |
|
|
200
187
|
|
|
201
188
|
> `answerCard` = 对话流式收尾;`messageAnswerCard` = message 工具外发。
|
|
202
189
|
|
|
190
|
+
**临时开排障日志示例:**
|
|
191
|
+
|
|
192
|
+
```json
|
|
193
|
+
"channels": {
|
|
194
|
+
"dingtalk-connector": {
|
|
195
|
+
"enabled": true,
|
|
196
|
+
"clientId": "…",
|
|
197
|
+
"clientSecret": "…",
|
|
198
|
+
"debug": true
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
203
|
---
|
|
204
204
|
|
|
205
205
|
## 🎯 回复标记 + 答案卡 + 工具进度(核心增强)
|
|
@@ -236,79 +236,51 @@ npx -y @jeik/dingtalk-connector@0.8.28 install --force && openclaw gateway resta
|
|
|
236
236
|
|
|
237
237
|
| 项目 | 说明 |
|
|
238
238
|
|------|------|
|
|
239
|
-
| 基础版本 |
|
|
240
|
-
| 修复内容 |
|
|
239
|
+
| 基础版本 | 对齐官方 **v0.8.24** 长连接能力,并叠加本仓库独有优化 |
|
|
240
|
+
| 修复内容 | 连接假死、消息丢失、错误卡卡住、图片灰图等实际使用问题 |
|
|
241
241
|
| 维护方式 | 社区维护,持续跟进官方更新 |
|
|
242
242
|
|
|
243
243
|
---
|
|
244
244
|
|
|
245
245
|
## 安装与要求
|
|
246
246
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
-
|
|
250
|
-
-
|
|
251
|
-
|
|
252
|
-
> 如低于此版本,执行 `npm install -g openclaw` 升级。
|
|
253
|
-
|
|
254
|
-
---
|
|
255
|
-
|
|
256
|
-
## 安装
|
|
257
|
-
|
|
258
|
-
> 与官方插件同 channel id(`dingtalk-connector`),`--force` 直接覆盖更新,**无需先卸载**官方版或旧版。
|
|
259
|
-
> **当前稳定版:`0.8.21-fix31`**(npm `latest` 已指向本版)。安装/更新后**必须** `openclaw gateway restart`。
|
|
260
|
-
|
|
261
|
-
### 方式一:npm(推荐)
|
|
247
|
+
- **OpenClaw** 已安装并正常运行([官网](https://openclaw.ai/))
|
|
248
|
+
- **版本**:OpenClaw ≥ **2026.4.9**(`openclaw -v`)
|
|
249
|
+
- 与官方插件同 channel id(`dingtalk-connector`),`--force` 可直接覆盖,**无需先卸载**
|
|
250
|
+
- 安装/更新后**必须** `openclaw gateway restart`
|
|
262
251
|
|
|
263
252
|
包名:[`@jeik/dingtalk-connector`](https://www.npmjs.com/package/@jeik/dingtalk-connector)
|
|
264
253
|
|
|
265
|
-
|
|
254
|
+
### 三条安装命令(按顺序试)
|
|
266
255
|
|
|
267
256
|
```bash
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
# 已有 dingtalk-connector / 装不上时强制覆盖
|
|
271
|
-
npx -y @jeik/dingtalk-connector install --force
|
|
272
|
-
```
|
|
257
|
+
# 1)装最新
|
|
258
|
+
openclaw plugins install @jeik/dingtalk-connector --force && openclaw gateway restart
|
|
273
259
|
|
|
274
|
-
|
|
260
|
+
# 2)若装到的不是最新,指定版本号
|
|
261
|
+
openclaw plugins install @jeik/dingtalk-connector@0.8.29 --force && openclaw gateway restart
|
|
275
262
|
|
|
276
|
-
|
|
277
|
-
openclaw plugins install @jeik/dingtalk-connector --force
|
|
278
|
-
openclaw gateway restart
|
|
263
|
+
# 3)若仍装不了,强制走 npm 官方源
|
|
264
|
+
NPM_CONFIG_REGISTRY=https://registry.npmjs.org openclaw plugins install @jeik/dingtalk-connector@0.8.29 --force && openclaw gateway restart
|
|
279
265
|
```
|
|
280
266
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
```bash
|
|
284
|
-
openclaw plugins install @jeik/dingtalk-connector --force
|
|
285
|
-
openclaw gateway restart
|
|
286
|
-
```
|
|
267
|
+
> 一键扫码建机器人(可选):`npx @jeik/dingtalk-connector install --force`
|
|
287
268
|
|
|
288
|
-
###
|
|
269
|
+
### 本地 tgz / 源码(开发、离线)
|
|
289
270
|
|
|
290
271
|
```bash
|
|
291
272
|
git clone https://github.com/jeikl/dingtalk-openclaw-connector-fix-Community.git
|
|
292
273
|
cd dingtalk-openclaw-connector-fix-Community
|
|
293
|
-
# 可选:钉到某次发布(这是 git tag,不是分支;clone 后可直接 checkout)
|
|
294
|
-
# git fetch --tags && git checkout v0.8.21-fix31
|
|
295
|
-
|
|
296
274
|
npm install && npm run build && npm pack
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
openclaw plugins install ./jeik-dingtalk-connector-0.8.21-fix31.tgz --force
|
|
300
|
-
openclaw gateway restart
|
|
275
|
+
openclaw plugins install ./jeik-dingtalk-connector-0.8.29.tgz --force && openclaw gateway restart
|
|
301
276
|
```
|
|
302
277
|
|
|
303
|
-
> 国内若 clone 慢,可用镜像前缀,例如:
|
|
304
|
-
> `git clone https://ghfast.top/https://github.com/jeikl/dingtalk-openclaw-connector-fix-Community.git`
|
|
305
|
-
|
|
306
278
|
### 安装后自检
|
|
307
279
|
|
|
308
280
|
```bash
|
|
309
|
-
openclaw -v #
|
|
281
|
+
openclaw -v # ≥ 2026.4.9
|
|
310
282
|
openclaw plugins list # 应看到 dingtalk-connector / @jeik/dingtalk-connector
|
|
311
|
-
#
|
|
283
|
+
# 发一条钉钉消息:应先「正在召唤大模型…」,再流式/答案卡
|
|
312
284
|
```
|
|
313
285
|
|
|
314
286
|
---
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
+
import { r as isDingtalkDebug } from "./logger-CnBTcwyq.mjs";
|
|
1
2
|
//#region src/utils/background-work.ts
|
|
3
|
+
/**
|
|
4
|
+
* 后台任务引用计数。
|
|
5
|
+
*
|
|
6
|
+
* 钉钉 WS 回调只「入队」后就返回,真正的 AI 跑在 sessionQueues 后台 Promise 里。
|
|
7
|
+
* 若只在 WS 回调里 markMessageProcessingStart/End,会在入队后立刻 End,
|
|
8
|
+
* 长任务(尤其 503 重试)期间心跳超时会触发幽灵重连 → 后续消息「网关没反应」。
|
|
9
|
+
*
|
|
10
|
+
* 用法:session 队列任务创建后 trackBackgroundWork(taskPromise)。
|
|
11
|
+
* connection 层订阅计数变化,在 count>0 时保持处理中 keepAlive。
|
|
12
|
+
*/
|
|
2
13
|
let activeCount = 0;
|
|
3
14
|
const listeners = /* @__PURE__ */ new Set();
|
|
4
15
|
function getActiveBackgroundWorkCount() {
|
|
@@ -31,7 +42,7 @@ function trackBackgroundWork(work, label) {
|
|
|
31
42
|
notify();
|
|
32
43
|
};
|
|
33
44
|
work.then(done, done);
|
|
34
|
-
if (label && typeof process !== "undefined" &&
|
|
45
|
+
if (label && typeof process !== "undefined" && isDingtalkDebug()) {
|
|
35
46
|
console.log(`[DingTalk][bgWork] +1 label=${label} count=${activeCount}`);
|
|
36
47
|
work.finally(() => {
|
|
37
48
|
console.log(`[DingTalk][bgWork] -1 label=${label} count=${activeCount}`);
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
+
import { r as isDingtalkDebug } from "./logger-CnBTcwyq.mjs";
|
|
1
2
|
//#region src/services/messaging/card-content-cache.ts
|
|
3
|
+
/**
|
|
4
|
+
* AI / 交互卡片正文缓存
|
|
5
|
+
*
|
|
6
|
+
* 钉钉「引用 AI 卡片」时,回调里的 repliedMsg 经常是:
|
|
7
|
+
* { msgType: "interactiveCard", content: {} 或仅有 templateId }
|
|
8
|
+
* 不带可读正文 → 模型侧只看到 `[引用] [interactiveCard消息]`。
|
|
9
|
+
*
|
|
10
|
+
* 对策:我们在 finishAICard / 定稿时把 outTrackId → 正文 记下来;
|
|
11
|
+
* 引用时仅用载荷里的 outTrackId / msgId 等精确回填。
|
|
12
|
+
* 默认不做「会话最近一条」兜底(会把错误卡片正文当成用户引用的内容)。
|
|
13
|
+
*
|
|
14
|
+
* 内存 LRU + TTL,进程重启后清空(可接受)。
|
|
15
|
+
*/
|
|
2
16
|
const MAX_ENTRIES = 300;
|
|
3
17
|
/** 默认保留 7 天(引用历史卡片) */
|
|
4
18
|
const DEFAULT_TTL_MS = 10080 * 60 * 1e3;
|
|
@@ -39,7 +53,7 @@ function rememberCardContent(params) {
|
|
|
39
53
|
byConversation.set(cid, next);
|
|
40
54
|
byKey.set(normalizeKey("convRef", `${cid}|${ref}`), entry);
|
|
41
55
|
}
|
|
42
|
-
try {
|
|
56
|
+
if (isDingtalkDebug()) try {
|
|
43
57
|
console.log(`[DingTalk][CardCache] 已缓存 | outTrack=${params.outTrackId || "-"} conv=${params.conversationId || "-"} len=${text.length}`);
|
|
44
58
|
} catch {}
|
|
45
59
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as createLogger } from "./logger-
|
|
1
|
+
import { t as createLogger } from "./logger-CnBTcwyq.mjs";
|
|
2
2
|
import { r as dingtalkUploadHttp } from "./http-client-DFWZgO1n.mjs";
|
|
3
|
-
import { t as CHUNK_CONFIG } from "./chunk-upload-
|
|
3
|
+
import { t as CHUNK_CONFIG } from "./chunk-upload-CIU5G_ay.mjs";
|
|
4
4
|
import * as fs from "fs";
|
|
5
5
|
import * as path from "path";
|
|
6
6
|
import FormData from "form-data";
|
|
@@ -48,7 +48,7 @@ async function uploadMediaToDingTalk(filePath, mediaType, oapiToken, maxSize = 2
|
|
|
48
48
|
if ((mediaType === "video" || mediaType === "file") && fileSize > CHUNK_CONFIG.SIZE_THRESHOLD) {
|
|
49
49
|
log?.info?.(`文件超过 20MB,使用分块上传:${absPath} (${fileSizeMB}MB)`);
|
|
50
50
|
try {
|
|
51
|
-
const { uploadLargeFileByChunks } = await import("./chunk-upload-
|
|
51
|
+
const { uploadLargeFileByChunks } = await import("./chunk-upload-BKM1y4Ba.mjs");
|
|
52
52
|
const downloadCode = await uploadLargeFileByChunks(absPath, mediaType, oapiToken, debugEnabled);
|
|
53
53
|
if (downloadCode) {
|
|
54
54
|
log?.info?.(`分块上传成功:${absPath}, download_code: ${downloadCode}`);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as VIDEO_MARKER_PATTERN, r as FILE_MARKER_PATTERN, t as AUDIO_MARKER_PATTERN } from "./common-
|
|
1
|
+
import { i as VIDEO_MARKER_PATTERN, r as FILE_MARKER_PATTERN, t as AUDIO_MARKER_PATTERN } from "./common-BfIYs1yC.mjs";
|
|
2
2
|
export { AUDIO_MARKER_PATTERN, FILE_MARKER_PATTERN, VIDEO_MARKER_PATTERN };
|