@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 +236 -224
- package/README.md +93 -303
- package/openclaw.plugin.json +9 -0
- package/package.json +79 -52
- package/src/api.ts +955 -955
- package/src/monitor.ts +1382 -1382
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.
|
|
9
|
-
|
|
10
|
-
###
|
|
11
|
-
|
|
12
|
-
- **
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
###
|
|
93
|
-
|
|
94
|
-
- **
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
- **
|
|
107
|
-
-
|
|
108
|
-
-
|
|
109
|
-
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
-
|
|
113
|
-
-
|
|
114
|
-
-
|
|
115
|
-
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
-
|
|
120
|
-
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
- **
|
|
125
|
-
-
|
|
126
|
-
-
|
|
127
|
-
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
-
|
|
131
|
-
|
|
132
|
-
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
-
|
|
138
|
-
-
|
|
139
|
-
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
- **
|
|
145
|
-
-
|
|
146
|
-
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
-
|
|
177
|
-
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
-
|
|
184
|
-
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
-
|
|
188
|
-
-
|
|
189
|
-
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
-
|
|
194
|
-
|
|
195
|
-
-
|
|
196
|
-
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
-
|
|
201
|
-
-
|
|
202
|
-
-
|
|
203
|
-
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
-
|
|
208
|
-
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
-
|
|
220
|
-
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
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.
|