@openclaw/feishu 2026.5.16-beta.1 → 2026.5.16-beta.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/dist/api.js CHANGED
@@ -2,7 +2,7 @@ import { a as parseFeishuTargetId, i as parseFeishuDirectConversationId, n as bu
2
2
  import { n as createFeishuThreadBindingManager, r as getFeishuThreadBindingManager, t as __testing } from "./thread-bindings-D5kDxq_j.js";
3
3
  import { n as handleFeishuSubagentEnded, r as handleFeishuSubagentSpawning, t as handleFeishuSubagentDeliveryTarget } from "./subagent-hooks-BUPKo9Al.js";
4
4
  import { r as listEnabledFeishuAccounts } from "./accounts-CP4tDW-z.js";
5
- import { a as setFeishuNamedAccountEnabled, i as feishuSetupAdapter, n as feishuSetupWizard, r as runFeishuLogin, t as feishuPlugin } from "./channel-5qZI7SEl.js";
5
+ import { a as setFeishuNamedAccountEnabled, i as feishuSetupAdapter, n as feishuSetupWizard, r as runFeishuLogin, t as feishuPlugin } from "./channel-DLhJC9t0.js";
6
6
  import { t as getFeishuRuntime } from "./runtime-Cc16UY23.js";
7
7
  import { a as jsonToolResult, d as registerFeishuChatTools, f as createFeishuToolClient, m as resolveFeishuToolAccount, n as registerFeishuDriveTools, o as toolExecutionErrorResult, p as resolveAnyEnabledFeishuToolsConfig, s as unknownToolActionResult } from "./drive-Av1h_Lwd.js";
8
8
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, readStringValue } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -1188,7 +1188,7 @@ const meta = {
1188
1188
  aliases: ["lark"],
1189
1189
  order: 70
1190
1190
  };
