dsh-channel-feishu 0.9.8 → 0.9.9

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/README.md CHANGED
@@ -43,7 +43,7 @@ dsh plugin add dsh-channel-feishu
43
43
 
44
44
  ```bash
45
45
  dsh plugin add https://github.com/Poy-Coder/dsh-channel-feishu
46
- dsh plugin add https://github.com/Poy-Coder/dsh-channel-feishu/releases/download/v0.9.8/dsh-channel-feishu-0.9.8.tgz
46
+ dsh plugin add https://github.com/Poy-Coder/dsh-channel-feishu/releases/download/v0.9.9/dsh-channel-feishu-0.9.9.tgz
47
47
  ```
48
48
 
49
49
  依赖必须用扁平结构装(非 ASCII 目录下 pnpm 的软链会把路径写坏):`pnpm install --node-linker=hoisted`。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-channel-feishu",
3
- "version": "0.9.8",
3
+ "version": "0.9.9",
4
4
  "type": "module",
5
5
  "description": "Feishu/Lark (飞书) channel for DeepSeek Harness: a chat bound to a DSH session, with streaming cards and attachments.",
6
6
  "license": "MIT",
@@ -588,6 +588,10 @@ export async function downloadMessageFile(base, token, messageId, fileKey, fileN
588
588
  const message = event?.message
589
589
  const sender = event?.sender
590
590
  if (!message || !sender) return null
591
+ // The SDK dispatcher hands over the event body, not the envelope, so
592
+ // `header.event_id` is usually absent. `message_id` is stable across
593
+ // redeliveries and is what dedupe needs to survive a restart.
594
+ const dedupeKey = String(event?.header?.event_id ?? event?.event_id ?? message.message_id ?? '')
591
595
  const messageType = String(message.message_type ?? '')
592
596
  const mentions = message.mentions
593
597
  let text = ''
@@ -607,7 +611,7 @@ export async function downloadMessageFile(base, token, messageId, fileKey, fileN
607
611
  if (file.fileKey) files = [file]
608
612
  } else {
609
613
  return {
610
- dedupeKey: String(event?.header?.event_id ?? ''),
614
+ dedupeKey,
611
615
  chatId: String(message.chat_id ?? ''),
612
616
  chatType: String(message.chat_type ?? ''),
613
617
  senderId: String(sender.sender_id?.open_id ?? ''),
@@ -620,7 +624,7 @@ export async function downloadMessageFile(base, token, messageId, fileKey, fileN
620
624
  }
621
625
  }
622
626
  return {
623
- dedupeKey: String(event?.header?.event_id ?? ''),
627
+ dedupeKey,
624
628
  chatId: String(message.chat_id ?? ''),
625
629
  chatType: String(message.chat_type ?? ''),
626
630
  senderId: String(sender.sender_id?.open_id ?? ''),