@openclaw/feishu 2026.10.10-beta.4 → 2026.10.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.
Files changed (41) hide show
  1. package/dist/.setup/{app-registration-DQOq5urV.mjs → app-registration-d8dxhKp-.mjs} +4 -5
  2. package/dist/.setup/{channel-VyjzWvqm.mjs → channel-dxkUGCgC.mjs} +34 -53
  3. package/dist/.setup/{channel.runtime-BjGRGNPJ.mjs → channel.runtime-DK9nv7tQ.mjs} +10 -14
  4. package/dist/.setup/{chat-qj1pEIcO.mjs → chat-CfRBIQrw.mjs} +3 -5
  5. package/dist/.setup/{client-BTiFlqqL.mjs → client-DlpvvLoz.mjs} +4 -7
  6. package/dist/.setup/{conversation-id-D00i9uy5.mjs → conversation-id-i1ICr3ID.mjs} +2 -4
  7. package/dist/.setup/{doctor-contract-BNXcJcWR.mjs → doctor-contract-CWB6EycD.mjs} +10 -20
  8. package/dist/.setup/{json-response-DXajw_FU.mjs → json-response-BX9Htr9f.mjs} +1 -2
  9. package/dist/.setup/{message-action-contract-Bhxj8Zrf.mjs → message-action-contract-C9KL891-.mjs} +1 -2
  10. package/dist/.setup/{monitor-DzmCjp4q.mjs → monitor-BJ0-Wu8d.mjs} +8 -12
  11. package/dist/.setup/{monitor.account-CpMwDf-a.mjs → monitor.account-DIvDEG0X.mjs} +56 -98
  12. package/dist/.setup/{probe-s0hiM44D.mjs → probe-BiQj7eM4.mjs} +4 -6
  13. package/dist/.setup/{reply-delivery-result-DknmIzOB.mjs → reply-delivery-result-QS_FCE--.mjs} +37 -70
  14. package/dist/.setup/{runtime-C5JxBWZp.mjs → runtime-6V3uDMw5.mjs} +1 -2
  15. package/dist/.setup/runtime-setter-api-DSLLnejl.mjs +2 -0
  16. package/dist/.setup/{secret-contract-DEyvsehF.mjs → secret-contract-DbKGdEJP.mjs} +1 -2
  17. package/dist/.setup/{secret-contract-api-XhxLE0dW.mjs → secret-contract-api-DHseJ7sg.mjs} +1 -1
  18. package/dist/.setup/{security-audit-b86aSgH2.mjs → security-audit-CYRW0D76.mjs} +1 -2
  19. package/dist/.setup/{session-conversation-BSBNK5Mq.mjs → session-conversation-CFw-zLLy.mjs} +2 -3
  20. package/dist/.setup/{setup-api-CH41-_5S.mjs → setup-api-qH0YRx2x.mjs} +1 -1
  21. package/dist/.setup/{subagent-hooks-CvVuM0O4.mjs → subagent-hooks-CA-gJ3Cu.mjs} +4 -5
  22. package/dist/.setup/{thread-bindings-BxKmOara.mjs → thread-bindings-6eyktxK_.mjs} +1 -2
  23. package/dist/.source-module-urls/6579f1b33dd01f8f0aaea28311ed6df1a635f9ad1e6fa86dcba53bca46407e55.json +1 -1
  24. package/dist/api.js +20 -32
  25. package/dist/channel-entry.js +1 -2
  26. package/dist/channel-plugin-api.js +1 -1
  27. package/dist/configured-state.js +1 -2
  28. package/dist/contract-api.js +3 -3
  29. package/dist/doctor-contract-api.js +1 -1
  30. package/dist/index.js +1 -2
  31. package/dist/runtime-api.js +1 -1
  32. package/dist/runtime-setter-api.js +1 -1
  33. package/dist/secret-contract-api.js +1 -1
  34. package/dist/security-contract-api.js +1 -1
  35. package/dist/session-binding-contract-api.js +1 -1
  36. package/dist/session-key-api.js +1 -1
  37. package/dist/setup-api.js +1 -1
  38. package/dist/setup-entry.js +4 -5
  39. package/dist/subagent-hooks-api.js +2 -3
  40. package/package.json +4 -4
  41. package/dist/.setup/runtime-setter-api-BrQHE03y.mjs +0 -2
