@yaoyuanchao/dingtalk 1.5.0 β†’ 1.5.2

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