@openclaw/feishu 2026.5.28 → 2026.5.30-beta.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/api.js +4 -4
- package/dist/{channel-BfeesQob.js → channel-DccLoln2.js} +22 -16
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-BLnKcmtO.js → channel.runtime-CmCCekKl.js} +4 -4
- package/dist/contract-api.js +1 -1
- package/dist/{monitor-CyD0CQxm.js → monitor-DSJJNRiU.js} +4 -2
- package/dist/{monitor.account-ByxawtBB.js → monitor.account-V8T4ZdUw.js} +193 -77
- package/dist/{monitor.state-t4Ae5VIa.js → monitor.state-V43tWIJ9.js} +2 -2
- package/dist/{probe-956I34qH.js → probe-DKDDBF_j.js} +19 -5
- package/dist/runtime-api.js +1 -1
- package/dist/setup-api.js +1 -1
- package/dist/{subagent-hooks-fuyBHOVu.js → subagent-hooks-Bw3Dg2mS.js} +2 -2
- package/dist/subagent-hooks-api.js +2 -7
- package/npm-shrinkwrap.json +3 -3
- package/package.json +4 -4
- package/dist/{send-Djou0Z5a.js → send-WRPbKn3K.js} +2 -2
- package/dist/{thread-bindings-D24m3Cjy.js → thread-bindings-C58Uq5Y1.js} +1 -1
package/dist/api.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { a as parseFeishuTargetId, i as parseFeishuDirectConversationId, n as buildFeishuModelOverrideParentCandidates, r as parseFeishuConversationId, t as buildFeishuConversationId } from "./conversation-id-DuL575sn.js";
|
|
2
|
-
import { n as getFeishuThreadBindingManager, r as testing, t as createFeishuThreadBindingManager } from "./thread-bindings-D24m3Cjy.js";
|
|
3
|
-
import { n as handleFeishuSubagentEnded, r as handleFeishuSubagentSpawning, t as handleFeishuSubagentDeliveryTarget } from "./subagent-hooks-fuyBHOVu.js";
|
|
4
1
|
import { r as listEnabledFeishuAccounts } from "./accounts-CXnY5H8g.js";
|
|
5
|
-
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-DccLoln2.js";
|
|
3
|
+
import { a as parseFeishuTargetId, i as parseFeishuDirectConversationId, n as buildFeishuModelOverrideParentCandidates, r as parseFeishuConversationId, t as buildFeishuConversationId } from "./conversation-id-DuL575sn.js";
|
|
6
4
|
import { t as getFeishuRuntime } from "./runtime-C5JxBWZp.js";
|
|
7
5
|
import { a as jsonToolResult, d as registerFeishuChatTools, f as createFeishuToolClient, m as resolveFeishuToolAccount, n as registerFeishuDriveTools, o as toolExecutionErrorResult, p as resolveAnyEnabledFeishuToolsConfig, s as unknownToolActionResult } from "./drive-USxqssMG.js";
|
|
6
|
+
import { n as getFeishuThreadBindingManager, r as testing, t as createFeishuThreadBindingManager } from "./thread-bindings-C58Uq5Y1.js";
|
|
7
|
+
import { n as handleFeishuSubagentEnded, r as handleFeishuSubagentSpawning, t as handleFeishuSubagentDeliveryTarget } from "./subagent-hooks-Bw3Dg2mS.js";
|
|
8
8
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, readStringValue, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
9
|
import { optionalPositiveIntegerSchema } from "openclaw/plugin-sdk/channel-actions";
|
|
10
10
|
import { existsSync } from "node:fs";
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import { a as parseFeishuTargetId, i as parseFeishuDirectConversationId, n as buildFeishuModelOverrideParentCandidates, r as parseFeishuConversationId, t as buildFeishuConversationId } from "./conversation-id-DuL575sn.js";
|
|
2
|
-
import { n as looksLikeFeishuId, r as normalizeFeishuTarget, t as detectIdType } from "./targets-BUjQ1TcA.js";
|
|
3
1
|
import { a as resolveDefaultFeishuAccountId, f as isRecord$2, i as listFeishuAccountIds, n as inspectFeishuCredentials, o as resolveFeishuAccount, r as listEnabledFeishuAccounts, s as resolveFeishuRuntimeAccount } from "./accounts-CXnY5H8g.js";
|
|
2
|
+
import { n as looksLikeFeishuId, r as normalizeFeishuTarget, t as detectIdType } from "./targets-BUjQ1TcA.js";
|
|
4
3
|
import { n as createFeishuSendReceipt, s as createFeishuCardInteractionEnvelope } from "./send-result-DSTSkRDM.js";
|
|
4
|
+
import { a as parseFeishuTargetId, i as parseFeishuDirectConversationId, n as buildFeishuModelOverrideParentCandidates, r as parseFeishuConversationId, t as buildFeishuConversationId } from "./conversation-id-DuL575sn.js";
|
|
5
5
|
import { t as messageActionTargetAliases } from "./security-audit-BIeA3W3Q.js";
|
|
6
6
|
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-ChjJKAJ9.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 { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
10
|
-
import { getSessionBindingService } from "openclaw/plugin-sdk/conversation-runtime";
|
|
11
|
-
import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
|
|
12
9
|
import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
13
10
|
import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
|
|
14
11
|
import { adaptScopedAccountAccessor, createHybridChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
@@ -16,23 +13,26 @@ import { buildChannelOutboundSessionRoute, createChatChannelPlugin, stripChannel
|
|
|
16
13
|
import { createRuntimeOutboundDelegates, defineChannelMessageAdapter } from "openclaw/plugin-sdk/channel-outbound";
|
|
17
14
|
import { createPairingPrefixStripper } from "openclaw/plugin-sdk/channel-pairing";
|
|
18
15
|
import { createAllowlistProviderGroupPolicyWarningCollector, projectConfigAccountIdWarningCollector } from "openclaw/plugin-sdk/channel-policy";
|
|
16
|
+
import { getSessionBindingService } from "openclaw/plugin-sdk/conversation-runtime";
|
|
19
17
|
import { createChannelDirectoryAdapter, createRuntimeDirectoryLiveAdapter, listDirectoryGroupEntriesFromMapKeysAndAllowFrom, listDirectoryUserEntriesFromAllowFromAndMapKeys } from "openclaw/plugin-sdk/directory-runtime";
|
|
20
18
|
import { normalizeMessagePresentation, renderMessagePresentationFallbackText } from "openclaw/plugin-sdk/interactive-runtime";
|
|
21
19
|
import { createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
|
|
22
20
|
import { parseStrictPositiveInteger } from "openclaw/plugin-sdk/number-runtime";
|
|
23
21
|
import { buildProbeChannelStatusSummary, createComputedAccountStatusAdapter, createDefaultChannelRuntimeState } from "openclaw/plugin-sdk/status-helpers";
|
|
24
|
-
import {
|
|
22
|
+
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
23
|
+
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$2, normalizeAccountId, resolveMergedAccountConfig } from "openclaw/plugin-sdk/account-resolution";
|
|
25
24
|
import { createResolvedApproverActionAuthAdapter, resolveApprovalApprovers } from "openclaw/plugin-sdk/approval-auth-runtime";
|
|
26
25
|
import { createActionGate } from "openclaw/plugin-sdk/channel-actions";
|
|
27
26
|
import { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-primitives";
|
|
28
27
|
import { PAIRING_APPROVED_MESSAGE } from "openclaw/plugin-sdk/channel-status";
|
|
29
28
|
import { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking";
|
|
30
|
-
import { normalizeAccountId as normalizeAccountId$
|
|
29
|
+
import { normalizeAccountId as normalizeAccountId$1 } from "openclaw/plugin-sdk/account-id";
|
|
31
30
|
import { z } from "zod";
|
|
32
31
|
import { buildSecretInputSchema, hasConfiguredSecretInput as hasConfiguredSecretInput$2 } from "openclaw/plugin-sdk/secret-input";
|
|
33
32
|
import fs from "node:fs";
|
|
34
33
|
import os from "node:os";
|
|
35
34
|
import path from "node:path";
|
|
35
|
+
import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
|
|
36
36
|
import { loadSessionStore, resolveSessionFilePath, resolveStorePath, updateSessionStore } from "openclaw/plugin-sdk/session-store-runtime";
|
|
37
37
|
import { resolveStateDir } from "openclaw/plugin-sdk/state-paths";
|
|
38
38
|
import { createChannelIngressResolver, defineStableChannelIngressIdentity } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
@@ -278,7 +278,7 @@ const FeishuConfigSchema = z.object({
|
|
|
278
278
|
}).strict().superRefine((value, ctx) => {
|
|
279
279
|
const defaultAccount = value.defaultAccount?.trim();
|
|
280
280
|
if (defaultAccount && value.accounts && Object.keys(value.accounts).length > 0) {
|
|
281
|
-
const normalizedDefaultAccount = normalizeAccountId$
|
|
281
|
+
const normalizedDefaultAccount = normalizeAccountId$1(defaultAccount);
|
|
282
282
|
if (!Object.prototype.hasOwnProperty.call(value.accounts, normalizedDefaultAccount)) ctx.addIssue({
|
|
283
283
|
code: z.ZodIssueCode.custom,
|
|
284
284
|
path: ["defaultAccount"],
|
|
@@ -982,7 +982,7 @@ function createFeishuIngressSubject(params) {
|
|
|
982
982
|
function createFeishuIngressResolver(params) {
|
|
983
983
|
return createChannelIngressResolver({
|
|
984
984
|
channelId: "feishu",
|
|
985
|
-
accountId: normalizeAccountId
|
|
985
|
+
accountId: normalizeAccountId(params.accountId) ?? "default",
|
|
986
986
|
identity: feishuIngressIdentity,
|
|
987
987
|
cfg: params.cfg,
|
|
988
988
|
...params.readAllowFromStore ? { readStoreAllowFrom: params.readAllowFromStore } : {}
|
|
@@ -1088,8 +1088,8 @@ function resolveFeishuReplyPolicy(params) {
|
|
|
1088
1088
|
const resolvedCfg = resolveMergedAccountConfig({
|
|
1089
1089
|
channelConfig: feishuCfg,
|
|
1090
1090
|
accounts: feishuCfg?.accounts,
|
|
1091
|
-
accountId: normalizeAccountId
|
|
1092
|
-
normalizeAccountId
|
|
1091
|
+
accountId: normalizeAccountId(params.accountId),
|
|
1092
|
+
normalizeAccountId,
|
|
1093
1093
|
omitKeys: ["defaultAccount"]
|
|
1094
1094
|
});
|
|
1095
1095
|
const groupRequireMention = resolveFeishuGroupConfig({
|
|
@@ -1426,6 +1426,11 @@ function applyNewAppSecurityPolicy(cfg, accountId, openId, groupPolicy) {
|
|
|
1426
1426
|
next = patchFeishuConfig(next, accountId, groupPatch);
|
|
1427
1427
|
return next;
|
|
1428
1428
|
}
|
|
1429
|
+
let appRegistrationModulePromise = null;
|
|
1430
|
+
const loadAppRegistrationModule = async () => {
|
|
1431
|
+
appRegistrationModulePromise ??= import("./app-registration-DCy5-X_C.js");
|
|
1432
|
+
return await appRegistrationModulePromise;
|
|
1433
|
+
};
|
|
1429
1434
|
async function promptFeishuDomain(params) {
|
|
1430
1435
|
return await params.prompter.select({
|
|
1431
1436
|
message: t("wizard.feishu.domainPrompt"),
|
|
@@ -1453,7 +1458,7 @@ async function promptFeishuSetupMethod(prompter) {
|
|
|
1453
1458
|
});
|
|
1454
1459
|
}
|
|
1455
1460
|
async function runScanToCreate(prompter, domain) {
|
|
1456
|
-
const { beginAppRegistration, initAppRegistration, pollAppRegistration, printQrCode } = await
|
|
1461
|
+
const { beginAppRegistration, initAppRegistration, pollAppRegistration, printQrCode } = await loadAppRegistrationModule();
|
|
1457
1462
|
try {
|
|
1458
1463
|
await initAppRegistration(domain);
|
|
1459
1464
|
} catch {
|
|
@@ -1538,7 +1543,7 @@ async function runNewAppFlow(params) {
|
|
|
1538
1543
|
appSecretProbeValue = appSecretResult.resolvedValue;
|
|
1539
1544
|
}
|
|
1540
1545
|
if (appId && appSecretProbeValue) {
|
|
1541
|
-
const { getAppOwnerOpenId } = await
|
|
1546
|
+
const { getAppOwnerOpenId } = await loadAppRegistrationModule();
|
|
1542
1547
|
scanOpenId = await getAppOwnerOpenId({
|
|
1543
1548
|
appId,
|
|
1544
1549
|
appSecret: appSecretProbeValue,
|
|
@@ -1648,7 +1653,7 @@ const feishuSetupWizard = {
|
|
|
1648
1653
|
});
|
|
1649
1654
|
let probeResult = null;
|
|
1650
1655
|
if (configured && account.configured) try {
|
|
1651
|
-
const { probeFeishu } = await import("./probe-
|
|
1656
|
+
const { probeFeishu } = await import("./probe-DKDDBF_j.js").then((n) => n.n);
|
|
1652
1657
|
probeResult = await probeFeishu(account);
|
|
1653
1658
|
} catch {}
|
|
1654
1659
|
if (!configured) return [formatFeishuStatusLine("needs-credentials")];
|
|
@@ -1724,7 +1729,7 @@ const meta = {
|
|
|
1724
1729
|
order: 70,
|
|
1725
1730
|
preferSessionLookupForAnnounceTarget: true
|
|
1726
1731
|
};
|
|
1727
|
-
const loadFeishuChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-
|
|
1732
|
+
const loadFeishuChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-CmCCekKl.js"), "feishuChannelRuntime");
|
|
1728
1733
|
function toFeishuMessageSendResult(result, kind) {
|
|
1729
1734
|
const receipt = result.receipt ?? createFeishuSendReceipt({
|
|
1730
1735
|
messageId: result.messageId,
|
|
@@ -2540,7 +2545,7 @@ const feishuPlugin = createChatChannelPlugin({
|
|
|
2540
2545
|
})
|
|
2541
2546
|
}),
|
|
2542
2547
|
gateway: { startAccount: async (ctx) => {
|
|
2543
|
-
const { monitorFeishuProvider } = await import("./monitor-
|
|
2548
|
+
const { monitorFeishuProvider } = await import("./monitor-DSJJNRiU.js");
|
|
2544
2549
|
const account = resolveFeishuRuntimeAccount({
|
|
2545
2550
|
cfg: ctx.cfg,
|
|
2546
2551
|
accountId: ctx.accountId
|
|
@@ -2554,6 +2559,7 @@ const feishuPlugin = createChatChannelPlugin({
|
|
|
2554
2559
|
return monitorFeishuProvider({
|
|
2555
2560
|
config: ctx.cfg,
|
|
2556
2561
|
runtime: ctx.runtime,
|
|
2562
|
+
channelRuntime: ctx.channelRuntime,
|
|
2557
2563
|
abortSignal: ctx.abortSignal,
|
|
2558
2564
|
accountId: ctx.accountId
|
|
2559
2565
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as feishuPlugin } from "./channel-
|
|
1
|
+
import { t as feishuPlugin } from "./channel-DccLoln2.js";
|
|
2
2
|
export { feishuPlugin };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { o as resolveFeishuAccount, s as resolveFeishuRuntimeAccount, y as parseFeishuCommentTarget } from "./accounts-CXnY5H8g.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-DccLoln2.js";
|
|
3
3
|
import { r as createFeishuClient } from "./client-BhMNZBJD.js";
|
|
4
4
|
import { c as getChatInfo, l as getChatMembers, r as cleanupAmbientCommentTypingReaction, t as deliverCommentThreadText, u as getFeishuMemberInfo } from "./drive-USxqssMG.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 } from "./send-
|
|
7
|
-
import { t as probeFeishu } from "./probe-
|
|
8
|
-
import { isRecord, normalizeLowercaseStringOrEmpty, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
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 } from "./send-WRPbKn3K.js";
|
|
7
|
+
import { t as probeFeishu } from "./probe-DKDDBF_j.js";
|
|
9
8
|
import { interactiveReplyToPresentation, normalizeInteractiveReply, normalizeMessagePresentation, renderMessagePresentationFallbackText, resolveInteractiveTextFallback } from "openclaw/plugin-sdk/interactive-runtime";
|
|
9
|
+
import { isRecord, normalizeLowercaseStringOrEmpty, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
10
10
|
import path from "node:path";
|
|
11
11
|
import { attachChannelToResult, createAttachedChannelResultAdapter } from "openclaw/plugin-sdk/channel-send-result";
|
|
12
12
|
import { resolvePayloadMediaUrls, sendPayloadMediaSequenceAndFinalize, sendTextMediaPayload } from "openclaw/plugin-sdk/reply-payload";
|
package/dist/contract-api.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as parseFeishuTargetId, i as parseFeishuDirectConversationId, r as parseFeishuConversationId, t as buildFeishuConversationId } from "./conversation-id-DuL575sn.js";
|
|
2
|
-
import { r as testing, t as createFeishuThreadBindingManager } from "./thread-bindings-D24m3Cjy.js";
|
|
3
2
|
import { t as messageActionTargetAliases } from "./security-audit-BIeA3W3Q.js";
|
|
4
3
|
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-ChjJKAJ9.js";
|
|
5
4
|
import { t as collectFeishuSecurityAuditFindings } from "./security-audit-shared-BIHeF-S_.js";
|
|
5
|
+
import { r as testing, t as createFeishuThreadBindingManager } from "./thread-bindings-C58Uq5Y1.js";
|
|
6
6
|
//#region extensions/feishu/contract-api.ts
|
|
7
7
|
const feishuSessionBindingAdapterChannels = ["feishu"];
|
|
8
8
|
//#endregion
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as listEnabledFeishuAccounts, s as resolveFeishuRuntimeAccount } from "./accounts-CXnY5H8g.js";
|
|
2
|
-
import { l as fetchBotIdentityForMonitor } from "./monitor.state-
|
|
2
|
+
import { l as fetchBotIdentityForMonitor } from "./monitor.state-V43tWIJ9.js";
|
|
3
3
|
//#region extensions/feishu/src/monitor.ts
|
|
4
4
|
let monitorAccountRuntimePromise;
|
|
5
5
|
async function loadMonitorAccountRuntime() {
|
|
6
|
-
monitorAccountRuntimePromise ??= import("./monitor.account-
|
|
6
|
+
monitorAccountRuntimePromise ??= import("./monitor.account-V8T4ZdUw.js");
|
|
7
7
|
return await monitorAccountRuntimePromise;
|
|
8
8
|
}
|
|
9
9
|
async function monitorFeishuProvider(opts = {}) {
|
|
@@ -20,6 +20,7 @@ async function monitorFeishuProvider(opts = {}) {
|
|
|
20
20
|
return monitorSingleAccount({
|
|
21
21
|
cfg,
|
|
22
22
|
account,
|
|
23
|
+
channelRuntime: opts.channelRuntime,
|
|
23
24
|
runtime: opts.runtime,
|
|
24
25
|
abortSignal: opts.abortSignal
|
|
25
26
|
});
|
|
@@ -45,6 +46,7 @@ async function monitorFeishuProvider(opts = {}) {
|
|
|
45
46
|
monitorPromises.push(monitorSingleAccount({
|
|
46
47
|
cfg,
|
|
47
48
|
account,
|
|
49
|
+
channelRuntime: opts.channelRuntime,
|
|
48
50
|
runtime: opts.runtime,
|
|
49
51
|
abortSignal: opts.abortSignal,
|
|
50
52
|
botOpenIdSource: {
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { t as buildFeishuConversationId } from "./conversation-id-DuL575sn.js";
|
|
2
|
-
import { i as resolveReceiveIdType } from "./targets-BUjQ1TcA.js";
|
|
3
|
-
import { t as createFeishuThreadBindingManager } from "./thread-bindings-D24m3Cjy.js";
|
|
4
1
|
import { _ as buildFeishuCommentTarget, f as isRecord$1, h as readString, l as encodeQuery, m as parseCommentContentElements, p as normalizeString, s as resolveFeishuRuntimeAccount, u as extractReplyText, v as normalizeCommentFileType } from "./accounts-CXnY5H8g.js";
|
|
5
|
-
import {
|
|
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-DccLoln2.js";
|
|
6
4
|
import { c as decodeFeishuCardAction, o as buildFeishuCardActionTextFallback, s as createFeishuCardInteractionEnvelope } from "./send-result-DSTSkRDM.js";
|
|
5
|
+
import { t as buildFeishuConversationId } from "./conversation-id-DuL575sn.js";
|
|
7
6
|
import { t as getFeishuRuntime } from "./runtime-C5JxBWZp.js";
|
|
8
7
|
import { a as getFeishuUserAgent, i as createFeishuWSClient, n as createEventDispatcher, r as createFeishuClient } from "./client-BhMNZBJD.js";
|
|
9
8
|
import { c as getChatInfo, i as createCommentTypingReactionLifecycle, t as deliverCommentThreadText } from "./drive-USxqssMG.js";
|
|
9
|
+
import { t as createFeishuThreadBindingManager } from "./thread-bindings-C58Uq5Y1.js";
|
|
10
10
|
import { createReplyPrefixContext, evaluateSupplementalContextVisibility, loadSessionStore, normalizeAgentId as normalizeAgentId$2, resolveChannelContextVisibilityMode, resolveSessionStoreEntry } 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 } from "./send-
|
|
12
|
-
import { i as waitForAbortableDelay, r as raceWithTimeoutAndAbort } from "./probe-
|
|
13
|
-
import { a as feishuWebhookRateLimiter, c as wsClients, i as botOpenIds, l as fetchBotIdentityForMonitor, n as FEISHU_WEBHOOK_MAX_BODY_BYTES, o as httpServers, r as botNames, s as recordWebhookStatus, t as FEISHU_WEBHOOK_BODY_TIMEOUT_MS } from "./monitor.state-
|
|
14
|
-
import { asBoolean, asNullableRecord, isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, readStringValue, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
15
|
-
import { ensureConfiguredBindingRouteReady, resolveConfiguredBindingRoute, resolveRuntimeConversationBindingRoute } from "openclaw/plugin-sdk/conversation-runtime";
|
|
16
|
-
import { resolveInboundLastRouteSessionKey } from "openclaw/plugin-sdk/routing";
|
|
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 } from "./send-WRPbKn3K.js";
|
|
12
|
+
import { i as waitForAbortableDelay, r as raceWithTimeoutAndAbort } from "./probe-DKDDBF_j.js";
|
|
13
|
+
import { a as feishuWebhookRateLimiter, c as wsClients, i as botOpenIds, l as fetchBotIdentityForMonitor, n as FEISHU_WEBHOOK_MAX_BODY_BYTES, o as httpServers, r as botNames, s as recordWebhookStatus, t as FEISHU_WEBHOOK_BODY_TIMEOUT_MS } from "./monitor.state-V43tWIJ9.js";
|
|
17
14
|
import { createChannelMessageReplyPipeline, formatChannelProgressDraftLineForEntry, isChannelProgressDraftWorkToolName, resolveAgentOutboundIdentity } from "openclaw/plugin-sdk/channel-outbound";
|
|
18
15
|
import { createChannelPairingController, createChannelPairingController as createChannelPairingController$1 } from "openclaw/plugin-sdk/channel-pairing";
|
|
19
|
-
import {
|
|
16
|
+
import { ensureConfiguredBindingRouteReady, resolveConfiguredBindingRoute, resolveRuntimeConversationBindingRoute } from "openclaw/plugin-sdk/conversation-runtime";
|
|
17
|
+
import { asDateTimestampMs, isFutureDateTimestampMs, parseStrictNonNegativeInteger, resolveDateTimestampMs, resolveExpiresAtMsFromDurationMs, resolveExpiresAtMsFromDurationSeconds } from "openclaw/plugin-sdk/number-runtime";
|
|
18
|
+
import { asBoolean, asNullableRecord, isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, readStringValue, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
20
19
|
import { stripReasoningTagsFromText } from "openclaw/plugin-sdk/text-chunking";
|
|
21
20
|
import fs from "node:fs";
|
|
22
21
|
import os from "node:os";
|
|
23
22
|
import path from "node:path";
|
|
23
|
+
import { resolveInboundLastRouteSessionKey } from "openclaw/plugin-sdk/routing";
|
|
24
24
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
25
25
|
import * as Lark from "@larksuiteoapi/node-sdk";
|
|
26
26
|
import * as crypto$1 from "node:crypto";
|
|
@@ -374,8 +374,10 @@ async function resolveFeishuSenderName(params) {
|
|
|
374
374
|
const normalizedSenderId = senderId.trim();
|
|
375
375
|
if (!normalizedSenderId) return {};
|
|
376
376
|
const cached = senderNameCache.get(normalizedSenderId);
|
|
377
|
-
const now = Date.now();
|
|
378
|
-
|
|
377
|
+
const now = asDateTimestampMs(Date.now());
|
|
378
|
+
const cachedExpireAt = cached ? asDateTimestampMs(cached.expireAt) : void 0;
|
|
379
|
+
if (cached && now !== void 0 && cachedExpireAt !== void 0 && cachedExpireAt > now) return { name: cached.name };
|
|
380
|
+
if (cached) senderNameCache.delete(normalizedSenderId);
|
|
379
381
|
try {
|
|
380
382
|
const client = createFeishuClient(account);
|
|
381
383
|
const userIdType = resolveSenderLookupIdType(normalizedSenderId);
|
|
@@ -385,9 +387,10 @@ async function resolveFeishuSenderName(params) {
|
|
|
385
387
|
})).data?.user;
|
|
386
388
|
const name = user?.name ?? user?.nickname ?? user?.en_name;
|
|
387
389
|
if (name) {
|
|
388
|
-
|
|
390
|
+
const expireAt = resolveExpiresAtMsFromDurationMs(SENDER_NAME_TTL_MS);
|
|
391
|
+
if (expireAt !== void 0) senderNameCache.set(normalizedSenderId, {
|
|
389
392
|
name,
|
|
390
|
-
expireAt
|
|
393
|
+
expireAt
|
|
391
394
|
});
|
|
392
395
|
return { name };
|
|
393
396
|
}
|
|
@@ -825,9 +828,10 @@ const STREAMING_UPDATE_THROTTLE_MS = 160;
|
|
|
825
828
|
const STREAMING_SIGNIFICANT_DELTA_CHARS = 18;
|
|
826
829
|
const FEISHU_STREAMING_TOKEN_DEFAULT_LIFETIME_SECONDS = 7200;
|
|
827
830
|
const tokenCache = /* @__PURE__ */ new Map();
|
|
828
|
-
function resolveStreamingTokenExpiresAt(value) {
|
|
829
|
-
|
|
830
|
-
|
|
831
|
+
function resolveStreamingTokenExpiresAt(value, nowMs = Date.now()) {
|
|
832
|
+
const now = resolveDateTimestampMs(nowMs);
|
|
833
|
+
if (typeof value === "number" && Number.isFinite(value) && value <= 0) return now;
|
|
834
|
+
return resolveExpiresAtMsFromDurationSeconds(value, { nowMs: now }) ?? resolveExpiresAtMsFromDurationSeconds(FEISHU_STREAMING_TOKEN_DEFAULT_LIFETIME_SECONDS, { nowMs: now }) ?? now;
|
|
831
835
|
}
|
|
832
836
|
function resolveApiBase(domain) {
|
|
833
837
|
if (domain === "lark") return "https://open.larksuite.com/open-apis";
|
|
@@ -846,7 +850,11 @@ function resolveAllowedHostnames(domain) {
|
|
|
846
850
|
async function getToken(creds) {
|
|
847
851
|
const key = `${creds.domain ?? "feishu"}|${creds.appId}`;
|
|
848
852
|
const cached = tokenCache.get(key);
|
|
849
|
-
|
|
853
|
+
const rawNow = Date.now();
|
|
854
|
+
const hasValidClock = asDateTimestampMs(rawNow) !== void 0;
|
|
855
|
+
const now = resolveDateTimestampMs(rawNow);
|
|
856
|
+
const minUsableExpiresAt = resolveExpiresAtMsFromDurationSeconds(60, { nowMs: now }) ?? now;
|
|
857
|
+
if (cached && hasValidClock && cached.expiresAt > minUsableExpiresAt) return cached.token;
|
|
850
858
|
const { response, release } = await fetchWithSsrFGuard({
|
|
851
859
|
url: `${resolveApiBase(creds.domain)}/auth/v3/tenant_access_token/internal`,
|
|
852
860
|
init: {
|
|
@@ -872,7 +880,7 @@ async function getToken(creds) {
|
|
|
872
880
|
if (data.code !== 0 || !data.tenant_access_token) throw new Error(`Token error: ${data.msg}`);
|
|
873
881
|
tokenCache.set(key, {
|
|
874
882
|
token: data.tenant_access_token,
|
|
875
|
-
expiresAt: resolveStreamingTokenExpiresAt(data.expire)
|
|
883
|
+
expiresAt: resolveStreamingTokenExpiresAt(data.expire, now)
|
|
876
884
|
});
|
|
877
885
|
return data.tenant_access_token;
|
|
878
886
|
}
|
|
@@ -1175,7 +1183,7 @@ var FeishuStreamingSession = class {
|
|
|
1175
1183
|
const pendingMerged = mergeStreamingText(this.state.currentText, this.pendingText ?? void 0);
|
|
1176
1184
|
const text = finalText ?? pendingMerged;
|
|
1177
1185
|
const apiBase = resolveApiBase(this.creds.domain);
|
|
1178
|
-
if (text && text !== this.state.sentText) {
|
|
1186
|
+
if ((text || finalText !== void 0) && text !== this.state.sentText) {
|
|
1179
1187
|
const sent = text.startsWith(this.state.sentText) ? await this.updateCardContent(resolveStreamingCardAppendContent(this.state.sentText, text), (e) => this.log?.(`Final update failed: ${String(e)}`)) : await this.replaceCardContent(text, (e) => this.log?.(`Final replace failed: ${String(e)}`));
|
|
1180
1188
|
this.state.currentText = text;
|
|
1181
1189
|
if (sent) this.state.sentText = text;
|
|
@@ -1210,6 +1218,24 @@ var FeishuStreamingSession = class {
|
|
|
1210
1218
|
this.pendingText = null;
|
|
1211
1219
|
this.log?.(`Closed streaming: cardId=${finalState.cardId}`);
|
|
1212
1220
|
}
|
|
1221
|
+
async discard() {
|
|
1222
|
+
if (!this.state || this.closed) return;
|
|
1223
|
+
this.closed = true;
|
|
1224
|
+
this.clearFlushTimer();
|
|
1225
|
+
await this.queue;
|
|
1226
|
+
const currentState = this.state;
|
|
1227
|
+
try {
|
|
1228
|
+
const response = await this.client.im.message.delete({ path: { message_id: currentState.messageId } });
|
|
1229
|
+
if (response.code !== void 0 && response.code !== 0) throw new Error(`Delete streaming card message failed: ${response.msg ?? response.code}`);
|
|
1230
|
+
this.state = null;
|
|
1231
|
+
this.pendingText = null;
|
|
1232
|
+
this.log?.(`Discarded streaming card: cardId=${currentState.cardId}`);
|
|
1233
|
+
} catch (error) {
|
|
1234
|
+
this.log?.(`Discard failed: ${String(error)}`);
|
|
1235
|
+
this.closed = false;
|
|
1236
|
+
await this.close("");
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1213
1239
|
isActive() {
|
|
1214
1240
|
return this.state !== null && !this.closed;
|
|
1215
1241
|
}
|
|
@@ -1554,6 +1580,17 @@ function createFeishuReplyDispatcher(params) {
|
|
|
1554
1580
|
}
|
|
1555
1581
|
})();
|
|
1556
1582
|
};
|
|
1583
|
+
const resetStreamingState = () => {
|
|
1584
|
+
streaming = null;
|
|
1585
|
+
streamingStartPromise = null;
|
|
1586
|
+
partialUpdateQueue = Promise.resolve();
|
|
1587
|
+
streamText = "";
|
|
1588
|
+
lastPartial = "";
|
|
1589
|
+
reasoningText = "";
|
|
1590
|
+
statusLine = "";
|
|
1591
|
+
snapshotBaseText = "";
|
|
1592
|
+
lastSnapshotTextLength = 0;
|
|
1593
|
+
};
|
|
1557
1594
|
const closeStreaming = async (options) => {
|
|
1558
1595
|
try {
|
|
1559
1596
|
if (streamingStartPromise) await streamingStartPromise;
|
|
@@ -1569,20 +1606,21 @@ function createFeishuReplyDispatcher(params) {
|
|
|
1569
1606
|
}
|
|
1570
1607
|
}
|
|
1571
1608
|
} finally {
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1609
|
+
resetStreamingState();
|
|
1610
|
+
}
|
|
1611
|
+
};
|
|
1612
|
+
const discardStreamingPreview = async () => {
|
|
1613
|
+
try {
|
|
1614
|
+
if (streamingStartPromise) await streamingStartPromise;
|
|
1615
|
+
await partialUpdateQueue;
|
|
1616
|
+
if (streaming?.isActive()) await streaming.discard();
|
|
1617
|
+
} finally {
|
|
1618
|
+
resetStreamingState();
|
|
1581
1619
|
}
|
|
1582
1620
|
};
|
|
1583
|
-
const updateStreamingStatusLine = (nextStatusLine) => {
|
|
1621
|
+
const updateStreamingStatusLine = (nextStatusLine, options) => {
|
|
1584
1622
|
statusLine = nextStatusLine;
|
|
1585
|
-
if (!streaming?.isActive()
|
|
1623
|
+
if (!Boolean(streaming?.isActive() || streamingStartPromise) && (options?.startIfNeeded === false || renderMode !== "card")) return;
|
|
1586
1624
|
startStreaming();
|
|
1587
1625
|
flushStreamingCardUpdate(buildCombinedStreamText(reasoningText, streamText));
|
|
1588
1626
|
};
|
|
@@ -1676,11 +1714,14 @@ function createFeishuReplyDispatcher(params) {
|
|
|
1676
1714
|
mediaUrl,
|
|
1677
1715
|
...payload.audioAsVoice === true ? { audioAsVoice: true } : {}
|
|
1678
1716
|
}));
|
|
1679
|
-
const
|
|
1717
|
+
const streamingCardEnabledForReplyKind = streamingEnabled && info?.kind === "final";
|
|
1718
|
+
const useCard = hasText && (streamingCardEnabledForReplyKind || renderMode === "card" || info?.kind === "block" && coreBlockStreamingEnabled && renderMode !== "raw" || renderMode === "auto" && shouldUseCard(text));
|
|
1680
1719
|
const skipTextForDuplicateFinal = info?.kind === "final" && hasText && deliveredFinalTexts.has(text);
|
|
1681
1720
|
const skipTextForClosedStreamingFinal = info?.kind === "final" && hasText && streamingClosedForReply && !streamingCloseErroredForReply && streamingEnabled && useCard;
|
|
1682
1721
|
const shouldDeliverText = hasText && !hasVoiceMedia && !skipTextForDuplicateFinal && !skipTextForClosedStreamingFinal;
|
|
1722
|
+
const shouldDiscardStreamingPreview = info?.kind === "final" && hasMedia && (hasVoiceMedia && !shouldDeliverText || skipTextForDuplicateFinal);
|
|
1683
1723
|
if (!shouldDeliverText && !hasMedia) return;
|
|
1724
|
+
if (shouldDiscardStreamingPreview) await discardStreamingPreview();
|
|
1684
1725
|
if (shouldDeliverText) {
|
|
1685
1726
|
if (info?.kind === "block") {
|
|
1686
1727
|
if (!(streamingEnabled && useCard)) return;
|
|
@@ -1691,7 +1732,8 @@ function createFeishuReplyDispatcher(params) {
|
|
|
1691
1732
|
startStreaming();
|
|
1692
1733
|
if (streamingStartPromise) await streamingStartPromise;
|
|
1693
1734
|
}
|
|
1694
|
-
|
|
1735
|
+
const shouldStreamText = info?.kind === "block" || info?.kind === "final";
|
|
1736
|
+
if (streaming?.isActive() && shouldStreamText) {
|
|
1695
1737
|
if (info?.kind === "block") queueStreamingUpdate(text, {
|
|
1696
1738
|
mode: "delta",
|
|
1697
1739
|
dedupeWithLastPartial: true
|
|
@@ -1773,6 +1815,7 @@ function createFeishuReplyDispatcher(params) {
|
|
|
1773
1815
|
trim: "both"
|
|
1774
1816
|
});
|
|
1775
1817
|
if (!cleaned) return;
|
|
1818
|
+
startStreaming();
|
|
1776
1819
|
queueStreamingUpdate(cleaned, {
|
|
1777
1820
|
dedupeWithLastPartial: true,
|
|
1778
1821
|
mode: "snapshot"
|
|
@@ -1795,7 +1838,7 @@ function createFeishuReplyDispatcher(params) {
|
|
|
1795
1838
|
if (statusLine) updateStreamingStatusLine(statusLine);
|
|
1796
1839
|
} : void 0,
|
|
1797
1840
|
onAssistantMessageStart: streamingEnabled ? () => {
|
|
1798
|
-
updateStreamingStatusLine("");
|
|
1841
|
+
updateStreamingStatusLine("", { startIfNeeded: false });
|
|
1799
1842
|
} : void 0,
|
|
1800
1843
|
onCompactionStart: streamingEnabled ? () => {
|
|
1801
1844
|
updateStreamingStatusLine("📦 **Compacting context...**");
|
|
@@ -1822,8 +1865,15 @@ function isFeishuTopicSessionScope(scope) {
|
|
|
1822
1865
|
return scope === "group_topic" || scope === "group_topic_sender";
|
|
1823
1866
|
}
|
|
1824
1867
|
function evictGroupNameCache() {
|
|
1825
|
-
const now = Date.now();
|
|
1826
|
-
|
|
1868
|
+
const now = asDateTimestampMs(Date.now());
|
|
1869
|
+
if (now === void 0) {
|
|
1870
|
+
groupNameCache.clear();
|
|
1871
|
+
return;
|
|
1872
|
+
}
|
|
1873
|
+
for (const [key, val] of groupNameCache) {
|
|
1874
|
+
const expiresAt = asDateTimestampMs(val.expiresAt);
|
|
1875
|
+
if (expiresAt === void 0 || expiresAt <= now) groupNameCache.delete(key);
|
|
1876
|
+
}
|
|
1827
1877
|
if (groupNameCache.size > GROUP_NAME_CACHE_MAX_SIZE) {
|
|
1828
1878
|
const excess = groupNameCache.size - GROUP_NAME_CACHE_MAX_SIZE;
|
|
1829
1879
|
let removed = 0;
|
|
@@ -1834,36 +1884,38 @@ function evictGroupNameCache() {
|
|
|
1834
1884
|
}
|
|
1835
1885
|
}
|
|
1836
1886
|
}
|
|
1837
|
-
function setCacheEntry(key,
|
|
1887
|
+
function setCacheEntry(key, name) {
|
|
1888
|
+
const expiresAt = resolveExpiresAtMsFromDurationMs(GROUP_NAME_CACHE_TTL_MS);
|
|
1838
1889
|
groupNameCache.delete(key);
|
|
1839
|
-
groupNameCache.set(key,
|
|
1890
|
+
if (expiresAt !== void 0) groupNameCache.set(key, {
|
|
1891
|
+
name,
|
|
1892
|
+
expiresAt
|
|
1893
|
+
});
|
|
1840
1894
|
}
|
|
1841
1895
|
async function resolveGroupName(params) {
|
|
1842
1896
|
const { account, chatId, log } = params;
|
|
1843
1897
|
if (!account.configured) return;
|
|
1844
1898
|
const cacheKey = `${account.accountId}:${chatId}`;
|
|
1845
1899
|
const cached = groupNameCache.get(cacheKey);
|
|
1846
|
-
if (cached
|
|
1900
|
+
if (cached) {
|
|
1901
|
+
const now = asDateTimestampMs(Date.now());
|
|
1902
|
+
const expiresAt = asDateTimestampMs(cached.expiresAt);
|
|
1903
|
+
if (now !== void 0 && expiresAt !== void 0 && expiresAt > now) return cached.name || void 0;
|
|
1904
|
+
groupNameCache.delete(cacheKey);
|
|
1905
|
+
}
|
|
1906
|
+
let resolvedName;
|
|
1847
1907
|
try {
|
|
1848
1908
|
const name = (await getChatInfo(createFeishuClient(account), chatId))?.name?.trim();
|
|
1849
|
-
if (name)
|
|
1850
|
-
name
|
|
1851
|
-
|
|
1852
|
-
});
|
|
1853
|
-
else setCacheEntry(cacheKey, {
|
|
1854
|
-
name: "",
|
|
1855
|
-
expiresAt: Date.now() + GROUP_NAME_CACHE_TTL_MS
|
|
1856
|
-
});
|
|
1909
|
+
if (name) {
|
|
1910
|
+
setCacheEntry(cacheKey, name);
|
|
1911
|
+
resolvedName = name;
|
|
1912
|
+
} else setCacheEntry(cacheKey, "");
|
|
1857
1913
|
} catch (err) {
|
|
1858
1914
|
log(`feishu[${account.accountId}]: getChatInfo failed for ${chatId}: ${String(err)}`);
|
|
1859
|
-
setCacheEntry(cacheKey,
|
|
1860
|
-
name: "",
|
|
1861
|
-
expiresAt: Date.now() + GROUP_NAME_CACHE_TTL_MS
|
|
1862
|
-
});
|
|
1915
|
+
setCacheEntry(cacheKey, "");
|
|
1863
1916
|
}
|
|
1864
|
-
const result = groupNameCache.get(cacheKey)?.name || void 0;
|
|
1865
1917
|
evictGroupNameCache();
|
|
1866
|
-
return
|
|
1918
|
+
return resolvedName;
|
|
1867
1919
|
}
|
|
1868
1920
|
async function resolveFeishuAudioPreflightTranscript(params) {
|
|
1869
1921
|
if (params.content.trim() !== "<media:audio>") return;
|
|
@@ -1992,7 +2044,7 @@ async function filterFetchedGroupContextMessages(messages, params) {
|
|
|
1992
2044
|
}) ? message : void 0))).filter((message) => message !== void 0);
|
|
1993
2045
|
}
|
|
1994
2046
|
async function handleFeishuMessage(params) {
|
|
1995
|
-
const { cfg, event, botOpenId, botName, runtime, chatHistories, accountId, processingClaimHeld = false } = params;
|
|
2047
|
+
const { cfg, event, botOpenId, botName, runtime, channelRuntime, chatHistories, accountId, processingClaimHeld = false } = params;
|
|
1996
2048
|
const account = resolveFeishuRuntimeAccount({
|
|
1997
2049
|
cfg,
|
|
1998
2050
|
accountId
|
|
@@ -2184,7 +2236,7 @@ async function handleFeishuMessage(params) {
|
|
|
2184
2236
|
}
|
|
2185
2237
|
}
|
|
2186
2238
|
try {
|
|
2187
|
-
const core = getFeishuRuntime();
|
|
2239
|
+
const core = { channel: channelRuntime ?? getFeishuRuntime().channel };
|
|
2188
2240
|
const pairing = createChannelPairingController({
|
|
2189
2241
|
core,
|
|
2190
2242
|
channel: "feishu",
|
|
@@ -2975,7 +3027,15 @@ var FeishuRetryableCardActionError = class extends Error {
|
|
|
2975
3027
|
}
|
|
2976
3028
|
};
|
|
2977
3029
|
function pruneProcessedCardActionTokens(now) {
|
|
2978
|
-
|
|
3030
|
+
const validNow = asDateTimestampMs(now);
|
|
3031
|
+
if (validNow === void 0) {
|
|
3032
|
+
processedCardActionTokens.clear();
|
|
3033
|
+
return;
|
|
3034
|
+
}
|
|
3035
|
+
for (const [key, entry] of processedCardActionTokens.entries()) if (!isFutureDateTimestampMs(entry.expiresAt, { nowMs: validNow })) processedCardActionTokens.delete(key);
|
|
3036
|
+
}
|
|
3037
|
+
function resolveProcessedCardActionTokenExpiresAt(now) {
|
|
3038
|
+
return resolveExpiresAtMsFromDurationMs(FEISHU_CARD_ACTION_TOKEN_TTL_MS, { nowMs: now });
|
|
2979
3039
|
}
|
|
2980
3040
|
function beginFeishuCardActionToken(params) {
|
|
2981
3041
|
const now = params.now ?? Date.now();
|
|
@@ -2984,10 +3044,12 @@ function beginFeishuCardActionToken(params) {
|
|
|
2984
3044
|
if (!normalizedToken) return false;
|
|
2985
3045
|
const key = `${params.accountId}:${normalizedToken}`;
|
|
2986
3046
|
const existing = processedCardActionTokens.get(key);
|
|
2987
|
-
if (existing && existing.expiresAt
|
|
2988
|
-
processedCardActionTokens.
|
|
3047
|
+
if (existing && isFutureDateTimestampMs(existing.expiresAt, { nowMs: now })) return false;
|
|
3048
|
+
processedCardActionTokens.delete(key);
|
|
3049
|
+
const expiresAt = resolveProcessedCardActionTokenExpiresAt(now);
|
|
3050
|
+
if (expiresAt !== void 0) processedCardActionTokens.set(key, {
|
|
2989
3051
|
status: "inflight",
|
|
2990
|
-
expiresAt
|
|
3052
|
+
expiresAt
|
|
2991
3053
|
});
|
|
2992
3054
|
return true;
|
|
2993
3055
|
}
|
|
@@ -2995,9 +3057,15 @@ function completeFeishuCardActionToken(params) {
|
|
|
2995
3057
|
const now = params.now ?? Date.now();
|
|
2996
3058
|
const normalizedToken = params.token.trim();
|
|
2997
3059
|
if (!normalizedToken) return;
|
|
2998
|
-
|
|
3060
|
+
const key = `${params.accountId}:${normalizedToken}`;
|
|
3061
|
+
const expiresAt = resolveProcessedCardActionTokenExpiresAt(now);
|
|
3062
|
+
if (expiresAt === void 0) {
|
|
3063
|
+
processedCardActionTokens.delete(key);
|
|
3064
|
+
return;
|
|
3065
|
+
}
|
|
3066
|
+
processedCardActionTokens.set(key, {
|
|
2999
3067
|
status: "completed",
|
|
3000
|
-
expiresAt
|
|
3068
|
+
expiresAt
|
|
3001
3069
|
});
|
|
3002
3070
|
}
|
|
3003
3071
|
function releaseFeishuCardActionToken(params) {
|
|
@@ -3041,6 +3109,7 @@ async function dispatchSyntheticCommand(params) {
|
|
|
3041
3109
|
event: buildSyntheticMessageEvent(params.event, params.command, resolvedChatType),
|
|
3042
3110
|
botOpenId: params.botOpenId,
|
|
3043
3111
|
runtime: params.runtime,
|
|
3112
|
+
channelRuntime: params.channelRuntime,
|
|
3044
3113
|
accountId: params.accountId
|
|
3045
3114
|
});
|
|
3046
3115
|
}
|
|
@@ -3052,7 +3121,15 @@ const resolvedChatTypeCache = /* @__PURE__ */ new Map();
|
|
|
3052
3121
|
const CHAT_TYPE_CACHE_TTL_MS = 30 * 6e4;
|
|
3053
3122
|
const CHAT_TYPE_CACHE_MAX_SIZE = 5e3;
|
|
3054
3123
|
function pruneChatTypeCache(now) {
|
|
3055
|
-
|
|
3124
|
+
const validNow = asDateTimestampMs(now);
|
|
3125
|
+
if (validNow === void 0) {
|
|
3126
|
+
resolvedChatTypeCache.clear();
|
|
3127
|
+
return;
|
|
3128
|
+
}
|
|
3129
|
+
for (const [key, entry] of resolvedChatTypeCache.entries()) {
|
|
3130
|
+
const expiresAt = asDateTimestampMs(entry.expiresAt);
|
|
3131
|
+
if (expiresAt === void 0 || expiresAt <= validNow) resolvedChatTypeCache.delete(key);
|
|
3132
|
+
}
|
|
3056
3133
|
if (resolvedChatTypeCache.size > CHAT_TYPE_CACHE_MAX_SIZE) {
|
|
3057
3134
|
const excess = resolvedChatTypeCache.size - CHAT_TYPE_CACHE_MAX_SIZE;
|
|
3058
3135
|
const iter = resolvedChatTypeCache.keys();
|
|
@@ -3065,6 +3142,18 @@ function pruneChatTypeCache(now) {
|
|
|
3065
3142
|
function sanitizeLogValue(v) {
|
|
3066
3143
|
return v.replace(/[\r\n]/g, " ").slice(0, 500);
|
|
3067
3144
|
}
|
|
3145
|
+
function resolveFeishuApprovalCardExpiresAt(nowRaw = Date.now()) {
|
|
3146
|
+
const now = asDateTimestampMs(nowRaw);
|
|
3147
|
+
return now === void 0 ? void 0 : resolveExpiresAtMsFromDurationMs(FEISHU_APPROVAL_CARD_TTL_MS, { nowMs: now });
|
|
3148
|
+
}
|
|
3149
|
+
function cacheResolvedCardActionChatType(cacheKey, value, now) {
|
|
3150
|
+
const expiresAt = resolveExpiresAtMsFromDurationMs(CHAT_TYPE_CACHE_TTL_MS, { nowMs: now });
|
|
3151
|
+
resolvedChatTypeCache.delete(cacheKey);
|
|
3152
|
+
if (expiresAt !== void 0) resolvedChatTypeCache.set(cacheKey, {
|
|
3153
|
+
value,
|
|
3154
|
+
expiresAt
|
|
3155
|
+
});
|
|
3156
|
+
}
|
|
3068
3157
|
async function resolveCardActionChatType(params) {
|
|
3069
3158
|
const explicitChatType = normalizeResolvedCardActionChatType(params.chatType);
|
|
3070
3159
|
if (explicitChatType) return explicitChatType;
|
|
@@ -3074,16 +3163,15 @@ async function resolveCardActionChatType(params) {
|
|
|
3074
3163
|
const now = Date.now();
|
|
3075
3164
|
pruneChatTypeCache(now);
|
|
3076
3165
|
const cached = resolvedChatTypeCache.get(cacheKey);
|
|
3077
|
-
|
|
3166
|
+
const cachedExpiresAt = cached ? asDateTimestampMs(cached.expiresAt) : void 0;
|
|
3167
|
+
if (cached && cachedExpiresAt !== void 0) return cached.value;
|
|
3168
|
+
if (cached) resolvedChatTypeCache.delete(cacheKey);
|
|
3078
3169
|
try {
|
|
3079
3170
|
const response = await createFeishuClient(params.account).im.chat.get({ path: { chat_id: chatId } });
|
|
3080
3171
|
if (response.code === 0) {
|
|
3081
3172
|
const resolvedChatType = normalizeResolvedCardActionChatType(response.data?.chat_mode) ?? normalizeResolvedCardActionChatType(response.data?.chat_type);
|
|
3082
3173
|
if (resolvedChatType) {
|
|
3083
|
-
|
|
3084
|
-
value: resolvedChatType,
|
|
3085
|
-
expiresAt: now + CHAT_TYPE_CACHE_TTL_MS
|
|
3086
|
-
});
|
|
3174
|
+
cacheResolvedCardActionChatType(cacheKey, resolvedChatType, now);
|
|
3087
3175
|
return resolvedChatType;
|
|
3088
3176
|
}
|
|
3089
3177
|
params.log(`feishu[${params.account.accountId}]: card action missing chat type for chat; defaulting to p2p`);
|
|
@@ -3156,6 +3244,20 @@ async function handleFeishuCardAction(params) {
|
|
|
3156
3244
|
return;
|
|
3157
3245
|
}
|
|
3158
3246
|
const prompt = typeof envelope.m?.prompt === "string" && envelope.m.prompt.trim() ? envelope.m.prompt : `Run \`${command}\` in this Feishu conversation?`;
|
|
3247
|
+
const expiresAt = resolveFeishuApprovalCardExpiresAt();
|
|
3248
|
+
if (expiresAt === void 0) {
|
|
3249
|
+
await sendInvalidInteractionNotice({
|
|
3250
|
+
cfg,
|
|
3251
|
+
event,
|
|
3252
|
+
reason: "malformed",
|
|
3253
|
+
accountId
|
|
3254
|
+
});
|
|
3255
|
+
completeFeishuCardActionToken({
|
|
3256
|
+
token: event.token,
|
|
3257
|
+
accountId: account.accountId
|
|
3258
|
+
});
|
|
3259
|
+
return;
|
|
3260
|
+
}
|
|
3159
3261
|
await sendCardFeishu({
|
|
3160
3262
|
cfg,
|
|
3161
3263
|
to: resolveCallbackTarget(event),
|
|
@@ -3165,7 +3267,7 @@ async function handleFeishuCardAction(params) {
|
|
|
3165
3267
|
command,
|
|
3166
3268
|
prompt,
|
|
3167
3269
|
sessionKey: envelope.c?.s,
|
|
3168
|
-
expiresAt
|
|
3270
|
+
expiresAt,
|
|
3169
3271
|
chatType: await resolveCardActionChatType({
|
|
3170
3272
|
event,
|
|
3171
3273
|
account,
|
|
@@ -3217,6 +3319,7 @@ async function handleFeishuCardAction(params) {
|
|
|
3217
3319
|
account,
|
|
3218
3320
|
botOpenId: params.botOpenId,
|
|
3219
3321
|
runtime,
|
|
3322
|
+
channelRuntime: params.channelRuntime,
|
|
3220
3323
|
accountId,
|
|
3221
3324
|
chatType: envelope.c?.t
|
|
3222
3325
|
});
|
|
@@ -3247,6 +3350,7 @@ async function handleFeishuCardAction(params) {
|
|
|
3247
3350
|
account,
|
|
3248
3351
|
botOpenId: params.botOpenId,
|
|
3249
3352
|
runtime,
|
|
3353
|
+
channelRuntime: params.channelRuntime,
|
|
3250
3354
|
accountId
|
|
3251
3355
|
});
|
|
3252
3356
|
completeFeishuCardActionToken({
|
|
@@ -3381,7 +3485,12 @@ function createQuickActionLauncherCard(params) {
|
|
|
3381
3485
|
}
|
|
3382
3486
|
async function maybeHandleFeishuQuickActionMenu(params) {
|
|
3383
3487
|
if (!isFeishuQuickActionMenuEventKey(params.eventKey)) return false;
|
|
3384
|
-
const
|
|
3488
|
+
const now = asDateTimestampMs(params.now ?? Date.now());
|
|
3489
|
+
const expiresAt = now === void 0 ? void 0 : resolveExpiresAtMsFromDurationMs(FEISHU_QUICK_ACTION_CARD_TTL_MS, { nowMs: now });
|
|
3490
|
+
if (expiresAt === void 0) {
|
|
3491
|
+
params.runtime?.log?.(`feishu[${params.accountId ?? "default"}]: failed to open quick-action launcher for ${params.operatorOpenId}: invalid expiry clock`);
|
|
3492
|
+
return false;
|
|
3493
|
+
}
|
|
3385
3494
|
try {
|
|
3386
3495
|
await sendCardFeishu({
|
|
3387
3496
|
cfg: params.cfg,
|
|
@@ -3484,6 +3593,7 @@ function createFeishuBotMenuHandler(params) {
|
|
|
3484
3593
|
botOpenId: getBotOpenId(accountId),
|
|
3485
3594
|
botName: getBotName(accountId),
|
|
3486
3595
|
runtime,
|
|
3596
|
+
channelRuntime: params.channelRuntime,
|
|
3487
3597
|
chatHistories,
|
|
3488
3598
|
accountId,
|
|
3489
3599
|
processingClaimHeld: true
|
|
@@ -4611,8 +4721,8 @@ function resolveFeishuDebounceMentions(params) {
|
|
|
4611
4721
|
const botMentions = merged.filter((mention) => mention.id.open_id?.trim() === normalizedBotOpenId);
|
|
4612
4722
|
return botMentions.length > 0 ? botMentions : void 0;
|
|
4613
4723
|
}
|
|
4614
|
-
function createFeishuMessageReceiveHandler({ cfg,
|
|
4615
|
-
const inboundDebounceMs =
|
|
4724
|
+
function createFeishuMessageReceiveHandler({ cfg, channelRuntime, accountId, runtime, chatHistories, fireAndForget, handleMessage, resolveDebounceText: resolveText, hasProcessedMessage, recordProcessedMessage, getBotOpenId = () => void 0, getBotName = () => void 0, resolveSequentialKey = ({ accountId, event }) => `feishu:${accountId}:${event.message.chat_id?.trim() || "unknown"}` }) {
|
|
4725
|
+
const inboundDebounceMs = channelRuntime.debounce.resolveInboundDebounceMs({
|
|
4616
4726
|
cfg,
|
|
4617
4727
|
channel: "feishu"
|
|
4618
4728
|
});
|
|
@@ -4634,6 +4744,7 @@ function createFeishuMessageReceiveHandler({ cfg, core, accountId, runtime, chat
|
|
|
4634
4744
|
botOpenId: getBotOpenId(accountId),
|
|
4635
4745
|
botName: getBotName(accountId),
|
|
4636
4746
|
runtime,
|
|
4747
|
+
channelRuntime,
|
|
4637
4748
|
chatHistories,
|
|
4638
4749
|
accountId,
|
|
4639
4750
|
processingClaimHeld: true
|
|
@@ -4659,7 +4770,7 @@ function createFeishuMessageReceiveHandler({ cfg, core, accountId, runtime, chat
|
|
|
4659
4770
|
error(`feishu[${accountId}]: failed to record merged dedupe id ${messageId}: ${String(err)}`);
|
|
4660
4771
|
}
|
|
4661
4772
|
};
|
|
4662
|
-
const inboundDebouncer =
|
|
4773
|
+
const inboundDebouncer = channelRuntime.debounce.createInboundDebouncer({
|
|
4663
4774
|
debounceMs: inboundDebounceMs,
|
|
4664
4775
|
buildKey: (event) => {
|
|
4665
4776
|
const chatId = event.message.chat_id?.trim();
|
|
@@ -4671,7 +4782,7 @@ function createFeishuMessageReceiveHandler({ cfg, core, accountId, runtime, chat
|
|
|
4671
4782
|
shouldDebounce: (event) => {
|
|
4672
4783
|
if (event.message.message_type !== "text") return false;
|
|
4673
4784
|
const text = resolveDebounceText(event);
|
|
4674
|
-
return Boolean(text) && !
|
|
4785
|
+
return Boolean(text) && !channelRuntime.commands.isControlCommandMessage(text, cfg);
|
|
4675
4786
|
},
|
|
4676
4787
|
onFlush: async (entries) => {
|
|
4677
4788
|
const last = entries.at(-1);
|
|
@@ -5149,7 +5260,7 @@ function parseFeishuCardActionEventPayload(value) {
|
|
|
5149
5260
|
};
|
|
5150
5261
|
}
|
|
5151
5262
|
function registerEventHandlers(eventDispatcher, context) {
|
|
5152
|
-
const { cfg, accountId, runtime, chatHistories, fireAndForget } = context;
|
|
5263
|
+
const { cfg, accountId, channelRuntime, runtime, chatHistories, fireAndForget } = context;
|
|
5153
5264
|
const log = runtime?.log ?? console.log;
|
|
5154
5265
|
const error = runtime?.error ?? console.error;
|
|
5155
5266
|
const runFeishuHandler = async (params) => {
|
|
@@ -5168,7 +5279,7 @@ function registerEventHandlers(eventDispatcher, context) {
|
|
|
5168
5279
|
eventDispatcher.register({
|
|
5169
5280
|
"im.message.receive_v1": createFeishuMessageReceiveHandler({
|
|
5170
5281
|
cfg,
|
|
5171
|
-
|
|
5282
|
+
channelRuntime,
|
|
5172
5283
|
accountId,
|
|
5173
5284
|
runtime,
|
|
5174
5285
|
chatHistories,
|
|
@@ -5226,6 +5337,7 @@ function registerEventHandlers(eventDispatcher, context) {
|
|
|
5226
5337
|
botOpenId: myBotId,
|
|
5227
5338
|
botName: botNames.get(accountId),
|
|
5228
5339
|
runtime,
|
|
5340
|
+
channelRuntime,
|
|
5229
5341
|
chatHistories,
|
|
5230
5342
|
accountId
|
|
5231
5343
|
});
|
|
@@ -5253,6 +5365,7 @@ function registerEventHandlers(eventDispatcher, context) {
|
|
|
5253
5365
|
botOpenId: myBotId,
|
|
5254
5366
|
botName: botNames.get(accountId),
|
|
5255
5367
|
runtime,
|
|
5368
|
+
channelRuntime,
|
|
5256
5369
|
chatHistories,
|
|
5257
5370
|
accountId
|
|
5258
5371
|
});
|
|
@@ -5264,7 +5377,8 @@ function registerEventHandlers(eventDispatcher, context) {
|
|
|
5264
5377
|
accountId,
|
|
5265
5378
|
runtime,
|
|
5266
5379
|
chatHistories,
|
|
5267
|
-
fireAndForget
|
|
5380
|
+
fireAndForget,
|
|
5381
|
+
channelRuntime
|
|
5268
5382
|
}),
|
|
5269
5383
|
"card.action.trigger": async (data) => {
|
|
5270
5384
|
try {
|
|
@@ -5278,6 +5392,7 @@ function registerEventHandlers(eventDispatcher, context) {
|
|
|
5278
5392
|
event,
|
|
5279
5393
|
botOpenId: botOpenIds.get(accountId),
|
|
5280
5394
|
runtime,
|
|
5395
|
+
channelRuntime,
|
|
5281
5396
|
accountId
|
|
5282
5397
|
});
|
|
5283
5398
|
if (fireAndForget) promise.catch((err) => {
|
|
@@ -5325,6 +5440,7 @@ async function monitorSingleAccount(params) {
|
|
|
5325
5440
|
registerEventHandlers(eventDispatcher, {
|
|
5326
5441
|
cfg,
|
|
5327
5442
|
accountId,
|
|
5443
|
+
channelRuntime: params.channelRuntime ?? getFeishuRuntime().channel,
|
|
5328
5444
|
runtime,
|
|
5329
5445
|
chatHistories,
|
|
5330
5446
|
fireAndForget: params.fireAndForget ?? true
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as probeFeishu } from "./probe-
|
|
2
|
-
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
1
|
+
import { t as probeFeishu } from "./probe-DKDDBF_j.js";
|
|
3
2
|
import { parseStrictPositiveInteger } from "openclaw/plugin-sdk/number-runtime";
|
|
3
|
+
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { WEBHOOK_ANOMALY_COUNTER_DEFAULTS, WEBHOOK_RATE_LIMIT_DEFAULTS, createFixedWindowRateLimiter, createWebhookAnomalyTracker } from "openclaw/plugin-sdk/webhook-ingress";
|
|
5
5
|
//#region extensions/feishu/src/monitor.startup.ts
|
|
6
6
|
const FEISHU_STARTUP_BOT_INFO_TIMEOUT_DEFAULT_MS = 3e4;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
2
|
import { r as createFeishuClient } from "./client-BhMNZBJD.js";
|
|
3
|
+
import { asDateTimestampMs, resolveExpiresAtMsFromDurationMs, resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
3
4
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
4
5
|
//#region extensions/feishu/src/async.ts
|
|
5
6
|
const RACE_TIMEOUT = Symbol("race-timeout");
|
|
@@ -13,9 +14,12 @@ async function raceWithTimeoutAndAbort(promise, options = {}) {
|
|
|
13
14
|
let timeoutHandle;
|
|
14
15
|
let abortHandler;
|
|
15
16
|
const contenders = [promise];
|
|
16
|
-
if (options.timeoutMs !== void 0)
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
if (options.timeoutMs !== void 0) {
|
|
18
|
+
const timeoutMs = resolveTimerTimeoutMs(options.timeoutMs, 1);
|
|
19
|
+
contenders.push(new Promise((resolve) => {
|
|
20
|
+
timeoutHandle = setTimeout(() => resolve(RACE_TIMEOUT), timeoutMs);
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
19
23
|
if (options.abortSignal) contenders.push(new Promise((resolve) => {
|
|
20
24
|
abortHandler = () => resolve(RACE_ABORT);
|
|
21
25
|
options.abortSignal?.addEventListener("abort", abortHandler, { once: true });
|
|
@@ -75,9 +79,14 @@ const PROBE_ERROR_TTL_MS = 60 * 1e3;
|
|
|
75
79
|
const MAX_PROBE_CACHE_SIZE = 64;
|
|
76
80
|
const FEISHU_PROBE_REQUEST_TIMEOUT_MS = 1e4;
|
|
77
81
|
function setCachedProbeResult(cacheKey, result, ttlMs) {
|
|
82
|
+
const expiresAt = resolveExpiresAtMsFromDurationMs(ttlMs);
|
|
83
|
+
if (expiresAt === void 0) {
|
|
84
|
+
probeCache.delete(cacheKey);
|
|
85
|
+
return result;
|
|
86
|
+
}
|
|
78
87
|
probeCache.set(cacheKey, {
|
|
79
88
|
result,
|
|
80
|
-
expiresAt
|
|
89
|
+
expiresAt
|
|
81
90
|
});
|
|
82
91
|
if (probeCache.size > MAX_PROBE_CACHE_SIZE) {
|
|
83
92
|
const oldest = probeCache.keys().next().value;
|
|
@@ -98,7 +107,12 @@ async function probeFeishu(creds, options = {}) {
|
|
|
98
107
|
const timeoutMs = options.timeoutMs ?? 1e4;
|
|
99
108
|
const cacheKey = creds.accountId ?? `${creds.appId}:${creds.appSecret.slice(0, 8)}`;
|
|
100
109
|
const cached = probeCache.get(cacheKey);
|
|
101
|
-
if (cached
|
|
110
|
+
if (cached) {
|
|
111
|
+
const now = asDateTimestampMs(Date.now());
|
|
112
|
+
const expiresAt = asDateTimestampMs(cached.expiresAt);
|
|
113
|
+
if (now !== void 0 && expiresAt !== void 0 && expiresAt > now) return cached.result;
|
|
114
|
+
probeCache.delete(cacheKey);
|
|
115
|
+
}
|
|
102
116
|
try {
|
|
103
117
|
const responseResult = await raceWithTimeoutAndAbort(createFeishuClient(creds).request({
|
|
104
118
|
method: "POST",
|
package/dist/runtime-api.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as setFeishuRuntime } from "./runtime-C5JxBWZp.js";
|
|
2
|
-
import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
|
|
3
2
|
import { createReplyPrefixContext } from "openclaw/plugin-sdk/channel-outbound";
|
|
4
3
|
import { createChannelPairingController } from "openclaw/plugin-sdk/channel-pairing";
|
|
5
4
|
import { PAIRING_APPROVED_MESSAGE, buildProbeChannelStatusSummary, createDefaultChannelRuntimeState } from "openclaw/plugin-sdk/channel-status";
|
|
6
5
|
import { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking";
|
|
6
|
+
import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
|
|
7
7
|
import { loadSessionStore, resolveSessionStoreEntry } from "openclaw/plugin-sdk/session-store-runtime";
|
|
8
8
|
import { DEFAULT_ACCOUNT_ID, buildChannelConfigSchema, createActionGate, createDedupeCache } from "openclaw/plugin-sdk/core";
|
|
9
9
|
import { buildAgentMediaPayload } from "openclaw/plugin-sdk/agent-media-payload";
|
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-DccLoln2.js";
|
|
2
2
|
export { feishuPlugin, feishuSetupAdapter, feishuSetupWizard };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { r as parseFeishuConversationId, t as buildFeishuConversationId } from "./conversation-id-DuL575sn.js";
|
|
3
2
|
import { r as normalizeFeishuTarget } from "./targets-BUjQ1TcA.js";
|
|
4
|
-
import {
|
|
3
|
+
import { r as parseFeishuConversationId, t as buildFeishuConversationId } from "./conversation-id-DuL575sn.js";
|
|
4
|
+
import { n as getFeishuThreadBindingManager } from "./thread-bindings-C58Uq5Y1.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,15 +1,10 @@
|
|
|
1
|
-
import { n as handleFeishuSubagentEnded, r as handleFeishuSubagentSpawning, t as handleFeishuSubagentDeliveryTarget } from "./subagent-hooks-fuyBHOVu.js";
|
|
2
1
|
//#region extensions/feishu/subagent-hooks-api.ts
|
|
3
2
|
let feishuSubagentHooksPromise = null;
|
|
4
3
|
function loadFeishuSubagentHooksModule() {
|
|
5
|
-
feishuSubagentHooksPromise ??= import("./subagent-hooks-
|
|
4
|
+
feishuSubagentHooksPromise ??= import("./subagent-hooks-Bw3Dg2mS.js").then((n) => n.i);
|
|
6
5
|
return feishuSubagentHooksPromise;
|
|
7
6
|
}
|
|
8
7
|
function registerFeishuSubagentHooks(api) {
|
|
9
|
-
api.on("subagent_spawning", async (event, ctx) => {
|
|
10
|
-
const { handleFeishuSubagentSpawning } = await loadFeishuSubagentHooksModule();
|
|
11
|
-
return await handleFeishuSubagentSpawning(event, ctx);
|
|
12
|
-
});
|
|
13
8
|
api.on("subagent_delivery_target", async (event) => {
|
|
14
9
|
const { handleFeishuSubagentDeliveryTarget } = await loadFeishuSubagentHooksModule();
|
|
15
10
|
return handleFeishuSubagentDeliveryTarget(event);
|
|
@@ -20,4 +15,4 @@ function registerFeishuSubagentHooks(api) {
|
|
|
20
15
|
});
|
|
21
16
|
}
|
|
22
17
|
//#endregion
|
|
23
|
-
export {
|
|
18
|
+
export { registerFeishuSubagentHooks };
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/feishu",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.30-beta.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/feishu",
|
|
9
|
-
"version": "2026.5.
|
|
9
|
+
"version": "2026.5.30-beta.1",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@larksuiteoapi/node-sdk": "1.66.0",
|
|
12
12
|
"typebox": "1.1.38",
|
|
13
13
|
"zod": "4.4.3"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
|
-
"openclaw": ">=2026.5.
|
|
16
|
+
"openclaw": ">=2026.5.30-beta.1"
|
|
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.5.
|
|
3
|
+
"version": "2026.5.30-beta.1",
|
|
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.5.
|
|
16
|
+
"openclaw": ">=2026.5.30-beta.1"
|
|
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.5.
|
|
50
|
+
"pluginApi": ">=2026.5.30-beta.1"
|
|
51
51
|
},
|
|
52
52
|
"build": {
|
|
53
|
-
"openclawVersion": "2026.5.
|
|
53
|
+
"openclawVersion": "2026.5.30-beta.1"
|
|
54
54
|
},
|
|
55
55
|
"release": {
|
|
56
56
|
"publishToClawHub": true,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { i as resolveReceiveIdType, r as normalizeFeishuTarget } from "./targets-BUjQ1TcA.js";
|
|
2
1
|
import { c as createFeishuApiError, f as isRecord$1, g as requestFeishuApi, s as resolveFeishuRuntimeAccount } from "./accounts-CXnY5H8g.js";
|
|
2
|
+
import { i as resolveReceiveIdType, r as normalizeFeishuTarget } from "./targets-BUjQ1TcA.js";
|
|
3
3
|
import { i as toFeishuSendResult, r as resolveFeishuReceiptKind, t as assertFeishuMessageApiSuccess } from "./send-result-DSTSkRDM.js";
|
|
4
4
|
import { t as getFeishuRuntime } from "./runtime-C5JxBWZp.js";
|
|
5
5
|
import { r as createFeishuClient } from "./client-BhMNZBJD.js";
|
|
6
|
-
import { isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
6
|
import { parseStrictNonNegativeInteger } from "openclaw/plugin-sdk/number-runtime";
|
|
7
|
+
import { isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { convertMarkdownTables } from "openclaw/plugin-sdk/text-chunking";
|
|
9
9
|
import fs from "node:fs";
|
|
10
10
|
import path from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
1
|
import { registerSessionBindingAdapter, resolveThreadBindingConversationIdFromBindingId, resolveThreadBindingIdleTimeoutMsForChannel, resolveThreadBindingMaxAgeMsForChannel, unregisterSessionBindingAdapter } from "openclaw/plugin-sdk/conversation-runtime";
|
|
2
|
+
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { normalizeAccountId, resolveAgentIdFromSessionKey } from "openclaw/plugin-sdk/routing";
|
|
4
4
|
//#region extensions/feishu/src/thread-bindings.ts
|
|
5
5
|
const FEISHU_THREAD_BINDINGS_STATE_KEY = Symbol.for("openclaw.feishuThreadBindingsState");
|