@@ -1,15 +1,15 @@
1
- import { c as normalizeFeishuExternalKey, g as resolveFeishuRuntimeAccount, h as resolveFeishuAccount, s as normalizeFeishuWebhookPath } from "./doctor-contract-BNXcJcWR.mjs";
2
- import { o as resolveConfiguredFeishuGroupSessionScope, t as buildFeishuConversationId, u as resolveReceiveIdType } from "./conversation-id-D00i9uy5.mjs";
3
- import { c as resolveFeishuLegacyWebhookListener, l as gateway_config_runtime_exports, s as describeFeishuWebhookPathConflict } from "./channel-VyjzWvqm.mjs";
4
- import { A as sendMessageFeishu, At as resolveFeishuGroupConfig, B as parseInteractiveCardContent, D as getMessageFeishu, Dt as hasExplicitFeishuGroupConfig, F as isFeishuBroadcastMention, Ft as normalizeFeishuChatType, G as resolveFeishuIdentityEmoji, H as resolveFeishuSenderName, I as isMentionForwardRequest, It as resolveFeishuChatType, L as normalizeMentions, Mt as resolveFeishuGroupSenderActivationIngressAccess, N as formatFeishuMediaContent, O as listFeishuThreadMessages, Ot as normalizeFeishuAllowEntry, P as extractMentionTargets, Pt as resolveFeishuReplyPolicy, R as isFeishuGroupChatType, Rt as createFeishuCardInteractionEnvelope, S as sendMediaFeishu, T as chunkFeishuCardMarkdown, V as parsePostContent, W as buildFeishuMediaFallbackText, _t as shouldUseFeishuCard, a as shouldSendNoVisibleReplyFallback, b as withinCardTableLimit, ct as buildFeishuCommentTarget, d as consumeFeishuPresentationFallbackMarker, ft as resolveFeishuCardTemplate, ht as materializeFeishuPostMarkdownSoftBreaks, i as noVisibleFeishuReplyDelivery, it as extractReplyText, j as sendStructuredCardFeishu, jt as resolveFeishuGroupConversationIngressAccess, k as sendCardFeishu, kt as resolveFeishuDmIngressAccess, lt as normalizeCommentFileType, mt as chunkFeishuPostMarkdown, n as createFeishuReplyDeliveryResult, nt as createCommentTypingReactionLifecycle, ot as parseCommentContentElements, q as deliverCommentThreadText, r as mergeFeishuReplyDeliveryResults, rt as encodeQuery, st as requestFeishuApi, t as createFeishuPartialReplyDeliveryError, u as buildFeishuPresentationFallback, v as renderFeishuReplyPayload, w as shouldSuppressFeishuTextForVoiceMedia, x as saveMessageResourceFeishu, y as resolveFeishuRichReply, z as normalizeFeishuEventChatType, zt as decodeFeishuCardAction } from "./reply-delivery-result-DknmIzOB.mjs";
5
- import { t as getFeishuRuntime } from "./runtime-C5JxBWZp.mjs";
6
- import { a as getFeishuUserAgent, f as resolveConfiguredHttpTimeoutMs, i as createFeishuWSClient, n as createEventDispatcher, r as createFeishuClient } from "./client-BTiFlqqL.mjs";
7
- import { t as createFeishuThreadBindingManager } from "./thread-bindings-BxKmOara.mjs";
8
- import { r as getChatInfo } from "./chat-qj1pEIcO.mjs";
1
+ import { c as normalizeFeishuExternalKey, g as resolveFeishuRuntimeAccount, h as resolveFeishuAccount, s as normalizeFeishuWebhookPath } from "./doctor-contract-CWB6EycD.mjs";
2
+ import { o as resolveConfiguredFeishuGroupSessionScope, t as buildFeishuConversationId, u as resolveReceiveIdType } from "./conversation-id-i1ICr3ID.mjs";
3
+ import { c as resolveFeishuLegacyWebhookListener, l as gateway_config_runtime_exports, s as describeFeishuWebhookPathConflict } from "./channel-dxkUGCgC.mjs";
4
+ import { A as sendMessageFeishu, At as resolveFeishuGroupConfig, B as parseInteractiveCardContent, D as getMessageFeishu, Dt as hasExplicitFeishuGroupConfig, F as isFeishuBroadcastMention, Ft as normalizeFeishuChatType, G as resolveFeishuIdentityEmoji, H as resolveFeishuSenderName, I as isMentionForwardRequest, It as resolveFeishuChatType, L as normalizeMentions, Mt as resolveFeishuGroupSenderActivationIngressAccess, N as formatFeishuMediaContent, O as listFeishuThreadMessages, Ot as normalizeFeishuAllowEntry, P as extractMentionTargets, Pt as resolveFeishuReplyPolicy, R as isFeishuGroupChatType, Rt as createFeishuCardInteractionEnvelope, S as sendMediaFeishu, T as chunkFeishuCardMarkdown, V as parsePostContent, W as buildFeishuMediaFallbackText, _t as shouldUseFeishuCard, a as shouldSendNoVisibleReplyFallback, b as withinCardTableLimit, ct as buildFeishuCommentTarget, d as consumeFeishuPresentationFallbackMarker, ft as resolveFeishuCardTemplate, ht as materializeFeishuPostMarkdownSoftBreaks, i as noVisibleFeishuReplyDelivery, it as extractReplyText, j as sendStructuredCardFeishu, jt as resolveFeishuGroupConversationIngressAccess, k as sendCardFeishu, kt as resolveFeishuDmIngressAccess, lt as normalizeCommentFileType, mt as chunkFeishuPostMarkdown, n as createFeishuReplyDeliveryResult, nt as createCommentTypingReactionLifecycle, ot as parseCommentContentElements, q as deliverCommentThreadText, r as mergeFeishuReplyDeliveryResults, rt as encodeQuery, st as requestFeishuApi, t as createFeishuPartialReplyDeliveryError, u as buildFeishuPresentationFallback, v as renderFeishuReplyPayload, w as shouldSuppressFeishuTextForVoiceMedia, x as saveMessageResourceFeishu, y as resolveFeishuRichReply, z as normalizeFeishuEventChatType, zt as decodeFeishuCardAction } from "./reply-delivery-result-QS_FCE--.mjs";
5
+ import { t as getFeishuRuntime } from "./runtime-6V3uDMw5.mjs";
6
+ import { a as getFeishuUserAgent, f as resolveConfiguredHttpTimeoutMs, i as createFeishuWSClient, n as createEventDispatcher, r as createFeishuClient } from "./client-DlpvvLoz.mjs";
7
+ import { t as createFeishuThreadBindingManager } from "./thread-bindings-6eyktxK_.mjs";
8
+ import { r as getChatInfo } from "./chat-CfRBIQrw.mjs";
9
9
  import { evaluateSupplementalContextVisibility, normalizeAgentId as normalizeAgentId$1, resolveChannelContextVisibilityMode } from "../runtime-api.js";
