@openclaw/feishu 2026.7.2-beta.4 → 2026.7.2-beta.5

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.
@@ -1,14 +1,14 @@
1
- import { _ as normalizeCommentFileType, c as encodeQuery, d as isRecord$2, f as normalizeString, g as buildFeishuCommentTarget, h as requestFeishuApi, l as extractReplyText, m as readString$1, o as resolveFeishuAccount, p as parseCommentContentElements, s as resolveFeishuRuntimeAccount } from "./accounts-BDoGHJDk.js";
1
+ import { _ as normalizeCommentFileType, c as encodeQuery, d as isRecord$2, f as normalizeString, g as buildFeishuCommentTarget, h as requestFeishuApi, l as extractReplyText, m as readString$1, o as resolveFeishuAccount, p as parseCommentContentElements, s as resolveFeishuRuntimeAccount } from "./accounts-CKhCa76b.js";
2
2
  import { i as resolveReceiveIdType } from "./targets-BUjQ1TcA.js";
3
- import { A as resolveFeishuChatType, C as resolveFeishuDmIngressAccess, E as resolveFeishuGroupSenderActivationIngressAccess, M as buildFeishuCardActionTextFallback, N as createFeishuCardInteractionEnvelope, O as resolveFeishuReplyPolicy, P as decodeFeishuCardAction, S as normalizeFeishuAllowEntry, T as resolveFeishuGroupConversationIngressAccess, d as chunkFeishuPostMarkdown, f as materializeFeishuPostMarkdownSoftBreaks, k as normalizeFeishuChatType$2, o as resolveFeishuCardTemplate, w as resolveFeishuGroupConfig, x as hasExplicitFeishuGroupConfig } from "./send-result-DfE5Fhz6.js";
3
+ import { A as resolveFeishuChatType, C as resolveFeishuDmIngressAccess, E as resolveFeishuGroupSenderActivationIngressAccess, M as buildFeishuCardActionTextFallback, N as createFeishuCardInteractionEnvelope, O as resolveFeishuReplyPolicy, P as decodeFeishuCardAction, S as normalizeFeishuAllowEntry, T as resolveFeishuGroupConversationIngressAccess, d as chunkFeishuPostMarkdown, f as materializeFeishuPostMarkdownSoftBreaks, k as normalizeFeishuChatType$2, o as resolveFeishuCardTemplate, w as resolveFeishuGroupConfig, x as hasExplicitFeishuGroupConfig } from "./send-result-Bcofg0Vv.js";
4
4
  import { o as resolveConfiguredFeishuGroupSessionScope, t as buildFeishuConversationId } from "./conversation-id-BeJL-wq7.js";
5
5
  import { a as getFeishuUserAgent, i as createFeishuWSClient, n as createEventDispatcher, r as createFeishuClient, s as resolveConfiguredHttpTimeoutMs } from "./client-Dee7cKsS.js";
6
6
  import { t as getFeishuRuntime } from "./runtime-C5JxBWZp.js";
7
- import { i as createCommentTypingReactionLifecycle, l as getChatInfo, t as deliverCommentThreadText } from "./drive-_zrcOxzS.js";
8
- import { t as createFeishuThreadBindingManager } from "./thread-bindings-V0bwk0A1.js";
7
+ import { i as createCommentTypingReactionLifecycle, l as getChatInfo, t as deliverCommentThreadText } from "./drive-DG6pKTPE.js";
8
+ import { t as createFeishuThreadBindingManager } from "./thread-bindings-Dqs_A0du.js";
9
9
  import { createReplyPrefixContext, evaluateSupplementalContextVisibility, getSessionEntry, normalizeAgentId as normalizeAgentId$2, resolveChannelContextVisibilityMode } from "./runtime-api.js";
10
10
  import { t as readFeishuJsonResponse } from "./json-response-CheljwGr.js";
