@yaoyuanchao/dingtalk 1.3.8 → 1.3.10

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaoyuanchao/dingtalk",
3
- "version": "1.3.8",
3
+ "version": "1.3.10",
4
4
  "type": "module",
5
5
  "description": "DingTalk channel plugin for Clawdbot with Stream Mode support",
6
6
  "license": "MIT",
package/src/card-api.ts CHANGED
@@ -148,9 +148,13 @@ export async function createCardInstance(
148
148
  cardTemplateId: params.cardTemplateId,
149
149
  outTrackId: params.outTrackId,
150
150
  cardData: params.cardData || { cardParamMap: {} },
151
- callbackType: params.callbackType || "STREAM",
152
151
  };
153
152
 
153
+ // Only add callbackType if specified (not needed for basic cards)
154
+ if (params.callbackType) {
155
+ body.callbackType = params.callbackType;
156
+ }
157
+
154
158
  if (params.robotCode) {
155
159
  body.robotCode = params.robotCode;
156
160
  }
@@ -430,7 +434,7 @@ export async function sendCardMessage(params: {
430
434
  outTrackId,
431
435
  cardData: { cardParamMap: params.cardData },
432
436
  robotCode: params.robotCode,
433
- callbackType: "STREAM",
437
+ // Note: callbackType not needed for basic cards
434
438
  });
435
439
 
436
440
  if (!createResult.success) {
package/src/monitor.ts CHANGED
@@ -771,15 +771,23 @@ async function deliverCardReply(
771
771
  const robotCodeValue = robotCode || clientId;
772
772
 
773
773
  // Prepare card data - use 'content' as the main variable for markdown content
774
+ // For basic cards: only send 'content'
775
+ // For AI streaming cards: also send 'flowStatus' and optionally 'title'
774
776
  const isStreaming = cardConfig.streamingEnabled;
775
777
  const cardData: Record<string, string> = {
776
778
  content: text,
777
- // flowStatus: "0" = streaming, "1" = complete
778
- flowStatus: isStreaming ? "0" : "1",
779
- // title: use configured title, or "完成" for non-streaming mode
780
- title: cardConfig.title || (isStreaming ? "" : "完成"),
781
779
  };
782
780
 
781
+ // Only add flowStatus for streaming cards (AI cards)
782
+ if (isStreaming) {
783
+ cardData.flowStatus = "0"; // "0" = streaming in progress
784
+ }
785
+
786
+ // Only add title if explicitly configured
787
+ if (cardConfig.title) {
788
+ cardData.title = cardConfig.title;
789
+ }
790
+
783
791
  log?.info?.("[dingtalk-card] Sending card message, templateId=" + cardConfig.templateId);
784
792
 
785
793
  const result = await sendCardMessage({