10
- import { t as readFeishuJsonResponse } from "./json-response-DXajw_FU.mjs";
11
- import { a as waitForAbortableDelay, i as raceWithTimeoutAndAbort } from "./probe-s0hiM44D.mjs";
12
- import { t as fetchBotIdentityForMonitor } from "./monitor-DzmCjp4q.mjs";
10
+ import { t as readFeishuJsonResponse } from "./json-response-BX9Htr9f.mjs";
11
+ import { a as waitForAbortableDelay, i as raceWithTimeoutAndAbort } from "./probe-BiQj7eM4.mjs";
12
+ import { t as fetchBotIdentityForMonitor } from "./monitor-BJ0-Wu8d.mjs";
13
13
  import { resolveAgentConfig } from "openclaw/plugin-sdk/agent-scope-runtime";
14
14
  import { DEFAULT_INGRESS_ADOPTION_STALL_MS, bindIngressLifecycleToReplyOptions, createChannelIngressError, createChannelIngressMonitor, createChannelMessageReplyPipeline, createReplyPrefixContext, formatChannelProgressDraftLineForEntry, resolveAgentOutboundIdentity, resolveChannelPreviewStreamMode, resolveChannelStreamingBlockEnabled, waitUntilAbort } from "openclaw/plugin-sdk/channel-outbound";
15
15
  import { createChannelPairingController } from "openclaw/plugin-sdk/channel-pairing";
@@ -50,7 +50,7 @@ import { channelBlockedPatch, channelReadyPatch } from "openclaw/plugin-sdk/gate
50
50
  import { createWebhookInFlightLimiter, readWebhookBodyOrReject, sendHttpRequestRejection } from "openclaw/plugin-sdk/webhook-request-guards";
51
51
  import { canonicalizeWebhookRouteKey, registerPluginHttpRoute, registerWebhookTarget, resolveSingleWebhookTarget } from "openclaw/plugin-sdk/webhook-targets";
52
52
  import { isAbortRequestText, isBtwRequestText } from "openclaw/plugin-sdk/command-primitives-runtime";
