@yaoyuanchao/dingtalk 1.4.16 → 1.4.18
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/package.json +1 -1
- package/src/channel.ts +13 -1
- package/src/config-schema.ts +2 -2
package/package.json
CHANGED
package/src/channel.ts
CHANGED
|
@@ -349,6 +349,11 @@ export const dingtalkPlugin = {
|
|
|
349
349
|
|
|
350
350
|
// Handle message actions (sendAttachment, etc.)
|
|
351
351
|
actions: {
|
|
352
|
+
// List supported actions for this channel - SDK uses this to tell agent what's available
|
|
353
|
+
listActions({ cfg }: { cfg: any }) {
|
|
354
|
+
return ['send', 'sendAttachment'];
|
|
355
|
+
},
|
|
356
|
+
|
|
352
357
|
supportsAction({ action }: { action: string }) {
|
|
353
358
|
return action === 'sendAttachment' || action === 'send';
|
|
354
359
|
},
|
|
@@ -422,7 +427,14 @@ export const dingtalkPlugin = {
|
|
|
422
427
|
}
|
|
423
428
|
|
|
424
429
|
console.log(`[dingtalk] sendAttachment success: ${filename}`);
|
|
425
|
-
|
|
430
|
+
// Return format compatible with SDK expectations
|
|
431
|
+
return {
|
|
432
|
+
ok: true,
|
|
433
|
+
channel: 'dingtalk',
|
|
434
|
+
filename,
|
|
435
|
+
// SDK expects content array format for tool results
|
|
436
|
+
content: [{ type: 'text', text: JSON.stringify({ ok: true, filename }) }],
|
|
437
|
+
};
|
|
426
438
|
},
|
|
427
439
|
},
|
|
428
440
|
|
package/src/config-schema.ts
CHANGED
|
@@ -81,8 +81,8 @@ export const dingTalkConfigSchema = z.object({
|
|
|
81
81
|
' - chunk: Split into multiple messages (default, same as official channels)\n' +
|
|
82
82
|
' - file: Convert to .md file and send as attachment'
|
|
83
83
|
),
|
|
84
|
-
longTextThreshold: z.number().int().positive().default(
|
|
85
|
-
.describe('Character threshold for longTextMode=file (default
|
|
84
|
+
longTextThreshold: z.number().int().positive().default(8000).optional()
|
|
85
|
+
.describe('Character threshold for longTextMode=file (default 8000)'),
|
|
86
86
|
}).strict();
|
|
87
87
|
|
|
88
88
|
// 导出配置类型
|