@openclaw/feishu 2026.11.5-beta.1 → 2026.11.5-beta.3
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-CBgQSu2L.mjs → app-registration-DhnIp0Kd.mjs} +2 -1
- package/dist/.setup/{channel-C-ihVGPI.mjs → channel-B7oAL99p.mjs} +55 -35
- package/dist/.setup/{channel.runtime-B-bwxyuO.mjs → channel.runtime-CPZ_4RmH.mjs} +14 -10
- package/dist/.setup/{chat-BnbyUuyu.mjs → chat-g8dTUdIb.mjs} +4 -3
- package/dist/.setup/{client-BAiJnY41.mjs → client-DqGMyzOi.mjs} +7 -4
- package/dist/.setup/{conversation-id-N6q3vKm-.mjs → conversation-id-BLsHZ7pf.mjs} +4 -2
- package/dist/.setup/{doctor-contract-ItAh0keT.mjs → doctor-contract-CPh2u5-o.mjs} +20 -10
- package/dist/.setup/{message-action-contract-BZK6bpAl.mjs → message-action-contract-DMVMY_ng.mjs} +2 -1
- package/dist/.setup/{monitor-BTjbcB44.mjs → monitor-BqBGfE5v.mjs} +10 -7
- package/dist/.setup/{monitor.account-bY8MrrbE.mjs → monitor.account-Dg2Hz-4E.mjs} +88 -50
- package/dist/.setup/{probe-D87MR-Mn.mjs → probe-CbNVGjv_.mjs} +6 -4
- package/dist/.setup/{reply-delivery-result-Bx8hMh42.mjs → reply-delivery-result-BjOCvaPo.mjs} +66 -35
- package/dist/.setup/{runtime-6V3uDMw5.mjs → runtime-C5JxBWZp.mjs} +2 -1
- package/dist/.setup/runtime-setter-api-BrQHE03y.mjs +2 -0
- package/dist/.setup/{secret-contract-BAucuP6O.mjs → secret-contract-Do6HTIFT.mjs} +2 -1
- package/dist/.setup/{secret-contract-api-DR5mIHhJ.mjs → secret-contract-api-LwCXK5Qg.mjs} +1 -1
- package/dist/.setup/{security-audit-CYRW0D76.mjs → security-audit-b86aSgH2.mjs} +2 -1
- package/dist/.setup/{session-conversation-DLgXP0-H.mjs → session-conversation-CM3UgYZY.mjs} +3 -2
- package/dist/.setup/{setup-api-D-s4rNpi.mjs → setup-api-CqAPCSPK.mjs} +1 -1
- package/dist/.setup/{subagent-hooks-BRem84Mh.mjs → subagent-hooks-DdiyEIi7.mjs} +5 -4
- package/dist/.setup/{thread-bindings-6eyktxK_.mjs → thread-bindings-BxKmOara.mjs} +2 -1
- package/dist/.source-module-urls/6579f1b33dd01f8f0aaea28311ed6df1a635f9ad1e6fa86dcba53bca46407e55.json +1 -1
- package/dist/api.js +28 -18
- package/dist/channel-entry.js +2 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/configured-state.js +2 -1
- package/dist/contract-api.js +3 -3
- package/dist/doctor-contract-api.js +1 -1
- package/dist/index.js +2 -1
- 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 +5 -4
- package/dist/subagent-hooks-api.js +3 -2
- package/package.json +4 -4
- package/dist/.setup/runtime-setter-api-DSLLnejl.mjs +0 -2
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { c as normalizeFeishuExternalKey, g as resolveFeishuRuntimeAccount, h as resolveFeishuAccount, s as normalizeFeishuWebhookPath } from "./doctor-contract-
|
|
2
|
-
import { c as resolveFeishuLegacyWebhookListener, l as gateway_config_runtime_exports, s as describeFeishuWebhookPathConflict } from "./channel-
|
|
3
|
-
import { o as resolveConfiguredFeishuGroupSessionScope, t as buildFeishuConversationId, u as resolveReceiveIdType } from "./conversation-id-
|
|
4
|
-
import { A as sendMessageFeishu, At as resolveFeishuGroupConfig, B as parseInteractiveCardContent, D as getMessageFeishu, Dt as hasExplicitFeishuGroupConfig, F as isFeishuBroadcastMention, G as resolveCardHeader, H as resolveFeishuSenderName, I as isMentionForwardRequest, It as resolveFeishuChatType, J as deliverCommentThreadText, K as resolveCardNote, 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, at as formatFeishuApiError, b as withinCardTableLimit, ct as buildFeishuCommentTarget, d as consumeFeishuPresentationFallbackMarker, ft as resolveFeishuCardTemplate, ht as materializeFeishuPostMarkdownSoftBreaks, i as noVisibleFeishuReplyDelivery, it as extractFeishuApiErrorMeta, 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, 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-CPh2u5-o.mjs";
|
|
2
|
+
import { c as resolveFeishuLegacyWebhookListener, l as gateway_config_runtime_exports, s as describeFeishuWebhookPathConflict } from "./channel-B7oAL99p.mjs";
|
|
3
|
+
import { o as resolveConfiguredFeishuGroupSessionScope, t as buildFeishuConversationId, u as resolveReceiveIdType } from "./conversation-id-BLsHZ7pf.mjs";
|
|
4
|
+
import { A as sendMessageFeishu, At as resolveFeishuGroupConfig, B as parseInteractiveCardContent, D as getMessageFeishu, Dt as hasExplicitFeishuGroupConfig, F as isFeishuBroadcastMention, G as resolveCardHeader, H as resolveFeishuSenderName, I as isMentionForwardRequest, It as resolveFeishuChatType, J as deliverCommentThreadText, K as resolveCardNote, 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, at as formatFeishuApiError, b as withinCardTableLimit, ct as buildFeishuCommentTarget, d as consumeFeishuPresentationFallbackMarker, ft as resolveFeishuCardTemplate, ht as materializeFeishuPostMarkdownSoftBreaks, i as noVisibleFeishuReplyDelivery, it as extractFeishuApiErrorMeta, 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, 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-BjOCvaPo.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-DqGMyzOi.mjs";
|
|
7
|
+
import { t as createFeishuThreadBindingManager } from "./thread-bindings-BxKmOara.mjs";
|
|
8
|
+
import { r as getChatInfo } from "./chat-g8dTUdIb.mjs";
|
|
9
9
|
import { evaluateSupplementalContextVisibility, normalizeAgentId as normalizeAgentId$1, resolveChannelContextVisibilityMode } from "../runtime-api.js";
|
|
10
|
-
import { a as waitForAbortableDelay, i as raceWithTimeoutAndAbort } from "./probe-
|
|
11
|
-
import { t as fetchBotIdentityForMonitor } from "./monitor-
|
|
10
|
+
import { a as waitForAbortableDelay, i as raceWithTimeoutAndAbort } from "./probe-CbNVGjv_.mjs";
|
|
11
|
+
import { t as fetchBotIdentityForMonitor } from "./monitor-BqBGfE5v.mjs";
|
|
12
12
|
import { resolveAgentConfig } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
13
13
|
import { DEFAULT_INGRESS_ADOPTION_STALL_MS, bindIngressLifecycleToReplyOptions, createChannelIngressError, createChannelIngressMonitor, createChannelMessageReplyPipeline, createReplyPrefixContext, formatChannelProgressDraftLineForEntry, resolveAgentOutboundIdentity, resolveChannelPreviewStreamMode, resolveChannelStreamingBlockEnabled, waitUntilAbort } from "openclaw/plugin-sdk/channel-outbound";
|
|
14
14
|
import { createChannelPairingController } from "openclaw/plugin-sdk/channel-pairing";
|
|
@@ -53,7 +53,7 @@ import { sendJson } from "openclaw/plugin-sdk/http-response-runtime";
|
|
|
53
53
|
import { createWebhookInFlightLimiter, readWebhookBodyOrReject, sendHttpRequestRejection } from "openclaw/plugin-sdk/webhook-request-guards";
|
|
54
54
|
import { canonicalizeWebhookRouteKey, registerPluginHttpRoute, registerWebhookTarget, resolveSingleWebhookTarget } from "openclaw/plugin-sdk/webhook-targets";
|
|
55
55
|
import { isAbortRequestText, isBtwRequestText } from "openclaw/plugin-sdk/command-primitives-runtime";
|
|
56
|
-
|
|
56
|
+
//#region src/channels/mention-gating.ts
|
|
57
57
|
function resolveBotThreadMentionPolicy(params) {
|
|
58
58
|
if (!params.isBotOwnedThread || params.requireMentionInBotThreads === void 0) return {
|
|
59
59
|
requireMention: params.requireMention,
|
|
@@ -64,7 +64,8 @@ function resolveBotThreadMentionPolicy(params) {
|
|
|
64
64
|
implicitMentionKinds: params.requireMentionInBotThreads ? params.implicitMentionKinds?.filter((kind) => kind === "native") : params.implicitMentionKinds
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
|
-
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region extensions/feishu/src/bot-agent-body.ts
|
|
68
69
|
const MAX_MENTION_CONTEXT_NAME_LENGTH = 80;
|
|
69
70
|
function formatMentionNameForAgentContext(name) {
|
|
70
71
|
const normalized = Array.from(name, (char) => {
|
|
@@ -94,7 +95,8 @@ function buildFeishuAgentBody(params) {
|
|
|
94
95
|
}
|
|
95
96
|
return messageBody;
|
|
96
97
|
}
|
|
97
|
-
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region extensions/feishu/src/bot-broadcast.ts
|
|
98
100
|
function createFeishuBroadcastIngressSettlement(params) {
|
|
99
101
|
const lanes = /* @__PURE__ */ new Set();
|
|
100
102
|
const failures = [];
|
|
@@ -247,7 +249,8 @@ function buildBroadcastSessionKey(baseSessionKey, originalAgentId, targetAgentId
|
|
|
247
249
|
const prefix = `agent:${originalAgentId}:`;
|
|
248
250
|
return baseSessionKey.startsWith(prefix) ? `agent:${targetAgentId}:${baseSessionKey.slice(prefix.length)}` : baseSessionKey;
|
|
249
251
|
}
|
|
250
|
-
|
|
252
|
+
//#endregion
|
|
253
|
+
//#region extensions/feishu/src/bot-content.ts
|
|
251
254
|
function resolveFeishuGroupSession(params) {
|
|
252
255
|
const { chatId, senderOpenId, messageId, rootId, threadId, chatType, groupConfig, feishuCfg } = params;
|
|
253
256
|
const normalizedThreadId = threadId?.trim();
|
|
@@ -436,13 +439,15 @@ async function resolveFeishuMediaList(params) {
|
|
|
436
439
|
}
|
|
437
440
|
return out;
|
|
438
441
|
}
|
|
439
|
-
|
|
442
|
+
//#endregion
|
|
443
|
+
//#region extensions/feishu/src/bot-group-name-state.ts
|
|
440
444
|
const feishuGroupNameCache = createStaleWhileRevalidateCache({
|
|
441
445
|
maxEntries: 500,
|
|
442
446
|
maxPending: Infinity,
|
|
443
447
|
ttlMs: 18e5
|
|
444
448
|
});
|
|
445
|
-
|
|
449
|
+
//#endregion
|
|
450
|
+
//#region extensions/feishu/src/bot-group-name.ts
|
|
446
451
|
async function resolveGroupName(params) {
|
|
447
452
|
const { account, chatId, log } = params;
|
|
448
453
|
if (!account.configured) return;
|
|
@@ -456,7 +461,8 @@ async function resolveGroupName(params) {
|
|
|
456
461
|
}, { allowStale: false });
|
|
457
462
|
return value;
|
|
458
463
|
}
|
|
459
|
-
|
|
464
|
+
//#endregion
|
|
465
|
+
//#region extensions/feishu/src/bot-name.ts
|
|
460
466
|
const POSITIVE_TTL_MS = 6e5;
|
|
461
467
|
const NEGATIVE_TTL_MS = 6e4;
|
|
462
468
|
const MAX_CACHE_ENTRIES = 5e3;
|
|
@@ -530,7 +536,8 @@ async function resolveFeishuBotName(params) {
|
|
|
530
536
|
inflight.delete(key);
|
|
531
537
|
}
|
|
532
538
|
}
|
|
533
|
-
|
|
539
|
+
//#endregion
|
|
540
|
+
//#region extensions/feishu/src/bot-thread-mentions.ts
|
|
534
541
|
async function prepareFeishuThreadRoot(params) {
|
|
535
542
|
let { cfg, account } = params;
|
|
536
543
|
const { ctx, botOpenId, log } = params;
|
|
@@ -575,7 +582,8 @@ async function prepareFeishuThreadRoot(params) {
|
|
|
575
582
|
getRootMessageInfo
|
|
576
583
|
};
|
|
577
584
|
}
|
|
578
|
-
|
|
585
|
+
//#endregion
|
|
586
|
+
//#region extensions/feishu/src/dedup-state.ts
|
|
579
587
|
const DEDUPE_NAMESPACE_PREFIX = "feishu.dedup";
|
|
580
588
|
const DEDUP_TTL_MS = 864e5;
|
|
581
589
|
const MEMORY_MAX_SIZE = 1e3;
|
|
@@ -598,7 +606,8 @@ const feishuDedupeState = {
|
|
|
598
606
|
this.guard = createFeishuDedupeGuard();
|
|
599
607
|
}
|
|
600
608
|
};
|
|
601
|
-
|
|
609
|
+
//#endregion
|
|
610
|
+
//#region extensions/feishu/src/dedup.ts
|
|
602
611
|
function dedupeOptions(namespace, log) {
|
|
603
612
|
return {
|
|
604
613
|
...namespace ? { namespace } : {},
|
|
@@ -634,7 +643,8 @@ async function hasProcessedFeishuMessage(messageId, namespace = "global", log) {
|
|
|
634
643
|
async function warmupDedupFromPluginState(namespace, log) {
|
|
635
644
|
return await feishuDedupeState.guard.warmup(namespace, (error) => log?.(`feishu-dedup: warmup persistent state error: ${String(error)}`));
|
|
636
645
|
}
|
|
637
|
-
|
|
646
|
+
//#endregion
|
|
647
|
+
//#region extensions/feishu/src/dedupe-key.ts
|
|
638
648
|
function resolvePostMediaParts(content) {
|
|
639
649
|
const { attachments } = parsePostContent(content, { includeTopLevelFiles: false });
|
|
640
650
|
return ["image", "file"].flatMap((kind) => attachments.filter((attachment) => attachment.kind === kind).map((attachment) => `${kind}_key:${attachment.key}`));
|
|
@@ -686,7 +696,8 @@ function resolveFeishuMessageDedupeKey(event) {
|
|
|
686
696
|
}
|
|
687
697
|
return messageId;
|
|
688
698
|
}
|
|
689
|
-
|
|
699
|
+
//#endregion
|
|
700
|
+
//#region extensions/feishu/src/dynamic-agent.ts
|
|
690
701
|
var DynamicAgentMutationSkipped = class extends Error {
|
|
691
702
|
constructor(cfg) {
|
|
692
703
|
super("dynamic agent mutation skipped");
|
|
@@ -835,7 +846,8 @@ function resolveUserPath(p) {
|
|
|
835
846
|
if (p.startsWith("~/")) return path.join(os.homedir(), p.slice(2));
|
|
836
847
|
return p;
|
|
837
848
|
}
|
|
838
|
-
|
|
849
|
+
//#endregion
|
|
850
|
+
//#region extensions/feishu/src/reasoning-preview.ts
|
|
839
851
|
async function resolveFeishuReasoningPreviewEnabled(params) {
|
|
840
852
|
const configDefault = resolveAgentConfig(params.cfg, params.agentId)?.reasoningDefault ?? params.cfg.agents?.defaults?.reasoningDefault ?? "off";
|
|
841
853
|
try {
|
|
@@ -850,9 +862,11 @@ async function resolveFeishuReasoningPreviewEnabled(params) {
|
|
|
850
862
|
}
|
|
851
863
|
return configDefault === "stream";
|
|
852
864
|
}
|
|
853
|
-
|
|
865
|
+
//#endregion
|
|
866
|
+
//#region extensions/feishu/src/reply-dispatcher-state.ts
|
|
854
867
|
const streamingStartBackoffUntilByAccount = /* @__PURE__ */ new Map();
|
|
855
|
-
|
|
868
|
+
//#endregion
|
|
869
|
+
//#region extensions/feishu/src/streaming-card.ts
|
|
856
870
|
const STREAMING_UPDATE_THROTTLE_MS = 160;
|
|
857
871
|
const STREAMING_SIGNIFICANT_DELTA_CHARS = 18;
|
|
858
872
|
const FEISHU_STREAMING_TOKEN_DEFAULT_LIFETIME_SECONDS = 7200;
|
|
@@ -1198,7 +1212,8 @@ var FeishuStreamingSession = class {
|
|
|
1198
1212
|
return this.state !== null && !this.closed;
|
|
1199
1213
|
}
|
|
1200
1214
|
};
|
|
1201
|
-
|
|
1215
|
+
//#endregion
|
|
1216
|
+
//#region extensions/feishu/src/streaming-update.ts
|
|
1202
1217
|
/** Admit captured snapshots in order while the session owns provider writes. */
|
|
1203
1218
|
function queueFeishuStreamingUpdate(params) {
|
|
1204
1219
|
const { queue, session, startPromise, text, accountId, runtime } = params;
|
|
@@ -1207,7 +1222,8 @@ function queueFeishuStreamingUpdate(params) {
|
|
|
1207
1222
|
if (session?.isActive()) session.update(text).catch((error) => runtime.error(`feishu[${accountId}] streaming update failed: ${String(error)}`));
|
|
1208
1223
|
});
|
|
1209
1224
|
}
|
|
1210
|
-
|
|
1225
|
+
//#endregion
|
|
1226
|
+
//#region extensions/feishu/src/typing-backoff.ts
|
|
1211
1227
|
/** Feishu API codes that should trip the typing circuit breaker. */
|
|
1212
1228
|
const FEISHU_BACKOFF_CODES = /* @__PURE__ */ new Set([
|
|
1213
1229
|
99991400,
|
|
@@ -1235,7 +1251,8 @@ function getBackoffCodeFromResponse(response) {
|
|
|
1235
1251
|
const code = response.code;
|
|
1236
1252
|
return typeof code === "number" && FEISHU_BACKOFF_CODES.has(code) ? code : void 0;
|
|
1237
1253
|
}
|
|
1238
|
-
|
|
1254
|
+
//#endregion
|
|
1255
|
+
//#region extensions/feishu/src/typing.ts
|
|
1239
1256
|
const TYPING_EMOJI = "Typing";
|
|
1240
1257
|
async function requestTypingReaction(request, operation, readResponse, runtime) {
|
|
1241
1258
|
const indicator = `typing indicator${operation === "remove" ? " removal" : ""}`;
|
|
@@ -1303,7 +1320,8 @@ async function removeTypingIndicator(params) {
|
|
|
1303
1320
|
reaction_id: state.reactionId
|
|
1304
1321
|
} }), "remove", () => void 0, runtime);
|
|
1305
1322
|
}
|
|
1306
|
-
|
|
1323
|
+
//#endregion
|
|
1324
|
+
//#region extensions/feishu/src/reply-dispatcher.ts
|
|
1307
1325
|
function mergeStreamingFinalText(previousText, nextText, appendError) {
|
|
1308
1326
|
if (!appendError || !previousText || nextText.startsWith(previousText)) return nextText;
|
|
1309
1327
|
if (previousText.endsWith(`\n\n${nextText}`)) return previousText;
|
|
@@ -2059,7 +2077,8 @@ function createFeishuReplyDispatcher(params) {
|
|
|
2059
2077
|
ensureNoVisibleReplyFallback
|
|
2060
2078
|
};
|
|
2061
2079
|
}
|
|
2062
|
-
|
|
2080
|
+
//#endregion
|
|
2081
|
+
//#region extensions/feishu/src/synthetic-event-target.ts
|
|
2063
2082
|
const directPreDispatchTargets = /* @__PURE__ */ new WeakMap();
|
|
2064
2083
|
/** Keep synthetic-only routing metadata outside the public Feishu event shape. */
|
|
2065
2084
|
function setFeishuSyntheticDirectPreDispatchTarget(event, target) {
|
|
@@ -2069,7 +2088,8 @@ function setFeishuSyntheticDirectPreDispatchTarget(event, target) {
|
|
|
2069
2088
|
function getFeishuSyntheticDirectPreDispatchTarget(event) {
|
|
2070
2089
|
return directPreDispatchTargets.get(event);
|
|
2071
2090
|
}
|
|
2072
|
-
|
|
2091
|
+
//#endregion
|
|
2092
|
+
//#region extensions/feishu/src/bot.ts
|
|
2073
2093
|
const permissionErrorNotifiedAt = /* @__PURE__ */ new Map();
|
|
2074
2094
|
const PERMISSION_ERROR_COOLDOWN_MS = 3e5;
|
|
2075
2095
|
function isFeishuTopicSessionScope(scope) {
|
|
@@ -3158,10 +3178,12 @@ async function handleFeishuMessage(params) {
|
|
|
3158
3178
|
error(`feishu[${account.accountId}]: failed to dispatch message: ${String(err)}`);
|
|
3159
3179
|
}
|
|
3160
3180
|
}
|
|
3161
|
-
|
|
3181
|
+
//#endregion
|
|
3182
|
+
//#region extensions/feishu/src/card-action-state.ts
|
|
3162
3183
|
const processedCardActions = /* @__PURE__ */ new Map();
|
|
3163
3184
|
const resolvedCardActionChatTypes = /* @__PURE__ */ new Map();
|
|
3164
|
-
|
|
3185
|
+
//#endregion
|
|
3186
|
+
//#region extensions/feishu/src/card-ux-shared.ts
|
|
3165
3187
|
function buildFeishuActionCard(params) {
|
|
3166
3188
|
return {
|
|
3167
3189
|
schema: "2.0",
|
|
@@ -3209,7 +3231,8 @@ function buildFeishuCardInteractionContext(params) {
|
|
|
3209
3231
|
...params.chatType ? { t: params.chatType } : {}
|
|
3210
3232
|
};
|
|
3211
3233
|
}
|
|
3212
|
-
|
|
3234
|
+
//#endregion
|
|
3235
|
+
//#region extensions/feishu/src/card-ux-approval.ts
|
|
3213
3236
|
const FEISHU_APPROVAL_REQUEST_ACTION = "feishu.quick_actions.request_approval";
|
|
3214
3237
|
const FEISHU_APPROVAL_CONFIRM_ACTION = "feishu.approval.confirm";
|
|
3215
3238
|
const FEISHU_APPROVAL_CANCEL_ACTION = "feishu.approval.cancel";
|
|
@@ -3238,7 +3261,8 @@ function createApprovalCard(params) {
|
|
|
3238
3261
|
})]
|
|
3239
3262
|
});
|
|
3240
3263
|
}
|
|
3241
|
-
|
|
3264
|
+
//#endregion
|
|
3265
|
+
//#region extensions/feishu/src/card-action.ts
|
|
3242
3266
|
const FEISHU_APPROVAL_CARD_TTL_MS = 3e5;
|
|
3243
3267
|
const FEISHU_CARD_ACTION_TOKEN_TTL_MS = 9e5;
|
|
3244
3268
|
function pruneExpiredCardEntries(cache, now) {
|
|
@@ -3432,7 +3456,8 @@ async function handleFeishuCardAction(params) {
|
|
|
3432
3456
|
refreshFeishuCardActionToken(tokenKey);
|
|
3433
3457
|
}
|
|
3434
3458
|
}
|
|
3435
|
-
|
|
3459
|
+
//#endregion
|
|
3460
|
+
//#region extensions/feishu/src/feishu-ingress.ts
|
|
3436
3461
|
const FEISHU_INGRESS_PAYLOAD_VERSION = 1;
|
|
3437
3462
|
const FEISHU_INGRESS_POLL_INTERVAL_MS = 500;
|
|
3438
3463
|
const FEISHU_DURABLE_EVENT_TYPES = /* @__PURE__ */ new Set(["drive.notice.comment_add_v1", "im.message.receive_v1"]);
|
|
@@ -3684,7 +3709,8 @@ function createFeishuDurableIngress(options) {
|
|
|
3684
3709
|
waitForIdle: monitor.waitForIdle
|
|
3685
3710
|
};
|
|
3686
3711
|
}
|
|
3687
|
-
|
|
3712
|
+
//#endregion
|
|
3713
|
+
//#region extensions/feishu/src/monitor.state.ts
|
|
3688
3714
|
const botOpenIds = /* @__PURE__ */ new Map();
|
|
3689
3715
|
const FEISHU_WEBHOOK_MAX_BODY_BYTES = 65536;
|
|
3690
3716
|
const FEISHU_WEBHOOK_BODY_TIMEOUT_MS = 5e3;
|
|
@@ -3705,7 +3731,8 @@ function recordWebhookStatus(runtime, accountId, path, statusCode) {
|
|
|
3705
3731
|
message: (count) => `${label}: webhook anomaly path=${path} status=${statusCode} count=${count}`
|
|
3706
3732
|
});
|
|
3707
3733
|
}
|
|
3708
|
-
|
|
3734
|
+
//#endregion
|
|
3735
|
+
//#region extensions/feishu/src/monitor.bot-identity.ts
|
|
3709
3736
|
const BOT_IDENTITY_RETRY_DELAYS_MS = [
|
|
3710
3737
|
6e4,
|
|
3711
3738
|
12e4,
|
|
@@ -3747,7 +3774,8 @@ function startBotIdentityRecovery(params) {
|
|
|
3747
3774
|
(runtime?.error ?? console.error)(`feishu[${accountId}]: bot identity background retry failed unexpectedly: ${String(err)}`);
|
|
3748
3775
|
});
|
|
3749
3776
|
}
|
|
3750
|
-
|
|
3777
|
+
//#endregion
|
|
3778
|
+
//#region extensions/feishu/src/monitor.comment.ts
|
|
3751
3779
|
const FEISHU_COMMENT_VERIFY_TIMEOUT_MS = 3e3;
|
|
3752
3780
|
const FEISHU_COMMENT_PAGE_SIZE = 100;
|
|
3753
3781
|
const FEISHU_COMMENT_PAGE_LIMIT = 5;
|
|
@@ -3907,7 +3935,7 @@ async function resolveDriveCommentEventTurn(params) {
|
|
|
3907
3935
|
logger?.(`feishu[${accountId}]: ignoring self-authored drive comment notice event=${eventId} sender=${senderId}`);
|
|
3908
3936
|
return null;
|
|
3909
3937
|
}
|
|
3910
|
-
const client = createFeishuClient((await import("./doctor-contract-
|
|
3938
|
+
const client = createFeishuClient((await import("./doctor-contract-CPh2u5-o.mjs").then((n) => n.l)).resolveFeishuAccount({
|
|
3911
3939
|
cfg,
|
|
3912
3940
|
accountId
|
|
3913
3941
|
}));
|
|
@@ -4173,7 +4201,8 @@ function parseFeishuDriveCommentNoticeEventPayload(value) {
|
|
|
4173
4201
|
type: readStringValue(value.type)
|
|
4174
4202
|
};
|
|
4175
4203
|
}
|
|
4176
|
-
|
|
4204
|
+
//#endregion
|
|
4205
|
+
//#region extensions/feishu/src/comment-handler.ts
|
|
4177
4206
|
function parseTimestampMs(value) {
|
|
4178
4207
|
return parseStrictNonNegativeInteger(value) ?? Date.now();
|
|
4179
4208
|
}
|
|
@@ -4482,7 +4511,8 @@ async function handleFeishuCommentEvent(params) {
|
|
|
4482
4511
|
typingReaction.cleanup();
|
|
4483
4512
|
}
|
|
4484
4513
|
}
|
|
4485
|
-
|
|
4514
|
+
//#endregion
|
|
4515
|
+
//#region extensions/feishu/src/sequential-queue.ts
|
|
4486
4516
|
const DEFAULT_TASK_TIMEOUT_MS = 3e5;
|
|
4487
4517
|
function createSequentialQueue(options = {}) {
|
|
4488
4518
|
const queues = /* @__PURE__ */ new Map();
|
|
@@ -4495,7 +4525,8 @@ function createSequentialQueue(options = {}) {
|
|
|
4495
4525
|
})
|
|
4496
4526
|
});
|
|
4497
4527
|
}
|
|
4498
|
-
|
|
4528
|
+
//#endregion
|
|
4529
|
+
//#region extensions/feishu/src/monitor.comment-notice-handler.ts
|
|
4499
4530
|
function createFeishuDriveCommentNoticeHandler(params) {
|
|
4500
4531
|
const { cfg, accountId, runtime, fireAndForget, abortSignal } = params;
|
|
4501
4532
|
const error = runtime?.error ?? console.error;
|
|
@@ -4543,7 +4574,8 @@ function createFeishuDriveCommentNoticeHandler(params) {
|
|
|
4543
4574
|
await settle();
|
|
4544
4575
|
};
|
|
4545
4576
|
}
|
|
4546
|
-
|
|
4577
|
+
//#endregion
|
|
4578
|
+
//#region extensions/feishu/src/monitor.message-handler.ts
|
|
4547
4579
|
function parseFeishuMessageEventPayload(value) {
|
|
4548
4580
|
if (!isRecord(value)) return null;
|
|
4549
4581
|
const sender = value.sender;
|
|
@@ -4797,7 +4829,8 @@ function createFeishuMessageReceiveHandler({ cfg, channelRuntime, accountId, run
|
|
|
4797
4829
|
if (!fireAndForget) await processing;
|
|
4798
4830
|
};
|
|
4799
4831
|
}
|
|
4800
|
-
|
|
4832
|
+
//#endregion
|
|
4833
|
+
//#region extensions/feishu/src/monitor-rate-limit-key.ts
|
|
4801
4834
|
function normalizeFeishuWebhookRateLimitClient(clientIp) {
|
|
4802
4835
|
if (!clientIp) return "unknown";
|
|
4803
4836
|
if (clientIp === "::1" || clientIp.startsWith("127.")) return "loopback";
|
|
@@ -4806,7 +4839,8 @@ function normalizeFeishuWebhookRateLimitClient(clientIp) {
|
|
|
4806
4839
|
function buildFeishuWebhookRateLimitKey(params) {
|
|
4807
4840
|
return `${params.accountId === void 0 ? params.path : `${params.accountId}:${params.path}`}:${normalizeFeishuWebhookRateLimitClient(params.clientIp)}`;
|
|
4808
4841
|
}
|
|
4809
|
-
|
|
4842
|
+
//#endregion
|
|
4843
|
+
//#region extensions/feishu/src/monitor.transport.ts
|
|
4810
4844
|
const FEISHU_WEBHOOK_ACCEPTED_HEADER = "x-openclaw-delivery-accepted";
|
|
4811
4845
|
const FEISHU_WEBHOOK_ACCEPTED_VALUE = "durable";
|
|
4812
4846
|
const FEISHU_PRE_AUTH_MAX_IN_FLIGHT = 64;
|
|
@@ -5180,7 +5214,8 @@ async function monitorWebhook(params) {
|
|
|
5180
5214
|
await cleanup();
|
|
5181
5215
|
}
|
|
5182
5216
|
}
|
|
5183
|
-
|
|
5217
|
+
//#endregion
|
|
5218
|
+
//#region extensions/feishu/src/monitor.vc-meeting-invited-handler.ts
|
|
5184
5219
|
const FEISHU_MEETING_NUMBER_PATTERN = /^\d{9}$/;
|
|
5185
5220
|
function parseInviteTimestamp(value) {
|
|
5186
5221
|
const parsed = Number.parseInt(value ?? "", 10);
|
|
@@ -5308,7 +5343,8 @@ function createFeishuVcMeetingInvitedHandler(params) {
|
|
|
5308
5343
|
return fireAndForget ? Promise.resolve() : task;
|
|
5309
5344
|
};
|
|
5310
5345
|
}
|
|
5311
|
-
|
|
5346
|
+
//#endregion
|
|
5347
|
+
//#region extensions/feishu/src/sequential-key.ts
|
|
5312
5348
|
function getFeishuSequentialKey(params) {
|
|
5313
5349
|
const { accountId, event, botOpenId, preparedContent, isControlCommandMessage } = params;
|
|
5314
5350
|
const baseKey = `feishu:${accountId}:${event.message.chat_id?.trim() || "unknown"}`;
|
|
@@ -5317,7 +5353,8 @@ function getFeishuSequentialKey(params) {
|
|
|
5317
5353
|
if (isBtwRequestText(text)) return `${baseKey}:btw`;
|
|
5318
5354
|
return isControlCommandMessage(text) ? `${baseKey}:commands` : baseKey;
|
|
5319
5355
|
}
|
|
5320
|
-
|
|
5356
|
+
//#endregion
|
|
5357
|
+
//#region extensions/feishu/src/monitor.account.ts
|
|
5321
5358
|
const FEISHU_QUICK_ACTION_CARD_TTL_MS = 6e5;
|
|
5322
5359
|
const QUICK_ACTION_MENU_KEYS = /* @__PURE__ */ new Set([
|
|
5323
5360
|
"quick-actions",
|
|
@@ -5333,7 +5370,7 @@ async function resolveReactionSyntheticEvent(params) {
|
|
|
5333
5370
|
const senderUserId = event.user_id?.user_id?.trim();
|
|
5334
5371
|
const senderId = senderOpenId || senderUserId;
|
|
5335
5372
|
if (!emoji || !messageId || !senderId) return null;
|
|
5336
|
-
const { resolveFeishuAccount } = await import("./doctor-contract-
|
|
5373
|
+
const { resolveFeishuAccount } = await import("./doctor-contract-CPh2u5-o.mjs").then((n) => n.l);
|
|
5337
5374
|
const reactionNotifications = resolveFeishuAccount({
|
|
5338
5375
|
cfg,
|
|
5339
5376
|
accountId
|
|
@@ -5755,4 +5792,5 @@ async function monitorSingleAccount(params) {
|
|
|
5755
5792
|
threadBindingManager?.stop();
|
|
5756
5793
|
}
|
|
5757
5794
|
}
|
|
5795
|
+
//#endregion
|
|
5758
5796
|
export { 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-CPh2u5-o.mjs";
|
|
2
|
+
import { r as createFeishuClient } from "./client-DqGMyzOi.mjs";
|
|
3
3
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
4
4
|
import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
5
5
|
import { racePromiseWithAbortSignal, raceWithTimeout } from "openclaw/plugin-sdk/time-runtime";
|
|
6
6
|
import { sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
7
7
|
import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
|
|
8
8
|
import { createHash } from "node:crypto";
|
|
9
|
-
|
|
9
|
+
//#region 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 = {}) {
|
|
@@ -34,7 +34,8 @@ function waitForAbortableDelay(delayMs, abortSignal) {
|
|
|
34
34
|
throw error;
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region extensions/feishu/src/probe.ts
|
|
38
39
|
var probe_exports = /* @__PURE__ */ __exportAll({
|
|
39
40
|
probeFeishu: () => probeFeishu,
|
|
40
41
|
registerFeishuAiAgent: () => registerFeishuAiAgent
|
|
@@ -164,4 +165,5 @@ async function registerFeishuAiAgent(creds, options = {}) {
|
|
|
164
165
|
};
|
|
165
166
|
}
|
|
166
167
|
}
|
|
168
|
+
//#endregion
|
|
167
169
|
export { waitForAbortableDelay as a, raceWithTimeoutAndAbort as i, probe_exports as n, registerFeishuAiAgent as r, probeFeishu as t };
|