53
- //#region src/channels/mention-gating.ts
53
+ // src/channels/mention-gating.ts
54
54
  function resolveBotThreadMentionPolicy(params) {
55
55
  if (!params.isBotOwnedThread || params.requireMentionInBotThreads === void 0) return {
56
56
  requireMention: params.requireMention,
@@ -61,8 +61,7 @@ function resolveBotThreadMentionPolicy(params) {
61
61
  implicitMentionKinds: params.requireMentionInBotThreads ? params.implicitMentionKinds?.filter((kind) => kind === "native") : params.implicitMentionKinds
62
62
  };
63
63
  }
64
- //#endregion
65
- //#region extensions/feishu/src/bot-agent-body.ts
64
+ // extensions/feishu/src/bot-agent-body.ts
66
65
  const MAX_MENTION_CONTEXT_NAME_LENGTH = 80;
67
66
  function formatMentionNameForAgentContext(name) {
68
67
  const normalized = Array.from(name, (char) => {
@@ -92,8 +91,7 @@ function buildFeishuAgentBody(params) {
92
91
  }
93
92
  return messageBody;
94
93
  }
95
- //#endregion
96
- //#region extensions/feishu/src/bot-broadcast.ts
94
+ // extensions/feishu/src/bot-broadcast.ts
97
95
  function createFeishuBroadcastIngressSettlement(params) {
98
96
  const lanes = /* @__PURE__ */ new Set();
99
97
  const failures = [];
@@ -248,8 +246,7 @@ function buildBroadcastSessionKey(baseSessionKey, originalAgentId, targetAgentId
248
246
  const prefix = `agent:${originalAgentId}:`;
249
247
  return baseSessionKey.startsWith(prefix) ? `agent:${targetAgentId}:${baseSessionKey.slice(prefix.length)}` : baseSessionKey;
250
248
  }
251
- //#endregion
252
- //#region extensions/feishu/src/bot-content.ts
249
+ // extensions/feishu/src/bot-content.ts
253
250
  function resolveFeishuGroupSession(params) {
254
251
  const { chatId, senderOpenId, messageId, rootId, threadId, chatType, groupConfig, feishuCfg } = params;
255
252
  const normalizedThreadId = threadId?.trim();
@@ -406,11 +403,9 @@ async function resolveFeishuMediaList(params) {
406
403
  }
407
404
  return out;
408
405
  }
409
- //#endregion
410
- //#region extensions/feishu/src/bot-group-name-state.ts
406
+ // extensions/feishu/src/bot-group-name-state.ts
411
407
  const feishuGroupNameCache = /* @__PURE__ */ new Map();
412
- //#endregion
413
- //#region extensions/feishu/src/bot-group-name.ts
408
+ // extensions/feishu/src/bot-group-name.ts
414
409
  const GROUP_NAME_CACHE_TTL_MS = 18e5;
415
410
  const GROUP_NAME_CACHE_MAX_SIZE = 500;
416
411
  function evictGroupNameCache() {
@@ -449,8 +444,7 @@ async function resolveGroupName(params) {
449
444
  evictGroupNameCache();
450
445
  return resolvedName;
451
446
  }
452
- //#endregion
453
- //#region extensions/feishu/src/bot-name.ts
447
+ // extensions/feishu/src/bot-name.ts
454
448
  const POSITIVE_TTL_MS = 6e5;
455
449
  const NEGATIVE_TTL_MS = 6e4;
456
450
  const MAX_CACHE_ENTRIES = 5e3;
@@ -582,8 +576,7 @@ async function resolveFeishuBotName(params) {
582
576
  inflight.delete(key);
583
577
  }
584
578
  }
585
- //#endregion
586
- //#region extensions/feishu/src/bot-thread-mentions.ts
579
+ // extensions/feishu/src/bot-thread-mentions.ts
587
580
  async function prepareFeishuThreadRoot(params) {
588
581
  let { cfg, account } = params;
589
582
  const { ctx, botOpenId, log } = params;
@@ -628,8 +621,7 @@ async function prepareFeishuThreadRoot(params) {
628
621
  getRootMessageInfo
629
622
  };
630
623
  }
631
- //#endregion
632
- //#region extensions/feishu/src/dedup-state.ts
624
+ // extensions/feishu/src/dedup-state.ts
633
625
  const DEDUPE_NAMESPACE_PREFIX = "feishu.dedup";
634
626
  const DEDUP_TTL_MS = 864e5;
635
627
  const MEMORY_MAX_SIZE = 1e3;
@@ -652,8 +644,7 @@ const feishuDedupeState = {
652
644
  this.guard = createFeishuDedupeGuard();
653
645
  }
654
646
  };
655
- //#endregion
656
- //#region extensions/feishu/src/dedup.ts
647
+ // extensions/feishu/src/dedup.ts
657
648
  function dedupeOptions(namespace, log) {
658
649
  return {
659
650
  ...namespace ? { namespace } : {},
@@ -693,8 +684,7 @@ async function hasProcessedFeishuMessage(messageId, namespace = "global", log) {
693
684
  async function warmupDedupFromPluginState(namespace, log) {
694
685
  return await feishuDedupeState.guard.warmup(namespace, (error) => log?.(`feishu-dedup: warmup persistent state error: ${String(error)}`));
695
686
  }
696
- //#endregion
697
- //#region extensions/feishu/src/dedupe-key.ts
687
+ // extensions/feishu/src/dedupe-key.ts
698
688
  function resolvePostMediaParts(content) {
699
689
  const { attachments } = parsePostContent(content, { includeTopLevelFiles: false });
700
690
  return ["image", "file"].flatMap((kind) => attachments.filter((attachment) => attachment.kind === kind).map((attachment) => `${kind}_key:${attachment.key}`));
@@ -746,8 +736,7 @@ function resolveFeishuMessageDedupeKey(event) {
746
736
  }
747
737
  return messageId;
748
738
  }
749
- //#endregion
750
- //#region extensions/feishu/src/dynamic-agent.ts
739
+ // extensions/feishu/src/dynamic-agent.ts
751
740
  var DynamicAgentMutationSkipped = class extends Error {
752
741
  constructor(cfg) {
753
742
  super("dynamic agent mutation skipped");
@@ -900,8 +889,7 @@ function resolveUserPath(p) {
900
889
  if (p.startsWith("~/")) return path.join(os.homedir(), p.slice(2));
901
890
  return p;
902
891
  }
903
- //#endregion
904
- //#region extensions/feishu/src/reasoning-preview.ts
892
+ // extensions/feishu/src/reasoning-preview.ts
905
893
  async function resolveFeishuReasoningPreviewEnabled(params) {
906
894
  const configDefault = resolveAgentConfig(params.cfg, params.agentId)?.reasoningDefault ?? params.cfg.agents?.defaults?.reasoningDefault ?? "off";
907
895
  if (!params.sessionKey) return configDefault === "stream";
@@ -917,11 +905,9 @@ async function resolveFeishuReasoningPreviewEnabled(params) {
917
905
  }
918
906
  return configDefault === "stream";
919
907
  }
920
- //#endregion
921
- //#region extensions/feishu/src/reply-dispatcher-state.ts
908
+ // extensions/feishu/src/reply-dispatcher-state.ts
922
909
  const streamingStartBackoffUntilByAccount = /* @__PURE__ */ new Map();
923
- //#endregion
924
- //#region extensions/feishu/src/streaming-card.ts
910
+ // extensions/feishu/src/streaming-card.ts
925
911
  /** Provider finalization failed after a streaming card may already be visible. */
926
912
  var FeishuStreamingFinalizationError = class extends Error {
927
913
  constructor(cause, result) {
@@ -1285,8 +1271,7 @@ var FeishuStreamingSession = class {
1285
1271
  return this.state !== null && !this.closed;
1286
1272
  }
1287
1273
  };
1288
- //#endregion
1289
- //#region extensions/feishu/src/streaming-update.ts
1274
+ // extensions/feishu/src/streaming-update.ts
1290
1275
  /** Admit captured snapshots in order while the session owns provider writes. */
1291
1276
  function queueFeishuStreamingUpdate(params) {
1292
1277
  const { queue, session, startPromise, text, accountId, runtime } = params;
@@ -1295,8 +1280,7 @@ function queueFeishuStreamingUpdate(params) {
1295
1280
  if (session?.isActive()) session.update(text).catch((error) => runtime.error?.(`feishu[${accountId}] streaming update failed: ${String(error)}`));
1296
1281
  });
1297
1282
  }
1298
- //#endregion
1299
- //#region extensions/feishu/src/typing-backoff.ts
1283
+ // extensions/feishu/src/typing-backoff.ts
1300
1284
  /** Feishu API codes that should trip the typing circuit breaker. */
1301
1285
  const FEISHU_BACKOFF_CODES = /* @__PURE__ */ new Set([
1302
1286
  99991400,
@@ -1324,8 +1308,7 @@ function getBackoffCodeFromResponse(response) {
1324
1308
  const code = response.code;
1325
1309
  return typeof code === "number" && FEISHU_BACKOFF_CODES.has(code) ? code : void 0;
1326
1310
  }
1327
- //#endregion
1328
- //#region extensions/feishu/src/typing.ts
1311
+ // extensions/feishu/src/typing.ts
1329
1312
  const TYPING_EMOJI = "Typing";
1330
1313
  async function requestTypingReaction(request, operation, readResponse, runtime) {
1331
1314
  const indicator = `typing indicator${operation === "remove" ? " removal" : ""}`;
@@ -1393,8 +1376,7 @@ async function removeTypingIndicator(params) {
1393
1376
  reaction_id: state.reactionId
1394
1377
  } }), "remove", () => void 0, runtime);
1395
1378
  }
1396
- //#endregion
1397
- //#region extensions/feishu/src/reply-dispatcher.ts
1379
+ // extensions/feishu/src/reply-dispatcher.ts
1398
1380
  function mergeStreamingFinalText(previousText, nextText, appendError) {
1399
1381
  if (!appendError || !previousText || nextText.startsWith(previousText)) return nextText;
1400
1382
  if (previousText.endsWith(`\n\n${nextText}`)) return previousText;
@@ -2178,8 +2160,7 @@ function createFeishuReplyDispatcher(params) {
2178
2160
  ensureNoVisibleReplyFallback
2179
2161
  };
2180
2162
  }
2181
- //#endregion
2182
- //#region extensions/feishu/src/synthetic-event-target.ts
2163
+ // extensions/feishu/src/synthetic-event-target.ts
2183
2164
  const directPreDispatchTargets = /* @__PURE__ */ new WeakMap();
2184
2165
  /** Keep synthetic-only routing metadata outside the public Feishu event shape. */
2185
2166
  function setFeishuSyntheticDirectPreDispatchTarget(event, target) {
@@ -2189,8 +2170,7 @@ function setFeishuSyntheticDirectPreDispatchTarget(event, target) {
2189
2170
  function getFeishuSyntheticDirectPreDispatchTarget(event) {
2190
2171
  return directPreDispatchTargets.get(event);
2191
2172
  }
2192
- //#endregion
2193
- //#region extensions/feishu/src/bot.ts
2173
+ // extensions/feishu/src/bot.ts
2194
2174
  const permissionErrorNotifiedAt = /* @__PURE__ */ new Map();
2195
2175
  const PERMISSION_ERROR_COOLDOWN_MS = 3e5;
2196
2176
  function isFeishuTopicSessionScope(scope) {
@@ -2997,7 +2977,7 @@ async function handleFeishuMessage(params) {
2997
2977
  readAllowFromStore: pairing.readAllowFromStore,
2998
2978
  senderOpenId: ctx.senderOpenId,
2999
2979
  senderUserId,
3000
- conversationId: ctx.senderOpenId,
2980
+ conversationId: ctx.chatId,
3001
2981
  mayPair: false,
3002
2982
  contextBinding
3003
2983
  });
@@ -3347,12 +3327,10 @@ async function handleFeishuMessage(params) {
3347
3327
  if (turnAdoptionLifecycle) throw err;
3348
3328
  }
3349
3329
  }
3350
- //#endregion
3351
- //#region extensions/feishu/src/card-action-state.ts
3330
+ // extensions/feishu/src/card-action-state.ts
3352
3331
  const processedCardActions = /* @__PURE__ */ new Map();
3353
3332
  const resolvedCardActionChatTypes = /* @__PURE__ */ new Map();
3354
- //#endregion
3355
- //#region extensions/feishu/src/card-ux-shared.ts
3333
+ // extensions/feishu/src/card-ux-shared.ts
3356
3334
  function buildFeishuActionCard(params) {
3357
3335
  return {
3358
3336
  schema: "2.0",
@@ -3393,8 +3371,7 @@ function buildFeishuCardInteractionContext(params) {
3393
3371
  ...params.chatType ? { t: params.chatType } : {}
3394
3372
  };
3395
3373
  }
3396
- //#endregion
3397
- //#region extensions/feishu/src/card-ux-approval.ts
3374
+ // extensions/feishu/src/card-ux-approval.ts
3398
3375
  const FEISHU_APPROVAL_REQUEST_ACTION = "feishu.quick_actions.request_approval";
3399
3376
  const FEISHU_APPROVAL_CONFIRM_ACTION = "feishu.approval.confirm";
3400
3377
  const FEISHU_APPROVAL_CANCEL_ACTION = "feishu.approval.cancel";
@@ -3423,8 +3400,7 @@ function createApprovalCard(params) {
3423
3400
  })]
3424
3401
  });
3425
3402
  }
3426
- //#endregion
3427
- //#region extensions/feishu/src/card-action.ts
3403
+ // extensions/feishu/src/card-action.ts
3428
3404
  const FEISHU_APPROVAL_CARD_TTL_MS = 3e5;
3429
3405
  const FEISHU_CARD_ACTION_TOKEN_TTL_MS = 9e5;
3430
3406
  function pruneExpiredCardEntries(cache, now) {
@@ -3654,8 +3630,7 @@ async function handleFeishuCardAction(params) {
3654
3630
  refreshFeishuCardActionToken(event.token, account.accountId);
3655
3631
  }
3656
3632
  }
3657
- //#endregion
3658
- //#region extensions/feishu/src/feishu-ingress.ts
3633
+ // extensions/feishu/src/feishu-ingress.ts
3659
3634
  const FEISHU_INGRESS_PAYLOAD_VERSION = 1;
3660
3635
  const FEISHU_INGRESS_POLL_INTERVAL_MS = 500;
3661
3636
  const FEISHU_DURABLE_EVENT_TYPES = /* @__PURE__ */ new Set(["drive.notice.comment_add_v1", "im.message.receive_v1"]);
@@ -3930,8 +3905,7 @@ function createFeishuDurableIngress(options) {
3930
3905
  waitForIdle: monitor.waitForIdle
3931
3906
  };
3932
3907
  }
3933
- //#endregion
3934
- //#region extensions/feishu/src/monitor.state.ts
3908
+ // extensions/feishu/src/monitor.state.ts
3935
3909
  const wsClients = /* @__PURE__ */ new Map();
3936
3910
  const botOpenIds = /* @__PURE__ */ new Map();
3937
3911
  const botIdentityRevisions = /* @__PURE__ */ new Map();
@@ -3962,8 +3936,7 @@ function recordWebhookStatus(runtime, accountId, path, statusCode) {
3962
3936
  message: (count) => `${label}: webhook anomaly path=${path} status=${statusCode} count=${count}`
3963
3937
  });
3964
3938
  }
3965
- //#endregion
3966
- //#region extensions/feishu/src/monitor.bot-identity.ts
3939
+ // extensions/feishu/src/monitor.bot-identity.ts
3967
3940
  const BOT_IDENTITY_RETRY_DELAYS_MS = [
3968
3941
  6e4,
3969
3942
  12e4,
@@ -4005,8 +3978,7 @@ function startBotIdentityRecovery(params) {
4005
3978
  (runtime?.error ?? console.error)(`feishu[${accountId}]: bot identity background retry failed unexpectedly: ${String(err)}`);
4006
3979
  });
4007
3980
  }