11
- import { _ as buildFeishuMediaFallbackText, a as getMessageFeishu, d as parsePostContent, f as extractMentionTargets, g as normalizeFeishuExternalKey, h as isFeishuGroupChatType, l as sendMessageFeishu, m as isMentionForwardRequest, n as sendMediaFeishu, o as listFeishuThreadMessages, p as isFeishuBroadcastMention, r as shouldSuppressFeishuTextForVoiceMedia, s as sendCardFeishu, t as saveMessageResourceFeishu, u as sendStructuredCardFeishu, v as resolveFeishuIdentityEmoji } from "./media-CRJunSRr.js";
11
+ import { _ as buildFeishuMediaFallbackText, a as getMessageFeishu, d as parsePostContent, f as extractMentionTargets, g as normalizeFeishuExternalKey, h as isFeishuGroupChatType, l as sendMessageFeishu, m as isMentionForwardRequest, n as sendMediaFeishu, o as listFeishuThreadMessages, p as isFeishuBroadcastMention, r as shouldSuppressFeishuTextForVoiceMedia, s as sendCardFeishu, t as saveMessageResourceFeishu, u as sendStructuredCardFeishu, v as resolveFeishuIdentityEmoji } from "./media-DOwcLJ1j.js";
12
12
  import { a as waitForAbortableDelay, i as raceWithTimeoutAndAbort } from "./probe-Za1kgUvx.js";
13
13
  import { t as fetchBotIdentityForMonitor } from "./monitor.startup-CSUPT_U1.js";
14
14
  import { DEFAULT_INGRESS_ADOPTION_STALL_MS, bindIngressLifecycleToReplyOptions, createChannelIngressMonitor, createChannelMessageReplyPipeline, createMessageReceiptFromOutboundResults, formatChannelProgressDraftLineForEntry, isChannelProgressDraftWorkToolName, resolveAgentOutboundIdentity, resolveChannelPreviewStreamMode, resolveChannelStreamingBlockEnabled } from "openclaw/plugin-sdk/channel-outbound";
