@openclaw/feishu 2026.5.12 → 2026.5.14-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 +5 -5
- package/dist/{channel-COlXCApz.js → channel-1pldyM9r.js} +369 -18
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-Bt1Lk06Y.js → channel.runtime-BlJ_XJTS.js} +5 -6
- package/dist/contract-api.js +3 -3
- package/dist/{drive-BocW3yO6.js → drive-Av1h_Lwd.js} +1 -1
- package/dist/{monitor-BZgAq8ET.js → monitor-Dfy3D2pM.js} +2 -2
- package/dist/{monitor.account-CI4_rDnC.js → monitor.account-CT3Skl8y.js} +62 -36
- package/dist/{monitor.state-D1WkvOGG.js → monitor.state-D6ByOM5W.js} +1 -1
- package/dist/{probe-BNzzU_uR.js → probe-DpPNslkb.js} +1 -1
- package/dist/runtime-api.js +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/{security-audit-DqJdocrN.js → security-audit-BzTLFO6g.js} +1 -1
- package/dist/security-contract-api.js +1 -1
- package/dist/{send-DiFpqzBJ.js → send-DsCQVFOE.js} +37 -37
- package/dist/session-key-api.js +1 -1
- package/dist/setup-api.js +1 -1
- package/package.json +5 -5
- package/dist/directory.static-DqfUoZrD.js +0 -44
- package/dist/policy-iDTxfTYv.js +0 -181
- package/dist/send-result-zZZOR3qT.js +0 -140
- /package/dist/{app-registration-BNC02wLI.js → app-registration-BVQ8zzYj.js} +0 -0
- /package/dist/{audio-preflight.runtime-BPlzkO3l.js → audio-preflight.runtime-qKoiXN6J.js} +0 -0
- /package/dist/{client-DBVoQL5w.js → client-B18oTGHf.js} +0 -0
- /package/dist/{runtime-CG0DuRCy.js → runtime-Cc16UY23.js} +0 -0
- /package/dist/{secret-contract-Dm4Z_zQN.js → secret-contract-DIpADEx7.js} +0 -0
- /package/dist/{security-audit-shared-ByuMx9cJ.js → security-audit-shared-B6kEakHj.js} +0 -0
- /package/dist/{session-conversation-BulT2OKc.js → session-conversation-DIuxgPQi.js} +0 -0
package/dist/api.js
CHANGED
|
@@ -2,9 +2,9 @@ import { a as parseFeishuTargetId, i as parseFeishuDirectConversationId, n as bu
|
|
|
2
2
|
import { n as createFeishuThreadBindingManager, r as getFeishuThreadBindingManager, t as __testing } from "./thread-bindings-D5kDxq_j.js";
|
|
3
3
|
import { n as handleFeishuSubagentEnded, r as handleFeishuSubagentSpawning, t as handleFeishuSubagentDeliveryTarget } from "./subagent-hooks-BUPKo9Al.js";
|
|
4
4
|
import { r as listEnabledFeishuAccounts } from "./accounts-CP4tDW-z.js";
|
|
5
|
-
import { a as setFeishuNamedAccountEnabled, i as feishuSetupAdapter, n as feishuSetupWizard, r as runFeishuLogin, t as feishuPlugin } from "./channel-
|
|
6
|
-
import { t as getFeishuRuntime } from "./runtime-
|
|
7
|
-
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-
|
|
5
|
+
import { a as setFeishuNamedAccountEnabled, i as feishuSetupAdapter, n as feishuSetupWizard, r as runFeishuLogin, t as feishuPlugin } from "./channel-1pldyM9r.js";
|
|
6
|
+
import { t as getFeishuRuntime } from "./runtime-Cc16UY23.js";
|
|
7
|
+
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-Av1h_Lwd.js";
|
|
8
8
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, readStringValue } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
9
|
import { existsSync } from "node:fs";
|
|
10
10
|
import { homedir } from "node:os";
|
|
@@ -861,7 +861,7 @@ async function uploadImageToDocx(client, blockId, imageBuffer, fileName, docToke
|
|
|
861
861
|
return fileToken;
|
|
862
862
|
}
|
|
863
863
|
async function downloadImage(url, maxBytes) {
|
|
864
|
-
return (await getFeishuRuntime().channel.media.
|
|
864
|
+
return (await getFeishuRuntime().channel.media.readRemoteMediaBuffer({
|
|
865
865
|
url,
|
|
866
866
|
maxBytes
|
|
867
867
|
})).buffer;
|
|
@@ -921,7 +921,7 @@ async function resolveUploadInput(url, filePath, maxBytes, localRoots, explicitF
|
|
|
921
921
|
if (!url && !filePath) throw new Error("Either url, file_path, or image (base64/data URI) must be provided");
|
|
922
922
|
if (url && filePath) throw new Error("Provide only one of url or file_path");
|
|
923
923
|
if (url) {
|
|
924
|
-
const fetched = await getFeishuRuntime().channel.media.
|
|
924
|
+
const fetched = await getFeishuRuntime().channel.media.readRemoteMediaBuffer({
|
|
925
925
|
url,
|
|
926
926
|
maxBytes
|
|
927
927
|
});
|
|
@@ -1,28 +1,25 @@
|
|
|
1
1
|
import { a as parseFeishuTargetId, i as parseFeishuDirectConversationId, n as buildFeishuModelOverrideParentCandidates, r as parseFeishuConversationId, t as buildFeishuConversationId } from "./conversation-id-Byq1c20x.js";
|
|
2
|
-
import { n as looksLikeFeishuId, r as normalizeFeishuTarget } from "./targets-Bb05cFr4.js";
|
|
2
|
+
import { n as looksLikeFeishuId, r as normalizeFeishuTarget, t as detectIdType } from "./targets-Bb05cFr4.js";
|
|
3
3
|
import { a as resolveDefaultFeishuAccountId, f as isRecord$1, i as listFeishuAccountIds, n as inspectFeishuCredentials, o as resolveFeishuAccount, r as listEnabledFeishuAccounts, s as resolveFeishuRuntimeAccount } from "./accounts-CP4tDW-z.js";
|
|
4
|
-
import {
|
|
5
|
-
import { n as
|
|
6
|
-
import { t as
|
|
7
|
-
import {
|
|
8
|
-
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-Dm4Z_zQN.js";
|
|
9
|
-
import { t as collectFeishuSecurityAuditFindings } from "./security-audit-shared-ByuMx9cJ.js";
|
|
10
|
-
import { t as resolveFeishuSessionConversation } from "./session-conversation-BulT2OKc.js";
|
|
4
|
+
import { t as messageActionTargetAliases } from "./security-audit-BzTLFO6g.js";
|
|
5
|
+
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-DIpADEx7.js";
|
|
6
|
+
import { t as collectFeishuSecurityAuditFindings } from "./security-audit-shared-B6kEakHj.js";
|
|
7
|
+
import { t as resolveFeishuSessionConversation } from "./session-conversation-DIuxgPQi.js";
|
|
11
8
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
12
9
|
import { getSessionBindingService } from "openclaw/plugin-sdk/conversation-runtime";
|
|
13
10
|
import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
14
11
|
import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
|
|
15
12
|
import { adaptScopedAccountAccessor, createHybridChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
16
13
|
import { buildChannelOutboundSessionRoute, createChatChannelPlugin, stripChannelTargetPrefix } from "openclaw/plugin-sdk/channel-core";
|
|
17
|
-
import { defineChannelMessageAdapter } from "openclaw/plugin-sdk/channel-message";
|
|
14
|
+
import { createMessageReceiptFromOutboundResults, defineChannelMessageAdapter } from "openclaw/plugin-sdk/channel-message";
|
|
18
15
|
import { createPairingPrefixStripper } from "openclaw/plugin-sdk/channel-pairing";
|
|
19
16
|
import { createAllowlistProviderGroupPolicyWarningCollector, projectConfigAccountIdWarningCollector } from "openclaw/plugin-sdk/channel-policy";
|
|
20
|
-
import { createChannelDirectoryAdapter, createRuntimeDirectoryLiveAdapter } from "openclaw/plugin-sdk/directory-runtime";
|
|
17
|
+
import { createChannelDirectoryAdapter, createRuntimeDirectoryLiveAdapter, listDirectoryGroupEntriesFromMapKeysAndAllowFrom, listDirectoryUserEntriesFromAllowFromAndMapKeys } from "openclaw/plugin-sdk/directory-runtime";
|
|
21
18
|
import { normalizeMessagePresentation, renderMessagePresentationFallbackText } from "openclaw/plugin-sdk/interactive-runtime";
|
|
22
19
|
import { createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
|
|
23
20
|
import { createRuntimeOutboundDelegates } from "openclaw/plugin-sdk/outbound-runtime";
|
|
24
21
|
import { buildProbeChannelStatusSummary, createComputedAccountStatusAdapter, createDefaultChannelRuntimeState } from "openclaw/plugin-sdk/status-helpers";
|
|
25
|
-
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$2 } from "openclaw/plugin-sdk/account-resolution";
|
|
22
|
+
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$2, normalizeAccountId, resolveMergedAccountConfig } from "openclaw/plugin-sdk/account-resolution";
|
|
26
23
|
import { createResolvedApproverActionAuthAdapter, resolveApprovalApprovers } from "openclaw/plugin-sdk/approval-auth-runtime";
|
|
27
24
|
import { createActionGate } from "openclaw/plugin-sdk/channel-actions";
|
|
28
25
|
import { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-primitives";
|
|
@@ -31,6 +28,7 @@ import { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking";
|
|
|
31
28
|
import { normalizeAccountId as normalizeAccountId$1 } from "openclaw/plugin-sdk/account-id";
|
|
32
29
|
import { z } from "zod";
|
|
33
30
|
import { buildSecretInputSchema, hasConfiguredSecretInput as hasConfiguredSecretInput$2 } from "openclaw/plugin-sdk/secret-input";
|
|
31
|
+
import { createChannelIngressResolver, defineStableChannelIngressIdentity } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
34
32
|
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, formatDocsLink, hasConfiguredSecretInput as hasConfiguredSecretInput$1, mergeAllowFromEntries, patchTopLevelChannelConfigSection, promptSingleChannelSecretInput, splitSetupEntries } from "openclaw/plugin-sdk/setup";
|
|
35
33
|
//#region extensions/feishu/src/approval-auth.ts
|
|
36
34
|
function normalizeFeishuApproverId(value) {
|
|
@@ -52,6 +50,100 @@ const feishuApprovalAuth = createResolvedApproverActionAuthAdapter({
|
|
|
52
50
|
normalizeSenderId: (value) => normalizeFeishuApproverId(value)
|
|
53
51
|
});
|
|
54
52
|
//#endregion
|
|
53
|
+
//#region extensions/feishu/src/card-interaction.ts
|
|
54
|
+
const FEISHU_CARD_INTERACTION_VERSION = "ocf1";
|
|
55
|
+
function isInteractionKind(value) {
|
|
56
|
+
return value === "button" || value === "quick" || value === "meta";
|
|
57
|
+
}
|
|
58
|
+
function isMetadataValue(value) {
|
|
59
|
+
return value === null || value === void 0 || typeof value === "string" || typeof value === "number" || typeof value === "boolean";
|
|
60
|
+
}
|
|
61
|
+
function createFeishuCardInteractionEnvelope(envelope) {
|
|
62
|
+
return {
|
|
63
|
+
oc: FEISHU_CARD_INTERACTION_VERSION,
|
|
64
|
+
...envelope
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function buildFeishuCardActionTextFallback(event) {
|
|
68
|
+
const actionValue = event.action.value;
|
|
69
|
+
if (isRecord$1(actionValue)) {
|
|
70
|
+
if (typeof actionValue.text === "string") return actionValue.text;
|
|
71
|
+
if (typeof actionValue.command === "string") return actionValue.command;
|
|
72
|
+
return JSON.stringify(actionValue);
|
|
73
|
+
}
|
|
74
|
+
return String(actionValue);
|
|
75
|
+
}
|
|
76
|
+
function decodeFeishuCardAction(params) {
|
|
77
|
+
const { event, now = Date.now() } = params;
|
|
78
|
+
const actionValue = event.action.value;
|
|
79
|
+
if (!isRecord$1(actionValue) || actionValue.oc !== "ocf1") return {
|
|
80
|
+
kind: "legacy",
|
|
81
|
+
text: buildFeishuCardActionTextFallback(event)
|
|
82
|
+
};
|
|
83
|
+
if (!isInteractionKind(actionValue.k) || typeof actionValue.a !== "string" || !actionValue.a) return {
|
|
84
|
+
kind: "invalid",
|
|
85
|
+
reason: "malformed"
|
|
86
|
+
};
|
|
87
|
+
if (actionValue.q !== void 0 && typeof actionValue.q !== "string") return {
|
|
88
|
+
kind: "invalid",
|
|
89
|
+
reason: "malformed"
|
|
90
|
+
};
|
|
91
|
+
if (actionValue.m !== void 0) {
|
|
92
|
+
if (!isRecord$1(actionValue.m)) return {
|
|
93
|
+
kind: "invalid",
|
|
94
|
+
reason: "malformed"
|
|
95
|
+
};
|
|
96
|
+
for (const value of Object.values(actionValue.m)) if (!isMetadataValue(value)) return {
|
|
97
|
+
kind: "invalid",
|
|
98
|
+
reason: "malformed"
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
if (actionValue.c !== void 0) {
|
|
102
|
+
if (!isRecord$1(actionValue.c)) return {
|
|
103
|
+
kind: "invalid",
|
|
104
|
+
reason: "malformed"
|
|
105
|
+
};
|
|
106
|
+
if (actionValue.c.u !== void 0 && typeof actionValue.c.u !== "string") return {
|
|
107
|
+
kind: "invalid",
|
|
108
|
+
reason: "malformed"
|
|
109
|
+
};
|
|
110
|
+
if (actionValue.c.h !== void 0 && typeof actionValue.c.h !== "string") return {
|
|
111
|
+
kind: "invalid",
|
|
112
|
+
reason: "malformed"
|
|
113
|
+
};
|
|
114
|
+
if (actionValue.c.s !== void 0 && typeof actionValue.c.s !== "string") return {
|
|
115
|
+
kind: "invalid",
|
|
116
|
+
reason: "malformed"
|
|
117
|
+
};
|
|
118
|
+
if (actionValue.c.e !== void 0 && !Number.isFinite(actionValue.c.e)) return {
|
|
119
|
+
kind: "invalid",
|
|
120
|
+
reason: "malformed"
|
|
121
|
+
};
|
|
122
|
+
if (actionValue.c.t !== void 0 && actionValue.c.t !== "p2p" && actionValue.c.t !== "group") return {
|
|
123
|
+
kind: "invalid",
|
|
124
|
+
reason: "malformed"
|
|
125
|
+
};
|
|
126
|
+
if (typeof actionValue.c.e === "number" && actionValue.c.e < now) return {
|
|
127
|
+
kind: "invalid",
|
|
128
|
+
reason: "stale"
|
|
129
|
+
};
|
|
130
|
+
const expectedUser = actionValue.c.u?.trim();
|
|
131
|
+
if (expectedUser && expectedUser !== (event.operator.open_id ?? "").trim()) return {
|
|
132
|
+
kind: "invalid",
|
|
133
|
+
reason: "wrong_user"
|
|
134
|
+
};
|
|
135
|
+
const expectedChat = actionValue.c.h?.trim();
|
|
136
|
+
if (expectedChat && expectedChat !== (event.context.chat_id ?? "").trim()) return {
|
|
137
|
+
kind: "invalid",
|
|
138
|
+
reason: "wrong_conversation"
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
return {
|
|
142
|
+
kind: "structured",
|
|
143
|
+
envelope: actionValue
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
//#endregion
|
|
55
147
|
//#region extensions/feishu/src/config-schema.ts
|
|
56
148
|
const ChannelActionsSchema = z.object({ reactions: z.boolean().optional() }).strict().optional();
|
|
57
149
|
const DmPolicySchema = z.enum([
|
|
@@ -328,6 +420,265 @@ const FeishuConfigSchema = z.object({
|
|
|
328
420
|
}
|
|
329
421
|
});
|
|
330
422
|
//#endregion
|
|
423
|
+
//#region extensions/feishu/src/directory.static.ts
|
|
424
|
+
function toFeishuDirectoryPeers(ids) {
|
|
425
|
+
return ids.map((id) => ({
|
|
426
|
+
kind: "user",
|
|
427
|
+
id
|
|
428
|
+
}));
|
|
429
|
+
}
|
|
430
|
+
function toFeishuDirectoryGroups(ids) {
|
|
431
|
+
return ids.map((id) => ({
|
|
432
|
+
kind: "group",
|
|
433
|
+
id
|
|
434
|
+
}));
|
|
435
|
+
}
|
|
436
|
+
async function listFeishuDirectoryPeers(params) {
|
|
437
|
+
const account = resolveFeishuAccount({
|
|
438
|
+
cfg: params.cfg,
|
|
439
|
+
accountId: params.accountId
|
|
440
|
+
});
|
|
441
|
+
return toFeishuDirectoryPeers(listDirectoryUserEntriesFromAllowFromAndMapKeys({
|
|
442
|
+
allowFrom: account.config.allowFrom,
|
|
443
|
+
map: account.config.dms,
|
|
444
|
+
query: params.query,
|
|
445
|
+
limit: params.limit,
|
|
446
|
+
normalizeAllowFromId: (entry) => normalizeFeishuTarget(entry) ?? entry,
|
|
447
|
+
normalizeMapKeyId: (entry) => normalizeFeishuTarget(entry) ?? entry
|
|
448
|
+
}).map((entry) => entry.id));
|
|
449
|
+
}
|
|
450
|
+
async function listFeishuDirectoryGroups(params) {
|
|
451
|
+
const account = resolveFeishuAccount({
|
|
452
|
+
cfg: params.cfg,
|
|
453
|
+
accountId: params.accountId
|
|
454
|
+
});
|
|
455
|
+
return toFeishuDirectoryGroups(listDirectoryGroupEntriesFromMapKeysAndAllowFrom({
|
|
456
|
+
groups: account.config.groups,
|
|
457
|
+
allowFrom: account.config.groupAllowFrom,
|
|
458
|
+
query: params.query,
|
|
459
|
+
limit: params.limit
|
|
460
|
+
}).map((entry) => entry.id));
|
|
461
|
+
}
|
|
462
|
+
//#endregion
|
|
463
|
+
//#region extensions/feishu/src/policy.ts
|
|
464
|
+
const FEISHU_PROVIDER_PREFIX_RE = /^(feishu|lark):/i;
|
|
465
|
+
const FEISHU_TYPED_PREFIX_RE = /^(chat|group|channel|user|dm|open_id):/i;
|
|
466
|
+
const FEISHU_ID_KIND = "plugin:feishu-id";
|
|
467
|
+
const feishuIngressIdentity = defineStableChannelIngressIdentity({
|
|
468
|
+
key: "feishu-id",
|
|
469
|
+
kind: FEISHU_ID_KIND,
|
|
470
|
+
normalize: normalizeFeishuAllowEntry,
|
|
471
|
+
sensitivity: "pii",
|
|
472
|
+
aliases: [{
|
|
473
|
+
key: "feishu-alt-id",
|
|
474
|
+
kind: FEISHU_ID_KIND,
|
|
475
|
+
normalizeEntry: () => null,
|
|
476
|
+
normalizeSubject: normalizeFeishuAllowEntry,
|
|
477
|
+
sensitivity: "pii"
|
|
478
|
+
}],
|
|
479
|
+
isWildcardEntry: (entry) => normalizeFeishuAllowEntry(entry) === "*",
|
|
480
|
+
resolveEntryId: ({ entryIndex }) => `feishu-entry-${entryIndex + 1}`
|
|
481
|
+
});
|
|
482
|
+
function normalizeFeishuAllowEntry(raw) {
|
|
483
|
+
const trimmed = raw.trim();
|
|
484
|
+
if (!trimmed) return "";
|
|
485
|
+
if (trimmed === "*") return "*";
|
|
486
|
+
let withoutProviderPrefix = trimmed;
|
|
487
|
+
while (FEISHU_PROVIDER_PREFIX_RE.test(withoutProviderPrefix)) withoutProviderPrefix = withoutProviderPrefix.replace(FEISHU_PROVIDER_PREFIX_RE, "").trim();
|
|
488
|
+
if (withoutProviderPrefix === "*") return "*";
|
|
489
|
+
const lowered = normalizeOptionalLowercaseString(withoutProviderPrefix) ?? "";
|
|
490
|
+
if (!lowered) return "";
|
|
491
|
+
const prefixed = lowered.match(FEISHU_TYPED_PREFIX_RE);
|
|
492
|
+
if (prefixed?.[1]) {
|
|
493
|
+
const kind = [
|
|
494
|
+
"chat",
|
|
495
|
+
"group",
|
|
496
|
+
"channel"
|
|
497
|
+
].includes(prefixed[1]) ? "chat" : "user";
|
|
498
|
+
const value = withoutProviderPrefix.slice(prefixed[0].length).trim();
|
|
499
|
+
return value === "*" ? "*" : value ? `${kind}:${value}` : "";
|
|
500
|
+
}
|
|
501
|
+
const detectedType = detectIdType(withoutProviderPrefix);
|
|
502
|
+
if (detectedType === "chat_id") return `chat:${withoutProviderPrefix}`;
|
|
503
|
+
if (detectedType === "open_id" || detectedType === "user_id") return `user:${withoutProviderPrefix}`;
|
|
504
|
+
return "";
|
|
505
|
+
}
|
|
506
|
+
function normalizeFeishuDmPolicy(policy) {
|
|
507
|
+
return policy === "open" || policy === "pairing" || policy === "allowlist" || policy === "disabled" ? policy : "pairing";
|
|
508
|
+
}
|
|
509
|
+
function normalizeFeishuGroupPolicy(policy) {
|
|
510
|
+
return policy === "allowall" ? "open" : policy;
|
|
511
|
+
}
|
|
512
|
+
function createFeishuIngressSubject(params) {
|
|
513
|
+
const ids = [params.primaryId, ...params.alternateIds ?? []].map((value) => value?.trim()).filter((value) => Boolean(value));
|
|
514
|
+
return {
|
|
515
|
+
stableId: ids[0],
|
|
516
|
+
aliases: { "feishu-alt-id": ids[1] }
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
function createFeishuIngressResolver(params) {
|
|
520
|
+
return createChannelIngressResolver({
|
|
521
|
+
channelId: "feishu",
|
|
522
|
+
accountId: normalizeAccountId(params.accountId) ?? "default",
|
|
523
|
+
identity: feishuIngressIdentity,
|
|
524
|
+
cfg: params.cfg,
|
|
525
|
+
...params.readAllowFromStore ? { readStoreAllowFrom: params.readAllowFromStore } : {}
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
async function resolveFeishuDmIngressAccess(params) {
|
|
529
|
+
return await createFeishuIngressResolver({
|
|
530
|
+
cfg: params.cfg,
|
|
531
|
+
accountId: params.accountId,
|
|
532
|
+
readAllowFromStore: params.readAllowFromStore
|
|
533
|
+
}).message({
|
|
534
|
+
subject: createFeishuIngressSubject({
|
|
535
|
+
primaryId: params.senderOpenId,
|
|
536
|
+
alternateIds: [params.senderUserId]
|
|
537
|
+
}),
|
|
538
|
+
conversation: {
|
|
539
|
+
kind: "direct",
|
|
540
|
+
id: params.conversationId
|
|
541
|
+
},
|
|
542
|
+
event: { mayPair: params.mayPair },
|
|
543
|
+
dmPolicy: normalizeFeishuDmPolicy(params.dmPolicy),
|
|
544
|
+
groupPolicy: "disabled",
|
|
545
|
+
allowFrom: params.allowFrom ?? [],
|
|
546
|
+
...params.command ? { command: params.command } : {}
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
async function resolveFeishuGroupConversationIngressAccess(params) {
|
|
550
|
+
const groupPolicy = normalizeFeishuGroupPolicy(params.groupPolicy);
|
|
551
|
+
const groupAllowFrom = groupPolicy === "allowlist" && params.groupExplicitlyConfigured ? [...params.groupAllowFrom ?? [], params.chatId] : params.groupAllowFrom ?? [];
|
|
552
|
+
return await createFeishuIngressResolver({
|
|
553
|
+
cfg: params.cfg,
|
|
554
|
+
accountId: params.accountId
|
|
555
|
+
}).message({
|
|
556
|
+
subject: createFeishuIngressSubject({ primaryId: params.chatId }),
|
|
557
|
+
conversation: {
|
|
558
|
+
kind: "group",
|
|
559
|
+
id: params.chatId
|
|
560
|
+
},
|
|
561
|
+
dmPolicy: "disabled",
|
|
562
|
+
groupPolicy,
|
|
563
|
+
groupAllowFrom
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
async function resolveFeishuGroupSenderActivationIngressAccess(params) {
|
|
567
|
+
const groupAllowFrom = params.allowFrom ?? [];
|
|
568
|
+
return await createFeishuIngressResolver({
|
|
569
|
+
cfg: params.cfg,
|
|
570
|
+
accountId: params.accountId
|
|
571
|
+
}).message({
|
|
572
|
+
subject: createFeishuIngressSubject({
|
|
573
|
+
primaryId: params.senderOpenId,
|
|
574
|
+
alternateIds: [params.senderUserId]
|
|
575
|
+
}),
|
|
576
|
+
conversation: {
|
|
577
|
+
kind: "group",
|
|
578
|
+
id: params.chatId
|
|
579
|
+
},
|
|
580
|
+
dmPolicy: "disabled",
|
|
581
|
+
groupPolicy: groupAllowFrom.length > 0 ? "allowlist" : "open",
|
|
582
|
+
groupAllowFrom,
|
|
583
|
+
mentionFacts: {
|
|
584
|
+
canDetectMention: true,
|
|
585
|
+
wasMentioned: params.mentionedBot
|
|
586
|
+
},
|
|
587
|
+
policy: { activation: {
|
|
588
|
+
requireMention: params.requireMention,
|
|
589
|
+
allowTextCommands: false
|
|
590
|
+
} },
|
|
591
|
+
...params.command ? { command: params.command } : {}
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
function resolveFeishuGroupConfig(params) {
|
|
595
|
+
const groups = params.cfg?.groups ?? {};
|
|
596
|
+
const wildcard = groups["*"];
|
|
597
|
+
const groupId = params.groupId?.trim();
|
|
598
|
+
if (!groupId) return;
|
|
599
|
+
const direct = groups[groupId];
|
|
600
|
+
if (direct) return direct;
|
|
601
|
+
const lowered = normalizeOptionalLowercaseString(groupId) ?? "";
|
|
602
|
+
const matchKey = Object.keys(groups).find((key) => normalizeOptionalLowercaseString(key) === lowered);
|
|
603
|
+
if (matchKey) return groups[matchKey];
|
|
604
|
+
return wildcard;
|
|
605
|
+
}
|
|
606
|
+
function hasExplicitFeishuGroupConfig(params) {
|
|
607
|
+
const groups = params.cfg?.groups ?? {};
|
|
608
|
+
const groupId = params.groupId?.trim();
|
|
609
|
+
if (!groupId) return false;
|
|
610
|
+
if (Object.prototype.hasOwnProperty.call(groups, groupId) && groupId !== "*") return true;
|
|
611
|
+
const lowered = normalizeOptionalLowercaseString(groupId) ?? "";
|
|
612
|
+
return Object.keys(groups).some((key) => key !== "*" && normalizeOptionalLowercaseString(key) === lowered);
|
|
613
|
+
}
|
|
614
|
+
function resolveFeishuGroupToolPolicy(params) {
|
|
615
|
+
const cfg = params.cfg.channels?.feishu;
|
|
616
|
+
if (!cfg) return;
|
|
617
|
+
return resolveFeishuGroupConfig({
|
|
618
|
+
cfg,
|
|
619
|
+
groupId: params.groupId
|
|
620
|
+
})?.tools;
|
|
621
|
+
}
|
|
622
|
+
function resolveFeishuReplyPolicy(params) {
|
|
623
|
+
if (params.isDirectMessage) return { requireMention: false };
|
|
624
|
+
const feishuCfg = params.cfg.channels?.feishu;
|
|
625
|
+
const resolvedCfg = resolveMergedAccountConfig({
|
|
626
|
+
channelConfig: feishuCfg,
|
|
627
|
+
accounts: feishuCfg?.accounts,
|
|
628
|
+
accountId: normalizeAccountId(params.accountId),
|
|
629
|
+
normalizeAccountId,
|
|
630
|
+
omitKeys: ["defaultAccount"]
|
|
631
|
+
});
|
|
632
|
+
const groupRequireMention = resolveFeishuGroupConfig({
|
|
633
|
+
cfg: resolvedCfg,
|
|
634
|
+
groupId: params.groupId
|
|
635
|
+
})?.requireMention;
|
|
636
|
+
return { requireMention: typeof groupRequireMention === "boolean" ? groupRequireMention : typeof resolvedCfg.requireMention === "boolean" ? resolvedCfg.requireMention : params.groupPolicy !== "open" };
|
|
637
|
+
}
|
|
638
|
+
//#endregion
|
|
639
|
+
//#region extensions/feishu/src/send-result.ts
|
|
640
|
+
function resolveFeishuReceiptKind(msgType) {
|
|
641
|
+
switch (msgType) {
|
|
642
|
+
case "audio": return "voice";
|
|
643
|
+
case "image":
|
|
644
|
+
case "media":
|
|
645
|
+
case "file": return "media";
|
|
646
|
+
case "interactive": return "card";
|
|
647
|
+
case "post":
|
|
648
|
+
case "text": return "text";
|
|
649
|
+
default: return "unknown";
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
function createFeishuSendReceipt(params) {
|
|
653
|
+
const messageId = params.messageId?.trim();
|
|
654
|
+
const chatId = params.chatId.trim();
|
|
655
|
+
return createMessageReceiptFromOutboundResults({
|
|
656
|
+
results: messageId ? [{
|
|
657
|
+
channel: "feishu",
|
|
658
|
+
messageId,
|
|
659
|
+
chatId,
|
|
660
|
+
conversationId: chatId
|
|
661
|
+
}] : [],
|
|
662
|
+
...chatId ? { threadId: chatId } : {},
|
|
663
|
+
kind: params.kind ?? "unknown"
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
function assertFeishuMessageApiSuccess(response, errorPrefix) {
|
|
667
|
+
if (response.code !== 0) throw new Error(`${errorPrefix}: ${response.msg || `code ${response.code}`}`);
|
|
668
|
+
}
|
|
669
|
+
function toFeishuSendResult(response, chatId, kind) {
|
|
670
|
+
const messageId = response.data?.message_id ?? "unknown";
|
|
671
|
+
return {
|
|
672
|
+
messageId,
|
|
673
|
+
chatId,
|
|
674
|
+
receipt: createFeishuSendReceipt({
|
|
675
|
+
messageId,
|
|
676
|
+
chatId,
|
|
677
|
+
kind
|
|
678
|
+
})
|
|
679
|
+
};
|
|
680
|
+
}
|
|
681
|
+
//#endregion
|
|
331
682
|
//#region extensions/feishu/src/session-route.ts
|
|
332
683
|
function resolveFeishuOutboundSessionRoute(params) {
|
|
333
684
|
let trimmed = stripChannelTargetPrefix(params.target, "feishu", "lark");
|
|
@@ -563,7 +914,7 @@ async function promptFeishuSetupMethod(prompter) {
|
|
|
563
914
|
});
|
|
564
915
|
}
|
|
565
916
|
async function runScanToCreate(prompter, domain) {
|
|
566
|
-
const { beginAppRegistration, initAppRegistration, pollAppRegistration, printQrCode } = await import("./app-registration-
|
|
917
|
+
const { beginAppRegistration, initAppRegistration, pollAppRegistration, printQrCode } = await import("./app-registration-BVQ8zzYj.js");
|
|
567
918
|
try {
|
|
568
919
|
await initAppRegistration(domain);
|
|
569
920
|
} catch {
|
|
@@ -648,7 +999,7 @@ async function runNewAppFlow(params) {
|
|
|
648
999
|
appSecretProbeValue = appSecretResult.resolvedValue;
|
|
649
1000
|
}
|
|
650
1001
|
if (appId && appSecretProbeValue) {
|
|
651
|
-
const { getAppOwnerOpenId } = await import("./app-registration-
|
|
1002
|
+
const { getAppOwnerOpenId } = await import("./app-registration-BVQ8zzYj.js");
|
|
652
1003
|
scanOpenId = await getAppOwnerOpenId({
|
|
653
1004
|
appId,
|
|
654
1005
|
appSecret: appSecretProbeValue,
|
|
@@ -758,7 +1109,7 @@ const feishuSetupWizard = {
|
|
|
758
1109
|
});
|
|
759
1110
|
let probeResult = null;
|
|
760
1111
|
if (configured && account.configured) try {
|
|
761
|
-
const { probeFeishu } = await import("./probe-
|
|
1112
|
+
const { probeFeishu } = await import("./probe-DpPNslkb.js").then((n) => n.n);
|
|
762
1113
|
probeResult = await probeFeishu(account);
|
|
763
1114
|
} catch {}
|
|
764
1115
|
if (!configured) return ["Feishu: needs app credentials"];
|
|
@@ -832,7 +1183,7 @@ const meta = {
|
|
|
832
1183
|
aliases: ["lark"],
|
|
833
1184
|
order: 70
|
|
834
1185
|
};
|
|
835
|
-
const loadFeishuChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-
|
|
1186
|
+
const loadFeishuChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-BlJ_XJTS.js"), "feishuChannelRuntime");
|
|
836
1187
|
function toFeishuMessageSendResult(result, kind) {
|
|
837
1188
|
const receipt = result.receipt ?? createFeishuSendReceipt({
|
|
838
1189
|
messageId: result.messageId,
|
|
@@ -888,7 +1239,7 @@ function buildFeishuPresentationCard(params) {
|
|
|
888
1239
|
};
|
|
889
1240
|
}
|
|
890
1241
|
async function createFeishuActionClient(account) {
|
|
891
|
-
const { createFeishuClient } = await import("./client-
|
|
1242
|
+
const { createFeishuClient } = await import("./client-B18oTGHf.js").then((n) => n.t);
|
|
892
1243
|
return createFeishuClient(account);
|
|
893
1244
|
}
|
|
894
1245
|
const collectFeishuSecurityWarnings = createAllowlistProviderGroupPolicyWarningCollector({
|
|
@@ -1675,7 +2026,7 @@ const feishuPlugin = createChatChannelPlugin({
|
|
|
1675
2026
|
})
|
|
1676
2027
|
}),
|
|
1677
2028
|
gateway: { startAccount: async (ctx) => {
|
|
1678
|
-
const { monitorFeishuProvider } = await import("./monitor-
|
|
2029
|
+
const { monitorFeishuProvider } = await import("./monitor-Dfy3D2pM.js");
|
|
1679
2030
|
const account = resolveFeishuRuntimeAccount({
|
|
1680
2031
|
cfg: ctx.cfg,
|
|
1681
2032
|
accountId: ctx.accountId
|
|
@@ -1742,4 +2093,4 @@ const feishuPlugin = createChatChannelPlugin({
|
|
|
1742
2093
|
}
|
|
1743
2094
|
});
|
|
1744
2095
|
//#endregion
|
|
1745
|
-
export { setFeishuNamedAccountEnabled$1 as a, feishuSetupAdapter as i, feishuSetupWizard as n, runFeishuLogin as r, feishuPlugin as t };
|
|
2096
|
+
export { buildFeishuCardActionTextFallback as _, setFeishuNamedAccountEnabled$1 as a, toFeishuSendResult as c, resolveFeishuGroupConfig as d, resolveFeishuGroupConversationIngressAccess as f, listFeishuDirectoryPeers as g, listFeishuDirectoryGroups as h, feishuSetupAdapter as i, hasExplicitFeishuGroupConfig as l, resolveFeishuReplyPolicy as m, feishuSetupWizard as n, assertFeishuMessageApiSuccess as o, resolveFeishuGroupSenderActivationIngressAccess as p, runFeishuLogin as r, resolveFeishuReceiptKind as s, feishuPlugin as t, resolveFeishuDmIngressAccess as u, createFeishuCardInteractionEnvelope as v, decodeFeishuCardAction as y };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as feishuPlugin } from "./channel-
|
|
1
|
+
import { t as feishuPlugin } from "./channel-1pldyM9r.js";
|
|
2
2
|
export { feishuPlugin };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { o as resolveFeishuAccount, s as resolveFeishuRuntimeAccount, y as parseFeishuCommentTarget } from "./accounts-CP4tDW-z.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { r as
|
|
5
|
-
import { c as getChatInfo, l as getChatMembers, r as cleanupAmbientCommentTypingReaction, t as deliverCommentThreadText, u as getFeishuMemberInfo } from "./drive-BocW3yO6.js";
|
|
2
|
+
import { g as listFeishuDirectoryPeers, h as listFeishuDirectoryGroups, v as createFeishuCardInteractionEnvelope } from "./channel-1pldyM9r.js";
|
|
3
|
+
import { r as createFeishuClient } from "./client-B18oTGHf.js";
|
|
4
|
+
import { c as getChatInfo, l as getChatMembers, r as cleanupAmbientCommentTypingReaction, t as deliverCommentThreadText, u as getFeishuMemberInfo } from "./drive-Av1h_Lwd.js";
|
|
6
5
|
import { chunkTextForOutbound } from "./runtime-api.js";
|
|
7
|
-
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-
|
|
8
|
-
import { t as probeFeishu } from "./probe-
|
|
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-DsCQVFOE.js";
|
|
7
|
+
import { t as probeFeishu } from "./probe-DpPNslkb.js";
|
|
9
8
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
10
9
|
import { interactiveReplyToPresentation, normalizeInteractiveReply, normalizeMessagePresentation, renderMessagePresentationFallbackText, resolveInteractiveTextFallback } from "openclaw/plugin-sdk/interactive-runtime";
|
|
11
10
|
import path from "node:path";
|
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-Byq1c20x.js";
|
|
2
2
|
import { n as createFeishuThreadBindingManager, t as __testing } from "./thread-bindings-D5kDxq_j.js";
|
|
3
|
-
import { t as messageActionTargetAliases } from "./security-audit-
|
|
4
|
-
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-
|
|
5
|
-
import { t as collectFeishuSecurityAuditFindings } from "./security-audit-shared-
|
|
3
|
+
import { t as messageActionTargetAliases } from "./security-audit-BzTLFO6g.js";
|
|
4
|
+
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-DIpADEx7.js";
|
|
5
|
+
import { t as collectFeishuSecurityAuditFindings } from "./security-audit-shared-B6kEakHj.js";
|
|
6
6
|
//#region extensions/feishu/contract-api.ts
|
|
7
7
|
const feishuSessionBindingAdapterChannels = ["feishu"];
|
|
8
8
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as formatFeishuApiError, f as isRecord$1, h as readString, i as listFeishuAccountIds, l as encodeQuery, o as resolveFeishuAccount, r as listEnabledFeishuAccounts, s as resolveFeishuRuntimeAccount, u as extractReplyText, y as parseFeishuCommentTarget } from "./accounts-CP4tDW-z.js";
|
|
2
|
-
import { r as createFeishuClient } from "./client-
|
|
2
|
+
import { r as createFeishuClient } from "./client-B18oTGHf.js";
|
|
3
3
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
5
5
|
import { Type } from "typebox";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as listEnabledFeishuAccounts, s as resolveFeishuRuntimeAccount } from "./accounts-CP4tDW-z.js";
|
|
2
|
-
import { l as fetchBotIdentityForMonitor } from "./monitor.state-
|
|
2
|
+
import { l as fetchBotIdentityForMonitor } from "./monitor.state-D6ByOM5W.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-CT3Skl8y.js");
|
|
7
7
|
return await monitorAccountRuntimePromise;
|
|
8
8
|
}
|
|
9
9
|
async function monitorFeishuProvider(opts = {}) {
|