@openclaw/feishu 2026.10.10-beta.5 → 2026.11.1
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/.setup/{app-registration-CYU0G5Oo.mjs → app-registration-d8dxhKp-.mjs} +2 -3
- package/dist/.setup/{channel-CY13hxu8.mjs → channel-oXfjraK8.mjs} +34 -53
- package/dist/.setup/{channel.runtime-gTMUHJAe.mjs → channel.runtime-DwAtbHg3.mjs} +10 -14
- package/dist/.setup/{chat-qj1pEIcO.mjs → chat-CfRBIQrw.mjs} +3 -5
- package/dist/.setup/{client-BTiFlqqL.mjs → client-DlpvvLoz.mjs} +4 -7
- package/dist/.setup/{conversation-id-D00i9uy5.mjs → conversation-id-i1ICr3ID.mjs} +2 -4
- package/dist/.setup/{doctor-contract-BNXcJcWR.mjs → doctor-contract-CWB6EycD.mjs} +10 -20
- package/dist/.setup/{json-response-DXajw_FU.mjs → json-response-BX9Htr9f.mjs} +1 -2
- package/dist/.setup/{message-action-contract-Bhxj8Zrf.mjs → message-action-contract-C9KL891-.mjs} +1 -2
- package/dist/.setup/{monitor-CJ0xKz5A.mjs → monitor-DHVCTSyT.mjs} +8 -12
- package/dist/.setup/{monitor.account-DRqaexjx.mjs → monitor.account-P2wAHXqG.mjs} +73 -126
- package/dist/.setup/{probe-s0hiM44D.mjs → probe-BiQj7eM4.mjs} +4 -6
- package/dist/.setup/{reply-delivery-result-DknmIzOB.mjs → reply-delivery-result-QS_FCE--.mjs} +37 -70
- package/dist/.setup/{runtime-C5JxBWZp.mjs → runtime-6V3uDMw5.mjs} +1 -2
- package/dist/.setup/runtime-setter-api-DSLLnejl.mjs +2 -0
- package/dist/.setup/{secret-contract-DEyvsehF.mjs → secret-contract-DbKGdEJP.mjs} +1 -2
- package/dist/.setup/{secret-contract-api-XhxLE0dW.mjs → secret-contract-api-DHseJ7sg.mjs} +1 -1
- package/dist/.setup/{security-audit-b86aSgH2.mjs → security-audit-CYRW0D76.mjs} +1 -2
- package/dist/.setup/{session-conversation-BSBNK5Mq.mjs → session-conversation-CFw-zLLy.mjs} +2 -3
- package/dist/.setup/{setup-api-sm3s4wvX.mjs → setup-api-DuREj_Gj.mjs} +1 -1
- package/dist/.setup/{subagent-hooks-CvVuM0O4.mjs → subagent-hooks-CA-gJ3Cu.mjs} +4 -5
- package/dist/.setup/{thread-bindings-BxKmOara.mjs → thread-bindings-6eyktxK_.mjs} +1 -2
- package/dist/.source-module-urls/6579f1b33dd01f8f0aaea28311ed6df1a635f9ad1e6fa86dcba53bca46407e55.json +1 -1
- package/dist/api.js +20 -32
- package/dist/channel-entry.js +1 -2
- package/dist/channel-plugin-api.js +1 -1
- package/dist/configured-state.js +1 -2
- package/dist/contract-api.js +3 -3
- package/dist/doctor-contract-api.js +1 -1
- package/dist/index.js +1 -2
- package/dist/runtime-api.js +1 -1
- package/dist/runtime-setter-api.js +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/security-contract-api.js +1 -1
- package/dist/session-binding-contract-api.js +1 -1
- package/dist/session-key-api.js +1 -1
- package/dist/setup-api.js +1 -1
- package/dist/setup-entry.js +4 -5
- package/dist/subagent-hooks-api.js +2 -3
- package/package.json +4 -4
- 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-
|
|
2
|
-
import { o as resolveConfiguredFeishuGroupSessionScope, t as buildFeishuConversationId, u as resolveReceiveIdType } from "./conversation-id-
|
|
3
|
-
import { c as resolveFeishuLegacyWebhookListener, l as gateway_config_runtime_exports, s as describeFeishuWebhookPathConflict } from "./channel-
|
|
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-
|
|
5
|
-
import { t as getFeishuRuntime } from "./runtime-
|
|
6
|
-
import { a as getFeishuUserAgent, f as resolveConfiguredHttpTimeoutMs, i as createFeishuWSClient, n as createEventDispatcher, r as createFeishuClient } from "./client-
|
|
7
|
-
import { t as createFeishuThreadBindingManager } from "./thread-bindings-
|
|
8
|
-
import { r as getChatInfo } from "./chat-
|
|
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-oXfjraK8.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-
|
|
11
|
-
import { a as waitForAbortableDelay, i as raceWithTimeoutAndAbort } from "./probe-
|
|
12
|
-
import { t as fetchBotIdentityForMonitor } from "./monitor-
|
|
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-DHVCTSyT.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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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) {
|
|
@@ -1013,18 +999,6 @@ function truncateSummary(text, max = 50) {
|
|
|
1013
999
|
function shouldPushStreamingUpdate(previousText, nextText) {
|
|
1014
1000
|
return !previousText || /[\n。!?!?;;::]$/.test(nextText) || nextText.length - previousText.length >= STREAMING_SIGNIFICANT_DELTA_CHARS;
|
|
1015
1001
|
}
|
|
1016
|
-
/** Merges cumulative or overlapping streaming snapshots without duplicating content. */
|
|
1017
|
-
function mergeStreamingText(previousText, nextText) {
|
|
1018
|
-
const previous = typeof previousText === "string" ? previousText : "";
|
|
1019
|
-
const next = typeof nextText === "string" ? nextText : "";
|
|
1020
|
-
if (!next) return previous;
|
|
1021
|
-
if (!previous || next === previous) return next;
|
|
1022
|
-
if (next.includes(previous)) return next;
|
|
1023
|
-
if (previous.includes(next)) return previous;
|
|
1024
|
-
const maxOverlap = Math.min(previous.length, next.length);
|
|
1025
|
-
for (let overlap = maxOverlap; overlap > 0; overlap -= 1) if (previous.slice(-overlap) === next.slice(0, overlap)) return `${previous}${next.slice(overlap)}`;
|
|
1026
|
-
return `${previous}${next}`;
|
|
1027
|
-
}
|
|
1028
1002
|
var FeishuStreamingSession = class {
|
|
1029
1003
|
constructor(client, creds, log) {
|
|
1030
1004
|
this.state = null;
|
|
@@ -1285,8 +1259,7 @@ var FeishuStreamingSession = class {
|
|
|
1285
1259
|
return this.state !== null && !this.closed;
|
|
1286
1260
|
}
|
|
1287
1261
|
};
|
|
1288
|
-
|
|
1289
|
-
//#region extensions/feishu/src/streaming-update.ts
|
|
1262
|
+
// extensions/feishu/src/streaming-update.ts
|
|
1290
1263
|
/** Admit captured snapshots in order while the session owns provider writes. */
|
|
1291
1264
|
function queueFeishuStreamingUpdate(params) {
|
|
1292
1265
|
const { queue, session, startPromise, text, accountId, runtime } = params;
|
|
@@ -1295,8 +1268,7 @@ function queueFeishuStreamingUpdate(params) {
|
|
|
1295
1268
|
if (session?.isActive()) session.update(text).catch((error) => runtime.error?.(`feishu[${accountId}] streaming update failed: ${String(error)}`));
|
|
1296
1269
|
});
|
|
1297
1270
|
}
|
|
1298
|
-
|
|
1299
|
-
//#region extensions/feishu/src/typing-backoff.ts
|
|
1271
|
+
// extensions/feishu/src/typing-backoff.ts
|
|
1300
1272
|
/** Feishu API codes that should trip the typing circuit breaker. */
|
|
1301
1273
|
const FEISHU_BACKOFF_CODES = /* @__PURE__ */ new Set([
|
|
1302
1274
|
99991400,
|
|
@@ -1324,8 +1296,7 @@ function getBackoffCodeFromResponse(response) {
|
|
|
1324
1296
|
const code = response.code;
|
|
1325
1297
|
return typeof code === "number" && FEISHU_BACKOFF_CODES.has(code) ? code : void 0;
|
|
1326
1298
|
}
|
|
1327
|
-
|
|
1328
|
-
//#region extensions/feishu/src/typing.ts
|
|
1299
|
+
// extensions/feishu/src/typing.ts
|
|
1329
1300
|
const TYPING_EMOJI = "Typing";
|
|
1330
1301
|
async function requestTypingReaction(request, operation, readResponse, runtime) {
|
|
1331
1302
|
const indicator = `typing indicator${operation === "remove" ? " removal" : ""}`;
|
|
@@ -1393,8 +1364,7 @@ async function removeTypingIndicator(params) {
|
|
|
1393
1364
|
reaction_id: state.reactionId
|
|
1394
1365
|
} }), "remove", () => void 0, runtime);
|
|
1395
1366
|
}
|
|
1396
|
-
|
|
1397
|
-
//#region extensions/feishu/src/reply-dispatcher.ts
|
|
1367
|
+
// extensions/feishu/src/reply-dispatcher.ts
|
|
1398
1368
|
function mergeStreamingFinalText(previousText, nextText, appendError) {
|
|
1399
1369
|
if (!appendError || !previousText || nextText.startsWith(previousText)) return nextText;
|
|
1400
1370
|
if (previousText.endsWith(`\n\n${nextText}`)) return previousText;
|
|
@@ -1517,7 +1487,6 @@ function createFeishuReplyDispatcher(params) {
|
|
|
1517
1487
|
let reasoningText = "";
|
|
1518
1488
|
let statusLine = "";
|
|
1519
1489
|
let snapshotBaseText = "";
|
|
1520
|
-
let lastSnapshotTextLength = 0;
|
|
1521
1490
|
let hasStreamingFinalText = false;
|
|
1522
1491
|
const deliveredFinalTexts = /* @__PURE__ */ new Set();
|
|
1523
1492
|
let lastStreamingSettlement;
|
|
@@ -1555,14 +1524,7 @@ function createFeishuReplyDispatcher(params) {
|
|
|
1555
1524
|
if (options?.dedupeWithLastPartial && nextText === lastPartial) return;
|
|
1556
1525
|
if (options?.dedupeWithLastPartial) lastPartial = nextText;
|
|
1557
1526
|
if ((options?.mode ?? "snapshot") === "delta") streamText = `${streamText}${nextText}`;
|
|
1558
|
-
else {
|
|
1559
|
-
const currentSnapshotText = snapshotBaseText ? streamText.slice(snapshotBaseText.length) : streamText;
|
|
1560
|
-
if (lastSnapshotTextLength >= 20 && nextText.length < lastSnapshotTextLength * .5 && !currentSnapshotText.includes(nextText)) {
|
|
1561
|
-
snapshotBaseText = streamText;
|
|
1562
|
-
streamText = `${snapshotBaseText}${nextText}`;
|
|
1563
|
-
} else streamText = `${snapshotBaseText}${mergeStreamingText(currentSnapshotText, nextText)}`;
|
|
1564
|
-
lastSnapshotTextLength = nextText.length;
|
|
1565
|
-
}
|
|
1527
|
+
else streamText = `${snapshotBaseText}${nextText}`;
|
|
1566
1528
|
flushStreamingCardUpdate(buildCombinedStreamText(reasoningText, streamText));
|
|
1567
1529
|
};
|
|
1568
1530
|
const startStreaming = () => {
|
|
@@ -1608,7 +1570,6 @@ function createFeishuReplyDispatcher(params) {
|
|
|
1608
1570
|
reasoningText = "";
|
|
1609
1571
|
statusLine = "";
|
|
1610
1572
|
snapshotBaseText = "";
|
|
1611
|
-
lastSnapshotTextLength = 0;
|
|
1612
1573
|
hasStreamingFinalText = false;
|
|
1613
1574
|
};
|
|
1614
1575
|
const performStreamingClose = async (disposition) => {
|
|
@@ -2021,7 +1982,7 @@ function createFeishuReplyDispatcher(params) {
|
|
|
2021
1982
|
...payload,
|
|
2022
1983
|
text: payloadText
|
|
2023
1984
|
});
|
|
2024
|
-
const text = info?.kind === "final" && !hasIndependentPresentation ? mergeStreamingFinalText(streamText, reply.text
|
|
1985
|
+
const text = info?.kind === "final" && !hasIndependentPresentation ? mergeStreamingFinalText(streamText, payload.isError ? reply.text : `${snapshotBaseText}${reply.text}`, payload.isError === true && hasStreamingFinalText) : reply.text;
|
|
2025
1986
|
const hasText = reply.hasText;
|
|
2026
1987
|
const hasMedia = reply.hasMedia;
|
|
2027
1988
|
const ttsSupplement = getReplyPayloadTtsSupplement(payload);
|
|
@@ -2098,8 +2059,6 @@ function createFeishuReplyDispatcher(params) {
|
|
|
2098
2059
|
if (info?.kind === "final") {
|
|
2099
2060
|
streamText = text;
|
|
2100
2061
|
hasStreamingFinalText = true;
|
|
2101
|
-
snapshotBaseText = "";
|
|
2102
|
-
lastSnapshotTextLength = text.length;
|
|
2103
2062
|
flushStreamingCardUpdate(buildCombinedStreamText(reasoningText, streamText));
|
|
2104
2063
|
}
|
|
2105
2064
|
}
|
|
@@ -2135,6 +2094,7 @@ function createFeishuReplyDispatcher(params) {
|
|
|
2135
2094
|
replyOptions: {
|
|
2136
2095
|
onModelSelected,
|
|
2137
2096
|
disableBlockStreaming: !coreBlockStreamingEnabled,
|
|
2097
|
+
preserveProgressCallbackStartOrder: previewStreamingEnabled ? true : void 0,
|
|
2138
2098
|
onPartialReply: previewStreamingEnabled ? (payload) => {
|
|
2139
2099
|
if (!payload.text) return false;
|
|
2140
2100
|
const cleaned = stripReasoningTagsFromText(payload.text, {
|
|
@@ -2171,15 +2131,18 @@ function createFeishuReplyDispatcher(params) {
|
|
|
2171
2131
|
if (statusLineLocal) return updateStreamingStatusLine(statusLineLocal);
|
|
2172
2132
|
return false;
|
|
2173
2133
|
} : void 0,
|
|
2174
|
-
onAssistantMessageStart: previewStreamingEnabled ? () =>
|
|
2134
|
+
onAssistantMessageStart: previewStreamingEnabled ? () => {
|
|
2135
|
+
snapshotBaseText = streamText ? `${streamText}\n\n` : "";
|
|
2136
|
+
lastPartial = "";
|
|
2137
|
+
return updateStreamingStatusLine("", false);
|
|
2138
|
+
} : void 0,
|
|
2175
2139
|
onCompactionStart: previewStreamingEnabled ? () => updateStreamingStatusLine("📦 **Compacting context...**") : void 0,
|
|
2176
2140
|
onCompactionEnd: previewStreamingEnabled ? () => updateStreamingStatusLine("") : void 0
|
|
2177
2141
|
},
|
|
2178
2142
|
ensureNoVisibleReplyFallback
|
|
2179
2143
|
};
|
|
2180
2144
|
}
|
|
2181
|
-
|
|
2182
|
-
//#region extensions/feishu/src/synthetic-event-target.ts
|
|
2145
|
+
// extensions/feishu/src/synthetic-event-target.ts
|
|
2183
2146
|
const directPreDispatchTargets = /* @__PURE__ */ new WeakMap();
|
|
2184
2147
|
/** Keep synthetic-only routing metadata outside the public Feishu event shape. */
|
|
2185
2148
|
function setFeishuSyntheticDirectPreDispatchTarget(event, target) {
|
|
@@ -2189,8 +2152,7 @@ function setFeishuSyntheticDirectPreDispatchTarget(event, target) {
|
|
|
2189
2152
|
function getFeishuSyntheticDirectPreDispatchTarget(event) {
|
|
2190
2153
|
return directPreDispatchTargets.get(event);
|
|
2191
2154
|
}
|
|
2192
|
-
|
|
2193
|
-
//#region extensions/feishu/src/bot.ts
|
|
2155
|
+
// extensions/feishu/src/bot.ts
|
|
2194
2156
|
const permissionErrorNotifiedAt = /* @__PURE__ */ new Map();
|
|
2195
2157
|
const PERMISSION_ERROR_COOLDOWN_MS = 3e5;
|
|
2196
2158
|
function isFeishuTopicSessionScope(scope) {
|
|
@@ -2997,7 +2959,7 @@ async function handleFeishuMessage(params) {
|
|
|
2997
2959
|
readAllowFromStore: pairing.readAllowFromStore,
|
|
2998
2960
|
senderOpenId: ctx.senderOpenId,
|
|
2999
2961
|
senderUserId,
|
|
3000
|
-
conversationId: ctx.
|
|
2962
|
+
conversationId: ctx.chatId,
|
|
3001
2963
|
mayPair: false,
|
|
3002
2964
|
contextBinding
|
|
3003
2965
|
});
|
|
@@ -3347,12 +3309,10 @@ async function handleFeishuMessage(params) {
|
|
|
3347
3309
|
if (turnAdoptionLifecycle) throw err;
|
|
3348
3310
|
}
|
|
3349
3311
|
}
|
|
3350
|
-
|
|
3351
|
-
//#region extensions/feishu/src/card-action-state.ts
|
|
3312
|
+
// extensions/feishu/src/card-action-state.ts
|
|
3352
3313
|
const processedCardActions = /* @__PURE__ */ new Map();
|
|
3353
3314
|
const resolvedCardActionChatTypes = /* @__PURE__ */ new Map();
|
|
3354
|
-
|
|
3355
|
-
//#region extensions/feishu/src/card-ux-shared.ts
|
|
3315
|
+
// extensions/feishu/src/card-ux-shared.ts
|
|
3356
3316
|
function buildFeishuActionCard(params) {
|
|
3357
3317
|
return {
|
|
3358
3318
|
schema: "2.0",
|
|
@@ -3368,8 +3328,15 @@ function buildFeishuActionCard(params) {
|
|
|
3368
3328
|
tag: "markdown",
|
|
3369
3329
|
content: params.content
|
|
3370
3330
|
}, {
|
|
3371
|
-
tag: "
|
|
3372
|
-
|
|
3331
|
+
tag: "column_set",
|
|
3332
|
+
flex_mode: "none",
|
|
3333
|
+
horizontal_spacing: "default",
|
|
3334
|
+
columns: params.actions.map((button) => ({
|
|
3335
|
+
tag: "column",
|
|
3336
|
+
width: "auto",
|
|
3337
|
+
vertical_align: "center",
|
|
3338
|
+
elements: [button]
|
|
3339
|
+
}))
|
|
3373
3340
|
}] }
|
|
3374
3341
|
};
|
|
3375
3342
|
}
|
|
@@ -3393,8 +3360,7 @@ function buildFeishuCardInteractionContext(params) {
|
|
|
3393
3360
|
...params.chatType ? { t: params.chatType } : {}
|
|
3394
3361
|
};
|
|
3395
3362
|
}
|
|
3396
|
-
|
|
3397
|
-
//#region extensions/feishu/src/card-ux-approval.ts
|
|
3363
|
+
// extensions/feishu/src/card-ux-approval.ts
|
|
3398
3364
|
const FEISHU_APPROVAL_REQUEST_ACTION = "feishu.quick_actions.request_approval";
|
|
3399
3365
|
const FEISHU_APPROVAL_CONFIRM_ACTION = "feishu.approval.confirm";
|
|
3400
3366
|
const FEISHU_APPROVAL_CANCEL_ACTION = "feishu.approval.cancel";
|
|
@@ -3423,8 +3389,7 @@ function createApprovalCard(params) {
|
|
|
3423
3389
|
})]
|
|
3424
3390
|
});
|
|
3425
3391
|
}
|
|
3426
|
-
|
|
3427
|
-
//#region extensions/feishu/src/card-action.ts
|
|
3392
|
+
// extensions/feishu/src/card-action.ts
|
|
3428
3393
|
const FEISHU_APPROVAL_CARD_TTL_MS = 3e5;
|
|
3429
3394
|
const FEISHU_CARD_ACTION_TOKEN_TTL_MS = 9e5;
|
|
3430
3395
|
function pruneExpiredCardEntries(cache, now) {
|
|
@@ -3654,8 +3619,7 @@ async function handleFeishuCardAction(params) {
|
|
|
3654
3619
|
refreshFeishuCardActionToken(event.token, account.accountId);
|
|
3655
3620
|
}
|
|
3656
3621
|
}
|
|
3657
|
-
|
|
3658
|
-
//#region extensions/feishu/src/feishu-ingress.ts
|
|
3622
|
+
// extensions/feishu/src/feishu-ingress.ts
|
|
3659
3623
|
const FEISHU_INGRESS_PAYLOAD_VERSION = 1;
|
|
3660
3624
|
const FEISHU_INGRESS_POLL_INTERVAL_MS = 500;
|
|
3661
3625
|
const FEISHU_DURABLE_EVENT_TYPES = /* @__PURE__ */ new Set(["drive.notice.comment_add_v1", "im.message.receive_v1"]);
|
|
@@ -3930,8 +3894,7 @@ function createFeishuDurableIngress(options) {
|
|
|
3930
3894
|
waitForIdle: monitor.waitForIdle
|
|
3931
3895
|
};
|
|
3932
3896
|
}
|
|
3933
|
-
|
|
3934
|
-
//#region extensions/feishu/src/monitor.state.ts
|
|
3897
|
+
// extensions/feishu/src/monitor.state.ts
|
|
3935
3898
|
const wsClients = /* @__PURE__ */ new Map();
|
|
3936
3899
|
const botOpenIds = /* @__PURE__ */ new Map();
|
|
3937
3900
|
const botIdentityRevisions = /* @__PURE__ */ new Map();
|
|
@@ -3962,8 +3925,7 @@ function recordWebhookStatus(runtime, accountId, path, statusCode) {
|
|
|
3962
3925
|
message: (count) => `${label}: webhook anomaly path=${path} status=${statusCode} count=${count}`
|
|
3963
3926
|
});
|
|
3964
3927
|
}
|
|
3965
|
-
|
|
3966
|
-
//#region extensions/feishu/src/monitor.bot-identity.ts
|
|
3928
|
+
// extensions/feishu/src/monitor.bot-identity.ts
|
|
3967
3929
|
const BOT_IDENTITY_RETRY_DELAYS_MS = [
|
|
3968
3930
|
6e4,
|
|
3969
3931
|
12e4,
|
|
@@ -4005,8 +3967,7 @@ function startBotIdentityRecovery(params) {
|
|
|
4005
3967
|
(runtime?.error ?? console.error)(`feishu[${accountId}]: bot identity background retry failed unexpectedly: ${String(err)}`);
|
|
4006
3968
|
});
|
|
4007
3969
|
}
|
|
4008
|
-
|
|
4009
|
-
//#region extensions/feishu/src/card-ux-launcher.ts
|
|
3970
|
+
// extensions/feishu/src/card-ux-launcher.ts
|
|
4010
3971
|
const FEISHU_QUICK_ACTION_CARD_TTL_MS = 6e5;
|
|
4011
3972
|
const QUICK_ACTION_MENU_KEYS = /* @__PURE__ */ new Set([
|
|
4012
3973
|
"quick-actions",
|
|
@@ -4079,8 +4040,7 @@ async function maybeHandleFeishuQuickActionMenu(params) {
|
|
|
4079
4040
|
params.runtime?.log?.(`feishu[${params.accountId ?? "default"}]: opened quick-action launcher for ${params.operatorOpenId}`);
|
|
4080
4041
|
return true;
|
|
4081
4042
|
}
|
|
4082
|
-
|
|
4083
|
-
//#region extensions/feishu/src/monitor.synthetic-error.ts
|
|
4043
|
+
// extensions/feishu/src/monitor.synthetic-error.ts
|
|
4084
4044
|
var FeishuRetryableSyntheticEventError = class extends Error {
|
|
4085
4045
|
constructor(message, options) {
|
|
4086
4046
|
super(message, options);
|
|
@@ -4090,8 +4050,7 @@ var FeishuRetryableSyntheticEventError = class extends Error {
|
|
|
4090
4050
|
function isFeishuRetryableSyntheticEventError(error) {
|
|
4091
4051
|
return error instanceof FeishuRetryableSyntheticEventError || typeof error === "object" && error !== null && "name" in error && error.name === "FeishuRetryableSyntheticEventError";
|
|
4092
4052
|
}
|
|
4093
|
-
|
|
4094
|
-
//#region extensions/feishu/src/monitor.bot-menu-handler.ts
|
|
4053
|
+
// extensions/feishu/src/monitor.bot-menu-handler.ts
|
|
4095
4054
|
function createFeishuBotMenuHandler(params) {
|
|
4096
4055
|
const { cfg, accountId, runtime, chatHistories, fireAndForget } = params;
|
|
4097
4056
|
const log = runtime?.log ?? console.log;
|
|
@@ -4194,8 +4153,7 @@ function createFeishuBotMenuHandler(params) {
|
|
|
4194
4153
|
return task;
|
|
4195
4154
|
};
|
|
4196
4155
|
}
|
|
4197
|
-
|
|
4198
|
-
//#region extensions/feishu/src/comment-dispatcher.ts
|
|
4156
|
+
// extensions/feishu/src/comment-dispatcher.ts
|
|
4199
4157
|
function createFeishuCommentReplyDispatcher(params) {
|
|
4200
4158
|
const core = getFeishuRuntime();
|
|
4201
4159
|
const prefixContext = createReplyPrefixContext({
|
|
@@ -4273,8 +4231,7 @@ function createFeishuCommentReplyDispatcher(params) {
|
|
|
4273
4231
|
cleanupTypingReaction: typingReaction.cleanup
|
|
4274
4232
|
};
|
|
4275
4233
|
}
|
|
4276
|
-
|
|
4277
|
-
//#region extensions/feishu/src/monitor.comment.ts
|
|
4234
|
+
// extensions/feishu/src/monitor.comment.ts
|
|
4278
4235
|
const FEISHU_COMMENT_VERIFY_TIMEOUT_MS = 3e3;
|
|
4279
4236
|
const FEISHU_COMMENT_PAGE_SIZE = 100;
|
|
4280
4237
|
const FEISHU_COMMENT_PAGE_LIMIT = 5;
|
|
@@ -4702,7 +4659,7 @@ async function resolveDriveCommentEventTurn(params) {
|
|
|
4702
4659
|
return null;
|
|
4703
4660
|
}
|
|
4704
4661
|
const context = await fetchDriveCommentContext({
|
|
4705
|
-
client: createClient ? createClient(account ?? { accountId }) : createFeishuClient((await import("./doctor-contract-
|
|
4662
|
+
client: createClient ? createClient(account ?? { accountId }) : createFeishuClient((await import("./doctor-contract-CWB6EycD.mjs").then((n) => n.l)).resolveFeishuAccount({
|
|
4706
4663
|
cfg,
|
|
4707
4664
|
accountId
|
|
4708
4665
|
})),
|
|
@@ -4771,8 +4728,7 @@ function parseFeishuDriveCommentNoticeEventPayload(value) {
|
|
|
4771
4728
|
type: readStringValue(value.type)
|
|
4772
4729
|
};
|
|
4773
4730
|
}
|
|
4774
|
-
|
|
4775
|
-
//#region extensions/feishu/src/comment-handler.ts
|
|
4731
|
+
// extensions/feishu/src/comment-handler.ts
|
|
4776
4732
|
function parseTimestampMs(value) {
|
|
4777
4733
|
return parseStrictNonNegativeInteger(value) ?? Date.now();
|
|
4778
4734
|
}
|
|
@@ -5019,8 +4975,7 @@ async function handleFeishuCommentEvent(params) {
|
|
|
5019
4975
|
cleanupTypingReaction();
|
|
5020
4976
|
}
|
|
5021
4977
|
}
|
|
5022
|
-
|
|
5023
|
-
//#region extensions/feishu/src/sequential-queue.ts
|
|
4978
|
+
// extensions/feishu/src/sequential-queue.ts
|
|
5024
4979
|
const DEFAULT_TASK_TIMEOUT_MS = 3e5;
|
|
5025
4980
|
function createSequentialQueue(options = {}) {
|
|
5026
4981
|
const queues = /* @__PURE__ */ new Map();
|
|
@@ -5039,8 +4994,7 @@ function createSequentialQueue(options = {}) {
|
|
|
5039
4994
|
return next;
|
|
5040
4995
|
};
|
|
5041
4996
|
}
|
|
5042
|
-
|
|
5043
|
-
//#region extensions/feishu/src/monitor.comment-notice-handler.ts
|
|
4997
|
+
// extensions/feishu/src/monitor.comment-notice-handler.ts
|
|
5044
4998
|
function buildCommentNoticeQueueKey(event) {
|
|
5045
4999
|
return `comment-doc:${event.notice_meta?.file_type?.trim() || "unknown"}:${event.notice_meta?.file_token?.trim() || "unknown"}`;
|
|
5046
5000
|
}
|
|
@@ -5091,8 +5045,7 @@ function createFeishuDriveCommentNoticeHandler(params) {
|
|
|
5091
5045
|
await settle();
|
|
5092
5046
|
};
|
|
5093
5047
|
}
|
|
5094
|
-
|
|
5095
|
-
//#region extensions/feishu/src/monitor.message-handler.ts
|
|
5048
|
+
// extensions/feishu/src/monitor.message-handler.ts
|
|
5096
5049
|
function parseFeishuMessageEventPayload(value) {
|
|
5097
5050
|
if (!isRecord(value)) return null;
|
|
5098
5051
|
const sender = value.sender;
|
|
@@ -5347,8 +5300,7 @@ function createFeishuMessageReceiveHandler({ cfg, channelRuntime, accountId, run
|
|
|
5347
5300
|
if (!fireAndForget) await processing;
|
|
5348
5301
|
};
|
|
5349
5302
|
}
|
|
5350
|
-
|
|
5351
|
-
//#region extensions/feishu/src/monitor-rate-limit-key.ts
|
|
5303
|
+
// extensions/feishu/src/monitor-rate-limit-key.ts
|
|
5352
5304
|
function normalizeFeishuWebhookRateLimitClient(clientIp) {
|
|
5353
5305
|
if (!clientIp) return "unknown";
|
|
5354
5306
|
if (clientIp === "::1" || clientIp.startsWith("127.")) return "loopback";
|
|
@@ -5357,8 +5309,7 @@ function normalizeFeishuWebhookRateLimitClient(clientIp) {
|
|
|
5357
5309
|
function buildFeishuWebhookRateLimitKey(params) {
|
|
5358
5310
|
return `${params.accountId === void 0 ? params.path : `${params.accountId}:${params.path}`}:${normalizeFeishuWebhookRateLimitClient(params.clientIp)}`;
|
|
5359
5311
|
}
|
|
5360
|
-
|
|
5361
|
-
//#region extensions/feishu/src/monitor.transport.ts
|
|
5312
|
+
// extensions/feishu/src/monitor.transport.ts
|
|
5362
5313
|
const FEISHU_WEBHOOK_ACCEPTED_HEADER = "x-openclaw-delivery-accepted";
|
|
5363
5314
|
const FEISHU_WEBHOOK_ACCEPTED_VALUE = "durable";
|
|
5364
5315
|
const FEISHU_PRE_AUTH_MAX_IN_FLIGHT = 64;
|
|
@@ -5745,8 +5696,7 @@ async function monitorWebhook(params) {
|
|
|
5745
5696
|
await cleanup();
|
|
5746
5697
|
}
|
|
5747
5698
|
}
|
|
5748
|
-
|
|
5749
|
-
//#region extensions/feishu/src/monitor.vc-meeting-invited-handler.ts
|
|
5699
|
+
// extensions/feishu/src/monitor.vc-meeting-invited-handler.ts
|
|
5750
5700
|
const FEISHU_MEETING_NUMBER_PATTERN = /^\d{9}$/;
|
|
5751
5701
|
function parseInviteTimestamp(value) {
|
|
5752
5702
|
const parsed = Number.parseInt(value ?? "", 10);
|
|
@@ -5886,8 +5836,7 @@ function createFeishuVcMeetingInvitedHandler(params) {
|
|
|
5886
5836
|
return fireAndForget ? Promise.resolve() : task;
|
|
5887
5837
|
};
|
|
5888
5838
|
}
|
|
5889
|
-
|
|
5890
|
-
//#region extensions/feishu/src/sequential-key.ts
|
|
5839
|
+
// extensions/feishu/src/sequential-key.ts
|
|
5891
5840
|
function getFeishuSequentialKey(params) {
|
|
5892
5841
|
const { accountId, event, botOpenId, preparedContent } = params;
|
|
5893
5842
|
const baseKey = `feishu:${accountId}:${event.message.chat_id?.trim() || "unknown"}`;
|
|
@@ -5896,8 +5845,7 @@ function getFeishuSequentialKey(params) {
|
|
|
5896
5845
|
if (isBtwRequestText(text)) return `${baseKey}:btw`;
|
|
5897
5846
|
return baseKey;
|
|
5898
5847
|
}
|
|
5899
|
-
|
|
5900
|
-
//#region extensions/feishu/src/monitor.account.ts
|
|
5848
|
+
// extensions/feishu/src/monitor.account.ts
|
|
5901
5849
|
const FEISHU_REACTION_VERIFY_TIMEOUT_MS = 1500;
|
|
5902
5850
|
async function resolveReactionSyntheticEvent(params) {
|
|
5903
5851
|
const { cfg, accountId, event, botOpenId, fetchMessage = getMessageFeishu, verificationTimeoutMs = FEISHU_REACTION_VERIFY_TIMEOUT_MS, logger, uuid = () => crypto$1.randomUUID(), action = "created" } = params;
|
|
@@ -5907,7 +5855,7 @@ async function resolveReactionSyntheticEvent(params) {
|
|
|
5907
5855
|
const senderUserId = event.user_id?.user_id?.trim();
|
|
5908
5856
|
const senderId = senderOpenId || senderUserId;
|
|
5909
5857
|
if (!emoji || !messageId || !senderId) return null;
|
|
5910
|
-
const { resolveFeishuAccount } = await import("./doctor-contract-
|
|
5858
|
+
const { resolveFeishuAccount } = await import("./doctor-contract-CWB6EycD.mjs").then((n) => n.l);
|
|
5911
5859
|
const reactionNotifications = resolveFeishuAccount({
|
|
5912
5860
|
cfg,
|
|
5913
5861
|
accountId
|
|
@@ -6195,5 +6143,4 @@ async function monitorSingleAccount(params) {
|
|
|
6195
6143
|
threadBindingManager?.stop();
|
|
6196
6144
|
}
|
|
6197
6145
|
}
|
|
6198
|
-
//#endregion
|
|
6199
6146
|
export { FeishuRetryableSyntheticEventError, monitorSingleAccount, resolveReactionSyntheticEvent };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { _ as __exportAll } from "./doctor-contract-
|
|
2
|
-
import { r as createFeishuClient } from "./client-
|
|
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
|
-
|
|
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
|
-
|
|
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 };
|