4008
- //#endregion
4009
- //#region extensions/feishu/src/card-ux-launcher.ts
3981
+ // extensions/feishu/src/card-ux-launcher.ts
4010
3982
  const FEISHU_QUICK_ACTION_CARD_TTL_MS = 6e5;
4011
3983
  const QUICK_ACTION_MENU_KEYS = /* @__PURE__ */ new Set([
4012
3984
  "quick-actions",
@@ -4079,8 +4051,7 @@ async function maybeHandleFeishuQuickActionMenu(params) {
4079
4051
  params.runtime?.log?.(`feishu[${params.accountId ?? "default"}]: opened quick-action launcher for ${params.operatorOpenId}`);
4080
4052
  return true;
4081
4053
  }
4082
- //#endregion
4083
- //#region extensions/feishu/src/monitor.synthetic-error.ts
4054
+ // extensions/feishu/src/monitor.synthetic-error.ts
4084
4055
  var FeishuRetryableSyntheticEventError = class extends Error {
4085
4056
  constructor(message, options) {
4086
4057
  super(message, options);
@@ -4090,8 +4061,7 @@ var FeishuRetryableSyntheticEventError = class extends Error {
4090
4061
  function isFeishuRetryableSyntheticEventError(error) {
4091
4062
  return error instanceof FeishuRetryableSyntheticEventError || typeof error === "object" && error !== null && "name" in error && error.name === "FeishuRetryableSyntheticEventError";
4092
4063
  }
4093
- //#endregion
4094
- //#region extensions/feishu/src/monitor.bot-menu-handler.ts
4064
+ // extensions/feishu/src/monitor.bot-menu-handler.ts
4095
4065
  function createFeishuBotMenuHandler(params) {
4096
4066
  const { cfg, accountId, runtime, chatHistories, fireAndForget } = params;
4097
4067
  const log = runtime?.log ?? console.log;
@@ -4194,8 +4164,7 @@ function createFeishuBotMenuHandler(params) {
4194
4164
  return task;
4195
4165
  };
4196
4166
  }
4197
- //#endregion
4198
- //#region extensions/feishu/src/comment-dispatcher.ts
4167
+ // extensions/feishu/src/comment-dispatcher.ts
4199
4168
  function createFeishuCommentReplyDispatcher(params) {
4200
4169
  const core = getFeishuRuntime();
4201
4170
  const prefixContext = createReplyPrefixContext({
@@ -4273,8 +4242,7 @@ function createFeishuCommentReplyDispatcher(params) {
4273
4242
  cleanupTypingReaction: typingReaction.cleanup
4274
4243
  };
4275
4244
  }
4276
- //#endregion
4277
- //#region extensions/feishu/src/monitor.comment.ts
4245
+ // extensions/feishu/src/monitor.comment.ts
4278
4246
  const FEISHU_COMMENT_VERIFY_TIMEOUT_MS = 3e3;
4279
4247
  const FEISHU_COMMENT_PAGE_SIZE = 100;
4280
4248
  const FEISHU_COMMENT_PAGE_LIMIT = 5;
@@ -4702,7 +4670,7 @@ async function resolveDriveCommentEventTurn(params) {
4702
4670
  return null;
4703
4671
  }
4704
4672
  const context = await fetchDriveCommentContext({
4705
- client: createClient ? createClient(account ?? { accountId }) : createFeishuClient((await import("./doctor-contract-BNXcJcWR.mjs").then((n) => n.l)).resolveFeishuAccount({
4673
+ client: createClient ? createClient(account ?? { accountId }) : createFeishuClient((await import("./doctor-contract-CWB6EycD.mjs").then((n) => n.l)).resolveFeishuAccount({
4706
4674
  cfg,
4707
4675
  accountId
4708
4676
  })),
@@ -4771,8 +4739,7 @@ function parseFeishuDriveCommentNoticeEventPayload(value) {
4771
4739
  type: readStringValue(value.type)
4772
4740
  };
4773
4741
  }
4774
- //#endregion
4775
- //#region extensions/feishu/src/comment-handler.ts
4742
+ // extensions/feishu/src/comment-handler.ts
4776
4743
  function parseTimestampMs(value) {
4777
4744
  return parseStrictNonNegativeInteger(value) ?? Date.now();
4778
4745
  }
@@ -5019,8 +4986,7 @@ async function handleFeishuCommentEvent(params) {
5019
4986
  cleanupTypingReaction();
5020
4987
  }
5021
4988
  }
5022
- //#endregion
5023
- //#region extensions/feishu/src/sequential-queue.ts
4989
+ // extensions/feishu/src/sequential-queue.ts
5024
4990
  const DEFAULT_TASK_TIMEOUT_MS = 3e5;
5025
4991
  function createSequentialQueue(options = {}) {
5026
4992
  const queues = /* @__PURE__ */ new Map();
@@ -5039,8 +5005,7 @@ function createSequentialQueue(options = {}) {
5039
5005
  return next;
5040
5006
  };
5041
5007
  }
5042
- //#endregion
5043
- //#region extensions/feishu/src/monitor.comment-notice-handler.ts
5008
+ // extensions/feishu/src/monitor.comment-notice-handler.ts
5044
5009
  function buildCommentNoticeQueueKey(event) {
5045
5010
  return `comment-doc:${event.notice_meta?.file_type?.trim() || "unknown"}:${event.notice_meta?.file_token?.trim() || "unknown"}`;
5046
5011
  }
@@ -5091,8 +5056,7 @@ function createFeishuDriveCommentNoticeHandler(params) {
5091
5056
  await settle();
5092
5057
  };
5093
5058
  }
5094
- //#endregion
5095
- //#region extensions/feishu/src/monitor.message-handler.ts
5059
+ // extensions/feishu/src/monitor.message-handler.ts
5096
5060
  function parseFeishuMessageEventPayload(value) {
5097
5061
  if (!isRecord(value)) return null;
5098
5062
  const sender = value.sender;
@@ -5347,8 +5311,7 @@ function createFeishuMessageReceiveHandler({ cfg, channelRuntime, accountId, run
5347
5311
  if (!fireAndForget) await processing;
5348
5312
  };
5349
5313
  }
5350
- //#endregion
5351
- //#region extensions/feishu/src/monitor-rate-limit-key.ts
5314
+ // extensions/feishu/src/monitor-rate-limit-key.ts
5352
5315
  function normalizeFeishuWebhookRateLimitClient(clientIp) {
5353
5316
  if (!clientIp) return "unknown";
5354
5317
  if (clientIp === "::1" || clientIp.startsWith("127.")) return "loopback";
@@ -5357,8 +5320,7 @@ function normalizeFeishuWebhookRateLimitClient(clientIp) {
5357
5320
  function buildFeishuWebhookRateLimitKey(params) {
5358
5321
  return `${params.accountId === void 0 ? params.path : `${params.accountId}:${params.path}`}:${normalizeFeishuWebhookRateLimitClient(params.clientIp)}`;
5359
5322
  }
5360
- //#endregion
5361
- //#region extensions/feishu/src/monitor.transport.ts
5323
+ // extensions/feishu/src/monitor.transport.ts
5362
5324
  const FEISHU_WEBHOOK_ACCEPTED_HEADER = "x-openclaw-delivery-accepted";
5363
5325
  const FEISHU_WEBHOOK_ACCEPTED_VALUE = "durable";
5364
5326
  const FEISHU_PRE_AUTH_MAX_IN_FLIGHT = 64;
@@ -5745,8 +5707,7 @@ async function monitorWebhook(params) {
5745
5707
  await cleanup();
5746
5708
  }
5747
5709
  }
5748
- //#endregion
5749
- //#region extensions/feishu/src/monitor.vc-meeting-invited-handler.ts
5710
+ // extensions/feishu/src/monitor.vc-meeting-invited-handler.ts
5750
5711
  const FEISHU_MEETING_NUMBER_PATTERN = /^\d{9}$/;
5751
5712
  function parseInviteTimestamp(value) {
5752
5713
  const parsed = Number.parseInt(value ?? "", 10);
@@ -5886,8 +5847,7 @@ function createFeishuVcMeetingInvitedHandler(params) {
5886
5847
  return fireAndForget ? Promise.resolve() : task;
5887
5848
  };
5888
5849
  }
5889
- //#endregion
5890
- //#region extensions/feishu/src/sequential-key.ts
5850
+ // extensions/feishu/src/sequential-key.ts
5891
5851
  function getFeishuSequentialKey(params) {
5892
5852
  const { accountId, event, botOpenId, preparedContent } = params;
5893
5853
  const baseKey = `feishu:${accountId}:${event.message.chat_id?.trim() || "unknown"}`;
@@ -5896,8 +5856,7 @@ function getFeishuSequentialKey(params) {
5896
5856
  if (isBtwRequestText(text)) return `${baseKey}:btw`;
5897
5857
  return baseKey;
5898
5858
  }
5899
- //#endregion
5900
- //#region extensions/feishu/src/monitor.account.ts
5859
+ // extensions/feishu/src/monitor.account.ts
5901
5860
  const FEISHU_REACTION_VERIFY_TIMEOUT_MS = 1500;
5902
5861
  async function resolveReactionSyntheticEvent(params) {
5903
5862
  const { cfg, accountId, event, botOpenId, fetchMessage = getMessageFeishu, verificationTimeoutMs = FEISHU_REACTION_VERIFY_TIMEOUT_MS, logger, uuid = () => crypto$1.randomUUID(), action = "created" } = params;
@@ -5907,7 +5866,7 @@ async function resolveReactionSyntheticEvent(params) {
5907
5866
  const senderUserId = event.user_id?.user_id?.trim();
5908
5867
  const senderId = senderOpenId || senderUserId;
5909
5868
  if (!emoji || !messageId || !senderId) return null;
5910
- const { resolveFeishuAccount } = await import("./doctor-contract-BNXcJcWR.mjs").then((n) => n.l);
5869
+ const { resolveFeishuAccount } = await import("./doctor-contract-CWB6EycD.mjs").then((n) => n.l);
5911
5870
  const reactionNotifications = resolveFeishuAccount({
5912
5871
  cfg,
5913
5872
  accountId
@@ -6195,5 +6154,4 @@ async function monitorSingleAccount(params) {
6195
6154
  threadBindingManager?.stop();
6196
6155
  }
6197
6156
  }
6198
- //#endregion
6199
6157
  export { FeishuRetryableSyntheticEventError, monitorSingleAccount, resolveReactionSyntheticEvent };
@@ -1,12 +1,12 @@
1
- import { _ as __exportAll } from "./doctor-contract-BNXcJcWR.mjs";
2
- import { r as createFeishuClient } from "./client-BTiFlqqL.mjs";
1
+ import { _ as __exportAll } from "./doctor-contract-CWB6EycD.mjs";
2
+ import { r as createFeishuClient } from "./client-DlpvvLoz.mjs";
3
3
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
4
4
  import { isFutureDateTimestampMs, resolveExpiresAtMsFromDurationMs, resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
5
5
  import { sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
6
6
  import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
7
7
  import { createHash } from "node:crypto";
8
8
  import { racePromiseWithAbortSignal, raceWithTimeout } from "openclaw/plugin-sdk/time-runtime";
9
- //#region extensions/feishu/src/async.ts
9
+ // extensions/feishu/src/async.ts
10
10
  const RACE_TIMEOUT = Symbol("race-timeout");
11
11
  const RACE_ABORT = Symbol("race-abort");
12
12
  async function raceWithTimeoutAndAbort(promise, options = {}) {
@@ -38,8 +38,7 @@ function waitForAbortableDelay(delayMs, abortSignal) {
38
38
  throw error;
39
39
  });
40
40
  }
41
- //#endregion
42
- //#region extensions/feishu/src/probe.ts
41
+ // extensions/feishu/src/probe.ts
43
42
  var probe_exports = /* @__PURE__ */ __exportAll({
44
43
  probeFeishu: () => probeFeishu,
45
44
  registerFeishuAiAgent: () => registerFeishuAiAgent
@@ -175,5 +174,4 @@ async function registerFeishuAiAgent(creds, options = {}) {
175
174
  };
176
175
  }
177
176
  }
178
- //#endregion
179
177
  export { waitForAbortableDelay as a, raceWithTimeoutAndAbort as i, probe_exports as n, registerFeishuAiAgent as r, probeFeishu as t };