@openclaw/feishu 2026.7.1-beta.1 → 2026.7.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.js +1 -1
- package/dist/{app-registration-DapxBG7t.js → app-registration-DuEyfVY1.js} +1 -5
- package/dist/{channel-C1Uun9zo.js → channel-Bwm5rvHg.js} +18 -25
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-Cjc4wDNg.js → channel.runtime-C6SITclp.js} +33 -23
- package/dist/{monitor-CQo4C7q9.js → monitor-Ckch4qvr.js} +2 -5
- package/dist/{monitor.account-08br3nkU.js → monitor.account-GXGIJrgw.js} +5 -4
- package/dist/{send-BcPh0I15.js → send-BJTjDWKi.js} +16 -5
- package/dist/setup-api.js +1 -1
- package/dist/subagent-hooks-api.js +2 -5
- package/npm-shrinkwrap.json +3 -3
- package/package.json +4 -4
package/dist/api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as listEnabledFeishuAccounts } from "./accounts-Cfzht2Hc.js";
|
|
2
|
-
import { a as setFeishuNamedAccountEnabled, i as feishuSetupAdapter, n as feishuSetupWizard, r as runFeishuLogin, t as feishuPlugin } from "./channel-
|
|
2
|
+
import { a as setFeishuNamedAccountEnabled, i as feishuSetupAdapter, n as feishuSetupWizard, r as runFeishuLogin, t as feishuPlugin } from "./channel-Bwm5rvHg.js";
|
|
3
3
|
import { a as parseFeishuTargetId, i as parseFeishuDirectConversationId, n as buildFeishuModelOverrideParentCandidates, r as parseFeishuConversationId, t as buildFeishuConversationId } from "./conversation-id-DuL575sn.js";
|
|
4
4
|
import { t as getFeishuRuntime } from "./runtime-C5JxBWZp.js";
|
|
5
5
|
import { r as createFeishuClient } from "./client-BwgAJuvo.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { finiteSecondsToTimerSafeMilliseconds } from "openclaw/plugin-sdk/number-runtime";
|
|
2
|
+
import { sleep } from "openclaw/plugin-sdk/runtime-env";
|
|
2
3
|
import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
3
4
|
import { renderQrTerminal } from "openclaw/plugin-sdk/media-runtime";
|
|
4
5
|
//#region extensions/feishu/src/app-registration.ts
|
|
@@ -181,11 +182,6 @@ async function getAppOwnerOpenId(params) {
|
|
|
181
182
|
return;
|
|
182
183
|
}
|
|
183
184
|
}
|
|
184
|
-
function sleep(ms) {
|
|
185
|
-
return new Promise((resolve) => {
|
|
186
|
-
setTimeout(resolve, ms);
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
185
|
function sleepRegistrationPollInterval(intervalSeconds) {
|
|
190
186
|
return sleep(finiteSecondsToTimerSafeMilliseconds(intervalSeconds) ?? finiteSecondsToTimerSafeMilliseconds(DEFAULT_REGISTRATION_POLL_INTERVAL_SECONDS) ?? REQUEST_TIMEOUT_MS);
|
|
191
187
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as resolveDefaultFeishuAccountId, d as isRecord$
|
|
1
|
+
import { a as resolveDefaultFeishuAccountId, d as isRecord$1, i as listFeishuAccountIds, n as inspectFeishuCredentials, o as resolveFeishuAccount, r as listEnabledFeishuAccounts, s as resolveFeishuRuntimeAccount } from "./accounts-Cfzht2Hc.js";
|
|
2
2
|
import { n as looksLikeFeishuId, r as normalizeFeishuTarget, t as detectIdType } from "./targets-BUjQ1TcA.js";
|
|
3
3
|
import { n as createFeishuSendReceipt, s as createFeishuCardInteractionEnvelope } from "./send-result-DSsIa4-p.js";
|
|
4
4
|
import { a as parseFeishuTargetId, i as parseFeishuDirectConversationId, n as buildFeishuModelOverrideParentCandidates, r as parseFeishuConversationId, t as buildFeishuConversationId } from "./conversation-id-DuL575sn.js";
|
|
@@ -6,6 +6,7 @@ import { t as messageActionTargetAliases } from "./security-audit-BIeA3W3Q.js";
|
|
|
6
6
|
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-DLaBl9m4.js";
|
|
7
7
|
import { t as collectFeishuSecurityAuditFindings } from "./security-audit-shared-BIHeF-S_.js";
|
|
8
8
|
import { t as resolveFeishuSessionConversation } from "./session-conversation-CZSMgac-.js";
|
|
9
|
+
import { createLazyRuntimeModule, createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
|
|
9
10
|
import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
10
11
|
import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
|
|
11
12
|
import { adaptScopedAccountAccessor, createHybridChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
@@ -16,10 +17,9 @@ import { createAllowlistProviderGroupPolicyWarningCollector, projectConfigAccoun
|
|
|
16
17
|
import { getSessionBindingService } from "openclaw/plugin-sdk/conversation-runtime";
|
|
17
18
|
import { createChannelDirectoryAdapter, createRuntimeDirectoryLiveAdapter, listDirectoryGroupEntriesFromMapKeysAndAllowFrom, listDirectoryUserEntriesFromAllowFromAndMapKeys } from "openclaw/plugin-sdk/directory-runtime";
|
|
18
19
|
import { normalizeMessagePresentation, renderMessagePresentationFallbackText } from "openclaw/plugin-sdk/interactive-runtime";
|
|
19
|
-
import { createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
|
|
20
20
|
import { parseStrictPositiveInteger } from "openclaw/plugin-sdk/number-runtime";
|
|
21
21
|
import { buildProbeChannelStatusSummary, createComputedAccountStatusAdapter, createDefaultChannelRuntimeState } from "openclaw/plugin-sdk/status-helpers";
|
|
22
|
-
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
22
|
+
import { isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
23
23
|
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$2, normalizeAccountId, resolveMergedAccountConfig } from "openclaw/plugin-sdk/account-resolution";
|
|
24
24
|
import { createResolvedApproverActionAuthAdapter, resolveApprovalApprovers } from "openclaw/plugin-sdk/approval-auth-runtime";
|
|
25
25
|
import { createActionGate } from "openclaw/plugin-sdk/channel-actions";
|
|
@@ -383,11 +383,8 @@ const SESSION_FILE_INSPECTION_MAX_BYTES = 16 * 1024 * 1024;
|
|
|
383
383
|
function timestampForPath(now = /* @__PURE__ */ new Date()) {
|
|
384
384
|
return now.toISOString().replaceAll(":", "-");
|
|
385
385
|
}
|
|
386
|
-
function isRecord$1(value) {
|
|
387
|
-
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
388
|
-
}
|
|
389
386
|
function toFeishuSessionEntry(value) {
|
|
390
|
-
if (!isRecord
|
|
387
|
+
if (!isRecord(value)) return {};
|
|
391
388
|
return {
|
|
392
389
|
sessionId: value.sessionId,
|
|
393
390
|
sessionFile: value.sessionFile
|
|
@@ -450,12 +447,12 @@ function normalizeMetadataString(value) {
|
|
|
450
447
|
function isFeishuSessionEntry(key, value) {
|
|
451
448
|
if (isFeishuAcpBindingSessionKey(key)) return false;
|
|
452
449
|
if (isFeishuSessionStoreKey(key)) return true;
|
|
453
|
-
if (!isRecord
|
|
450
|
+
if (!isRecord(value)) return false;
|
|
454
451
|
if (normalizeMetadataString(value.channel) === "feishu" || normalizeMetadataString(value.lastChannel) === "feishu") return true;
|
|
455
|
-
if (normalizeMetadataString((isRecord
|
|
456
|
-
if (normalizeMetadataString((isRecord
|
|
457
|
-
if (normalizeMetadataString((isRecord
|
|
458
|
-
const origin = isRecord
|
|
452
|
+
if (normalizeMetadataString((isRecord(value.route) ? value.route : null)?.channel) === "feishu") return true;
|
|
453
|
+
if (normalizeMetadataString((isRecord(value.deliveryContext) ? value.deliveryContext : null)?.channel) === "feishu") return true;
|
|
454
|
+
if (normalizeMetadataString((isRecord(value.pendingFinalDeliveryContext) ? value.pendingFinalDeliveryContext : null)?.channel) === "feishu") return true;
|
|
455
|
+
const origin = isRecord(value.origin) ? value.origin : null;
|
|
459
456
|
const originProvider = normalizeMetadataString(origin?.provider);
|
|
460
457
|
const originSurface = normalizeMetadataString(origin?.surface);
|
|
461
458
|
const originFrom = normalizeMetadataString(origin?.from);
|
|
@@ -547,17 +544,17 @@ function resolveSessionTranscriptCandidates(params) {
|
|
|
547
544
|
return [...candidates].toSorted();
|
|
548
545
|
}
|
|
549
546
|
function isSessionHeader(value) {
|
|
550
|
-
return isRecord
|
|
547
|
+
return isRecord(value) && value.type === "session" && typeof value.id === "string";
|
|
551
548
|
}
|
|
552
549
|
function isBlankUserMessage(value) {
|
|
553
|
-
if (!isRecord
|
|
550
|
+
if (!isRecord(value) || value.type !== "message" || !isRecord(value.message)) return false;
|
|
554
551
|
if (value.message.role !== "user") return false;
|
|
555
552
|
const content = value.message.content;
|
|
556
553
|
if (typeof content === "string") return content.trim().length === 0;
|
|
557
554
|
return Array.isArray(content) && content.length === 0;
|
|
558
555
|
}
|
|
559
556
|
function isUserMessage(value) {
|
|
560
|
-
return isRecord
|
|
557
|
+
return isRecord(value) && value.type === "message" && isRecord(value.message) && value.message.role === "user";
|
|
561
558
|
}
|
|
562
559
|
function inspectSessionTranscript(params) {
|
|
563
560
|
let stat;
|
|
@@ -1431,11 +1428,7 @@ function applyNewAppSecurityPolicy(cfg, accountId, openId, groupPolicy) {
|
|
|
1431
1428
|
next = patchFeishuConfig(next, accountId, groupPatch);
|
|
1432
1429
|
return next;
|
|
1433
1430
|
}
|
|
1434
|
-
|
|
1435
|
-
const loadAppRegistrationModule = async () => {
|
|
1436
|
-
appRegistrationModulePromise ??= import("./app-registration-DapxBG7t.js");
|
|
1437
|
-
return await appRegistrationModulePromise;
|
|
1438
|
-
};
|
|
1431
|
+
const loadAppRegistrationModule = createLazyRuntimeModule(() => import("./app-registration-DuEyfVY1.js"));
|
|
1439
1432
|
async function promptFeishuDomain(params) {
|
|
1440
1433
|
return await params.prompter.select({
|
|
1441
1434
|
message: t("wizard.feishu.domainPrompt"),
|
|
@@ -1715,13 +1708,13 @@ function readBooleanParam(params, keys) {
|
|
|
1715
1708
|
}
|
|
1716
1709
|
}
|
|
1717
1710
|
function hasLegacyFeishuCardCommandValue(actionValue) {
|
|
1718
|
-
return isRecord$
|
|
1711
|
+
return isRecord$1(actionValue) && actionValue.oc !== "ocf1" && (Boolean(typeof actionValue.command === "string" && actionValue.command.trim()) || Boolean(typeof actionValue.text === "string" && actionValue.text.trim()));
|
|
1719
1712
|
}
|
|
1720
1713
|
function containsLegacyFeishuCardCommandValue(node) {
|
|
1721
1714
|
if (Array.isArray(node)) return node.some((item) => containsLegacyFeishuCardCommandValue(item));
|
|
1722
|
-
if (!isRecord$
|
|
1715
|
+
if (!isRecord$1(node)) return false;
|
|
1723
1716
|
if (node.tag === "button" && hasLegacyFeishuCardCommandValue(node.value)) return true;
|
|
1724
|
-
if (node.tag === "button" && Array.isArray(node.behaviors) && node.behaviors.some((behavior) => isRecord$
|
|
1717
|
+
if (node.tag === "button" && Array.isArray(node.behaviors) && node.behaviors.some((behavior) => isRecord$1(behavior) && hasLegacyFeishuCardCommandValue(behavior.value))) return true;
|
|
1725
1718
|
return Object.values(node).some((value) => containsLegacyFeishuCardCommandValue(value));
|
|
1726
1719
|
}
|
|
1727
1720
|
const meta = {
|
|
@@ -1735,7 +1728,7 @@ const meta = {
|
|
|
1735
1728
|
order: 70,
|
|
1736
1729
|
preferSessionLookupForAnnounceTarget: true
|
|
1737
1730
|
};
|
|
1738
|
-
const loadFeishuChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-
|
|
1731
|
+
const loadFeishuChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-C6SITclp.js"), "feishuChannelRuntime");
|
|
1739
1732
|
function toFeishuMessageSendResult(result, kind) {
|
|
1740
1733
|
const receipt = result.receipt ?? createFeishuSendReceipt({
|
|
1741
1734
|
messageId: result.messageId,
|
|
@@ -2551,7 +2544,7 @@ const feishuPlugin = createChatChannelPlugin({
|
|
|
2551
2544
|
})
|
|
2552
2545
|
}),
|
|
2553
2546
|
gateway: { startAccount: async (ctx) => {
|
|
2554
|
-
const { monitorFeishuProvider } = await import("./monitor-
|
|
2547
|
+
const { monitorFeishuProvider } = await import("./monitor-Ckch4qvr.js");
|
|
2555
2548
|
const account = resolveFeishuRuntimeAccount({
|
|
2556
2549
|
cfg: ctx.cfg,
|
|
2557
2550
|
accountId: ctx.accountId
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as feishuPlugin } from "./channel-
|
|
1
|
+
import { t as feishuPlugin } from "./channel-Bwm5rvHg.js";
|
|
2
2
|
export { feishuPlugin };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { o as resolveFeishuAccount, s as resolveFeishuRuntimeAccount, v as parseFeishuCommentTarget } from "./accounts-Cfzht2Hc.js";
|
|
2
|
-
import { h as listFeishuDirectoryPeers, m as listFeishuDirectoryGroups, o as buildFeishuPresentationCardElements } from "./channel-
|
|
2
|
+
import { h as listFeishuDirectoryPeers, m as listFeishuDirectoryGroups, o as buildFeishuPresentationCardElements } from "./channel-Bwm5rvHg.js";
|
|
3
3
|
import { r as createFeishuClient } from "./client-BwgAJuvo.js";
|
|
4
4
|
import { c as getChatInfo, l as getChatMembers, r as cleanupAmbientCommentTypingReaction, t as deliverCommentThreadText, u as getFeishuMemberInfo } from "./drive-djUl8IRC.js";
|
|
5
5
|
import { chunkTextForOutbound } from "./runtime-api.js";
|
|
6
|
-
import { a as sendCardFeishu, c as sendStructuredCardFeishu, g as shouldSuppressFeishuTextForVoiceMedia, h as sendMediaFeishu, i as resolveFeishuCardTemplate, n as getMessageFeishu, o as sendMarkdownCardFeishu, s as sendMessageFeishu, t as editMessageFeishu, y as resolveFeishuIdentityHeaderTitle } from "./send-
|
|
6
|
+
import { a as sendCardFeishu, c as sendStructuredCardFeishu, g as shouldSuppressFeishuTextForVoiceMedia, h as sendMediaFeishu, i as resolveFeishuCardTemplate, n as getMessageFeishu, o as sendMarkdownCardFeishu, s as sendMessageFeishu, t as editMessageFeishu, y as resolveFeishuIdentityHeaderTitle } from "./send-BJTjDWKi.js";
|
|
7
7
|
import { t as probeFeishu } from "./probe-Cv2M2Ivr.js";
|
|
8
8
|
import { interactiveReplyToPresentation, normalizeInteractiveReply, normalizeMessagePresentation, renderMessagePresentationFallbackText, resolveInteractiveTextFallback } from "openclaw/plugin-sdk/interactive-runtime";
|
|
9
9
|
import { isRecord, normalizeLowercaseStringOrEmpty, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -246,6 +246,9 @@ function buildFeishuPayloadCard(params) {
|
|
|
246
246
|
body: { elements }
|
|
247
247
|
});
|
|
248
248
|
}
|
|
249
|
+
function hasVisibleFallbackCommand(blocks) {
|
|
250
|
+
return blocks?.some((block) => block.type === "buttons" && block.buttons.some((button) => !button.disabled && button.action?.type === "command" && !button.url && !button.webApp?.url && !button.web_app?.url)) ?? false;
|
|
251
|
+
}
|
|
249
252
|
function renderFeishuPresentationPayload({ payload, presentation, ctx }) {
|
|
250
253
|
const card = buildFeishuPayloadCard({
|
|
251
254
|
payload,
|
|
@@ -254,6 +257,7 @@ function renderFeishuPresentationPayload({ payload, presentation, ctx }) {
|
|
|
254
257
|
});
|
|
255
258
|
if (!card) return null;
|
|
256
259
|
const existingFeishuData = isRecord(payload.channelData?.feishu) ? payload.channelData.feishu : void 0;
|
|
260
|
+
const fallbackHasCommand = hasVisibleFallbackCommand(presentation?.blocks);
|
|
257
261
|
return {
|
|
258
262
|
...payload,
|
|
259
263
|
text: renderMessagePresentationFallbackText({
|
|
@@ -264,7 +268,8 @@ function renderFeishuPresentationPayload({ payload, presentation, ctx }) {
|
|
|
264
268
|
...payload.channelData,
|
|
265
269
|
feishu: {
|
|
266
270
|
...existingFeishuData,
|
|
267
|
-
card
|
|
271
|
+
card,
|
|
272
|
+
...fallbackHasCommand ? { fallbackHasCommand: true } : {}
|
|
268
273
|
}
|
|
269
274
|
}
|
|
270
275
|
};
|
|
@@ -385,26 +390,31 @@ const feishuOutbound = {
|
|
|
385
390
|
replyToId: ctx.replyToId,
|
|
386
391
|
threadId: ctx.threadId
|
|
387
392
|
});
|
|
388
|
-
if (parseFeishuCommentTarget(ctx.to))
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
393
|
+
if (parseFeishuCommentTarget(ctx.to)) {
|
|
394
|
+
const normalizedPresentation = normalizeMessagePresentation(ctx.payload.presentation) ?? (() => {
|
|
395
|
+
const interactive = normalizeInteractiveReply(ctx.payload.interactive);
|
|
396
|
+
return interactive ? interactiveReplyToPresentation(interactive) : void 0;
|
|
397
|
+
})();
|
|
398
|
+
const presentationFallbackText = renderMessagePresentationFallbackText({
|
|
399
|
+
text: ctx.payload.text,
|
|
400
|
+
presentation: normalizedPresentation
|
|
401
|
+
});
|
|
402
|
+
const text = hasVisibleFallbackCommand(normalizedPresentation?.blocks) || isRecord(ctx.payload.channelData?.feishu) && ctx.payload.channelData.feishu.fallbackHasCommand === true ? `${presentationFallbackText}\n\n> Interactive buttons are unavailable in Feishu document comments. You can type the command shown above manually.` : presentationFallbackText;
|
|
403
|
+
return await sendTextMediaPayload({
|
|
404
|
+
channel: "feishu",
|
|
405
|
+
ctx: {
|
|
406
|
+
...ctx,
|
|
407
|
+
payload: {
|
|
408
|
+
...ctx.payload,
|
|
409
|
+
text,
|
|
410
|
+
interactive: void 0,
|
|
411
|
+
presentation: void 0,
|
|
412
|
+
channelData: void 0
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
adapter: feishuOutbound
|
|
416
|
+
});
|
|
417
|
+
}
|
|
408
418
|
const mediaUrls = normalizeStringEntries(resolvePayloadMediaUrls(ctx.payload));
|
|
409
419
|
return attachChannelToResult("feishu", await sendPayloadMediaSequenceAndFinalize({
|
|
410
420
|
text: ctx.payload.text ?? "",
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { r as listEnabledFeishuAccounts, s as resolveFeishuRuntimeAccount } from "./accounts-Cfzht2Hc.js";
|
|
2
2
|
import { f as fetchBotIdentityForMonitor } from "./monitor.state-R4ZgNpac.js";
|
|
3
|
+
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
3
4
|
//#region extensions/feishu/src/monitor.ts
|
|
4
|
-
|
|
5
|
-
async function loadMonitorAccountRuntime() {
|
|
6
|
-
monitorAccountRuntimePromise ??= import("./monitor.account-08br3nkU.js");
|
|
7
|
-
return await monitorAccountRuntimePromise;
|
|
8
|
-
}
|
|
5
|
+
const loadMonitorAccountRuntime = createLazyRuntimeModule(() => import("./monitor.account-GXGIJrgw.js"));
|
|
9
6
|
async function monitorFeishuProvider(opts = {}) {
|
|
10
7
|
const cfg = opts.config;
|
|
11
8
|
if (!cfg) throw new Error("Config is required for Feishu monitor");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ as normalizeCommentFileType, c as encodeQuery, d as isRecord$1, f as normalizeString, g as buildFeishuCommentTarget, h as requestFeishuApi, l as extractReplyText, m as readString, o as resolveFeishuAccount, p as parseCommentContentElements, s as resolveFeishuRuntimeAccount } from "./accounts-Cfzht2Hc.js";
|
|
2
2
|
import { i as resolveReceiveIdType } from "./targets-BUjQ1TcA.js";
|
|
3
|
-
import { c as normalizeFeishuAllowEntry, d as resolveFeishuGroupConversationIngressAccess, f as resolveFeishuGroupSenderActivationIngressAccess, l as resolveFeishuDmIngressAccess, p as resolveFeishuReplyPolicy, s as hasExplicitFeishuGroupConfig, u as resolveFeishuGroupConfig } from "./channel-
|
|
3
|
+
import { c as normalizeFeishuAllowEntry, d as resolveFeishuGroupConversationIngressAccess, f as resolveFeishuGroupSenderActivationIngressAccess, l as resolveFeishuDmIngressAccess, p as resolveFeishuReplyPolicy, s as hasExplicitFeishuGroupConfig, u as resolveFeishuGroupConfig } from "./channel-Bwm5rvHg.js";
|
|
4
4
|
import { c as decodeFeishuCardAction, o as buildFeishuCardActionTextFallback, s as createFeishuCardInteractionEnvelope } from "./send-result-DSsIa4-p.js";
|
|
5
5
|
import { t as buildFeishuConversationId } from "./conversation-id-DuL575sn.js";
|
|
6
6
|
import { t as getFeishuRuntime } from "./runtime-C5JxBWZp.js";
|
|
@@ -8,7 +8,7 @@ import { a as getFeishuUserAgent, i as createFeishuWSClient, n as createEventDis
|
|
|
8
8
|
import { c as getChatInfo, i as createCommentTypingReactionLifecycle, t as deliverCommentThreadText } from "./drive-djUl8IRC.js";
|
|
9
9
|
import { t as createFeishuThreadBindingManager } from "./thread-bindings-V0bwk0A1.js";
|
|
10
10
|
import { createReplyPrefixContext, evaluateSupplementalContextVisibility, getSessionEntry, normalizeAgentId as normalizeAgentId$2, resolveChannelContextVisibilityMode } from "./runtime-api.js";
|
|
11
|
-
import { _ as normalizeFeishuExternalKey, a as sendCardFeishu, c as sendStructuredCardFeishu, d as isFeishuBroadcastMention, f as isMentionForwardRequest, g as shouldSuppressFeishuTextForVoiceMedia, h as sendMediaFeishu, i as resolveFeishuCardTemplate, l as parsePostContent, m as saveMessageResourceFeishu, n as getMessageFeishu, p as isFeishuGroupChatType, r as listFeishuThreadMessages, s as sendMessageFeishu, u as extractMentionTargets, v as resolveFeishuIdentityEmoji } from "./send-
|
|
11
|
+
import { _ as normalizeFeishuExternalKey, a as sendCardFeishu, c as sendStructuredCardFeishu, d as isFeishuBroadcastMention, f as isMentionForwardRequest, g as shouldSuppressFeishuTextForVoiceMedia, h as sendMediaFeishu, i as resolveFeishuCardTemplate, l as parsePostContent, m as saveMessageResourceFeishu, n as getMessageFeishu, p as isFeishuGroupChatType, r as listFeishuThreadMessages, s as sendMessageFeishu, u as extractMentionTargets, v as resolveFeishuIdentityEmoji } from "./send-BJTjDWKi.js";
|
|
12
12
|
import { i as waitForAbortableDelay, r as raceWithTimeoutAndAbort } from "./probe-Cv2M2Ivr.js";
|
|
13
13
|
import { a as clearFeishuBotIdentityState, c as httpServers, d as wsClients, f as fetchBotIdentityForMonitor, i as botOpenIds, l as recordWebhookStatus, n as FEISHU_WEBHOOK_MAX_BODY_BYTES, o as closeTrackedFeishuHttpServer, r as botNames, s as feishuWebhookRateLimiter, t as FEISHU_WEBHOOK_BODY_TIMEOUT_MS, u as setFeishuBotIdentityState } from "./monitor.state-R4ZgNpac.js";
|
|
14
14
|
import { createChannelMessageReplyPipeline, formatChannelProgressDraftLineForEntry, isChannelProgressDraftWorkToolName, resolveAgentOutboundIdentity } from "openclaw/plugin-sdk/channel-outbound";
|
|
@@ -1150,7 +1150,7 @@ var FeishuStreamingSession = class {
|
|
|
1150
1150
|
this.flushTimer = null;
|
|
1151
1151
|
const pending = this.pendingText;
|
|
1152
1152
|
if (!pending || this.closed) return;
|
|
1153
|
-
this.update(pending);
|
|
1153
|
+
this.update(pending).catch((error) => this.log?.(`Scheduled flush update failed: ${String(error)}`));
|
|
1154
1154
|
}, delayMs);
|
|
1155
1155
|
}
|
|
1156
1156
|
async update(text) {
|
|
@@ -2851,7 +2851,8 @@ async function handleFeishuMessage(params) {
|
|
|
2851
2851
|
access: {
|
|
2852
2852
|
mentions: {
|
|
2853
2853
|
canDetectMention: isGroup,
|
|
2854
|
-
wasMentioned
|
|
2854
|
+
wasMentioned,
|
|
2855
|
+
requireMention
|
|
2855
2856
|
},
|
|
2856
2857
|
commands: { authorized: commandAuthorized }
|
|
2857
2858
|
},
|
|
@@ -501,12 +501,14 @@ async function prepareFeishuVoiceMedia(params) {
|
|
|
501
501
|
return params;
|
|
502
502
|
}
|
|
503
503
|
}
|
|
504
|
-
async function
|
|
504
|
+
async function probeMediaDurationMs(params) {
|
|
505
505
|
try {
|
|
506
506
|
return await withTempWorkspace({
|
|
507
507
|
rootDir: resolvePreferredOpenClawTmpDir(),
|
|
508
|
-
prefix: "feishu-
|
|
508
|
+
prefix: "feishu-media-probe-"
|
|
509
509
|
}, async (workspace) => {
|
|
510
|
+
const ext = normalizeLowercaseStringOrEmpty(path.extname(params.fileName));
|
|
511
|
+
const inferredExt = ext && ext.length <= 12 ? ext : mediaKindFromMime(params.contentType) === "video" ? ".mp4" : ".ogg";
|
|
510
512
|
const stdout = await runFfprobe([
|
|
511
513
|
"-v",
|
|
512
514
|
"error",
|
|
@@ -514,17 +516,21 @@ async function probeAudioDurationMs(buffer) {
|
|
|
514
516
|
"format=duration",
|
|
515
517
|
"-of",
|
|
516
518
|
"csv=p=0",
|
|
517
|
-
await workspace.write(
|
|
519
|
+
await workspace.write(`input${inferredExt}`, params.buffer)
|
|
518
520
|
], { timeoutMs: 5e3 });
|
|
519
521
|
const seconds = Number.parseFloat(stdout.trim());
|
|
520
522
|
if (!Number.isFinite(seconds) || seconds <= 0) return;
|
|
521
523
|
return Math.max(1, Math.round(seconds * 1e3));
|
|
522
524
|
});
|
|
523
525
|
} catch (err) {
|
|
524
|
-
console.warn("[feishu] failed to probe
|
|
526
|
+
console.warn("[feishu] failed to probe media duration; upload will omit it:", err);
|
|
525
527
|
return;
|
|
526
528
|
}
|
|
527
529
|
}
|
|
530
|
+
async function maybeProbeUploadDurationMs(params) {
|
|
531
|
+
if (params.msgType !== "audio" && params.msgType !== "media") return;
|
|
532
|
+
return await probeMediaDurationMs(params);
|
|
533
|
+
}
|
|
528
534
|
/**
|
|
529
535
|
* Upload and send media (image or file) from URL, local path, or buffer.
|
|
530
536
|
* When mediaUrl is a local path, mediaLocalRoots (from core outbound context)
|
|
@@ -586,7 +592,12 @@ async function sendMediaFeishu(params) {
|
|
|
586
592
|
...voiceIntentDegradedToFile ? { voiceIntentDegradedToFile: true } : {}
|
|
587
593
|
};
|
|
588
594
|
}
|
|
589
|
-
const durationMs =
|
|
595
|
+
const durationMs = await maybeProbeUploadDurationMs({
|
|
596
|
+
buffer,
|
|
597
|
+
fileName: name,
|
|
598
|
+
contentType,
|
|
599
|
+
msgType: routing.msgType
|
|
600
|
+
});
|
|
590
601
|
const { fileKey } = await uploadFileFeishu({
|
|
591
602
|
cfg,
|
|
592
603
|
file: buffer,
|
package/dist/setup-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as feishuSetupAdapter, n as feishuSetupWizard, t as feishuPlugin } from "./channel-
|
|
1
|
+
import { i as feishuSetupAdapter, n as feishuSetupWizard, t as feishuPlugin } from "./channel-Bwm5rvHg.js";
|
|
2
2
|
export { feishuPlugin, feishuSetupAdapter, feishuSetupWizard };
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
+
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
1
2
|
//#region extensions/feishu/subagent-hooks-api.ts
|
|
2
|
-
|
|
3
|
-
function loadFeishuSubagentHooksModule() {
|
|
4
|
-
feishuSubagentHooksPromise ??= import("./subagent-hooks-1pqt5tAA.js").then((n) => n.i);
|
|
5
|
-
return feishuSubagentHooksPromise;
|
|
6
|
-
}
|
|
3
|
+
const loadFeishuSubagentHooksModule = createLazyRuntimeModule(() => import("./subagent-hooks-1pqt5tAA.js").then((n) => n.i));
|
|
7
4
|
function registerFeishuSubagentHooks(api) {
|
|
8
5
|
api.on("subagent_delivery_target", async (event) => {
|
|
9
6
|
const { handleFeishuSubagentDeliveryTarget } = await loadFeishuSubagentHooksModule();
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/feishu",
|
|
3
|
-
"version": "2026.7.1-beta.
|
|
3
|
+
"version": "2026.7.1-beta.2",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/feishu",
|
|
9
|
-
"version": "2026.7.1-beta.
|
|
9
|
+
"version": "2026.7.1-beta.2",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@larksuiteoapi/node-sdk": "1.66.0",
|
|
12
12
|
"typebox": "1.1.39",
|
|
13
13
|
"zod": "4.4.3"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
|
-
"openclaw": ">=2026.7.1-beta.
|
|
16
|
+
"openclaw": ">=2026.7.1-beta.2"
|
|
17
17
|
},
|
|
18
18
|
"peerDependenciesMeta": {
|
|
19
19
|
"openclaw": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/feishu",
|
|
3
|
-
"version": "2026.7.1-beta.
|
|
3
|
+
"version": "2026.7.1-beta.2",
|
|
4
4
|
"description": "OpenClaw Feishu/Lark channel plugin for chats and workplace tools (community maintained by @m1heng).",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"zod": "4.4.3"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
|
-
"openclaw": ">=2026.7.1-beta.
|
|
16
|
+
"openclaw": ">=2026.7.1-beta.2"
|
|
17
17
|
},
|
|
18
18
|
"peerDependenciesMeta": {
|
|
19
19
|
"openclaw": {
|
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
"minHostVersion": ">=2026.5.29"
|
|
48
48
|
},
|
|
49
49
|
"compat": {
|
|
50
|
-
"pluginApi": ">=2026.7.1-beta.
|
|
50
|
+
"pluginApi": ">=2026.7.1-beta.2"
|
|
51
51
|
},
|
|
52
52
|
"build": {
|
|
53
|
-
"openclawVersion": "2026.7.1-beta.
|
|
53
|
+
"openclawVersion": "2026.7.1-beta.2"
|
|
54
54
|
},
|
|
55
55
|
"release": {
|
|
56
56
|
"publishToClawHub": true,
|