1191
- const loadFeishuChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-ItaPP5oR.js"), "feishuChannelRuntime");
1191
+ const loadFeishuChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-6Ww4ftMP.js"), "feishuChannelRuntime");
1192
1192
  function toFeishuMessageSendResult(result, kind) {
1193
1193
  const receipt = result.receipt ?? createFeishuSendReceipt({
1194
1194
  messageId: result.messageId,
@@ -2031,7 +2031,7 @@ const feishuPlugin = createChatChannelPlugin({
2031
2031
  })
2032
2032
  }),
2033
2033
  gateway: { startAccount: async (ctx) => {
2034
- const { monitorFeishuProvider } = await import("./monitor-DCbtaaGD.js");
2034
+ const { monitorFeishuProvider } = await import("./monitor-BGTm4U2e.js");
2035
2035
  const account = resolveFeishuRuntimeAccount({
2036
2036
  cfg: ctx.cfg,
2037
2037
  accountId: ctx.accountId
@@ -1,2 +1,2 @@
1
- import { t as feishuPlugin } from "./channel-5qZI7SEl.js";
1
+ import { t as feishuPlugin } from "./channel-DLhJC9t0.js";
2
2
  export { feishuPlugin };
@@ -1,9 +1,9 @@
1
1
  import { o as resolveFeishuAccount, s as resolveFeishuRuntimeAccount, y as parseFeishuCommentTarget } from "./accounts-CP4tDW-z.js";
2
- import { g as listFeishuDirectoryPeers, h as listFeishuDirectoryGroups, v as createFeishuCardInteractionEnvelope } from "./channel-5qZI7SEl.js";
2
+ import { g as listFeishuDirectoryPeers, h as listFeishuDirectoryGroups, v as createFeishuCardInteractionEnvelope } from "./channel-DLhJC9t0.js";
3
3
  import { r as createFeishuClient } from "./client-B18oTGHf.js";
4
4
  import { c as getChatInfo, l as getChatMembers, r as cleanupAmbientCommentTypingReaction, t as deliverCommentThreadText, u as getFeishuMemberInfo } from "./drive-Av1h_Lwd.js";
5
5
  import { chunkTextForOutbound } from "./runtime-api.js";
6
- import { a as sendCardFeishu, c as sendStructuredCardFeishu, g as shouldSuppressFeishuTextForVoiceMedia, h as sendMediaFeishu, i as resolveFeishuCardTemplate, n as getMessageFeishu, o as sendMarkdownCardFeishu, s as sendMessageFeishu, t as editMessageFeishu } from "./send-Br7R_DPr.js";
6
+ import { a as sendCardFeishu, c as sendStructuredCardFeishu, g as shouldSuppressFeishuTextForVoiceMedia, h as sendMediaFeishu, i as resolveFeishuCardTemplate, n as getMessageFeishu, o as sendMarkdownCardFeishu, s as sendMessageFeishu, t as editMessageFeishu } from "./send-Csj0slBG.js";
7
7
  import { t as probeFeishu } from "./probe-DpPNslkb.js";
8
8
  import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
9
9
  import { interactiveReplyToPresentation, normalizeInteractiveReply, normalizeMessagePresentation, renderMessagePresentationFallbackText, resolveInteractiveTextFallback } from "openclaw/plugin-sdk/interactive-runtime";
@@ -3,7 +3,7 @@ import { l as fetchBotIdentityForMonitor } from "./monitor.state-D6ByOM5W.js";
3
3
  //#region extensions/feishu/src/monitor.ts
4
4
  let monitorAccountRuntimePromise;
5
5
  async function loadMonitorAccountRuntime() {
6
- monitorAccountRuntimePromise ??= import("./monitor.account-BOwkN120.js");
6
+ monitorAccountRuntimePromise ??= import("./monitor.account-Cn20lZwr.js");
7
7
  return await monitorAccountRuntimePromise;
8
8
  }
9
9
  async function monitorFeishuProvider(opts = {}) {
@@ -2,12 +2,12 @@ import { t as buildFeishuConversationId } from "./conversation-id-Byq1c20x.js";
2
2
  import { i as resolveReceiveIdType } from "./targets-Bb05cFr4.js";
3
3
  import { n as createFeishuThreadBindingManager } from "./thread-bindings-D5kDxq_j.js";
4
4
  import { _ as buildFeishuCommentTarget, f as isRecord$3, h as readString$2, l as encodeQuery, m as parseCommentContentElements, p as normalizeString, s as resolveFeishuRuntimeAccount, u as extractReplyText, v as normalizeCommentFileType } from "./accounts-CP4tDW-z.js";
5
- import { _ as buildFeishuCardActionTextFallback, d as resolveFeishuGroupConfig, f as resolveFeishuGroupConversationIngressAccess, l as hasExplicitFeishuGroupConfig, m as resolveFeishuReplyPolicy, p as resolveFeishuGroupSenderActivationIngressAccess, u as resolveFeishuDmIngressAccess, v as createFeishuCardInteractionEnvelope, y as decodeFeishuCardAction } from "./channel-5qZI7SEl.js";
5
+ import { _ as buildFeishuCardActionTextFallback, d as resolveFeishuGroupConfig, f as resolveFeishuGroupConversationIngressAccess, l as hasExplicitFeishuGroupConfig, m as resolveFeishuReplyPolicy, p as resolveFeishuGroupSenderActivationIngressAccess, u as resolveFeishuDmIngressAccess, v as createFeishuCardInteractionEnvelope, y as decodeFeishuCardAction } from "./channel-DLhJC9t0.js";
6
6
  import { t as getFeishuRuntime } from "./runtime-Cc16UY23.js";
7
7
  import { a as getFeishuUserAgent, i as createFeishuWSClient, n as createEventDispatcher, r as createFeishuClient } from "./client-B18oTGHf.js";
8
8
  import { c as getChatInfo, i as createCommentTypingReactionLifecycle, t as deliverCommentThreadText } from "./drive-Av1h_Lwd.js";
9
9
  import { buildAgentMediaPayload, createReplyPrefixContext, evaluateSupplementalContextVisibility, loadSessionStore, normalizeAgentId as normalizeAgentId$1, resolveChannelContextVisibilityMode, resolveSessionStoreEntry } from "./runtime-api.js";
10
- import { _ as normalizeFeishuExternalKey, a as sendCardFeishu, c as sendStructuredCardFeishu, d as isFeishuBroadcastMention, f as isMentionForwardRequest, g as shouldSuppressFeishuTextForVoiceMedia, h as sendMediaFeishu, i as resolveFeishuCardTemplate, l as parsePostContent, m as saveMessageResourceFeishu, n as getMessageFeishu, p as isFeishuGroupChatType, r as listFeishuThreadMessages, s as sendMessageFeishu, u as extractMentionTargets } from "./send-Br7R_DPr.js";
10
+ import { _ as normalizeFeishuExternalKey, a as sendCardFeishu, c as sendStructuredCardFeishu, d as isFeishuBroadcastMention, f as isMentionForwardRequest, g as shouldSuppressFeishuTextForVoiceMedia, h as sendMediaFeishu, i as resolveFeishuCardTemplate, l as parsePostContent, m as saveMessageResourceFeishu, n as getMessageFeishu, p as isFeishuGroupChatType, r as listFeishuThreadMessages, s as sendMessageFeishu, u as extractMentionTargets } from "./send-Csj0slBG.js";
11
11
  import { i as waitForAbortableDelay, r as raceWithTimeoutAndAbort } from "./probe-DpPNslkb.js";
12
12
  import { a as feishuWebhookRateLimiter, c as wsClients, i as botOpenIds, l as fetchBotIdentityForMonitor, n as FEISHU_WEBHOOK_MAX_BODY_BYTES, o as httpServers, r as botNames, s as recordWebhookStatus, t as FEISHU_WEBHOOK_BODY_TIMEOUT_MS } from "./monitor.state-D6ByOM5W.js";
13
13
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -753,6 +753,11 @@ function shouldPushStreamingUpdate(previousText, nextText) {
753
753
  if (hasNaturalStreamingBoundary(nextText)) return true;
754
754
  return nextText.length - previousText.length >= STREAMING_SIGNIFICANT_DELTA_CHARS;
755
755
  }
756
+ function resolveStreamingCardAppendContent(previousText, nextText) {
757
+ if (!nextText || nextText === previousText) return "";
758
+ if (!previousText) return nextText;
759
+ return nextText.startsWith(previousText) ? nextText.slice(previousText.length) : nextText;
760
+ }
756
761
  function mergeStreamingText(previousText, nextText) {
757
762
  const previous = typeof previousText === "string" ? previousText : "";
758
763
  const next = typeof nextText === "string" ? nextText : "";
@@ -790,7 +795,7 @@ var FeishuStreamingSession = class {
790
795
  const apiBase = resolveApiBase(this.creds.domain);
791
796
  const elements = [{
792
797
  tag: "markdown",
793
- content: "⏳ Thinking...",
798
+ content: "",
794
799
  element_id: "content"
795
800
  }];
796
801
  if (options?.note) {
@@ -882,34 +887,82 @@ var FeishuStreamingSession = class {
882
887
  messageId: sendRes.data.message_id,
883
888
  sequence: 1,
884
889
  currentText: "",
890
+ sentText: "",
885
891
  hasNote: !!options?.note
886
892
  };
887
893
  this.log?.(`Started streaming: cardId=${cardId}, messageId=${sendRes.data.message_id}`);
888
894
  }
889
895
  async updateCardContent(text, onError) {
890
- if (!this.state) return;
896
+ if (!this.state) return false;
891
897
  const apiBase = resolveApiBase(this.creds.domain);
892
898
  this.state.sequence += 1;
893
- await fetchWithSsrFGuard({
894
- url: `${apiBase}/cardkit/v1/cards/${this.state.cardId}/elements/content/content`,
895
- init: {
896
- method: "PUT",
897
- headers: {
898
- Authorization: `Bearer ${await getToken(this.creds)}`,
899
- "Content-Type": "application/json",
900
- "User-Agent": getFeishuUserAgent()
899
+ try {
900
+ const { response, release } = await fetchWithSsrFGuard({
901
+ url: `${apiBase}/cardkit/v1/cards/${this.state.cardId}/elements/content/content`,
902
+ init: {
903
+ method: "PUT",
904
+ headers: {
905
+ Authorization: `Bearer ${await getToken(this.creds)}`,
906
+ "Content-Type": "application/json",
907
+ "User-Agent": getFeishuUserAgent()
908
+ },
909
+ body: JSON.stringify({
910
+ content: text,
911
+ sequence: this.state.sequence,
912
+ uuid: `s_${this.state.cardId}_${this.state.sequence}`
913
+ })
901
914
  },
902
- body: JSON.stringify({
903
- content: text,
904
- sequence: this.state.sequence,
905
- uuid: `s_${this.state.cardId}_${this.state.sequence}`
906
- })
907
- },
908
- policy: { allowedHostnames: resolveAllowedHostnames(this.creds.domain) },
909
- auditContext: "feishu.streaming-card.update"
910
- }).then(async ({ release }) => {
915
+ policy: { allowedHostnames: resolveAllowedHostnames(this.creds.domain) },
916
+ auditContext: "feishu.streaming-card.update"
917
+ });
918
+ await release();
919
+ if (!response.ok) {
920
+ onError?.(/* @__PURE__ */ new Error(`Update card content failed with HTTP ${response.status}`));
921
+ return false;
922
+ }
923
+ return true;
924
+ } catch (error) {
925
+ onError?.(error);
926
+ return false;
927
+ }
928
+ }
929
+ async replaceCardContent(text, onError) {
930
+ if (!this.state) return false;
931
+ const apiBase = resolveApiBase(this.creds.domain);
932
+ this.state.sequence += 1;
933
+ try {
934
+ const { response, release } = await fetchWithSsrFGuard({
935
+ url: `${apiBase}/cardkit/v1/cards/${this.state.cardId}/elements/content`,
936
+ init: {
937
+ method: "PUT",
938
+ headers: {
939
+ Authorization: `Bearer ${await getToken(this.creds)}`,
940
+ "Content-Type": "application/json",
941
+ "User-Agent": getFeishuUserAgent()
942
+ },
943
+ body: JSON.stringify({
944
+ element: JSON.stringify({
945
+ tag: "markdown",
946
+ content: text,
947
+ element_id: "content"
948
+ }),
949
+ sequence: this.state.sequence,
950
+ uuid: `r_${this.state.cardId}_${this.state.sequence}`
951
+ })
952
+ },
953
+ policy: { allowedHostnames: resolveAllowedHostnames(this.creds.domain) },
954
+ auditContext: "feishu.streaming-card.replace"
955
+ });
911
956
  await release();
912
- }).catch((error) => onError?.(error));
957
+ if (!response.ok) {
958
+ onError?.(/* @__PURE__ */ new Error(`Replace card content failed with HTTP ${response.status}`));
959
+ return false;
960
+ }
961
+ return true;
962
+ } catch (error) {
963
+ onError?.(error);
964
+ return false;
965
+ }
913
966
  }
914
967
  clearFlushTimer() {
915
968
  if (this.flushTimer) {
@@ -945,9 +998,11 @@ var FeishuStreamingSession = class {
945
998
  const nextText = this.pendingText ?? mergedInput;
946
999
  const mergedText = mergeStreamingText(this.state.currentText, nextText);
947
1000
  if (!mergedText || mergedText === this.state.currentText) return;
1001
+ const appendContent = resolveStreamingCardAppendContent(this.state.sentText, mergedText);
1002
+ if (!appendContent) return;
948
1003
  this.pendingText = null;
949
1004
  this.state.currentText = mergedText;
950
- await this.updateCardContent(mergedText, (e) => this.log?.(`Update failed: ${String(e)}`));
1005
+ if (await this.updateCardContent(appendContent, (e) => this.log?.(`Update failed: ${String(e)}`)) && this.state) this.state.sentText = mergedText;
951
1006
  });
952
1007
  await this.queue;
953
1008
  }
@@ -982,11 +1037,12 @@ var FeishuStreamingSession = class {
982
1037
  this.clearFlushTimer();
983
1038
  await this.queue;
984
1039
  const pendingMerged = mergeStreamingText(this.state.currentText, this.pendingText ?? void 0);
985
- const text = finalText ? mergeStreamingText(pendingMerged, finalText) : pendingMerged;
1040
+ const text = finalText ?? pendingMerged;
986
1041
  const apiBase = resolveApiBase(this.creds.domain);
987
- if (text && text !== this.state.currentText) {
988
- await this.updateCardContent(text);
1042
+ if (text && text !== this.state.sentText) {
1043
+ const sent = text.startsWith(this.state.sentText) ? await this.updateCardContent(resolveStreamingCardAppendContent(this.state.sentText, text), (e) => this.log?.(`Final update failed: ${String(e)}`)) : await this.replaceCardContent(text, (e) => this.log?.(`Final replace failed: ${String(e)}`));
989
1044
  this.state.currentText = text;
1045
+ if (sent) this.state.sentText = text;
990
1046
  }
991
1047
  if (options?.note) await this.updateNoteContent(options.note);
992
1048
  this.state.sequence += 1;
@@ -1,6 +1,6 @@
1
1
  import { i as resolveReceiveIdType, r as normalizeFeishuTarget } from "./targets-Bb05cFr4.js";
2
2
  import { c as createFeishuApiError, f as isRecord$2, g as requestFeishuApi, s as resolveFeishuRuntimeAccount } from "./accounts-CP4tDW-z.js";
3
- import { c as toFeishuSendResult, o as assertFeishuMessageApiSuccess, s as resolveFeishuReceiptKind } from "./channel-5qZI7SEl.js";
3
+ import { c as toFeishuSendResult, o as assertFeishuMessageApiSuccess, s as resolveFeishuReceiptKind } from "./channel-DLhJC9t0.js";
4
4
  import { t as getFeishuRuntime } from "./runtime-Cc16UY23.js";
5
5
  import { r as createFeishuClient } from "./client-B18oTGHf.js";
6
6
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
package/dist/setup-api.js CHANGED
@@ -1,2 +1,2 @@
1
- import { i as feishuSetupAdapter, n as feishuSetupWizard, t as feishuPlugin } from "./channel-5qZI7SEl.js";
1
+ import { i as feishuSetupAdapter, n as feishuSetupWizard, t as feishuPlugin } from "./channel-DLhJC9t0.js";
2
2
  export { feishuPlugin, feishuSetupAdapter, feishuSetupWizard };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/feishu",
3
- "version": "2026.5.16-beta.1",
3
+ "version": "2026.5.16-beta.2",
4
4
  "description": "OpenClaw Feishu/Lark channel plugin (community maintained by @m1heng)",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,7 +17,7 @@
17
17
  "openclaw": "workspace:*"
18
18
  },
19
19
  "peerDependencies": {
20
- "openclaw": ">=2026.5.16-beta.1"
20
+ "openclaw": ">=2026.5.16-beta.2"
21
21
  },
22
22
  "peerDependenciesMeta": {
23
23
  "openclaw": {
@@ -48,10 +48,10 @@
48
48
  "minHostVersion": ">=2026.4.25"
49
49
  },
50
50
  "compat": {
51
- "pluginApi": ">=2026.5.16-beta.1"
51
+ "pluginApi": ">=2026.5.16-beta.2"
52
52
  },
53
53
  "build": {
54
- "openclawVersion": "2026.5.16-beta.1"
54
+ "openclawVersion": "2026.5.16-beta.2"
55
55
  },
56
56
  "release": {
57
57
  "publishToClawHub": true,