@@ -18,6 +18,7 @@ import { asDateTimestampMs, isFutureDateTimestampMs, parseStrictNonNegativeInteg
18
18
  import { asBoolean, asNullableRecord, isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, readStringValue, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
19
19
  import { stripReasoningTagsFromText } from "openclaw/plugin-sdk/text-chunking";
20
20
  import { resolveDefaultGroupPolicy, resolveOpenProviderRuntimeGroupPolicy, warnMissingProviderGroupPolicyFallbackOnce } from "openclaw/plugin-sdk/runtime-group-policy";
21
+ import { fanInChannelIngressLifecycles } from "openclaw/plugin-sdk/channel-ingress-runtime";
21
22
  import fs from "node:fs";
22
23
  import os from "node:os";
23
24
  import path from "node:path";
@@ -25,6 +26,7 @@ import { normalizeAccountId, resolveAgentRoute, resolveInboundLastRouteSessionKe
25
26
  import { resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
26
27
  import { collectErrorGraphCandidates, formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
27
28
  import * as Lark from "@larksuiteoapi/node-sdk";
29
+ import { formatReasoningMessage, resolveHumanDelayConfig } from "openclaw/plugin-sdk/agent-runtime";
28
30
  import { WEBHOOK_ANOMALY_COUNTER_DEFAULTS, WEBHOOK_RATE_LIMIT_DEFAULTS, applyBasicWebhookRequestGuards, createFixedWindowRateLimiter, createWebhookAnomalyTracker, resolveRequestClientIp } from "openclaw/plugin-sdk/webhook-ingress";
29
31
  import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime";
30
32
  import { getReplyPayloadTtsSupplement, resolveSendableOutboundReplyParts, resolveTextChunksWithFallback, sendMediaWithLeadingCaption } from "openclaw/plugin-sdk/reply-payload";
@@ -37,7 +39,6 @@ import { sliceUtf16Safe, truncateUtf16Safe } from "openclaw/plugin-sdk/text-util
37
39
  import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
38
40
  import { createChannelReplayGuard } from "openclaw/plugin-sdk/persistent-dedupe";
39
41
  import { resolveChannelConfigWrites } from "openclaw/plugin-sdk/channel-config-writes";
40
- import { formatReasoningMessage, resolveHumanDelayConfig } from "openclaw/plugin-sdk/agent-runtime";
41
42
  import { logTypingFailure } from "openclaw/plugin-sdk/channel-feedback";
42
43
  import { getGlobalHookRunner } from "openclaw/plugin-sdk/plugin-runtime";
43
44
  import * as http from "node:http";
@@ -3615,6 +3616,42 @@ async function handleFeishuMessage(params) {
3615
3616
  const agentIds = (cfg.agents?.list ?? []).map((a) => normalizeAgentId$2(a.id));
3616
3617
  const hasKnownAgents = agentIds.length > 0;
3617
3618
  log(`feishu[${account.accountId}]: broadcasting to ${broadcastAgents.length} agents (strategy=${strategy}, active=${activeAgentId ?? "none"})`);
3619
+ const createBroadcastInboundAdapter = (paramsLocal) => ({
3620
+ ingest: () => ({
3621
+ id: ctx.messageId,
3622
+ timestamp: messageCreateTimeMs,
3623
+ rawText: ctx.content,
3624
+ textForAgent: paramsLocal.ctxPayload.BodyForAgent,
3625
+ textForCommands: paramsLocal.ctxPayload.CommandBody,
3626
+ raw: ctx
3627
+ }),
3628
+ resolveTurn: () => ({
3629
+ cfg,
3630
+ channel: "feishu",
3631
+ accountId: route.accountId,
3632
+ route: {
3633
+ agentId: paramsLocal.agentId,
3634
+ sessionKey: paramsLocal.sessionKey
3635
+ },
3636
+ ctxPayload: paramsLocal.ctxPayload,
3637
+ record: paramsLocal.record,
3638
+ ...paramsLocal.variant.kind === "observeOnly" ? {
3639
+ admission: {
3640
+ kind: "observeOnly",
3641
+ reason: "broadcast-observer"
3642
+ },
3643
+ delivery: { deliver: async () => ({ visibleReplySent: false }) },
3644
+ replyOptions: bindIngressLifecycleToReplyOptions(paramsLocal.lifecycle)
3645
+ } : {
3646
+ dispatcherOptions: paramsLocal.variant.dispatcher.dispatcherOptions,
3647
+ delivery: paramsLocal.variant.dispatcher.delivery,
3648
+ replyOptions: {
3649
+ ...paramsLocal.variant.dispatcher.replyOptions,
3650
+ ...bindIngressLifecycleToReplyOptions(paramsLocal.lifecycle)
3651
+ }
3652
+ }
3653
+ })
3654
+ });
3618
3655
  const dispatchForAgent = async (agentId) => {
3619
3656
  const normalizedAgentId = normalizeAgentId$2(agentId);
3620
3657
  if (hasKnownAgents && !agentIds.includes(normalizedAgentId)) {
@@ -3658,100 +3695,53 @@ async function handleFeishuMessage(params) {
3658
3695
  sessionKey: agentSessionKey
3659
3696
  });
3660
3697
  const agentCtx = await buildCtxPayloadForAgent(agentId, agentSessionKey, route.accountId, ctx.mentionedBot && agentId === activeAgentId);
3698
+ let variant;
3661
3699
  if (agentId === activeAgentId) {
3662
3700
  const identity = resolveAgentOutboundIdentity(cfg, agentId);
3663
- const { dispatcherOptions, delivery, replyOptions, ensureNoVisibleReplyFallback } = createFeishuReplyDispatcher({
3664
- cfg,
3665
- agentId,
3666
- runtime,
3667
- chatId: ctx.chatId,
3668
- sendTarget: feishuTo,
3669
- allowReasoningPreview,
3670
- replyToMessageId: replyTargetMessageId,
3671
- typingTargetMessageId,
3672
- skipReplyToInMessages: !isGroup && !directThreadReply,
3673
- replyInThread,
3674
- rootId: ctx.rootId,
3675
- threadReply,
3676
- accountId: account.accountId,
3677
- identity,
3678
- mentionTargets: ctx.mentionTargets,
3679
- requiredMentionTargets,
3680
- messageCreateTimeMs,
3681
- sessionKey: agentSessionKey
3682
- });
3701
+ variant = {
3702
+ kind: "active",
3703
+ dispatcher: createFeishuReplyDispatcher({
3704
+ cfg,
3705
+ agentId,
3706
+ runtime,
3707
+ chatId: ctx.chatId,
3708
+ sendTarget: feishuTo,
3709
+ allowReasoningPreview,
3710
+ replyToMessageId: replyTargetMessageId,
3711
+ typingTargetMessageId,
3712
+ skipReplyToInMessages: !isGroup && !directThreadReply,
3713
+ replyInThread,
3714
+ rootId: ctx.rootId,
3715
+ threadReply,
3716
+ accountId: account.accountId,
3717
+ identity,
3718
+ mentionTargets: ctx.mentionTargets,
3719
+ requiredMentionTargets,
3720
+ messageCreateTimeMs,
3721
+ sessionKey: agentSessionKey
3722
+ })
3723
+ };
3683
3724
  log(`feishu[${account.accountId}]: broadcast active dispatch agent=${agentId} (session=${agentSessionKey})`);
3684
- const turnResult = await core.channel.inbound.run({
3685
- channel: "feishu",
3686
- accountId: route.accountId,
3687
- raw: ctx,
3688
- adapter: {
3689
- ingest: () => ({
3690
- id: ctx.messageId,
3691
- timestamp: messageCreateTimeMs,
3692
- rawText: ctx.content,
3693
- textForAgent: agentCtx.BodyForAgent,
3694
- textForCommands: agentCtx.CommandBody,
3695
- raw: ctx
3696
- }),
3697
- resolveTurn: () => ({
3698
- cfg,
3699
- channel: "feishu",
3700
- accountId: route.accountId,
3701
- route: {
3702
- agentId,
3703
- sessionKey: agentSessionKey
3704
- },
3705
- ctxPayload: agentCtx,
3706
- record: agentRecord,
3707
- dispatcherOptions,
3708
- delivery,
3709
- replyOptions: {
3710
- ...replyOptions,
3711
- ...bindIngressLifecycleToReplyOptions(lane.lifecycle)
3712
- }
3713
- })
3714
- }
3715
- });
3716
- if (turnResult.dispatched && shouldSendNoVisibleReplyFallback(turnResult.dispatchResult)) await ensureNoVisibleReplyFallback("broadcast-dispatch-complete-no-visible-reply");
3717
- await lane.onDispatchComplete(turnResult.dispatched);
3718
3725
  } else {
3719
3726
  delete agentCtx.CommandAuthorized;
3727
+ variant = { kind: "observeOnly" };
3720
3728
  log(`feishu[${account.accountId}]: broadcast observer dispatch agent=${agentId} (session=${agentSessionKey})`);
3721
- const turnResult = await core.channel.inbound.run({
3722
- channel: "feishu",
3723
- accountId: route.accountId,
3724
- raw: ctx,
3725
- adapter: {
3726
- ingest: () => ({
3727
- id: ctx.messageId,
3728
- timestamp: messageCreateTimeMs,
3729
- rawText: ctx.content,
3730
- textForAgent: agentCtx.BodyForAgent,
3731
- textForCommands: agentCtx.CommandBody,
3732
- raw: ctx
3733
- }),
3734
- resolveTurn: () => ({
3735
- cfg,
3736
- channel: "feishu",
3737
- accountId: route.accountId,
3738
- route: {
3739
- agentId,
3740
- sessionKey: agentSessionKey
3741
- },
3742
- ctxPayload: agentCtx,
3743
- record: agentRecord,
3744
- admission: {
3745
- kind: "observeOnly",
3746
- reason: "broadcast-observer"
3747
- },
3748
- delivery: { deliver: async () => ({ visibleReplySent: false }) },
3749
- replyOptions: bindIngressLifecycleToReplyOptions(lane.lifecycle)
3750
- })
3751
- }
3752
- });
3753
- await lane.onDispatchComplete(turnResult.dispatched);
3754
3729
  }
3730
+ const turnResult = await core.channel.inbound.run({
3731
+ channel: "feishu",
3732
+ accountId: route.accountId,
3733
+ raw: ctx,
3734
+ adapter: createBroadcastInboundAdapter({
3735
+ agentId,
3736
+ sessionKey: agentSessionKey,
3737
+ ctxPayload: agentCtx,
3738
+ record: agentRecord,
3739
+ lifecycle: lane.lifecycle,
3740
+ variant
3741
+ })
3742
+ });
3743
+ if (variant.kind === "active" && turnResult.dispatched && shouldSendNoVisibleReplyFallback(turnResult.dispatchResult)) await variant.dispatcher.ensureNoVisibleReplyFallback("broadcast-dispatch-complete-no-visible-reply");
3744
+ await lane.onDispatchComplete(turnResult.dispatched);
3755
3745
  } catch (err) {
3756
3746
  await lane.onDispatchFailed(err);
3757
3747
  throw err;
@@ -4358,8 +4348,8 @@ function buildFeishuFlushIngressLifecycle(sources, options) {
4358
4348
  const durableSources = sources.filter((source) => source.lifecycle !== void 0);
4359
4349
  const lifecycles = durableSources.map((source) => source.lifecycle);
4360
4350
  const replayClaims = durableSources.map((source) => source.replayClaim).filter((claim) => claim !== void 0);
4361
- const [firstLifecycle] = lifecycles;
4362
- if (!firstLifecycle) return {
4351
+ const transportLifecycle = fanInChannelIngressLifecycles(lifecycles).lifecycle;
4352
+ if (!transportLifecycle) return {
4363
4353
  lifecycle: void 0,
4364
4354
  settle: async () => {}
4365
4355
  };
@@ -4373,7 +4363,7 @@ function buildFeishuFlushIngressLifecycle(sources, options) {
4373
4363
  const runAbandon = async () => {
4374
4364
  if (terminal) return;
4375
4365
  releaseReplayClaims();
4376
- await Promise.all(lifecycles.map(async (lifecycle) => await lifecycle.onAbandoned()));
4366
+ await transportLifecycle.onAbandoned();
4377
4367
  terminal = "abandoned";
4378
4368
  };
4379
4369
  const ensureAbandoned = async () => {
@@ -4402,7 +4392,7 @@ function buildFeishuFlushIngressLifecycle(sources, options) {
4402
4392
  }
4403
4393
  const activeAdoption = adopting ?? (async () => {
4404
4394
  try {
4405
- for (const lifecycle of lifecycles) await lifecycle.onAdopted();
4395
+ await transportLifecycle.onAdopted();
4406
4396
  terminal = "adopted";
4407
4397
  const results = await Promise.allSettled(replayClaims.map(async (claim) => claim.commit()));
4408
4398
  for (const result of results) if (result.status === "rejected") try {
@@ -4422,17 +4412,17 @@ function buildFeishuFlushIngressLifecycle(sources, options) {
4422
4412
  };
4423
4413
  return {
4424
4414
  lifecycle: {
4425
- abortSignal: lifecycles.length === 1 ? firstLifecycle.abortSignal : AbortSignal.any(lifecycles.map((lifecycle) => lifecycle.abortSignal)),
4415
+ abortSignal: transportLifecycle.abortSignal,
4426
4416
  onAdopted: async () => {
4427
4417
  handedOff = true;
4428
4418
  await adoptAll();
4429
4419
  },
4430
4420
  onDeferred: () => {
4431
4421
  handedOff = true;
4432
- for (const lifecycle of lifecycles) lifecycle.onDeferred();
4422
+ transportLifecycle.onDeferred();
4433
4423
  },
4434
4424
  onAdoptionFinalizing: () => {
4435
- for (const lifecycle of lifecycles) lifecycle.onAdoptionFinalizing();
4425
+ transportLifecycle.onAdoptionFinalizing();
4436
4426
  },
4437
4427
  onAbandoned: async () => {
4438
4428
  handedOff = true;
@@ -4444,8 +4434,8 @@ function buildFeishuFlushIngressLifecycle(sources, options) {
4444
4434
  handedOff = true;
4445
4435
  releaseReplayClaims();
4446
4436
  try {
4447
- for (const lifecycle of lifecycles) lifecycle.onAdoptionFinalizing();
4448
- for (const lifecycle of lifecycles) await lifecycle.onAdopted();
4437
+ transportLifecycle.onAdoptionFinalizing();
4438
+ await transportLifecycle.onAdopted();
4449
4439
  terminal = "adopted";
4450
4440
  } catch (error) {
4451
4441
  await ensureAbandoned().catch(() => void 0);
@@ -5588,7 +5578,7 @@ async function resolveDriveCommentEventCore(params) {
5588
5578
  return null;
5589
5579
  }
5590
5580
  const context = await fetchDriveCommentContext({
5591
- client: createClient ? createClient(account ?? { accountId }) : createFeishuClient((await import("./accounts-BDoGHJDk.js").then((n) => n.t)).resolveFeishuAccount({
5581
+ client: createClient ? createClient(account ?? { accountId }) : createFeishuClient((await import("./accounts-CKhCa76b.js").then((n) => n.t)).resolveFeishuAccount({
5592
5582
  cfg,
5593
5583
  accountId
5594
5584
  })),
@@ -6784,7 +6774,7 @@ async function resolveReactionSyntheticEvent(params) {
6784
6774
  const senderId = event.user_id?.open_id;
6785
6775
  const senderUserId = event.user_id?.user_id;
6786
6776
  if (!emoji || !messageId || !senderId) return null;
6787
- const { resolveFeishuAccount } = await import("./accounts-BDoGHJDk.js").then((n) => n.t);
6777
+ const { resolveFeishuAccount } = await import("./accounts-CKhCa76b.js").then((n) => n.t);
6788
6778
  const reactionNotifications = resolveFeishuAccount({
6789
6779
  cfg,
6790
6780
  accountId
@@ -6,8 +6,7 @@ import { PAIRING_APPROVED_MESSAGE, buildProbeChannelStatusSummary, createDefault
6
6
  import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
7
7
  import { getSessionEntry } from "openclaw/plugin-sdk/session-store-runtime";
8
8
  import { DEFAULT_ACCOUNT_ID, buildChannelConfigSchema, createActionGate, createDedupeCache } from "openclaw/plugin-sdk/core";
9
- import { buildAgentMediaPayload } from "openclaw/plugin-sdk/agent-media-payload";
10
9
  import { evaluateSupplementalContextVisibility, filterSupplementalContextItems, resolveChannelContextVisibilityMode } from "openclaw/plugin-sdk/context-visibility-runtime";
11
10
  import { readJsonFileWithFallback } from "openclaw/plugin-sdk/json-store";
12
11
  import { isRequestBodyLimitError, readRequestBodyWithLimit, requestBodyErrorToText } from "openclaw/plugin-sdk/webhook-ingress";
13
- export { DEFAULT_ACCOUNT_ID, PAIRING_APPROVED_MESSAGE, buildAgentMediaPayload, buildChannelConfigSchema, buildProbeChannelStatusSummary, chunkTextForOutbound, createActionGate, createChannelPairingController, createDedupeCache, createDefaultChannelRuntimeState, createReplyPrefixContext, evaluateSupplementalContextVisibility, filterSupplementalContextItems, getSessionEntry, isRequestBodyLimitError, normalizeAgentId, readJsonFileWithFallback, readRequestBodyWithLimit, requestBodyErrorToText, resolveChannelContextVisibilityMode, setFeishuRuntime };
12
+ export { DEFAULT_ACCOUNT_ID, PAIRING_APPROVED_MESSAGE, buildChannelConfigSchema, buildProbeChannelStatusSummary, chunkTextForOutbound, createActionGate, createChannelPairingController, createDedupeCache, createDefaultChannelRuntimeState, createReplyPrefixContext, evaluateSupplementalContextVisibility, filterSupplementalContextItems, getSessionEntry, isRequestBodyLimitError, normalizeAgentId, readJsonFileWithFallback, readRequestBodyWithLimit, requestBodyErrorToText, resolveChannelContextVisibilityMode, setFeishuRuntime };
@@ -1,4 +1,4 @@
1
- import "./security-audit-shared-BIHeF-S_.js";
1
+ import "./security-audit-shared-BgpY7AiJ.js";
2
2
  //#region extensions/feishu/src/message-action-contract.ts
3
3
  const messageActionTargetAliases = {
4
4
  read: { aliases: ["messageId"] },
@@ -1,25 +1,20 @@
1
+ import { asOptionalRecord, hasNonEmptyString } from "openclaw/plugin-sdk/string-coerce-runtime";
1
2
  import { hasConfiguredSecretInput } from "openclaw/plugin-sdk/secret-input";
2
3
  //#region extensions/feishu/src/security-audit-shared.ts
3
- function asRecord(value) {
4
- return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
5
- }
6
- function hasNonEmptyString(value) {
7
- return typeof value === "string" && value.trim().length > 0;
8
- }
9
4
  function isFeishuDocToolEnabled(cfg) {
10
- const feishu = asRecord(asRecord(cfg.channels)?.feishu);
5
+ const feishu = asOptionalRecord(asOptionalRecord(cfg.channels)?.feishu);
11
6
  if (!feishu || feishu.enabled === false) return false;
12
- const baseTools = asRecord(feishu.tools);
7
+ const baseTools = asOptionalRecord(feishu.tools);
13
8
  const baseDocEnabled = baseTools?.doc !== false;
14
9
  const baseAppId = hasNonEmptyString(feishu.appId);
15
10
  const baseAppSecret = hasConfiguredSecretInput(feishu.appSecret, cfg.secrets?.defaults);
16
11
  const baseConfigured = baseAppId && baseAppSecret;
17
- const accounts = asRecord(feishu.accounts);
12
+ const accounts = asOptionalRecord(feishu.accounts);
18
13
  if (!accounts || Object.keys(accounts).length === 0) return baseDocEnabled && baseConfigured;
19
14
  for (const accountValue of Object.values(accounts)) {
20
- const account = asRecord(accountValue) ?? {};
15
+ const account = asOptionalRecord(accountValue) ?? {};
21
16
  if (account.enabled === false) continue;
22
- if (!((asRecord(account.tools) ?? baseTools)?.doc !== false)) continue;
17
+ if (!((asOptionalRecord(account.tools) ?? baseTools)?.doc !== false)) continue;
23
18
  if ((hasNonEmptyString(account.appId) || baseAppId) && (hasConfiguredSecretInput(account.appSecret, cfg.secrets?.defaults) || baseAppSecret)) return true;
24
19
  }
25
20
  return false;
@@ -1,2 +1,2 @@
1
- import { t as collectFeishuSecurityAuditFindings } from "./security-audit-shared-BIHeF-S_.js";
1
+ import { t as collectFeishuSecurityAuditFindings } from "./security-audit-shared-BgpY7AiJ.js";
2
2
  export { collectFeishuSecurityAuditFindings };
@@ -1,4 +1,4 @@
1
- import { d as isRecord$1 } from "./accounts-BDoGHJDk.js";
1
+ import { d as isRecord$1 } from "./accounts-CKhCa76b.js";
2
2
  import { r as normalizeFeishuTarget, t as detectIdType } from "./targets-BUjQ1TcA.js";
3
3
  import { compileAllowlist, resolveAllowlistMatchByCandidates } from "openclaw/plugin-sdk/allow-from";
4
4
  import { ToolAuthorizationError } from "openclaw/plugin-sdk/channel-actions";
@@ -1,2 +1,2 @@
1
- import { r as testing, t as createFeishuThreadBindingManager } from "./thread-bindings-V0bwk0A1.js";
1
+ import { r as testing, t as createFeishuThreadBindingManager } from "./thread-bindings-Dqs_A0du.js";
2
2
  export { createFeishuThreadBindingManager, testing as feishuThreadBindingTesting };
package/dist/setup-api.js CHANGED
@@ -1,2 +1,2 @@
1
- import { i as feishuSetupAdapter, n as feishuSetupWizard, t as feishuPlugin } from "./channel-DB1x6UJX.js";
1
+ import { i as feishuSetupAdapter, n as feishuSetupWizard, t as feishuPlugin } from "./channel-CBNICmK9.js";
2
2
  export { feishuPlugin, feishuSetupAdapter, feishuSetupWizard };
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
2
  import { r as normalizeFeishuTarget } from "./targets-BUjQ1TcA.js";
3
3
  import { r as parseFeishuConversationId, t as buildFeishuConversationId } from "./conversation-id-BeJL-wq7.js";
4
- import { n as getFeishuThreadBindingManager } from "./thread-bindings-V0bwk0A1.js";
4
+ import { n as getFeishuThreadBindingManager } from "./thread-bindings-Dqs_A0du.js";
5
5
  import { normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
6
6
  //#region extensions/feishu/src/subagent-hooks.ts
7
7
  var subagent_hooks_exports = /* @__PURE__ */ __exportAll({
@@ -1,6 +1,6 @@
1
1
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
2
2
  //#region extensions/feishu/subagent-hooks-api.ts
3
- const loadFeishuSubagentHooksModule = createLazyRuntimeModule(() => import("./subagent-hooks-BKTOxB-T.js").then((n) => n.i));
3
+ const loadFeishuSubagentHooksModule = createLazyRuntimeModule(() => import("./subagent-hooks-DL2SC5zX.js").then((n) => n.i));
4
4
  function registerFeishuSubagentHooks(api) {
5
5
  api.on("subagent_delivery_target", async (event) => {
6
6
  const { handleFeishuSubagentDeliveryTarget } = await loadFeishuSubagentHooksModule();
@@ -1,6 +1,7 @@
1
1
  import { registerSessionBindingAdapter, resolveThreadBindingConversationIdFromBindingId, resolveThreadBindingIdleTimeoutMsForChannel, resolveThreadBindingMaxAgeMsForChannel, unregisterSessionBindingAdapter } from "openclaw/plugin-sdk/conversation-runtime";
2
2
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
3
3
  import { normalizeAccountId, resolveAgentIdFromSessionKey } from "openclaw/plugin-sdk/routing";
4
+ import { resolveDefaultAgentId } from "openclaw/plugin-sdk/agent-runtime";
4
5
  //#region extensions/feishu/src/thread-bindings.ts
5
6
  const FEISHU_THREAD_BINDINGS_STATE_KEY = Symbol.for("openclaw.feishuThreadBindingsState");
6
7
  let state;
@@ -94,7 +95,7 @@ function createFeishuThreadBindingManager(params) {
94
95
  deliveryThreadId: typeof metadata?.deliveryThreadId === "string" && metadata.deliveryThreadId.trim() ? metadata.deliveryThreadId.trim() : existingLocal?.deliveryThreadId,
95
96
  targetKind: toFeishuTargetKind(targetKind),
96
97
  targetSessionKey: normalizedTargetSessionKey,
97
- agentId: typeof metadata?.agentId === "string" && metadata.agentId.trim() ? metadata.agentId.trim() : existingLocal?.agentId ?? resolveAgentIdFromSessionKey(normalizedTargetSessionKey),
98
+ agentId: typeof metadata?.agentId === "string" && metadata.agentId.trim() ? metadata.agentId.trim() : existingLocal?.agentId ?? resolveAgentIdFromSessionKey(normalizedTargetSessionKey, resolveDefaultAgentId(params.cfg)),
98
99
  label: typeof metadata?.label === "string" && metadata.label.trim() ? metadata.label.trim() : existingLocal?.label,
99
100
  boundBy: typeof metadata?.boundBy === "string" && metadata.boundBy.trim() ? metadata.boundBy.trim() : existingLocal?.boundBy,
100
101
  boundAt: now,
@@ -1142,9 +1142,6 @@
1142
1142
  },
1143
1143
  "bitable": {
1144
1144
  "type": "boolean"
1145
- },
1146
- "base": {
1147
- "type": "boolean"
1148
1145
  }
1149
1146
  },
1150
1147
  "additionalProperties": false
@@ -1909,9 +1906,6 @@
1909
1906
  },
1910
1907
  "bitable": {
1911
1908
  "type": "boolean"
1912
- },
1913
- "base": {
1914
- "type": "boolean"
1915
1909
  }
1916
1910
  },
1917
1911
  "additionalProperties": false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/feishu",
3
- "version": "2026.7.2-beta.4",
3
+ "version": "2026.7.2-beta.5",
4
4
  "description": "OpenClaw Feishu/Lark channel plugin for chats and workplace tools (community maintained by @m1heng).",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,7 +16,7 @@
16
16
  "zod": "4.4.3"
17
17
  },
18
18
  "peerDependencies": {
19
- "openclaw": ">=2026.7.2-beta.4"
19
+ "openclaw": ">=2026.7.2-beta.5"
20
20
  },
21
21
  "peerDependenciesMeta": {
22
22
  "openclaw": {
@@ -60,10 +60,10 @@
60
60
  "minHostVersion": ">=2026.5.29"
61
61
  },
62
62
  "compat": {
63
- "pluginApi": ">=2026.7.2-beta.4"
63
+ "pluginApi": ">=2026.7.2-beta.5"
64
64
  },
65
65
  "build": {
66
- "openclawVersion": "2026.7.2-beta.4"
66
+ "openclawVersion": "2026.7.2-beta.5"
67
67
  },
68
68
  "release": {
69
69
  "publishToClawHub": true,
@@ -77,7 +77,6 @@
77
77
  "files": [
78
78
  "dist/**",
79
79
  "openclaw.plugin.json",
80
- "npm-shrinkwrap.json",
81
80
  "README.md",
82
81
  "skills/**"
83
82
  ],