@yaoyuanchao/dingtalk 1.4.20 → 1.5.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 CHANGED
@@ -1,203 +1,236 @@
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
- ## [1.4.10] - 2026-01-30
9
-
10
- ### Fixed
11
-
12
- - **Remove peerDependencies** — removed `clawdbot` from peerDependencies to prevent npm 7+ from installing the entire clawdbot package (400+ deps, ~55MB) into plugin's node_modules; clawdbot is injected at runtime via jiti alias
13
- - **`clawdbot plugins update` now works** installation reduced from timeout (~5min+) to seconds
14
-
15
- ## [1.4.9] - 2026-01-30
16
-
17
- ### Fixed
18
-
19
- - **zod v4 compatibility** — upgraded zod dependency from `^3.22.0` to `^4.3.6` to match clawdbot's version; fixed `ZodError.errors` → `ZodError.issues` API change
20
-
21
- ### Changed
22
-
23
- - **Dependency alignment** — now uses same zod version as clawdbot core and clawdbot-feishu plugin
24
-
25
- ## [1.3.6] - 2026-01-28
26
-
27
- ### Fixed
28
-
29
- - **Stream ACK method name** — corrected `socketResponse()` to `socketCallBackResponse()` (the actual SDK method); previous typo caused ACK to silently fail, triggering DingTalk 60-second retry
30
- - **Audio message handling** skip .amr file download when DingTalk ASR recognition text is available; prevents agent from being confused by audio attachment and trying Whisper instead of reading the already-transcribed text
31
-
32
- ## [1.3.5] - 2026-01-28
33
-
34
- ### Fixed
35
-
36
- - **Outbound `to` parameter parsing** — bare userId (no `dm:` prefix) now correctly treated as DM target; previously silently dropped with ok:true
37
- - **SessionWebhook response validation** — `sendViaSessionWebhook()` and `sendMarkdownViaSessionWebhook()` now return errcode/errmsg and check `.ok`; failures trigger REST API fallback instead of being silently ignored
38
- - **Stream ACK timing** — immediately call `socketResponse()` on message receipt to prevent DingTalk 60-second retry timeout; previously awaited full AI processing before ACK
39
- - **`resolveDeliverText()` type safety** check `typeof payload.markdown === 'string'` to avoid treating boolean flags as text content
40
-
41
- ### Changed
42
-
43
- - **`parseOutboundTo()` enhanced** — handles `"dm:id"`, `"group:id"`, `"dingtalk:dm:id"`, `"dingtalk:group:id"`, and bare `"id"` (defaults to DM)
44
- - **`deliverReply()` error propagation** — throws on sessionWebhook rejection to trigger retry + REST API fallback
45
- - **Media URL merging** — `resolveDeliverText()` merges `payload.mediaUrl`/`payload.imageUrl` into text as markdown image syntax
46
- - **Webhook functions** return `{ ok, errcode, errmsg }` for proper error inspection
47
-
48
- ## [1.3.0] - 2026-01-28
49
-
50
- ### Added
51
-
52
- - **Full SDK Pipeline** — runtime feature detection for `dispatchReplyFromConfig` with 9-step SDK integration (routing, session, envelope, dispatch)
53
- - **Media support** — image download via `downloadPicture()`, audio/video/file recognition via `downloadMediaFile()`
54
- - **Smart Markdown detection** — `messageFormat: 'auto'` option with regex-based content detection
55
- - **Thinking indicator** — `showThinking` config option sends "正在思考..." before AI processing
56
- - **Activity recording** — `runtime.channel.activity.record()` calls for start/stop/message events
57
- - **`cleanupOldMedia()`** — generalized media cleanup (replaces `cleanupOldPictures`)
58
-
59
- ### Changed
60
-
61
- - **Message extraction refactored** — `extractMessageContent()` switch-case structure for text/richText/picture/audio/video/file
62
- - **Config schema** — added `showThinking`, `messageFormat: 'auto'` option
63
- - **`sendMedia()` outbound** — uses markdown image syntax instead of plain URL text
64
-
65
- ## [1.2.0] - 2026-01-28
66
-
67
- ### 🎉 Major Features - Official Plugin Release
68
-
69
- This release transforms the DingTalk plugin into an official Clawdbot plugin that can be installed via `clawdbot plugins install` command.
70
-
71
- ### Added
72
-
73
- - **Official NPM Installation Support**
74
- - Published to NPM as `@yaoyuanchao/dingtalk`
75
- - Install with: `clawdbot plugins install @yaoyuanchao/dingtalk`
76
- - Added `clawdbot.install` configuration in package.json
77
-
78
- - **Interactive Onboarding Wizard** (`src/onboarding.ts`)
79
- - Run with: `clawdbot onboard --channel dingtalk`
80
- - Step-by-step guided configuration
81
- - Automatic connection testing
82
- - Policy selection with descriptions
83
- - Auto-save to configuration file
84
-
85
- - **Zod Schema Validation** (`src/config-schema.ts`)
86
- - Type-safe configuration validation
87
- - Automatic error messages with detailed paths
88
- - Default values for all optional fields
89
- - Strict mode to catch unknown properties
90
-
91
- - **Health Check System** (`src/probe.ts`)
92
- - Connection status monitoring
93
- - Latency measurement
94
- - Improved `status.probeAccount` with detailed error reporting
95
-
96
- - **Enhanced Error Messages**
97
- - Validation errors show exact field and reason
98
- - Helpful hints for environment variable configuration
99
- - Guidance for troubleshooting connection issues
100
-
101
- ### Changed
102
-
103
- - **Package Configuration**
104
- - Renamed from `@clawdbot/dingtalk` to `@yaoyuanchao/dingtalk`
105
- - Version bumped from 0.1.0 to 1.2.0
106
- - Added MIT license
107
- - Added keywords for NPM discoverability
108
- - Added `peerDependencies` for clawdbot version requirement
109
- - Added `files` field to control NPM publish content
110
-
111
- - **Configuration Validation**
112
- - Migrated from JSON Schema to Zod
113
- - Environment variables merged before validation
114
- - Better error messages for invalid configurations
115
-
116
- - **Module Imports**
117
- - Separated probe functionality into dedicated module
118
- - Improved type safety with Zod type inference
119
-
120
- ### Technical Details
121
-
122
- - **Dependencies**: Added `zod@^3.22.0`
123
- - **Peer Dependencies**: Requires `clawdbot >= 2026.1.24`
124
- - **TypeScript**: Published as TypeScript source (not compiled JS)
125
- - **Backward Compatibility**: All v0.1.0 features preserved
126
-
127
- ### Migration Guide
128
-
129
- If you're upgrading from v0.1.0, see [UPGRADE.md](./UPGRADE.md) for detailed steps.
130
-
131
- Summary:
132
- 1. **No configuration changes required** - existing configs work as-is
133
- 2. Backup, stop gateway, delete old plugin, install via NPM, restart
134
- 3. **Optional**: Try the new onboarding wizard for fresh setup
135
-
136
- ## [0.1.0] - 2026-01-26
137
-
138
- ### Initial Release
139
-
140
- #### Added
141
-
142
- - **Stream Mode Connection**
143
- - WebSocket-based connection via `dingtalk-stream@2.1.4`
144
- - No public domain required
145
- - Auto-reconnection support
146
-
147
- - **Private Messages (DM)**
148
- - Support for 1-on-1 conversations
149
- - Pairing mode with automatic staffId display
150
- - Allowlist mode for restricted access
151
- - Open mode for unrestricted access
152
-
153
- - **Group Chat Support**
154
- - @mention detection
155
- - Group allowlist (conversation IDs)
156
- - Optional mention requirement
157
-
158
- - **Message Sending**
159
- - Dual-route strategy:
160
- - SessionWebhook (preferred, 35-minute validity)
161
- - REST API (fallback for expired sessions)
162
- - Text message support
163
- - Markdown format support (limited by DingTalk)
164
- - Auto-converts tables to code blocks
165
-
166
- - **Access Control**
167
- - DM policies: disabled, pairing, allowlist, open
168
- - Group policies: disabled, allowlist, open
169
- - Per-user staffId authorization
170
- - Per-group conversationId authorization
171
-
172
- - **Configuration**
173
- - Environment variable support (DINGTALK_CLIENT_ID, etc.)
174
- - JSON configuration in clawdbot.json
175
- - Credential source detection (config vs env)
176
-
177
- - **Core Modules**
178
- - `src/monitor.ts` - Stream connection and message handling
179
- - `src/api.ts` - DingTalk REST API wrapper
180
- - `src/channel.ts` - Clawdbot ChannelPlugin implementation
181
- - `src/accounts.ts` - Account credential resolution
182
- - `src/types.ts` - TypeScript type definitions
183
-
184
- #### Known Limitations
185
-
186
- - **Markdown Support**: DingTalk doesn't support tables in markdown
187
- - **Media Messages**: Sending files/images not yet implemented
188
- - **Rate Limits**: 20 messages/minute/group (DingTalk limit)
189
-
190
- ---
191
-
192
- ## Legend
193
-
194
- - 🎉 **Major Features**: Significant new functionality
195
- - **Enhancements**: Improvements to existing features
196
- - 🐛 **Bug Fixes**: Fixes for issues
197
- - 🔒 **Security**: Security-related changes
198
- - 📝 **Documentation**: Documentation updates
199
- - ⚠️ **Breaking Changes**: Changes that may require migration
200
-
201
- ---
202
-
203
- **Note**: This changelog focuses on user-facing changes. For detailed commit history, see the Git log.
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
+ ## [1.5.1] - 2026-02-03
9
+
10
+ ### Added
11
+
12
+ - **OpenClaw compatibility** — added `openclaw.plugin.json` for seamless migration from ClawdBot to OpenClaw
13
+ - Plugin now works with both ClawdBot and OpenClaw without any code changes
14
+
15
+ ### Changed
16
+
17
+ - Updated package description to mention OpenClaw support
18
+ - Added "openclaw" to keywords
19
+
20
+ ## [1.5.0] - 2026-01-31
21
+
22
+ ### 🎉 New Feature: Typing Indicator with Auto-Recall
23
+
24
+ - **Typing Indicator** — When processing a message, automatically sends "⏳ 思考中..." which is silently recalled when the reply is ready. Much better UX than the old `showThinking` option.
25
+ - **Message Recall APIs** — New functions in `api.ts`:
26
+ - `sendDMMessageWithKey()` — Send DM and return processQueryKey for recall
27
+ - `sendGroupMessageWithKey()` — Send group message and return processQueryKey
28
+ - `recallDMMessages()` — Batch recall DM messages
29
+ - `recallGroupMessages()` Batch recall group messages
30
+ - `sendTypingIndicator()`One-stop helper that returns a cleanup function
31
+
32
+ ### Configuration
33
+
34
+ - `typingIndicator: false` — Disable typing indicator (default: enabled)
35
+ - `typingIndicatorMessage: "xxx"` — Customize the thinking message
36
+
37
+ ### Changed
38
+
39
+ - Deprecated `showThinking` option (still works as fallback if `typingIndicator` is explicitly disabled)
40
+
41
+ ## [1.4.10] - 2026-01-30
42
+
43
+ ### Fixed
44
+
45
+ - **Remove peerDependencies** — removed `clawdbot` from peerDependencies to prevent npm 7+ from installing the entire clawdbot package (400+ deps, ~55MB) into plugin's node_modules; clawdbot is injected at runtime via jiti alias
46
+ - **`clawdbot plugins update` now works** installation reduced from timeout (~5min+) to seconds
47
+
48
+ ## [1.4.9] - 2026-01-30
49
+
50
+ ### Fixed
51
+
52
+ - **zod v4 compatibility** — upgraded zod dependency from `^3.22.0` to `^4.3.6` to match clawdbot's version; fixed `ZodError.errors` `ZodError.issues` API change
53
+
54
+ ### Changed
55
+
56
+ - **Dependency alignment** — now uses same zod version as clawdbot core and clawdbot-feishu plugin
57
+
58
+ ## [1.3.6] - 2026-01-28
59
+
60
+ ### Fixed
61
+
62
+ - **Stream ACK method name** — corrected `socketResponse()` to `socketCallBackResponse()` (the actual SDK method); previous typo caused ACK to silently fail, triggering DingTalk 60-second retry
63
+ - **Audio message handling** — skip .amr file download when DingTalk ASR recognition text is available; prevents agent from being confused by audio attachment and trying Whisper instead of reading the already-transcribed text
64
+
65
+ ## [1.3.5] - 2026-01-28
66
+
67
+ ### Fixed
68
+
69
+ - **Outbound `to` parameter parsing** bare userId (no `dm:` prefix) now correctly treated as DM target; previously silently dropped with ok:true
70
+ - **SessionWebhook response validation** — `sendViaSessionWebhook()` and `sendMarkdownViaSessionWebhook()` now return errcode/errmsg and check `.ok`; failures trigger REST API fallback instead of being silently ignored
71
+ - **Stream ACK timing** — immediately call `socketResponse()` on message receipt to prevent DingTalk 60-second retry timeout; previously awaited full AI processing before ACK
72
+ - **`resolveDeliverText()` type safety** — check `typeof payload.markdown === 'string'` to avoid treating boolean flags as text content
73
+
74
+ ### Changed
75
+
76
+ - **`parseOutboundTo()` enhanced** — handles `"dm:id"`, `"group:id"`, `"dingtalk:dm:id"`, `"dingtalk:group:id"`, and bare `"id"` (defaults to DM)
77
+ - **`deliverReply()` error propagation** — throws on sessionWebhook rejection to trigger retry + REST API fallback
78
+ - **Media URL merging** — `resolveDeliverText()` merges `payload.mediaUrl`/`payload.imageUrl` into text as markdown image syntax
79
+ - **Webhook functions** return `{ ok, errcode, errmsg }` for proper error inspection
80
+
81
+ ## [1.3.0] - 2026-01-28
82
+
83
+ ### Added
84
+
85
+ - **Full SDK Pipeline** — runtime feature detection for `dispatchReplyFromConfig` with 9-step SDK integration (routing, session, envelope, dispatch)
86
+ - **Media support** — image download via `downloadPicture()`, audio/video/file recognition via `downloadMediaFile()`
87
+ - **Smart Markdown detection** — `messageFormat: 'auto'` option with regex-based content detection
88
+ - **Thinking indicator** `showThinking` config option sends "正在思考..." before AI processing
89
+ - **Activity recording** `runtime.channel.activity.record()` calls for start/stop/message events
90
+ - **`cleanupOldMedia()`** — generalized media cleanup (replaces `cleanupOldPictures`)
91
+
92
+ ### Changed
93
+
94
+ - **Message extraction refactored** — `extractMessageContent()` switch-case structure for text/richText/picture/audio/video/file
95
+ - **Config schema** — added `showThinking`, `messageFormat: 'auto'` option
96
+ - **`sendMedia()` outbound** uses markdown image syntax instead of plain URL text
97
+
98
+ ## [1.2.0] - 2026-01-28
99
+
100
+ ### 🎉 Major Features - Official Plugin Release
101
+
102
+ This release transforms the DingTalk plugin into an official Clawdbot plugin that can be installed via `clawdbot plugins install` command.
103
+
104
+ ### Added
105
+
106
+ - **Official NPM Installation Support**
107
+ - Published to NPM as `@yaoyuanchao/dingtalk`
108
+ - Install with: `clawdbot plugins install @yaoyuanchao/dingtalk`
109
+ - Added `clawdbot.install` configuration in package.json
110
+
111
+ - **Interactive Onboarding Wizard** (`src/onboarding.ts`)
112
+ - Run with: `clawdbot onboard --channel dingtalk`
113
+ - Step-by-step guided configuration
114
+ - Automatic connection testing
115
+ - Policy selection with descriptions
116
+ - Auto-save to configuration file
117
+
118
+ - **Zod Schema Validation** (`src/config-schema.ts`)
119
+ - Type-safe configuration validation
120
+ - Automatic error messages with detailed paths
121
+ - Default values for all optional fields
122
+ - Strict mode to catch unknown properties
123
+
124
+ - **Health Check System** (`src/probe.ts`)
125
+ - Connection status monitoring
126
+ - Latency measurement
127
+ - Improved `status.probeAccount` with detailed error reporting
128
+
129
+ - **Enhanced Error Messages**
130
+ - Validation errors show exact field and reason
131
+ - Helpful hints for environment variable configuration
132
+ - Guidance for troubleshooting connection issues
133
+
134
+ ### Changed
135
+
136
+ - **Package Configuration**
137
+ - Renamed from `@clawdbot/dingtalk` to `@yaoyuanchao/dingtalk`
138
+ - Version bumped from 0.1.0 to 1.2.0
139
+ - Added MIT license
140
+ - Added keywords for NPM discoverability
141
+ - Added `peerDependencies` for clawdbot version requirement
142
+ - Added `files` field to control NPM publish content
143
+
144
+ - **Configuration Validation**
145
+ - Migrated from JSON Schema to Zod
146
+ - Environment variables merged before validation
147
+ - Better error messages for invalid configurations
148
+
149
+ - **Module Imports**
150
+ - Separated probe functionality into dedicated module
151
+ - Improved type safety with Zod type inference
152
+
153
+ ### Technical Details
154
+
155
+ - **Dependencies**: Added `zod@^3.22.0`
156
+ - **Peer Dependencies**: Requires `clawdbot >= 2026.1.24`
157
+ - **TypeScript**: Published as TypeScript source (not compiled JS)
158
+ - **Backward Compatibility**: All v0.1.0 features preserved
159
+
160
+ ### Migration Guide
161
+
162
+ If you're upgrading from v0.1.0, see [UPGRADE.md](./UPGRADE.md) for detailed steps.
163
+
164
+ Summary:
165
+ 1. **No configuration changes required** - existing configs work as-is
166
+ 2. Backup, stop gateway, delete old plugin, install via NPM, restart
167
+ 3. **Optional**: Try the new onboarding wizard for fresh setup
168
+
169
+ ## [0.1.0] - 2026-01-26
170
+
171
+ ### Initial Release
172
+
173
+ #### Added
174
+
175
+ - **Stream Mode Connection**
176
+ - WebSocket-based connection via `dingtalk-stream@2.1.4`
177
+ - No public domain required
178
+ - Auto-reconnection support
179
+
180
+ - **Private Messages (DM)**
181
+ - Support for 1-on-1 conversations
182
+ - Pairing mode with automatic staffId display
183
+ - Allowlist mode for restricted access
184
+ - Open mode for unrestricted access
185
+
186
+ - **Group Chat Support**
187
+ - @mention detection
188
+ - Group allowlist (conversation IDs)
189
+ - Optional mention requirement
190
+
191
+ - **Message Sending**
192
+ - Dual-route strategy:
193
+ - SessionWebhook (preferred, 35-minute validity)
194
+ - REST API (fallback for expired sessions)
195
+ - Text message support
196
+ - Markdown format support (limited by DingTalk)
197
+ - Auto-converts tables to code blocks
198
+
199
+ - **Access Control**
200
+ - DM policies: disabled, pairing, allowlist, open
201
+ - Group policies: disabled, allowlist, open
202
+ - Per-user staffId authorization
203
+ - Per-group conversationId authorization
204
+
205
+ - **Configuration**
206
+ - Environment variable support (DINGTALK_CLIENT_ID, etc.)
207
+ - JSON configuration in clawdbot.json
208
+ - Credential source detection (config vs env)
209
+
210
+ - **Core Modules**
211
+ - `src/monitor.ts` - Stream connection and message handling
212
+ - `src/api.ts` - DingTalk REST API wrapper
213
+ - `src/channel.ts` - Clawdbot ChannelPlugin implementation
214
+ - `src/accounts.ts` - Account credential resolution
215
+ - `src/types.ts` - TypeScript type definitions
216
+
217
+ #### Known Limitations
218
+
219
+ - **Markdown Support**: DingTalk doesn't support tables in markdown
220
+ - **Media Messages**: Sending files/images not yet implemented
221
+ - **Rate Limits**: 20 messages/minute/group (DingTalk limit)
222
+
223
+ ---
224
+
225
+ ## Legend
226
+
227
+ - 🎉 **Major Features**: Significant new functionality
228
+ - ✨ **Enhancements**: Improvements to existing features
229
+ - 🐛 **Bug Fixes**: Fixes for issues
230
+ - 🔒 **Security**: Security-related changes
231
+ - 📝 **Documentation**: Documentation updates
232
+ - ⚠️ **Breaking Changes**: Changes that may require migration
233
+
234
+ ---
235
+
236
+ **Note**: This changelog focuses on user-facing changes. For detailed commit history, see the Git log.