@huo15/dingtalk-connector-pro 1.0.0

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.
Files changed (62) hide show
  1. package/CHANGELOG.md +485 -0
  2. package/LICENSE +21 -0
  3. package/README.en.md +479 -0
  4. package/README.md +209 -0
  5. package/docs/AGENT_ROUTING.md +335 -0
  6. package/docs/DEAP_AGENT_GUIDE.en.md +115 -0
  7. package/docs/DEAP_AGENT_GUIDE.md +115 -0
  8. package/docs/images/dingtalk.svg +1 -0
  9. package/docs/images/image-1.png +0 -0
  10. package/docs/images/image-2.png +0 -0
  11. package/docs/images/image-3.png +0 -0
  12. package/docs/images/image-4.png +0 -0
  13. package/docs/images/image-5.png +0 -0
  14. package/docs/images/image-6.png +0 -0
  15. package/docs/images/image-7.png +0 -0
  16. package/index.ts +28 -0
  17. package/install-beta.sh +438 -0
  18. package/install-npm.sh +167 -0
  19. package/openclaw.plugin.json +498 -0
  20. package/package.json +80 -0
  21. package/src/channel.ts +463 -0
  22. package/src/config/accounts.ts +242 -0
  23. package/src/config/schema.ts +148 -0
  24. package/src/core/connection.ts +722 -0
  25. package/src/core/message-handler.ts +1700 -0
  26. package/src/core/provider.ts +111 -0
  27. package/src/core/state.ts +54 -0
  28. package/src/directory.ts +95 -0
  29. package/src/docs.ts +293 -0
  30. package/src/gateway-methods.ts +404 -0
  31. package/src/onboarding.ts +413 -0
  32. package/src/policy.ts +32 -0
  33. package/src/probe.ts +212 -0
  34. package/src/reply-dispatcher.ts +630 -0
  35. package/src/runtime.ts +32 -0
  36. package/src/sdk/helpers.ts +322 -0
  37. package/src/sdk/types.ts +513 -0
  38. package/src/secret-input.ts +19 -0
  39. package/src/services/media/audio.ts +54 -0
  40. package/src/services/media/chunk-upload.ts +296 -0
  41. package/src/services/media/common.ts +155 -0
  42. package/src/services/media/file.ts +70 -0
  43. package/src/services/media/image.ts +81 -0
  44. package/src/services/media/index.ts +10 -0
  45. package/src/services/media/video.ts +162 -0
  46. package/src/services/media.ts +1136 -0
  47. package/src/services/messaging/card.ts +342 -0
  48. package/src/services/messaging/index.ts +17 -0
  49. package/src/services/messaging/send.ts +141 -0
  50. package/src/services/messaging.ts +1013 -0
  51. package/src/targets.ts +45 -0
  52. package/src/types/index.ts +59 -0
  53. package/src/utils/agent.ts +63 -0
  54. package/src/utils/async.ts +51 -0
  55. package/src/utils/constants.ts +27 -0
  56. package/src/utils/http-client.ts +37 -0
  57. package/src/utils/index.ts +8 -0
  58. package/src/utils/logger.ts +78 -0
  59. package/src/utils/session.ts +147 -0
  60. package/src/utils/token.ts +93 -0
  61. package/src/utils/utils-legacy.ts +454 -0
  62. package/tsconfig.json +20 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,485 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.8.12] - 2026-04-01
