@zhin.js/adapter-dingtalk 1.0.80 → 1.1.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 (65) hide show
  1. package/CHANGELOG.md +621 -0
  2. package/README.md +67 -333
  3. package/adapters/dingtalk.js +33 -0
  4. package/adapters/dingtalk.ts +38 -0
  5. package/agent/PERMITS.md +19 -0
  6. package/agent/tools/add_chat_members.ts +20 -0
  7. package/agent/tools/create_chat.ts +21 -0
  8. package/agent/tools/dept_info.ts +15 -0
  9. package/agent/tools/get_dept_users.ts +16 -0
  10. package/agent/tools/get_user.ts +15 -0
  11. package/agent/tools/list_departments.ts +16 -0
  12. package/agent/tools/send_work_notice.ts +18 -0
  13. package/agent/tools/update_chat.ts +25 -0
  14. package/commands/endpoint/add/[id].js +3 -0
  15. package/commands/endpoint/add/[id].ts +3 -0
  16. package/commands/endpoint/list.js +3 -0
  17. package/commands/endpoint/list.ts +3 -0
  18. package/commands/endpoint/remove/[id].js +3 -0
  19. package/commands/endpoint/remove/[id].ts +3 -0
  20. package/lib/client.d.ts +12 -0
  21. package/lib/client.js +2 -0
  22. package/lib/dingtalk-endpoint-commands.d.ts +1 -0
  23. package/lib/dingtalk-endpoint-commands.js +18 -0
  24. package/lib/dingtalk-runtime-state.d.ts +1 -0
  25. package/lib/dingtalk-runtime-state.js +6 -0
  26. package/lib/endpoint.d.ts +72 -0
  27. package/lib/endpoint.js +353 -0
  28. package/lib/index.d.ts +5 -15
  29. package/lib/index.js +5 -214
  30. package/lib/platform-permit.d.ts +14 -0
  31. package/lib/platform-permit.js +33 -0
  32. package/lib/protocol.d.ts +134 -0
  33. package/lib/protocol.js +265 -0
  34. package/lib/webhook.d.ts +13 -0
  35. package/lib/webhook.js +47 -0
  36. package/package.json +64 -18
  37. package/plugin.js +19 -0
  38. package/schema.json +92 -0
  39. package/src/client.ts +16 -0
  40. package/src/dingtalk-endpoint-commands.ts +19 -0
  41. package/src/dingtalk-runtime-state.ts +7 -0
  42. package/src/endpoint.ts +439 -0
  43. package/src/index.ts +44 -228
  44. package/src/platform-permit.ts +48 -0
  45. package/src/protocol.ts +385 -0
  46. package/src/webhook.ts +75 -0
  47. package/lib/adapter.d.ts +0 -16
  48. package/lib/adapter.d.ts.map +0 -1
  49. package/lib/adapter.js +0 -37
  50. package/lib/adapter.js.map +0 -1
  51. package/lib/bot.d.ts +0 -46
  52. package/lib/bot.d.ts.map +0 -1
  53. package/lib/bot.js +0 -539
  54. package/lib/bot.js.map +0 -1
  55. package/lib/index.d.ts.map +0 -1
  56. package/lib/index.js.map +0 -1
  57. package/lib/types.d.ts +0 -58
  58. package/lib/types.d.ts.map +0 -1
  59. package/lib/types.js +0 -5
  60. package/lib/types.js.map +0 -1
  61. package/plugin.yml +0 -3
  62. package/src/adapter.ts +0 -44
  63. package/src/bot.ts +0 -590
  64. package/src/types.ts +0 -56
  65. /package/{skills/dingtalk/SKILL.md → agent/skills/dingtalk.md} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,626 @@
1
1
  # @zhin.js/adapter-dingtalk
2
2
 
3
+ ## 1.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 1fc6270: Reset all 88 published official packages onto the owner-governed 1.1.x stable line. Packages whose historical 1.1.0 version is still available publish as 1.1.0; packages where npm permanently reserves that version use the next available 1.1.x patch. Historical higher version lines remain installable but are superseded, and routine releases after this reset are patch-only.
8
+
9
+ ### Patch Changes
10
+
11
+ - a34bf91: Publish internal peer dependencies as compatible caret ranges instead of exact versions, preventing compatible internal minor releases from forcing unrelated major bumps.
12
+ - Updated dependencies [1fc6270]
13
+ - @zhin.js/adapter@1.1.12
14
+ - @zhin.js/core@1.1.35
15
+ - @zhin.js/feature-kit@1.1.0
16
+ - @zhin.js/host-http@1.1.0
17
+ - @zhin.js/im-contract@1.1.0
18
+ - @zhin.js/logger@1.1.0
19
+
20
+ ## 8.0.1
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies [f7ee28d]
25
+ - @zhin.js/adapter@1.2.2
26
+ - @zhin.js/core@1.5.16
27
+ - zhin.js@7.0.1
28
+ - @zhin.js/agent@1.2.1
29
+
30
+ ## 8.0.0
31
+
32
+ ### Patch Changes
33
+
34
+ - Updated dependencies [12325e1]
35
+ - Updated dependencies [d19e976]
36
+ - @zhin.js/agent@1.2.0
37
+ - zhin.js@7.0.0
38
+
39
+ ## 7.0.8
40
+
41
+ ### Patch Changes
42
+
43
+ - Updated dependencies [a728a20]
44
+ - @zhin.js/host-http@1.0.17
45
+ - @zhin.js/agent@1.1.22
46
+ - zhin.js@6.0.15
47
+
48
+ ## 7.0.7
49
+
50
+ ### Patch Changes
51
+
52
+ - Updated dependencies [337fd05]
53
+ - @zhin.js/agent@1.1.21
54
+ - zhin.js@6.0.15
55
+
56
+ ## 7.0.6
57
+
58
+ ### Patch Changes
59
+
60
+ - Updated dependencies [fcbff21]
61
+ - @zhin.js/host-http@1.0.16
62
+ - zhin.js@6.0.15
63
+
64
+ ## 7.0.5
65
+
66
+ ### Patch Changes
67
+
68
+ - Updated dependencies [882a08a]
69
+ - @zhin.js/agent@1.1.20
70
+ - zhin.js@6.0.15
71
+ - @zhin.js/core@1.5.15
72
+
73
+ ## 7.0.4
74
+
75
+ ### Patch Changes
76
+
77
+ - Updated dependencies [d85eddd]
78
+ - @zhin.js/agent@1.1.19
79
+ - @zhin.js/host-http@1.0.15
80
+ - @zhin.js/core@1.5.15
81
+ - zhin.js@6.0.15
82
+
83
+ ## 7.0.3
84
+
85
+ ### Patch Changes
86
+
87
+ - Updated dependencies [a5ee497]
88
+ - Updated dependencies [a5ee497]
89
+ - Updated dependencies [ba7e17a]
90
+ - Updated dependencies [7108d0b]
91
+ - @zhin.js/agent@1.1.18
92
+ - @zhin.js/host-http@1.0.14
93
+ - @zhin.js/core@1.5.15
94
+ - zhin.js@6.0.15
95
+
96
+ ## 7.0.2
97
+
98
+ ### Patch Changes
99
+
100
+ - Updated dependencies [736fa04]
101
+ - @zhin.js/agent@1.1.17
102
+ - zhin.js@6.0.14
103
+
104
+ ## 7.0.1
105
+
106
+ ### Patch Changes
107
+
108
+ - 1fc78bc: Unify native platform Client access behind the literal `adapter` discriminant. Handlers infer both native events and Clients, while command, inbound/outbound middleware, and both Agent tool authoring surfaces expose the exact operation-scoped Client through a lazy `$client` getter. Definitions without `adapter` keep `$client` typed as `unknown`, and runtime dispatch rejects adapter mismatches before resolving the Client. Bundled platform tools now use this single path instead of model-provided endpoint ids and adapter-specific dependency wrappers. Every adapter registers one Client/EventMap contract, and protocol adapters including NapCat, Milky, OneBot and Satori now produce transport-independent Client objects rather than letting Endpoint instances impersonate Clients.
109
+ - Updated dependencies [e9c6a73]
110
+ - Updated dependencies [4e8117c]
111
+ - Updated dependencies [902fa35]
112
+ - Updated dependencies [54bfd6b]
113
+ - Updated dependencies [12025ee]
114
+ - Updated dependencies [09b14d6]
115
+ - Updated dependencies [1fc78bc]
116
+ - @zhin.js/agent@1.1.16
117
+ - @zhin.js/adapter@1.2.1
118
+ - @zhin.js/core@1.5.14
119
+ - @zhin.js/host-http@1.0.13
120
+ - @zhin.js/command@1.0.16
121
+ - @zhin.js/logger@1.0.77
122
+ - zhin.js@6.0.14
123
+ - @zhin.js/feature-kit@1.0.13
124
+ - @zhin.js/permission@1.0.4
125
+
126
+ ## 7.0.0
127
+
128
+ ### Patch Changes
129
+
130
+ - Updated dependencies [b10d058]
131
+ - Updated dependencies [f2c532f]
132
+ - Updated dependencies [3dbf990]
133
+ - @zhin.js/host-http@1.0.12
134
+ - @zhin.js/adapter@1.2.0
135
+ - @zhin.js/core@1.5.13
136
+ - @zhin.js/agent@1.1.15
137
+ - zhin.js@6.0.13
138
+
139
+ ## 6.0.14
140
+
141
+ ### Patch Changes
142
+
143
+ - 974772e: Replace the user-facing `Prompt` vocabulary with the `UserInteraction` authoring surface for input, confirmation, and selection. Commands and handlers now expose `interaction`; IM Runtime exposes `createInteraction`; schema-driven endpoint collection is named `SchemaInteraction`. The old prompt-named interaction types and properties are removed rather than aliased. User interactions render through one canonical Markdown and keyboard/list presentation module shared by commands and Agent `ask_user` turns.
144
+
145
+ Extract the transport-neutral interaction contract into `@zhin.js/interaction`. A discriminated `ask()` API supports text, number, confirmation, single-select, multi-select, and typed lists with structured `title`, `description`, and `tip` content. Typed `sequence()` interactions return one result object keyed by step id, render progress, and retry invalid replies without leaking invalid values to callers.
146
+
147
+ Preserve AI Markdown and card command actions through outbound publishing. QQ delivers Markdown with native command buttons; KOOK, Discord, Telegram, DingTalk, and Lark/Feishu now declare and encode their native Markdown dialects while retaining each adapter's interaction policy. Correct QQ callback button action encoding and button style mapping.
148
+
149
+ - 5969c5b: Add SideEventGateway so adapters forward notice/request/system into HandlerIndex. HandlerContext now exposes only generation-safe capabilities and prompt ports; live Endpoint escape hatches are removed.
150
+ - Updated dependencies [5969c5b]
151
+ - Updated dependencies [d336a3f]
152
+ - Updated dependencies [0c82a7e]
153
+ - Updated dependencies [b9217e4]
154
+ - Updated dependencies [5969c5b]
155
+ - Updated dependencies [5969c5b]
156
+ - Updated dependencies [974772e]
157
+ - Updated dependencies [5969c5b]
158
+ - Updated dependencies [5969c5b]
159
+ - Updated dependencies [2f786bd]
160
+ - Updated dependencies [63d89f9]
161
+ - Updated dependencies [71c7cdd]
162
+ - Updated dependencies [3cca0ea]
163
+ - Updated dependencies [1312ca0]
164
+ - Updated dependencies [985fa22]
165
+ - Updated dependencies [04b861d]
166
+ - Updated dependencies [a23d544]
167
+ - Updated dependencies [8cddabf]
168
+ - Updated dependencies [dbe5081]
169
+ - @zhin.js/im-contract@1.0.4
170
+ - @zhin.js/core@1.5.12
171
+ - @zhin.js/adapter@1.1.11
172
+ - @zhin.js/agent@1.1.14
173
+ - @zhin.js/host-http@1.0.11
174
+ - @zhin.js/command@1.0.15
175
+ - zhin.js@6.0.12
176
+ - @zhin.js/permission@1.0.3
177
+
178
+ ## 6.0.13
179
+
180
+ ### Patch Changes
181
+
182
+ - @zhin.js/core@1.5.11
183
+ - @zhin.js/agent@1.1.13
184
+ - zhin.js@6.0.11
185
+
186
+ ## 6.0.12
187
+
188
+ ### Patch Changes
189
+
190
+ - 3556601: Declare Stable Feature packages referenced by `zhin.features` as optional `peerDependencies` on official plugins/adapters (`@zhin.js/runtime` ≥1.0.12 requires features to be declared in deps/peers). Keeps authoring via `zhin.js` facades without installing Feature implementation packages into `dependencies`, and removes the need for consumer postinstall peer-patch scripts. `zhin new` scaffolds the same peer shape.
191
+ - @zhin.js/agent@1.1.12
192
+ - @zhin.js/core@1.5.10
193
+ - zhin.js@6.0.10
194
+
195
+ ## 6.0.11
196
+
197
+ ### Patch Changes
198
+
199
+ - eb84b77: fix: 更新文档,建立正确的依赖关系
200
+ - Updated dependencies [d3920e9]
201
+ - @zhin.js/core@1.5.10
202
+ - zhin.js@6.0.10
203
+ - @zhin.js/adapter@1.1.10
204
+ - @zhin.js/agent@1.1.11
205
+
206
+ ## 6.0.10
207
+
208
+ ### Patch Changes
209
+
210
+ - Updated dependencies [e4757a8]
211
+ - Updated dependencies [c3c0ebf]
212
+ - @zhin.js/command@1.0.13
213
+ - @zhin.js/host-http@1.0.10
214
+ - @zhin.js/agent@1.1.10
215
+ - @zhin.js/core@1.5.9
216
+ - @zhin.js/adapter@1.1.9
217
+ - zhin.js@6.0.9
218
+
219
+ ## 6.0.9
220
+
221
+ ### Patch Changes
222
+
223
+ - Updated dependencies [63253bb]
224
+ - Updated dependencies [6fb24dd]
225
+ - Updated dependencies [d162216]
226
+ - Updated dependencies [7427818]
227
+ - Updated dependencies [90da255]
228
+ - Updated dependencies [8e973dc]
229
+ - Updated dependencies [953cfe1]
230
+ - Updated dependencies [0e73866]
231
+ - @zhin.js/plugin-runtime@1.1.6
232
+ - @zhin.js/core@1.5.8
233
+ - @zhin.js/adapter@1.1.8
234
+ - @zhin.js/host-http@1.0.9
235
+ - @zhin.js/agent@1.1.9
236
+ - zhin.js@6.0.8
237
+ - @zhin.js/command@1.0.12
238
+ - @zhin.js/permission@1.0.2
239
+
240
+ ## 6.0.8
241
+
242
+ ### Patch Changes
243
+
244
+ - Updated dependencies [36cb1ca]
245
+ - @zhin.js/core@1.5.7
246
+ - @zhin.js/agent@1.1.8
247
+ - zhin.js@6.0.7
248
+
249
+ ## 6.0.7
250
+
251
+ ### Patch Changes
252
+
253
+ - Updated dependencies [7945544]
254
+ - @zhin.js/command@1.0.11
255
+ - @zhin.js/agent@1.1.7
256
+ - @zhin.js/adapter@1.1.7
257
+ - @zhin.js/core@1.5.6
258
+ - zhin.js@6.0.6
259
+
260
+ ## 6.0.6
261
+
262
+ ### Patch Changes
263
+
264
+ - Updated dependencies [2d0a622]
265
+ - @zhin.js/command@1.0.10
266
+ - @zhin.js/adapter@1.1.7
267
+ - @zhin.js/core@1.5.5
268
+ - @zhin.js/agent@1.1.6
269
+ - zhin.js@6.0.5
270
+
271
+ ## 6.0.5
272
+
273
+ ### Patch Changes
274
+
275
+ - 51015d6: refactor(adapters): migrate platform-permit to PermissionSubject
276
+
277
+ All adapter platform-permit checkers now accept PermissionSubject
278
+ (duck-typed from Message/CommandSession) instead of Message directly.
279
+ registerPlatformPermitChecker is replaced by host.registerPlatform in
280
+ the adapter plugin setup. activity-feedback service updated for new
281
+ PermissionHost integration.
282
+
283
+ - Updated dependencies [6f9c366]
284
+ - Updated dependencies [373a56b]
285
+ - Updated dependencies [0de46a8]
286
+ - Updated dependencies [c106ecc]
287
+ - Updated dependencies [ca92e03]
288
+ - Updated dependencies [b0f37ae]
289
+ - Updated dependencies [ba08a2f]
290
+ - Updated dependencies [b08f7fe]
291
+ - Updated dependencies [daffd4c]
292
+ - Updated dependencies [36c7400]
293
+ - Updated dependencies [a9fa72e]
294
+ - Updated dependencies [c8de3ef]
295
+ - Updated dependencies [60f0fc8]
296
+ - Updated dependencies [574c990]
297
+ - Updated dependencies [d096f16]
298
+ - Updated dependencies [3f29623]
299
+ - Updated dependencies [2916852]
300
+ - Updated dependencies [d047869]
301
+ - Updated dependencies [162fa34]
302
+ - Updated dependencies [e62561e]
303
+ - Updated dependencies [3eeeb46]
304
+ - Updated dependencies [85d0f82]
305
+ - Updated dependencies [61bfc1c]
306
+ - Updated dependencies [04bad47]
307
+ - Updated dependencies [e40b048]
308
+ - Updated dependencies [5a5b1bb]
309
+ - Updated dependencies [f1708c3]
310
+ - Updated dependencies [d254a81]
311
+ - Updated dependencies [7123c47]
312
+ - Updated dependencies [05befc1]
313
+ - Updated dependencies [0663b6a]
314
+ - Updated dependencies [f28f9b3]
315
+ - Updated dependencies [9f340f7]
316
+ - Updated dependencies [e53444f]
317
+ - Updated dependencies [5eedd26]
318
+ - Updated dependencies [92b0dd7]
319
+ - Updated dependencies [f919b6f]
320
+ - Updated dependencies [098e411]
321
+ - Updated dependencies [e1b7c01]
322
+ - Updated dependencies [9b94f87]
323
+ - Updated dependencies [a7df753]
324
+ - @zhin.js/agent@1.1.5
325
+ - @zhin.js/host-http@1.0.8
326
+ - @zhin.js/permission@1.0.1
327
+ - @zhin.js/im-contract@1.0.3
328
+ - @zhin.js/adapter@1.1.7
329
+ - @zhin.js/plugin-runtime@1.1.5
330
+ - @zhin.js/command@1.0.9
331
+ - @zhin.js/core@1.5.4
332
+ - zhin.js@6.0.4
333
+
334
+ ## 6.0.4
335
+
336
+ ### Patch Changes
337
+
338
+ - f8c7a54: fix: im
339
+ - Updated dependencies [f8c7a54]
340
+ - @zhin.js/logger@1.0.76
341
+ - @zhin.js/host-http@1.0.7
342
+ - @zhin.js/adapter@1.1.6
343
+ - @zhin.js/agent@1.1.4
344
+ - @zhin.js/command@1.0.8
345
+ - @zhin.js/core@1.5.3
346
+ - @zhin.js/im-contract@1.0.2
347
+ - @zhin.js/plugin-runtime@1.1.4
348
+ - zhin.js@6.0.3
349
+
350
+ ## 6.0.3
351
+
352
+ ### Patch Changes
353
+
354
+ - Updated dependencies [afc0e66]
355
+ - Updated dependencies [2e41ad5]
356
+ - Updated dependencies [9f57124]
357
+ - @zhin.js/core@1.5.2
358
+ - @zhin.js/adapter@1.1.5
359
+ - @zhin.js/im-contract@1.0.1
360
+ - @zhin.js/plugin-runtime@1.1.3
361
+ - @zhin.js/command@1.0.7
362
+ - @zhin.js/host-http@1.0.6
363
+ - @zhin.js/agent@1.1.3
364
+ - zhin.js@6.0.2
365
+
366
+ ## 6.0.2
367
+
368
+ ### Patch Changes
369
+
370
+ - Updated dependencies [696ab1b]
371
+ - @zhin.js/agent@1.1.2
372
+ - zhin.js@6.0.1
373
+
374
+ ## 6.0.1
375
+
376
+ ### Patch Changes
377
+
378
+ - Updated dependencies [c8f4d45]
379
+ - @zhin.js/plugin-runtime@1.1.2
380
+ - @zhin.js/host-http@1.0.5
381
+ - @zhin.js/adapter@1.1.4
382
+ - @zhin.js/agent@1.1.1
383
+ - @zhin.js/command@1.0.6
384
+ - @zhin.js/core@1.5.1
385
+ - zhin.js@6.0.1
386
+
387
+ ## 6.0.0
388
+
389
+ ### Patch Changes
390
+
391
+ - 4fbff5d: feat!: 多模态双向 Segment 一贯制(BREAKING,无兼容层)
392
+
393
+ 全框架唯一媒体表达统一为 canonical `Segment` + `MediaRef{kind: url|path|base64|file, value, mime_type?, file_name?, size?}`,新增 audio/video/file 段类型;所有第二形状(legacy `data.url/file/base64` 字段、`mediaRefFromLegacyData`/`mediaRefToLegacyFields` 桥、双写)全部删除。
394
+
395
+ - **core**:`SendContent` 一等支持 `Segment[]`;endpoint 出站载荷只含 canonical 段;`resolveOutboundMediaPolicy` 改为纯声明驱动(adapter definition `segments.outboundMedia`),内置策略表删除,未声明回退 `url-or-text`;`ImageContent` 旧桥删除。
396
+ - **ai**:新增 `MediaContentBlock`/`MediaBlockRef`(Segment 同构)与 `UserMessage.media`(当前 turn 媒体,**不持久化**——存储层自动剥离);`createUserMessage(text, media?)` 签名变更(`ImageContent` 删除);provider 边界序列化器 `filterMediaBlocksForProvider` + 能力表(缺省 image-only,不支持类型降级占位文本);ai-sdk 桥媒体块 → SDK image/file parts。
397
+ - **agent**:入站 turn 注入(`turn/inbound-media.ts`)——commMessage 媒体段 → 当前 turn `UserMessage.media`;图片 path 物化、音频默认 STT(`@zhin.js/speech` 可选,失败降级占位)、视频/文件占位;`publishOutboundElements` 产出 canonical Segment;`transcribeAudioPayload` 导出。
398
+ - **cli**:`bridgeRuntimeMessage` 回复链路媒体段透传,不再压平为文本(`$reply` 直达 normalize → adapter)。
399
+ - **全部 20 个平台适配器**:出站媒体只消费 `data.media`(url 直发 / base64 直发 / 平台上传 / 读盘),入站媒体产出 canonical `data.media`;`segments.outboundMedia` 声明与实际消费逐一核对修正;QQ 入站新增 canonical segments(image/audio/video/file/mention/face/reply),图片/语音/视频不再丢失。
400
+
401
+ 迁移:适配器/插件产媒体一律用 `{ type, data: { media: MediaRef } }`;发送 legacy `data.url/file/base64` 形状的段会被 warn 丢弃。
402
+
403
+ - Updated dependencies [7c1e63a]
404
+ - Updated dependencies [4fbff5d]
405
+ - Updated dependencies [5b94d9c]
406
+ - @zhin.js/command@1.0.5
407
+ - @zhin.js/adapter@1.1.3
408
+ - @zhin.js/core@1.5.0
409
+ - @zhin.js/agent@1.1.0
410
+ - zhin.js@6.0.0
411
+
412
+ ## 5.0.5
413
+
414
+ ### Patch Changes
415
+
416
+ - Updated dependencies [d8bf702]
417
+ - @zhin.js/host-http@1.0.4
418
+ - @zhin.js/agent@1.0.10
419
+ - @zhin.js/core@1.4.3
420
+ - zhin.js@5.0.3
421
+
422
+ ## 5.0.4
423
+
424
+ ### Patch Changes
425
+
426
+ - Updated dependencies [45b3256]
427
+ - @zhin.js/core@1.4.3
428
+ - @zhin.js/agent@1.0.9
429
+ - zhin.js@5.0.3
430
+
431
+ ## 5.0.3
432
+
433
+ ### Patch Changes
434
+
435
+ - Updated dependencies [f346346]
436
+ - @zhin.js/agent@1.0.8
437
+ - @zhin.js/core@1.4.2
438
+ - zhin.js@5.0.2
439
+
440
+ ## 5.0.2
441
+
442
+ ### Patch Changes
443
+
444
+ - d5cd4aa: Publish Plugin Runtime entry points and convention modules as JavaScript so
445
+ installed npm plugins load on Node without TypeScript stripping. Workspace
446
+ development continues to prefer TypeScript sources for local HMR.
447
+
448
+ Remove the unconsumed legacy game hub APIs from game-kit; game navigation and
449
+ records now use ordinary convention commands owned by the game hub plugin.
450
+
451
+ - Updated dependencies [d5cd4aa]
452
+ - @zhin.js/command@1.0.4
453
+ - zhin.js@5.0.2
454
+ - @zhin.js/adapter@1.1.2
455
+ - @zhin.js/core@1.4.2
456
+ - @zhin.js/agent@1.0.7
457
+
458
+ ## 5.0.1
459
+
460
+ ### Patch Changes
461
+
462
+ - cdf64e7: 多方向审计修复批(8 面 30+ bug):
463
+
464
+ - **安全**:钉钉 webhook 验签绕过修复(缺 timestamp/sign 一律 403 + ±1h 防重放);exec-policy fail-closed(换行/`$(`/反引号拒绝、管道逐段过白名单、env dump 复合拆段);wecom 验签改 timingSafeEqual;config:set 拒绝 `__proto__` 等魔术键、host 键优先防覆写。
465
+ - **P0 功能**:`zhin packages` scoped 包名解析为空导致 rm -rf 风险;命令数字参数解析失败炸断消息链路(dispatch 捕获 continue);TaskQueue 监听器首个事件自摘除导致 assistant 队列挂死(+超时后完成不覆盖终态);DatabaseHost 跨世代共享崩溃(define 幂等 + stop 改进程级);rss 按不存在 id 列删除改业务键。
466
+ - **Runtime/HMR**:native watcher 过滤忽略目录(lib/.zhin 不再触发重载风暴);host 段配置 patch(http.port 等)存在 installResources 时全量重建;capability 目录非 entry 支持文件升级进程重启;documentTransaction 失败回滚。
467
+ - **CLI 写侧**:config/setup 对 toml 静默假成功改统一 config-file(不支持格式报错);doctor/onboard 默认配置改新形态 plugins 映射;schedule add 改 --prompt;migrate engines/中文模板误伤/覆盖前备份。
468
+ - **适配器生命周期**:napcat/milky start 失败竞态与僵尸连接、心跳 close 清理、stop-during-connect settle;slack webhook 二次 writeHead + messageChannelMap LRU。
469
+ - **Host/向导**:logs/stats 与 inbox 查询改 DB 侧 count/orderBy/limit 下推;save-yaml 写入前校验;zhipu/moonshot baseUrl 必填预填;.env 写入转义 + 幂等合并;setup 数据库密码不再明文落 config;60s fetch 超时与 JSON 守卫。
470
+
471
+ - 74b035c: endpoint 管理命令扩展至 18/20 适配器:kook / discord / github(private_key 支持内联文件路径)/ icqq(bindFlow 登记式 add + `icqq login` 引导)/ dingtalk / lark / line / satori / wechat-mp / wecom / weixin-ilink 接入 `endpoint list/add/remove`(字段对齐各自 schema,凭据写 `.env`)。email(smtp/imap 嵌套对象)与 sandbox(无凭据)暂不接。
472
+ - Updated dependencies [cdf64e7]
473
+ - Updated dependencies [2d0a159]
474
+ - Updated dependencies [5691aba]
475
+ - Updated dependencies [078e3f7]
476
+ - Updated dependencies [50497a5]
477
+ - Updated dependencies [9c997b2]
478
+ - Updated dependencies [09d4f25]
479
+ - Updated dependencies [43485a9]
480
+ - Updated dependencies [f0ec5ab]
481
+ - Updated dependencies [3e925d0]
482
+ - Updated dependencies [fa66c4c]
483
+ - Updated dependencies [fa66c4c]
484
+ - Updated dependencies [6cb6152]
485
+ - @zhin.js/command@1.0.3
486
+ - @zhin.js/agent@1.0.6
487
+ - @zhin.js/plugin-runtime@1.1.1
488
+ - @zhin.js/host-http@1.0.3
489
+ - zhin.js@5.0.1
490
+ - @zhin.js/adapter@1.1.1
491
+ - @zhin.js/core@1.4.1
492
+
493
+ ## 5.0.0
494
+
495
+ ### Patch Changes
496
+
497
+ - 7db69c1: 命令前缀改为适配器配置项:`MessageDispatcher` 不再硬编码 `/`,默认按消息所属适配器实例 config 的 `commandPrefix` 解析(默认 `''` 无前缀,任意文本按命令匹配),`endpoints[i].commandPrefix` 逐项覆盖;`ImRuntime({ commandPrefix })` 仍可设全局静态前缀。全部 20 个平台适配器 schema 新增 `commandPrefix` 属性。
498
+
499
+ BREAKING(行为变化):未配置时命令不再需要 `/` 前缀——原 `/zt` 写法不再命中,直接发 `zt` 即可;需要斜杠风格的适配器请在配置里显式设 `commandPrefix: '/'`。
500
+
501
+ - 713445c: 适配器配置格式定稿(不兼容旧格式):`plugins.<adapter>` 顶层仅共享字段 + `commandPrefix`,`endpoints[i]` 携带 endpoint 级字段(`name` + 凭据,各 schema 已类型化),`endpoints` 为必填(icqq 另需顶层 `master`);icqq 新增 `trusted` 列表(顶层/逐项均可)。scaffold-wizard 全部字段式与自定义 configure() 产出改为新格式,examples(full-bot / qq-games-bot)与 20 个适配器 README 同步迁移。
502
+ - Updated dependencies [7db69c1]
503
+ - Updated dependencies [e5c84ed]
504
+ - Updated dependencies [3ea84a0]
505
+ - Updated dependencies [1ddcd70]
506
+ - Updated dependencies [ac9da66]
507
+ - @zhin.js/core@1.4.0
508
+ - @zhin.js/adapter@1.1.0
509
+ - @zhin.js/plugin-runtime@1.1.0
510
+ - @zhin.js/agent@1.0.5
511
+ - @zhin.js/host-http@1.0.2
512
+ - zhin.js@5.0.0
513
+
514
+ ## 4.0.3
515
+
516
+ ### Patch Changes
517
+
518
+ - cc5c94d: 约定式插件运行时迁移(breaking):插件与适配器由 `usePlugin()` / `extends Adapter` 迁移为 `definePlugin` / `defineAdapter` + `plugin.ts` + 约定目录(`adapters/`、`commands/`、`components/`、`tools/` 等)。
519
+
520
+ - 新增约定式运行时包:`@zhin.js/plugin-runtime`、`@zhin.js/adapter`、`@zhin.js/runtime`、`@zhin.js/host-http`(首版 1.0.0 走 init-publish,不在本 changeset 内 bump)。
521
+ - 全部 20 个平台适配器改为约定式 `defineAdapter`,旧 `usePlugin` / `extends Adapter` / `segment-mapper` 生产入口已删除;onebot11 反向 WSS、onebot12 webhook/wss、milky sse/webhook/wss、satori webhook、kook webhook、qq webhook/middleware 等 slice 1 推迟的连接模式已补齐。
522
+ - 游戏 / 工具 / 服务插件同步迁移到约定目录结构。
523
+ - CLI 增加 plugin-runtime host installer(http/database/outbound/schedule/console 等)。
524
+
525
+ 后续加固(同批):
526
+
527
+ - CLI:`zhin runtime start --daemon`(pidfile/崩溃拉起/风暴保护),orphan watchdog 防僵尸进程;legacy `zhin dev` / `zhin start` 已移除(含 `zhin restart`),`zhin stop` 兼容新 daemon。
528
+ - 安全:builtin 工具统一走 `security/policy-facade.ts` 的 `runToolPolicies`(声明式策略表,deny 优先);审计日志 close flush + 背压队列;`splitCompoundCommand` 引号感知、`extractCommandName` 去引号堵绕过。
529
+ - 日志:Logger 双堆栈修复、本地时区、`getLogger` 挂树(`setLevel` 递归生效)、第三方库(log4js/discord)桥接、启动人读总结。
530
+ - 结构:`plugins/games/shared` 迁为 `packages/game-kit`(`@zhin.js/game-kit`);死目录 `plugins/adapters/common` 删除。
531
+ - 脚手架:`create-zhin-app` / `zhin new` / scaffold-wizard 生成物改为 Plugin Runtime 形态(minimal-bot 同构,新配置格式)。
532
+ - Console:endpoint.list 真实名称与 phase、schema:get-all 按 instanceKey 映射、db:\* 接 DatabaseHost。
533
+
534
+ 注:按仓库发布惯例(见 1bb345dd2),本次 breaking 迁移统一使用 patch,避免 zhin.js 5.0 级联。
535
+
536
+ - 447f3e2: 迁移缺口修复(legacy 功能对齐):
537
+
538
+ - html 段出站规范化:经 `@zhin.js/html-renderer` 渲染为 image 段(sandbox 豁免、无渲染器时降级文本),修复真实平台 `[object Object]`。
539
+ - 群聊 @ 触发 AI:适配器入站标注 `metadata.mentioned`(icqq/qq/slack/onebot11/onebot12/napcat/milky/discord/telegram/kook/dingtalk/satori),`matchAiTrigger` 补齐 ignorePrefixes/respondToAt/respondToPrivate/keywords(默认值与 legacy 对齐)。
540
+ - im_transcripts 全量流水恢复写入(chat_history 工具可用);群聊旁听上下文回迁。
541
+ - `ai.trigger.timeout/thinkingMessage/errorTemplate` 生效;masters/trusted 角色解析对齐 legacy。
542
+ - `Message.sender` 统一为用户 ID(onebot11/12、napcat、milky 原误传显示名);quote_id 经 metadata 接入 AI 引用上下文。
543
+
544
+ - Updated dependencies [16ec4e8]
545
+ - Updated dependencies [cc5c94d]
546
+ - Updated dependencies [447f3e2]
547
+ - @zhin.js/core@1.3.5
548
+ - @zhin.js/agent@1.0.4
549
+ - @zhin.js/host-http@1.0.1
550
+ - zhin.js@4.1.3
551
+ - @zhin.js/logger@1.0.75
552
+ - @zhin.js/plugin-runtime@1.0.1
553
+ - @zhin.js/adapter@1.0.1
554
+
555
+ ## 4.0.2
556
+
557
+ ### Patch Changes
558
+
559
+ - 872c583: Slack 适配器 Phase 1/2:mrkdwn 出站、长消息切分、斜杠/按钮 ephemeral 反馈、入站 mrkdwn→Markdown、editMessage 对齐 core。
560
+
561
+ Logger 表格日志与 string-width 列宽;Agent AI Handler 框线表格与 introspection/MCP 导出;Core side-event 归一化;Schedule 时区规划;多适配器 side-event 与 API surface 更新。
562
+
563
+ - 872c583: fix: 代码格式优化
564
+ - Updated dependencies [872c583]
565
+ - Updated dependencies [872c583]
566
+ - @zhin.js/agent@1.0.3
567
+ - @zhin.js/host-router@2.0.3
568
+ - zhin.js@4.1.2
569
+
570
+ ## 4.0.1
571
+
572
+ ### Patch Changes
573
+
574
+ - 5cc9c03: fix: ai 优化
575
+ - b9b3881: fix: 增加游戏引擎以及部分游戏
576
+ - Updated dependencies [5cc9c03]
577
+ - Updated dependencies [7700903]
578
+ - @zhin.js/host-router@2.0.2
579
+ - zhin.js@4.1.1
580
+
581
+ ## 4.0.0
582
+
583
+ ### Patch Changes
584
+
585
+ - c4575c9: fix: 输入输出优化,文档优化
586
+ - Updated dependencies [c4575c9]
587
+ - Updated dependencies [c4575c9]
588
+ - @zhin.js/host-router@2.0.1
589
+ - zhin.js@4.1.0
590
+
591
+ ## 3.0.1
592
+
593
+ ### Patch Changes
594
+
595
+ - Updated dependencies [ae5239c]
596
+ - zhin.js@4.0.1
597
+ - @zhin.js/host-router@2.0.0
598
+
599
+ ## 3.0.0
600
+
601
+ ### Patch Changes
602
+
603
+ - zhin.js@3.0.0
604
+ - @zhin.js/host-router@2.0.0
605
+
606
+ ## 2.0.1
607
+
608
+ ### Patch Changes
609
+
610
+ - d8def69: fix: 性能优化
611
+ - 2ef4896: fix: 更新概念 Bot=>Endpoint,已适配后续更多的业务场景;统一角色权限
612
+ - Updated dependencies [d8def69]
613
+ - Updated dependencies [2ef4896]
614
+ - @zhin.js/host-router@1.0.1
615
+ - zhin.js@2.0.1
616
+
617
+ ## 2.0.0
618
+
619
+ ### Patch Changes
620
+
621
+ - zhin.js@2.0.0
622
+ - @zhin.js/host-router@1.0.0
623
+
3
624
  ## 1.0.80
4
625
 
5
626
  ### Patch Changes