9
+
10
+ ### 修复 / Fixes
11
+ - 🐛 **修复 v0.8.11 安装后启动崩溃** ([#419](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector/issues/419)) - `mammoth` 和 `pdf-parse` 使用静态 import 但已从 dependencies 移除,导致模块加载阶段报错 `Cannot find module 'mammoth'`。改为动态 import + 优雅降级
12
+ **Fix startup crash after v0.8.11 installation** - Changed `mammoth` and `pdf-parse` from static import to dynamic import with graceful degradation
13
+
14
+ ### 改进 / Improvements
15
+ - ✅ **大幅精简依赖体积** - 移除 `pdf-parse`(~21MB)、`fluent-ffmpeg`(~12MB)、`@ffmpeg-installer/ffmpeg`(~70MB)、`@ffprobe-installer/ffprobe` 等非核心依赖,仅保留 `mammoth`(~2MB)在 `optionalDependencies`
16
+ **Significantly reduce dependency size** - Removed ~100MB of non-core optional dependencies, keeping only `mammoth` (~2MB)
17
+
18
+ ### 重构 / Refactoring
19
+ - ✅ **移除无效的代理禁用代码** - 经源码分析 `dingtalk-stream` SDK 的 WebSocket 连接使用 `ws` 库直接建立,不受 `axios.defaults.proxy` 影响。移除 `proxy-config.ts` 及相关代理配置
20
+ **Remove ineffective proxy bypass code** - Analysis showed `ws` library bypasses axios entirely; removed `proxy-config.ts` and all proxy configuration code
21
+
22
+ ## [0.8.11] - 2026-04-01
23
+
24
+ ### 新增 / Added
25
+ - ✨ **升级 Zod v4 + 自动生成 configSchema** - 将 Zod 从 v3 升级至 v4(`zod@^4.3.6`),通过 SDK 的 `buildChannelConfigSchema()` 自动从 Zod Schema 生成 JSON Schema,替代手动维护的 `configSchema.schema`
26
+ **Upgrade Zod v4 + auto-generate configSchema** - Upgraded Zod from v3 to v4, auto-generating JSON Schema via SDK's `buildChannelConfigSchema()`
27
+
28
+ ### 改进 / Improvements
29
+ - ✅ **依赖结构优化,减小安装体积** - 将 `openclaw` 移至 `peerDependencies`(optional),将 `fluent-ffmpeg`/`@ffmpeg-installer/ffmpeg`/`@ffprobe-installer/ffprobe` 移至 `optionalDependencies`,移除未使用的 `pako`
30
+ **Dependency optimization, reduced install size** - Moved `openclaw` to `peerDependencies` (optional), moved ffmpeg packages to `optionalDependencies`, removed unused `pako`
31
+
32
+ ## [0.8.10] - 2026-03-31
33
+
34
+ ### 修复 / Fixes
35
+ - 🐛 **Gateway Methods 配置访问失败** ([#397](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector/issues/397)) - 修复 SDK 升级后 `context.deps.config` 为 `undefined`,所有 Gateway RPC 方法调用失败。改用 SDK 的 `loadConfig()` 函数获取配置
36
+ **Gateway Methods config access failure** - Fixed `context.deps.config` being `undefined` after SDK upgrade, now uses `loadConfig()` from `openclaw/plugin-sdk/config-runtime`
37
+
38
+ - 🐛 **锁定 axios 版本避免兼容性问题** ([#396](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector/issues/396)) - 将 `axios` 从 `^1.6.0` 锁定为 `1.6.0`,避免自动升级引入不兼容变更
39
+ **Pin axios version** - Pinned `axios` from `^1.6.0` to `1.6.0` to prevent incompatible upgrades
40
+
41
+ ### 改进 / Improvements
42
+ - ✅ **connection.ts 动态 import 优化** - 将 `createLoggerFromConfig` 改为动态 import,避免潜在循环依赖
43
+ **connection.ts dynamic import** - Changed `createLoggerFromConfig` to dynamic import to avoid potential circular dependencies
44
+
45
+ ## [0.8.9] - 2026-03-31
46
+
47
+ ### 新增 / Added
48
+ - ✨ **引用消息完整解析** - 新增 `extractQuotedMsgText` 递归解析引用消息(最多 3 层嵌套),支持 text、richText、picture、video、audio、file、markdown、interactiveCard 等消息类型,自动提取引用中的媒体附件和链接
49
+ **Quoted message full parsing** - Added recursive quoted message parsing (up to 3 levels) with media attachment and URL extraction
50
+
51
+ - ✨ **新增配置项 asyncMode / ackText / endpoint / debug** - `configSchema` 新增四个配置字段
52
+ **New config options** - Added `asyncMode`, `ackText`, `endpoint`, `debug` to configSchema
53
+
54
+ - ✨ **普通消息本地图片后处理** - `sendNormalToUser` 和 `sendNormalToGroup` 新增本地图片上传后处理,发送普通消息时自动替换本地图片路径为 media_id
55
+ **Local image post-processing for normal messages** - Added automatic local image upload and replacement in `sendNormalToUser` and `sendNormalToGroup`
56
+
57
+ ### 修复 / Fixes
58
+ - 🐛 **macOS LaunchAgent 环境 WebSocket 连接失败** - 修复 macOS LaunchAgent/daemon 环境下 fd 0/1/2 无效(EBADF)导致 TCP 连接创建失败的问题
59
+ **WebSocket connection failure on macOS LaunchAgent** - Fixed EBADF errors on macOS LaunchAgent environments by redirecting invalid file descriptors to `/dev/null`
60
+
61
+ - 🐛 **AI Card 流式关闭竞争条件** - 修复 `closeStreaming` 被 `onIdle` 和 `onError` 同时触发时的竞争条件,采用 snapshot 模式防止并发崩溃
62
+ **AI Card streaming close race condition** - Fixed race condition in `closeStreaming` using snapshot pattern to prevent concurrent crashes
63
+
64
+ - 🐛 **FormData CJS 互操作问题** - 将 `form-data` 从动态 import 改为静态 import,修复 jiti/ESM 环境下 `.default` 偶发为 undefined 的问题
65
+ **FormData CJS interop issue** - Changed `form-data` from dynamic to static import, fixing intermittent `.default` undefined errors in jiti/ESM
66
+
67
+ - 🐛 **纯文本图片路径误转换** - 禁用纯文本中本地图片路径自动转换为图片语法的行为,避免影响用户展示路径文本的场景
68
+ **Bare image path false conversion** - Disabled automatic conversion of bare local image paths to image syntax
69
+
70
+ ### 改进 / Improvements
71
+ - ✅ **Zod Schema 拆分兼容 Web UI** - 将 `DingtalkConfigSchema` 拆分为 `DingtalkConfigBaseSchema` 和带 `superRefine` 的完整 Schema,解决 JSON Schema 生成兼容性问题
72
+ **Zod Schema split for Web UI compatibility** - Split schema to fix `buildChannelConfigSchema` JSON Schema generation
73
+
74
+ - ✅ **configSchema 类型简化** - 将 `clientId`、`clientSecret` 等字段从 `oneOf` 联合类型简化为单一 `string` 类型
75
+ **configSchema type simplification** - Simplified JSON Schema from `oneOf` union types to single `string` type
76
+
77
+ - ✅ **reply-dispatcher logger 统一** - 替换手动构建的 log 对象为 `createLoggerFromConfig`
78
+ **reply-dispatcher logger unification** - Replaced manual log object with `createLoggerFromConfig`
79
+
80
+ - ✅ **锁定 axios 版本到 1.6.0** - 避免自动升级引入不兼容变更
81
+ **Pin axios to 1.6.0** - Prevent automatic upgrades from introducing incompatible changes
82
+
83
+ ## [0.8.8] - 2026-03-29
84
+
85
+ ### 修复 / Fixes
86
+ - 🐛 **多 block 流式响应产生多条独立气泡** ([#369](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector/issues/369)) - 重构 `startStreaming` 并发控制逻辑,从 `isCreatingCard` 布尔标志改为 `cardCreationPromise`,彻底消除多 block 响应场景下每个 block 新建独立 AI Card 气泡的问题
87
+ **Multi-block streaming response creates multiple bubbles** - Refactored `startStreaming` concurrency control from boolean flag to `cardCreationPromise`, eliminating independent AI Card bubbles per block in multi-block responses
88
+
89
+ - 🐛 **Web UI Connected / Last inbound 显示 n/a** - 新增 `onStatusChange` 回调在连接建立/断开/收到消息时上报状态字段;补全 `buildSessionContext` 中 `conversationId` 和 `groupSubject` 字段透传
90
+ **Web UI shows n/a for Connected and Last inbound** - Added `onStatusChange` callback to report status fields on connection events; fixed `buildSessionContext` field passthrough
91
+
92
+ - 🐛 **AI Card 函数调用参数错误** - 修复 `reply-dispatcher.ts` 中 `createAICardForTarget`、`streamAICard`、`finishAICard` 参数从 `params.runtime` 改为 `account.config/log`
93
+ **AI Card function call parameter error** - Fixed parameters in `reply-dispatcher.ts` from `params.runtime` to `account.config/log`
94
+
95
+ - 🐛 **sendFileProactive 参数错误导致文件发送失败** - 修复 `processFileMarkers` 和 `processRawMediaPaths` 错误传入 `downloadUrl`,改为正确的 `cleanMediaId`
96
+ **File sending failure due to wrong sendFileProactive parameter** - Fixed incorrect `downloadUrl` parameter, now correctly uses `cleanMediaId`
97
+
98
+ - 🐛 **纯多账号配置下 probe 被跳过** ([#381](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector/issues/381)) - `getStatus()` 改用 `resolveDingtalkAccount()` 统一获取账号信息,修复纯多账号配置下状态显示不准确的问题
99
+ **Probe skipped in pure multi-account config** - `getStatus()` now uses `resolveDingtalkAccount()` for unified account resolution
100
+
101
+ ### 改进 / Improvements
102
+ - ✅ **音频时长提取安全性改进** ([#134](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector/issues/134)) - `extractAudioDuration` 改用 `fluent-ffmpeg` 的 `ffprobe` API,消除安全扫描误报
103
+ **Audio duration extraction security improvement** - Changed to `fluent-ffmpeg` `ffprobe` API, eliminating security scan false positives
104
+
105
+ - ✅ **SDK 接口迁移** - `onboarding.ts` 类型引用迁移到新版 `ChannelSetupWizardAdapter`,导入路径更新为 `openclaw/plugin-sdk/setup`
106
+ **SDK interface migration** - Migrated to `ChannelSetupWizardAdapter` and updated import path to `openclaw/plugin-sdk/setup`
107
+
108
+ ## [0.8.7] - 2026-03-26
109
+
110
+ ### 修复 / Fixes
111
+ - 🐛 **账号 ID 大小写敏感修复** - 修复 `normalizeAccountId` 函数强制将账号 ID 转为小写(`.toLowerCase()`)导致驼峰命名账号(如 `zhizaoDashuIP`)无法匹配配置的问题。现在账号 ID 仅做 `trim()` 处理,保留原始大小写,与配置文件中的 key 严格匹配
112
+ **Account ID case-sensitivity fix** - Fixed `normalizeAccountId` forcibly lowercasing account IDs, which caused camelCase account IDs (e.g., `zhizaoDashuIP`) to fail configuration lookup. Account IDs are now only trimmed, preserving original casing for strict matching against config keys
113
+
114
+ - 🐛 **WebSocket 连接代理控制统一** - 修复 `src/core/connection.ts` 中 WebSocket 连接未遵循 `DINGTALK_FORCE_PROXY` 环境变量的问题,现在与 HTTP 请求保持一致的代理控制逻辑
115
+ **Unified proxy control for WebSocket connections** - Fixed WebSocket connections not respecting the `DINGTALK_FORCE_PROXY` environment variable; proxy control is now consistent with HTTP requests
116
+
117
+ - 🐛 **媒体下载代理控制统一** - 修复 `src/core/message-handler.ts` 中图片/文件下载时代理配置与 HTTP 客户端不一致的问题,确保所有媒体下载请求统一遵循代理控制策略
118
+ **Unified proxy control for media downloads** - Fixed inconsistent proxy configuration for image/file downloads; all media download requests now follow the unified proxy control policy
119
+
120
+ - 🐛 **多账号消息去重误判** - 修复多账号(多机器人)场景下,同一条群消息 @多个机器人时,第二个机器人因去重缓存未按账号隔离,误将消息判定为重复而跳过处理的问题。`checkAndMarkDingtalkMessage` 的去重 key 现在带有 `accountId` 前缀,不同机器人账号的去重缓存完全隔离
121
+ **Multi-account message deduplication false positive** - Fixed an issue where a group message mentioning multiple bots caused the second bot to skip processing due to a shared deduplication cache. The deduplication key now includes an `accountId` prefix, fully isolating each bot's cache
122
+
123
+ ## [0.8.6] - 2026-03-24
124
+
125
+ ### 改进 / Improvements
126
+ - ✅ **移除版本校验逻辑** - 删除插件入口 `index.ts` 中的 OpenClaw SDK 版本兼容性检查代码,简化插件启动流程,提升加载性能
127
+ **Removed version check logic** - Removed OpenClaw SDK version compatibility check code from plugin entry `index.ts`, simplifying plugin startup process and improving load performance
128
+
129
+ ## [0.8.5] - 2026-03-24
130
+
131
+ ### 改进 / Improvements
132
+ - ✅ **移除 SDK 版本兼容性检查** - 移除插件启动时的 OpenClaw SDK 版本检查逻辑,简化插件入口代码,提升加载性能
133
+ **Removed SDK version compatibility check** - Removed OpenClaw SDK version check logic at plugin startup, simplifying entry code and improving load performance
134
+
135
+ ## [0.8.4] - 2026-03-24
136
+
137
+ ### 修复 / Fixes
138
+ - 🐛 **群聊消息处理崩溃** - 修复群聊时报错 `TypeError: Cannot read properties of undefined (reading 'config')` 导致 Agent 无法回复的问题。根因是 `src/policy.ts` 中 `resolveDingtalkGroupToolPolicy` 函数的参数签名与 OpenClaw SDK 的 `ChannelGroupContext` 接口不匹配,函数期望接收 `account: ResolvedDingtalkAccount`,但框架实际传入 `{ cfg, groupId, accountId, ... }`,导致 `account` 为 `undefined`。现已修正参数签名,内部通过 `resolveDingtalkAccount()` 正确获取账号信息。单聊不受影响。
139
+ **Group chat message processing crash** - Fixed `TypeError: Cannot read properties of undefined (reading 'config')` crash in group chats. Root cause: `resolveDingtalkGroupToolPolicy` in `src/policy.ts` had a parameter signature mismatch with the OpenClaw SDK's `ChannelGroupContext` interface. Fixed by correcting the parameter signature and resolving the account internally via `resolveDingtalkAccount()`. Direct messages were unaffected.
140
+
141
+ - 🐛 **兼容旧版 OpenClaw Gateway(createPluginRuntimeStore 缺失)** - 修复在旧版 OpenClaw Gateway 上加载插件时报错 `TypeError: (0 , _pluginSdk.createPluginRuntimeStore) is not a function` 的问题。根因是 `src/runtime.ts` 直接从 `openclaw/plugin-sdk` 导入 `createPluginRuntimeStore`,而该函数在旧版 SDK 中并不存在。现已替换为内联实现的 `createRuntimeStore`,功能完全等价,兼容所有版本的 OpenClaw
142
+ **Compatible with older OpenClaw Gateway (missing createPluginRuntimeStore)** - Fixed `TypeError: (0 , _pluginSdk.createPluginRuntimeStore) is not a function` when loading the plugin on older OpenClaw Gateway versions. Root cause: `src/runtime.ts` imported `createPluginRuntimeStore` from `openclaw/plugin-sdk`, which doesn't exist in older SDK versions. Replaced with an inline `createRuntimeStore` implementation that is fully equivalent and compatible with all OpenClaw versions
143
+
144
+ - 🐛 **openclaw 依赖版本约束放宽** - 将 `package.json` 中的 `"openclaw": "^2026.3.0"` 改为 `"openclaw": "*"`,避免版本约束导致安装失败或与用户已安装版本冲突
145
+ **Relaxed openclaw dependency version constraint** - Changed `"openclaw": "^2026.3.0"` to `"openclaw": "*"` in `package.json` to avoid installation failures or conflicts with the user's installed version
146
+
147
+ ## [0.8.3] - 2026-03-24
148
+
149
+ ### 修复 / Fixes
150
+ - 🐛 **兼容 OpenClaw Gateway 新版本** - 修复在 OpenClaw Gateway 2026.3.22+ 版本下安装插件时报错 `ERR_PACKAGE_PATH_NOT_EXPORTED: Package subpath './plugin-sdk/compat' is not defined by "exports"` 的问题。根因是 `src/runtime.ts` 使用了已被新版 SDK 移除的 `openclaw/plugin-sdk/compat` 子路径,现已改为从 `openclaw/plugin-sdk` 主入口导入,对所有版本(2026.3.1+)均兼容
151
+ **Compatible with newer OpenClaw Gateway versions** - Fixed `ERR_PACKAGE_PATH_NOT_EXPORTED: Package subpath './plugin-sdk/compat' is not defined by "exports"` when installing under OpenClaw Gateway 2026.3.22+. Root cause: `src/runtime.ts` imported from the removed `openclaw/plugin-sdk/compat` sub-path; now imports from the `openclaw/plugin-sdk` main entry, compatible with all versions (2026.3.1+)
152
+
153
+ - ✅ **AI 卡片流式更新延迟优化** - 改动前 `onReplyStart` 串行等待 AI Card 创建(约 500ms~1s),期间 partial reply 全部丢弃,节流间隔 1000ms 也过于保守。改动后 AI Card 创建改为 fire-and-forget 与 AI 生成并行,节流间隔调整为 500ms,流式内容能更早更频繁地呈现
154
+ **AI card progressive update latency improvement** - Previously `onReplyStart` awaited AI Card creation serially (~500ms–1s), discarding all partial replies during that window, with a 1000ms throttle too conservative for short replies. AI Card creation now runs fire-and-forget in parallel with AI generation; throttle reduced to 500ms for earlier and more frequent streaming updates
155
+
156
+ - 🐛 **多 Agent 路由与 sharedMemoryAcrossConversations 冲突** - 修复配置 `sharedMemoryAcrossConversations: true` 时,多群分配不同 Agent 的 bindings 全部路由到同一 Agent 的问题。路由匹配现在使用专用的 `peerId`(真实 peer 标识,不受会话隔离配置影响),session 构建使用 `sessionPeerId`,两者职责严格分离
157
+ **Multi-Agent routing conflict with sharedMemoryAcrossConversations** - Fixed all bindings resolving to the same Agent when `sharedMemoryAcrossConversations: true`. Routing now uses dedicated `peerId` (real peer identifier, unaffected by session isolation config); session construction uses `sessionPeerId` with strict separation of responsibilities
158
+
159
+ - 🐛 **发送图片失败** - 修复发送图片时出现异常的问题 ([#316](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector/issues/316))
160
+ **Image sending failure** - Fixed an issue where sending images would fail with an error ([#316](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector/issues/316))
161
+
162
+ - 🐛 **发送人昵称与群名称未正确传递给 AI** - 修复会话上下文中 `SenderName` 字段错误传入用户 ID(而非昵称)、`GroupSubject` 字段错误传入群 ID(而非群名称)的问题,AI 现在能正确获取发送人的钉钉昵称和所在群的名称
163
+ **Sender nickname and group name not passed to AI** - Fixed `SenderName` being set to user ID instead of display name, and `GroupSubject` being set to group ID instead of group title; AI now correctly receives the sender's nickname and group name
164
+
165
+ ### 改进 / Improvements
166
+ - ✨ **消息队列繁忙时的即时排队反馈** - 当用户快速连续发送消息、上一条仍在处理中时,新消息现在会立即弹出一条 AI Card 气泡显示排队提示文案,同时贴上"思考中"表情。等轮到该消息处理时,气泡**原地更新**为最终回复内容,不会额外多发一条消息
167
+ **Instant queue acknowledgement when busy** - When a user sends messages in quick succession while the previous one is still processing, the new message now immediately shows an AI Card bubble with a queuing acknowledgement and a "thinking" emoji. When it's the message's turn, the same bubble is **updated in place** with the final reply — no extra message is sent
168
+
169
+ ## [0.8.2] - 2026-03-22
170
+
171
+ ### 修复 / Fixes
172
+ - 🐛 **多账号重复启动问题** - 修复 `enabled: false` 的账号仍会建立 WebSocket 连接的问题,禁用账号现在正确保持 pending 状态直到 Gateway 停止
173
+ **Multi-account duplicate startup** - Fixed accounts with `enabled: false` still establishing WebSocket connections; disabled accounts now correctly remain in a pending state until the Gateway stops
174
+
175
+ - 🐛 **相同 clientId 账号去重** - 修复多个账号配置相同 `clientId` 时建立重复连接的问题,通过静态配置分析确保同一 `clientId` 只有列表中第一个启用账号建立连接
176
+ **Duplicate clientId deduplication** - Fixed duplicate connections when multiple accounts share the same `clientId`; static config analysis now ensures only the first enabled account per `clientId` establishes a connection
177
+
178
+
179
+ ### 改进 / Improvements
180
+ - ✅ **Onboarding 配置向导优化** - 改进钉钉连接器配置引导逻辑,调整凭据输入顺序(先 Client ID 后 Client Secret),优化引导文案
181
+ **Onboarding wizard improvement** - Improved DingTalk connector onboarding flow, adjusted credential input order (Client ID first, then Client Secret), and refined guidance text
182
+
183
+ - ✅ **会话 Key 遵循 OpenClaw 规范** - 会话上下文按 OpenClaw 标准规则构建,通过 `channel`、`accountId`、`chatType`、`peerId` 唯一标识会话,支持 `sharedMemoryAcrossConversations` 跨会话记忆共享
184
+ **Session key follows OpenClaw convention** - Session context now built per OpenClaw standard rules, uniquely identified via `channel`, `accountId`, `chatType`, `peerId`; supports `sharedMemoryAcrossConversations` for cross-conversation memory sharing
185
+
186
+ - ✅ **消息处理逻辑优化** - 重构消息处理流程,提升消息响应速度和处理可靠性,确保消息按序正确处理
187
+ **Message processing logic optimization** - Refactored message processing flow to improve response speed and reliability, ensuring messages are processed correctly in order
188
+
189
+ ## [0.8.1] - 2026-03-20
190
+
191
+ ### 修复 / Fixes
192
+ - 🐛 **文件和图片下载 OSS 签名验证失败** - 修复默认 `Content-Type` 请求头导致 OSS 签名验证失败的问题,确保文件和图片能够正常下载
193
+ **File and image download OSS signature verification failure** - Fixed OSS signature verification failure caused by default `Content-Type` header, ensuring files and images download correctly
194
+
195
+ ## [0.8.0] - 2026-03-20
196
+
197
+ ### 重构 / Refactoring
198
+ - ✅ **业务逻辑分层重构** - 对项目结构进行重构,采用业务逻辑分层设计,明确职责边界,降低模块耦合并提升可维护性
199
+ **Business-logic layered refactor** - Reworked project architecture with layered business logic design, clarifying responsibilities, reducing coupling, and improving maintainability
200
+ - ✅ **OpenClaw 对接方式升级** - 从 OpenClaw HTTP 对接迁移为 OpenClaw SDK,统一调用链路并增强集成稳定性
201
+ **OpenClaw integration upgrade** - Migrated from OpenClaw HTTP integration to OpenClaw SDK for a unified invocation flow and better integration stability
202
+
203
+ ### 改进 / Improvements
204
+ - ✅ **IM 交互体验优化** - 优化 IM 场景下的部分交互细节,提升消息处理与反馈体验
205
+ **IM interaction optimization** - Improved several interaction details in IM scenarios to provide smoother message handling and feedback
206
+ - ✅ **README 重写与配置简化** - 重写 README 文档,简化配置教程,降低接入门槛并提升上手效率
207
+ **README rewrite & simpler setup** - Rewrote README and simplified setup guidance to reduce onboarding complexity and speed up adoption
208
+
209
+ ### 修复 / Fixes
210
+ - 🐛 **dingtalk-stream 断连问题修复** - 修复 dingtalk-stream 相关的部分断连场景,增强长连接稳定性与恢复能力
211
+ **dingtalk-stream disconnect fixes** - Fixed several dingtalk-stream related disconnection scenarios, improving long-connection stability and recovery
212
+
213
+ ## [0.7.10] - 2026-03-16
214
+
215
+ ### 新增 / Added
216
+ - ✨ **WebSocket 心跳重连机制优化** - 关闭 DWClient 的 `autoConnect`,采用应用层自动重连机制(修复 DWClient 重连 bug);添加指数退避重连策略,避免雪崩效应;使用 WebSocket 原生 Ping 进行心跳检测
217
+ **WebSocket heartbeat & reconnect optimization** - Disabled DWClient's `autoConnect`, implemented app-layer auto-reconnect (fixing DWClient bug); added exponential backoff to avoid avalanche; using WebSocket native Ping for heartbeat
218
+ - ✨ **socket-manager 模块** - 新增模块统一管理 WebSocket 连接生命周期,包括心跳检测、自动重连、指数退避、事件监听等
219
+ **socket-manager module** - New module for unified WebSocket connection lifecycle management, including heartbeat, auto-reconnect, exponential backoff, event listening
220
+ - ✨ **debug 参数** - 添加 `debug` 配置项控制详细日志输出,便于问题排查
221
+ **debug parameter** - Added `debug` config to control detailed log output for easier troubleshooting
222
+ - ✨ **WebSocket 无限重连机制** - 移除最大重连次数限制,实现无限重连,确保长连接服务的高可用性
223
+ **WebSocket infinite reconnection** - Removed maximum reconnection attempt limit, implemented infinite reconnection to ensure high availability for long-lived connection services
224
+
225
+ ### 修复 / Fixes
226
+ - 🐛 **修复 DWClient 重连 bug** - DWClient 内置重连机制存在缺陷,通过应用层重连机制替代,确保连接稳定可靠
227
+ **Fixed DWClient reconnect bug** - DWClient's built-in reconnect has defects; replaced with app-layer reconnect for stable connection
228
+ - 🐛 **长连接静默断开** - 通过应用层心跳检测连接活性,超时后主动重连,减少因长时间无数据导致的静默断连且无法恢复
229
+ **Long-lived connection silent disconnect** - App-layer heartbeat detects liveness and triggers reconnect on timeout, reducing silent disconnects when idle
230
+ ### 改进 / Improvements
231
+ - ✅ **DWClient 配置** - 设置 `autoReconnect: false`、`keepAlive: false`,由应用层接管重连和心跳,避免与钉钉服务端策略冲突
232
+ **DWClient config** - Set `autoReconnect: false`, `keepAlive: false`; app-layer takes over reconnect and heartbeat to avoid server conflicts
233
+ - ✅ **指数退避策略** - 公式 `baseBackoffDelay * Math.pow(2, attempt) + jitter(0-1s)`,最大退避 30 秒,避免雪崩效应
234
+ **Exponential backoff strategy** - Formula `baseBackoffDelay * Math.pow(2, attempt) + jitter(0-1s)`, max 30s backoff to avoid avalanche effect
235
+ - ✅ **统一事件监听** - `pong`、`message`、`close`、`open` 四个事件统一管理和清理,提升代码可维护性
236
+ **Unified event listening** - `pong`, `message`, `close`, `open` events managed and cleaned up uniformly, improving maintainability
237
+ - ✅ **配置简化** - 从 `SocketManagerConfig` 中移除 `maxReconnectAttempts` 配置项,简化配置复杂度
238
+ **Configuration simplification** - Removed `maxReconnectAttempts` from `SocketManagerConfig`, simplifying configuration
239
+ - ✅ **日志输出优化** - 更新重连日志格式,移除最大次数显示(从 "尝试 X/5" 改为 "尝试 X")
240
+ **Log output optimization** - Updated reconnection log format, removed maximum attempt display (from "attempt X/5" to "attempt X")
241
+
242
+ ### 技术细节 / Technical Details
243
+ - **退避策略**:指数退避 + 随机抖动,公式 `baseBackoffDelay * Math.pow(2, attempt) + jitter(0-1s)`
244
+ - **最大退避**:30 秒(由 `maxBackoffDelay` 限制)
245
+ - **重置条件**:重连成功后 `reconnectAttempts` 归零
246
+ - **立即重连**:心跳检测失败、WebSocket close、disconnect 消息触发时立即重连,不退避
247
+
248
+ ## [0.7.9] - 2026-03-13
249
+
250
+ ### 新增 / Added
251
+ - ✨ **应用层心跳机制** - 钉钉 Stream 客户端使用自定义心跳(WebSocket ping/pong,30 秒间隔、90 秒超时),超时后主动断开并重连,重连失败 5 秒后重试
252
+ **Application-layer heartbeat** - Stream client uses custom ping/pong heartbeat (30s interval, 90s timeout), reconnects on timeout with 5s retry on failure
253
+ - ✨ **统一停止与清理** - 停止客户端时通过 `doStop` 统一清理心跳定时器并调用 `client.disconnect()`,确保连接正确关闭
254
+ **Unified stop & cleanup** - `doStop` clears heartbeat timer and calls `client.disconnect()` when stopping the client
255
+
256
+ ### 修复 / Fixes
257
+ - 🐛 **长连接静默断开** - 关闭 SDK 激进 keepAlive(8 秒超时),改用应用层心跳,减少因长时间无数据导致的静默断连且无法恢复
258
+ **Long-lived connection silent disconnect** - Disabled SDK aggressive keepAlive (8s timeout), use app-layer heartbeat to reduce silent disconnects when idle
259
+
260
+ ### 改进 / Improvements
261
+ - ✅ **DWClient 配置** - 启用 `autoReconnect: true`,设置 `keepAlive: false`,由应用层心跳替代 SDK 心跳,避免与钉钉服务端策略冲突
262
+ **DWClient config** - `autoReconnect: true`, `keepAlive: false`; app-layer heartbeat replaces SDK keepAlive to avoid conflicts with server
263
+
264
+ ## [0.7.8] - 2026-03-13
265
+
266
+ ### 修复 / Fixes
267
+ - 🐛 **AI 卡片模版与渲染优化** - 更新 AI 卡片模版 ID,使卡片样式与最新官方规范保持一致,并提升多终端展示效果
268
+ **AI card template & rendering optimization** - Updated the AI card template ID to match the latest official standard and improved rendering across clients
269
+ - 🐛 **Markdown 表格渲染修复** - 在发送到钉钉前自动为 Markdown 表格头部补充必要空行,避免因缺少空行导致表格被当作普通文本渲染
270
+ **Markdown table rendering fix** - Automatically inserts required blank lines before Markdown table headers to prevent DingTalk from rendering tables as plain text
271
+ - 🐛 **消息去重逻辑优化** - 将消息去重维度从「账号 + 消息 ID」简化为单一「消息 ID」,避免多账号场景下的重复处理或误判
272
+ **Message de-duplication optimization** - Simplified de-duplication from `(accountId, messageId)` to `messageId` only, preventing duplicate handling or misjudgment in multi-account scenarios
273
+
274
+ ### 改进 / Improvements
275
+ - ✅ **统一 Markdown 修正管道** - 对 AI 卡片流式内容、最终内容、普通 Markdown 消息及 `sampleMarkdown` 卡片文本统一应用 Markdown 修正规则,确保表格等格式在各入口行为一致
276
+ **Unified Markdown normalization pipeline** - Applies the same Markdown normalization to streaming AI card content, final content, regular Markdown messages, and `sampleMarkdown` card text for consistent behavior
277
+ - ✅ **AI 卡片状态内容一致性** - 在完成 AI 卡片时,对展示内容和写入 `cardParamMap.msgContent` 的内容使用同一份 Markdown 修正结果,确保用户看到的内容与内部状态一致
278
+ **Consistent AI card status content** - Ensures the same normalized Markdown is used both for the visible content and `cardParamMap.msgContent` when finishing AI cards
279
+
280
+ ## [0.7.7] - 2026-03-13
281
+
282
+ ### 新增 / Added
283
+ - ✨ **自定义 Gateway URL 支持** - 新增 `gatewayBaseUrl` 配置项,支持通过自定义 URL(如 Nginx 反向代理到 TLS/HTTPS Gateway)访问 Gateway
284
+ **Custom Gateway URL support** - Added `gatewayBaseUrl` option to allow using a custom URL (e.g., Nginx reverse proxy to a TLS/HTTPS Gateway)
285
+ - ✨ **钉钉「思考中」表情反馈** - 在处理用户消息期间为原消息贴上「🤔思考中」表情,处理结束后自动撤回,清晰展示处理进度
286
+ **DingTalk “thinking” emotion feedback** - Attaches a “🤔 Thinking” emotion to the original user message while processing and automatically recalls it after completion to clearly indicate progress
287
+ - ✨ **测试基础设施完善** - 引入 Vitest 及多种测试脚本(run/watch/coverage/ui/integration),为后续自动化测试和回归验证提供基础
288
+ **Improved testing infrastructure** - Introduced Vitest and multiple test scripts (run/watch/coverage/ui/integration) to enable better automated and regression testing
289
+ - ✨ **Issue Webhook 工作流** - 新增 GitHub Actions 工作流,将 Issue 变更以统一 JSON 格式推送到配置的 Webhook
290
+ **Issue webhook workflow** - Added a GitHub Actions workflow to push Issue changes as unified JSON payloads to a configured webhook
291
+
292
+ ### 修复 / Fixes
293
+ - 🐛 **媒体元数据与缩略图提取更健壮** - ffprobe 或缩略图生成失败时不再中断主流程,而是返回默认元数据或空缩略图
294
+ **More robust media metadata & thumbnail extraction** - ffprobe or thumbnail generation failures no longer abort the main flow but return default metadata or a null thumbnail instead
295
+ - 🐛 **音频时长提取兼容性改进** - 使用动态 `import('child_process')` 替代 `require('child_process')`,提升在不同运行环境下的兼容性
296
+ **Audio duration extraction compatibility** - Replaced `require('child_process')` with dynamic `import('child_process')` to improve compatibility across environments
297
+ - 🐛 **主动消息用户列表校验** - 为主动消息的 `userIds` 列表增加空值过滤,避免因无效用户 ID 导致请求失败
298
+ **Proactive message user list validation** - Added empty value filtering for the `userIds` list in proactive messages to prevent request failures caused by invalid IDs
299
+
300
+ ## [0.7.6] - 2026-03-12
301
+
302
+ ### 修复 / Fixes
303
+ - 🐛 **Gateway 端口连接修复** - 修复修改 gateway 端口后无法连接的问题,确保配置中的 `gateway.port` 能够正确生效
304
+ **Gateway port connection fix** - Fixed issue where connection fails after modifying gateway port, ensuring that `gateway.port` in configuration takes effect correctly
305
+ - 🐛 **新会话命令修复** - 修复新会话命令(`/new`、`/reset`、`/clear`、`新会话` 等)未真正清理会话的问题,统一将命令透传到 Gateway 由 Gateway 统一处理会话重置
306
+ **New session command fix** - Fixed issue where new session commands (`/new`, `/reset`, `/clear`, `新会话`, etc.) did not actually clear sessions, commands are now forwarded to Gateway for unified session reset handling
307
+
308
+ ## [0.7.5] - 2026-03-10
309
+
310
+ ### 修复 / Fixes
311
+ - 🐛 **修复 Stream 客户端频繁重连问题** - 禁用 `DWClient` 内置的 `autoReconnect`,由框架的 health-monitor 统一管理重连逻辑,避免双重重连机制冲突
312
+ **Fixed Stream client frequent reconnection issue** - Disabled `DWClient` built-in `autoReconnect`, reconnection is now managed by framework's health-monitor to avoid dual reconnection mechanism conflict
313
+ - 🐛 **修复连接关闭不完整问题** - `stop()` 方法现在正确调用 `client.disconnect()` 关闭 WebSocket 连接
314
+ **Fixed incomplete connection closure** - `stop()` method now correctly calls `client.disconnect()` to close WebSocket connection
315
+ - 🐛 **Gateway 端口连接修复** - 修复修改 gateway 端口后无法连接的问题
316
+ **Gateway port connection fix** - Fixed issue where connection fails after modifying gateway port
317
+
318
+ ### 重构 / Refactoring
319
+ - ✅ **OpenClaw session.dmScope 机制** - 会话管理由 OpenClaw Gateway 统一处理,插件不再内部管理会话超时
320
+ **OpenClaw session.dmScope mechanism** - Session management is now handled by OpenClaw Gateway, plugin no longer manages session timeout internally
321
+ - ✅ **SessionContext 标准化** - 使用 OpenClaw 标准的 SessionContext JSON 格式传递会话上下文
322
+ **SessionContext standardization** - Use OpenClaw standard SessionContext JSON format for session context
323
+
324
+ ### 配置变更 / Configuration Changes
325
+ - 新增 `groupSessionScope`(默认:`group`)- 群聊会话隔离策略(仅当 separateSessionByConversation=true 时生效):`group`=群共享,`group_sender`=群内用户独立
326
+ Added `groupSessionScope` (default: `group`) - Group chat session isolation (only when separateSessionByConversation=true): `group`=shared, `group_sender`=per-user
327
+ - ⚠️ **废弃** `sessionTimeout` - 会话超时由 OpenClaw Gateway 的 `session.reset.idleMinutes` 配置控制,详见 [Gateway 配置文档](https://docs.openclaw.ai/gateway/configuration)
328
+ **Deprecated** `sessionTimeout` - Session timeout is now controlled by OpenClaw Gateway's `session.reset.idleMinutes`, see [Gateway Configuration](https://docs.openclaw.ai/gateway/configuration)
329
+
330
+ ### 向后兼容 / Backward Compatibility
331
+ - 旧配置 `sessionTimeout` 仍可使用,但会打印废弃警告日志
332
+ Old config `sessionTimeout` still works but will print deprecation warning
333
+
334
+ ## [0.7.4] - 2026-03-09
335
+
336
+ ### 新增功能 / Added Features
337
+ - ✅ **按会话区分 Session** - 支持按单聊、群聊、不同群分别维护独立会话,单聊与群聊、不同群之间的对话上下文互不干扰
338
+ **Session by conversation** - Support separate sessions for direct chat, group chat, and different groups; conversation context is isolated between DMs, group chats, and different groups
339
+ - ✅ **记忆隔离/共享配置** - 新增 `sharedMemoryAcrossConversations` 配置,控制单 Agent 场景下是否在不同会话间共享记忆;默认 `false` 实现群聊与私聊、不同群之间的记忆隔离
340
+ **Memory isolation/sharing config** - Added `sharedMemoryAcrossConversations` option to control whether memory is shared across conversations in single-Agent mode; default `false` isolates memory between DMs, group chats, and different groups
341
+ - ✅ **Gateway Session 格式增强** - Session key 支持 `group:conversationId` 格式,便于 Gateway 识别群聊场景
342
+ **Gateway session format enhancement** - Session key supports `group:conversationId` format for Gateway to identify group chat scenarios
343
+ - ✅ **X-OpenClaw-Memory-User 支持** - 向 Gateway 传递记忆归属用户标识,支持 Gateway 侧记忆管理
344
+ **X-OpenClaw-Memory-User support** - Pass memory user identifier to Gateway for memory management
345
+
346
+ ### 配置 / Configuration
347
+ - 新增 `separateSessionByConversation`(默认:`true`)- 是否按单聊/群聊/群区分 session
348
+ Added `separateSessionByConversation` (default: `true`) - Whether to separate sessions by direct/group/different groups
349
+ Added `separateSessionByConversation` (default: `true`) - Whether to separate sessions by direct/group/different groups (deprecated in 0.7.5)
350
+ - 新增 `sharedMemoryAcrossConversations`(默认:`false`)- 单 Agent 场景下是否在不同会话间共享记忆;`false` 时不同群聊、群聊与私聊记忆隔离
351
+ Added `sharedMemoryAcrossConversations` (default: `false`) - Whether to share memory across conversations in single-Agent mode; when `false`, memory is isolated between different groups and between DMs and groups
352
+
353
+ ## [0.7.3] - 2026-03-09
354
+
355
+ ### 修复 / Fixes
356
+ - 🐛 **兼容性修复**:修复 0.7.0 引入的默认 Agent 路由回归问题。0.7.0 之前默认路由到 `main` agent,0.7.0 之后错误地路由到 `default` agent,现已恢复为 `main` agent
357
+ **Compatibility fix**: Fixed default agent routing regression introduced in 0.7.0. Before 0.7.0 default routed to `main` agent, after 0.7.0 incorrectly routed to `default` agent, now restored to `main` agent
358
+ - 🐛 修复用户显式配置名为 `default` 的账号时被错误映射的问题:使用 `__default__` 作为内部默认账号标识
359
+ Fixed issue where user-configured account named `default` was incorrectly mapped: Use `__default__` as internal default account identifier
360
+
361
+ ### 改进 / Improvements
362
+ - 抽取 `DEFAULT_ACCOUNT_ID` 常量到文件顶部,统一管理默认账号标识
363
+ Extracted `DEFAULT_ACCOUNT_ID` constant to file top, unified management of default account identifier
364
+ - 更新 API 文档注释,移除对 `default` 的硬编码引用
365
+ Updated API documentation comments, removed hardcoded references to `default`
366
+
367
+ ## [0.7.2] - 2026-03-05
368
+
369
+ ### 新增功能 / Added Features
370
+ - ✅ 新增异步模式:立即回执用户消息,后台处理任务,然后主动推送最终结果作为独立消息
371
+ Added async mode: immediately acknowledge user messages, process in background, then push the final result as a separate message
372
+ - ✅ 支持自定义回执消息文本,可通过 `ackText` 配置项设置
373
+ Support custom acknowledgment message text, configurable via `ackText` option
374
+
375
+ ### 修复 / Fixes
376
+ - 🐛 修复异步模式下 Agent 路由问题:`streamFromGateway` 调用时缺少 `accountId` 参数,导致会话路由到 undefined agent
377
+ Fixed agent routing in async mode: `streamFromGateway` was called without `accountId`, causing sessions to route to undefined agent
378
+ - 🐛 修复默认 Agent 路由:当 `accountId` 为 `'default'` 时跳过 `X-OpenClaw-Agent-Id` header,让 gateway 路由到其配置的默认 agent
379
+ Fixed default agent routing: Skip `X-OpenClaw-Agent-Id` header when `accountId` is `'default'`, letting gateway route to its configured default agent
380
+ - 🐛 修复异步模式内容处理:使用 `userContent`(包含文件附件)替代原始 `content.text`
381
+ Fixed async mode content: Use `userContent` (includes file attachments) instead of raw `content.text`
382
+ - 🐛 修复异步模式图片支持:将 `imageLocalPaths` 传递给 gateway stream
383
+ Fixed image support for async mode: Pass `imageLocalPaths` to gateway stream
384
+
385
+ ### 配置 / Configuration
386
+ - 新增 `asyncMode` 配置项(默认:`false`)- 启用异步模式
387
+ Added `asyncMode` configuration option (default: `false`) - Enable async mode
388
+ - 新增 `ackText` 配置项(默认:`'🫡 任务已接收,处理中...'`)- 自定义回执消息文本
389
+ Added `ackText` configuration option (default: `'🫡 任务已接收,处理中...'`) - Custom ack message text
390
+
391
+ ## [0.7.1] - 2026-03-05
392
+
393
+ ### 修复 / Fixes
394
+ - 🐛 修复 stream 模式 model 参数错误导致 session 路由失败的问题
395
+ Fixed issue where incorrect model parameter in stream mode caused session routing failures
396
+ - 🐛 将 Gateway 请求中的 model 参数从 `'default'` 更正为 `'main'`,确保正确的 Agent 路由
397
+ Corrected model parameter in Gateway requests from `'default'` to `'main'` to ensure proper Agent routing
398
+
399
+ ### 改进 / Improvements
400
+ - 优化异步模式处理流程,改进错误处理和日志输出
401
+ Optimized async mode processing flow, improved error handling and log output
402
+ - 增强 DM Policy 检查机制,支持白名单配置
403
+ Enhanced DM Policy check mechanism, supporting allowlist configuration
404
+
405
+ ## [0.7.0] - 2026-03-05
406
+
407
+ ### 新增功能 / Added Features
408
+
409
+ #### 富媒体接收支持 / Rich Media Reception Support
410
+ - ✅ 支持接收 JPEG 图片消息,自动下载到 `~/.openclaw/workspace/media/inbound/` 目录
411
+ Support receiving JPEG image messages, automatically downloaded to `~/.openclaw/workspace/media/inbound/` directory
412
+ - ✅ 支持接收 PNG 图片(在 richText 中),自动提取 URL 和 downloadCode 并下载
413
+ Support receiving PNG images (in richText), automatically extract URL and downloadCode and download
414
+ - ✅ 图片自动传递给视觉模型,AI 可以识别和分析图片内容
415
+ Images are automatically passed to vision models, AI can recognize and analyze image content
416
+ - ✅ 媒体文件统一命名格式:`openclaw-media-{timestamp}.{ext}`
417
+ Unified naming format for media files: `openclaw-media-{timestamp}.{ext}`
418
+
419
+ #### 文件附件提取 / File Attachment Extraction
420
+ - ✅ 支持解析 `.docx` 文件(通过 `mammoth` 库提取文本内容)
421
+ Support parsing `.docx` files (extract text content via `mammoth` library)
422
+ - ✅ 支持解析 `.pdf` 文件(通过 `pdf-parse` 库提取文本内容)
423
+ Support parsing `.pdf` files (extract text content via `pdf-parse` library)
424
+ - ✅ 支持读取纯文本文件(`.txt`、`.md`、`.json` 等),内容直接注入到 AI 上下文
425
+ Support reading plain text files (`.txt`, `.md`, `.json`, etc.), content directly injected into AI context
426
+ - ✅ 支持处理二进制文件(`.xlsx`、`.pptx`、`.zip` 等),文件保存到磁盘并在消息中报告路径
427
+ Support processing binary files (`.xlsx`, `.pptx`, `.zip`, etc.), files saved to disk and paths reported in messages
428
+
429
+ #### 钉钉文档 API / DingTalk Document API
430
+ - ✅ 支持创建钉钉文档 (`docs.create`)
431
+ Support creating DingTalk documents (`docs.create`)
432
+ - ✅ 支持在现有文档上追加内容 (`docs.append`)
433
+ Support appending content to existing documents (`docs.append`)
434
+ - ✅ 支持搜索钉钉文档 (`docs.search`)
435
+ Support searching DingTalk documents (`docs.search`)
436
+ - ✅ 支持列举空间下的文档 (`docs.list`)
437
+ Support listing documents under a space (`docs.list`)
438
+ - ⚠️ 注意:读取文档功能 (`docs.read`) 需要 MCP 提供相应的 tool,当前版本暂不支持
439
+ Note: Document reading functionality (`docs.read`) requires MCP to provide the corresponding tool, currently not supported in this version
440
+
441
+ #### 多 Agent 路由支持 / Multi-Agent Routing Support
442
+ - ✅ 支持一个连接器实例同时连接多个 Agent
443
+ Support one connector instance connecting to multiple Agents simultaneously
444
+ - ✅ 支持多个钉钉机器人分别绑定到不同的 Agent,实现角色分工和专业化服务
445
+ Support multiple DingTalk bots binding to different Agents, enabling role division and specialized services
446
+ - ✅ 每个 Agent 拥有独立的会话空间,实现会话隔离
447
+ Each Agent has an independent session space, achieving session isolation
448
+ - ✅ 向后兼容单 Agent 场景,无需额外配置
449
+ Backward compatible with single Agent scenarios, no additional configuration required
450
+ - ✅ 提供多 Agent 配置说明和示例,支持通过 `accounts` 和 `bindings` 配置多个机器人
451
+ Provides multi-Agent configuration documentation and examples, supports configuring multiple bots via `accounts` and `bindings`
452
+
453
+ ### 修复 / Fixes
454
+ - 🐛 修复机器人发送语音消息播放异常问题,音频进度和播放功能现已正常工作
455
+ Fixed bot voice message playback issues, audio progress and playback functionality now work correctly
456
+
457
+ ### 改进 / Improvements
458
+ - 优化媒体文件下载和存储机制
459
+ Optimized media file download and storage mechanism
460
+ - 改进文件附件处理流程,支持更多文件类型
461
+ Improved file attachment processing flow, supporting more file types
462
+ - 增强错误处理和日志输出
463
+ Enhanced error handling and log output
464
+ - 新增 Markdown 表格自动转换功能,将 Markdown 表格转换为钉钉支持的文本格式,提升消息可读性
465
+ Added automatic Markdown table conversion, converting Markdown tables to DingTalk-supported text format for better message readability
466
+
467
+ ### 依赖更新 / Dependency Updates
468
+ - 新增 `mammoth@^1.8.0` - Word 文档解析
469
+ Added `mammoth@^1.8.0` - Word document parsing
470
+ - 新增 `pdf-parse@^1.1.1` - PDF 文档解析
471
+ Added `pdf-parse@^1.1.1` - PDF document parsing
472
+
473
+ ### 已知问题 / Known Issues
474
+ - ⚠️ 钉钉文档读取功能 (`docs.read`) 当前不可用,因为 MCP 中未提供相应的 tool。代码层面实现正常,等待 MCP 支持。
475
+ DingTalk document reading functionality (`docs.read`) is currently unavailable because MCP does not provide the corresponding tool. Implementation is correct at the code level, waiting for MCP support.
476
+
477
+ ### 文档更新 / Documentation Updates
478
+ - 更新 README.md,添加新功能使用说明
479
+ Updated README.md, added usage instructions for new features
480
+ - 添加富媒体接收、文件附件提取、钉钉文档 API、多 Agent 路由等章节
481
+ Added sections on rich media reception, file attachment extraction, DingTalk document API, multi-Agent routing, etc.
482
+ - 新增"多 Agent 配置"章节,提供详细的配置示例和说明
483
+ Added "Multi-Agent Configuration" section with detailed configuration examples and instructions
484
+ - 补充常见问题解答
485
+ Added FAQ section
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 DingTalk Real Team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.