@openclaw/feishu 2026.9.2 → 2026.9.4

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 CHANGED
@@ -1,9 +1,9 @@
1
- import { a as setFeishuNamedAccountEnabled, i as feishuSetupAdapter, n as feishuSetupWizard, r as runFeishuLogin, t as feishuPlugin } from "./channel-VytDDz_B.js";
2
- import { G as createFeishuToolClient, H as feishuExternalToolResult, K as resolveAnyEnabledFeishuToolsConfig, U as toolExecutionErrorResult, V as registerFeishuDriveTools, W as unknownToolActionResult, lt as parseFeishuMarkdown, ot as chunkFeishuMarkdown, q as resolveFeishuToolAccount } from "./reply-delivery-result-CYaKkbUN.js";
1
+ import { a as setFeishuNamedAccountEnabled, i as feishuSetupAdapter, n as feishuSetupWizard, r as runFeishuLogin, t as feishuPlugin } from "./channel-HDnQAH4Z.js";
2
+ import { G as feishuExternalToolResult, J as createFeishuToolClient, K as toolExecutionErrorResult, W as registerFeishuDriveTools, X as resolveFeishuToolAccount, Y as resolveAnyEnabledFeishuToolsConfig, ft as parseFeishuMarkdown, lt as chunkFeishuMarkdown, q as unknownToolActionResult } from "./reply-delivery-result-C3smdVzb.js";
3
3
  import { a as parseFeishuTargetId, i as parseFeishuDirectConversationId, n as buildFeishuModelOverrideParentCandidates, r as parseFeishuConversationId, t as buildFeishuConversationId } from "./conversation-id-VYgGQ-GX.js";
4
- import { s as resolveConfiguredHttpTimeoutMs } from "./client-DMbIL3UH.js";
4
+ import { r as createFeishuClient, s as resolveConfiguredHttpTimeoutMs } from "./client-DMbIL3UH.js";
5
5
  import { t as getFeishuRuntime } from "./runtime-C5JxBWZp.js";
6
- import { o as registerFeishuChatTools } from "./chat-DDhIcPQy.js";
6
+ import { o as registerFeishuChatTools } from "./chat-zhIPXu4X.js";
7
7
  import { n as getFeishuThreadBindingManager, t as createFeishuThreadBindingManager } from "./thread-bindings-BiL1wGqK.js";
8
8
  import { n as handleFeishuSubagentEnded, t as handleFeishuSubagentDeliveryTarget } from "./subagent-hooks-Buadpie_.js";
9
9
  import { optionalPositiveIntegerSchema } from "openclaw/plugin-sdk/channel-actions";
@@ -553,19 +553,13 @@ function resolveRemoteImageUrl(value) {
553
553
  }
554
554
  function collectMarkdownImages(root) {
555
555
  const definitions = /* @__PURE__ */ new Map();
556
+ const imageNodes = [];
556
557
  visitMarkdown(root, (node) => {
557
- if (node.type !== "definition" || !node.identifier || !node.url) return;
558
- if (!definitions.has(node.identifier)) definitions.set(node.identifier, node.url);
558
+ if (node.type === "definition" && node.identifier && node.url) {
559
+ if (!definitions.has(node.identifier)) definitions.set(node.identifier, node.url);
560
+ } else if (node.type === "image" || node.type === "imageReference") imageNodes.push(node);
559
561
  });
560
- const images = [];
561
- visitMarkdown(root, (node) => {
562
- if (node.type === "image") {
563
- images.push({ url: resolveRemoteImageUrl(node.url) });
564
- return;
565
- }
566
- if (node.type === "imageReference") images.push({ url: resolveRemoteImageUrl(node.identifier ? definitions.get(node.identifier) : void 0) });
567
- });
568
- return images;
562
+ return imageNodes.map((node) => ({ url: resolveRemoteImageUrl(node.type === "image" ? node.url : node.identifier ? definitions.get(node.identifier) : void 0) }));
569
563
  }
570
564
  function splitSourceAtOffsets(source, offsets) {
571
565
  const chunks = [];
@@ -658,7 +652,11 @@ function createDocxMarkdownChunk(markdown) {
658
652
  };
659
653
  }
660
654
  function createDocxMarkdownPlan(markdown) {
661
- return { chunks: splitSourceAtOffsets(markdown, headingOffsets(markdown, parseFeishuMarkdown(markdown))).map(createDocxMarkdownChunk) };
655
+ const root = parseFeishuMarkdown(markdown);
656
+ return { chunks: splitSourceAtOffsets(markdown, headingOffsets(markdown, root)).map((chunk) => chunk === markdown ? {
657
+ markdown,
658
+ images: collectMarkdownImages(root)
659
+ } : createDocxMarkdownChunk(chunk)) };
662
660
  }
663
661
  function splitDocxMarkdownBySize(markdown, maxChars) {
664
662
  if (markdown.length <= maxChars) return [markdown];
@@ -1494,36 +1492,9 @@ async function listAppScopes(client) {
1494
1492
  };
1495
1493
  }
1496
1494
  function registerFeishuDocTools(api) {
1497
- if (!api.config) return;
1498
- const toolsCfg = resolveAnyEnabledFeishuToolsConfig(api.config);
1499
- const getClient = (params, defaultAccountId) => createFeishuToolClient({
1500
- api,
1501
- executeParams: params,
1502
- defaultAccountId,
1503
- requiredTool: {
1504
- family: "doc",
1505
- label: "Doc"
1506
- }
1507
- });
1508
- const getMediaMaxBytes = (params, defaultAccountId) => (resolveFeishuToolAccount({
1509
- api,
1510
- executeParams: params,
1511
- defaultAccountId,
1512
- requiredTool: {
1513
- family: "doc",
1514
- label: "Doc"
1515
- }
1516
- }).config?.mediaMaxMb ?? 30) * 1024 * 1024;
1517
- const getImageReadTimeoutMs = (params, defaultAccountId) => resolveConfiguredHttpTimeoutMs(resolveFeishuToolAccount({
1518
- api,
1519
- executeParams: params,
1520
- defaultAccountId,
1521
- requiredTool: {
1522
- family: "doc",
1523
- label: "Doc"
1524
- }
1525
- }));
1526
- if (toolsCfg.doc) api.registerTool((ctx) => {
1495
+ api.registerTool((ctx) => {
1496
+ const cfg = ctx.runtimeConfig ?? ctx.config ?? api.config;
1497
+ if (!cfg || !resolveAnyEnabledFeishuToolsConfig(cfg).doc) return null;
1527
1498
  const defaultAccountId = ctx.agentAccountId;
1528
1499
  const mediaLocalRoots = resolveDocToolLocalRoots(ctx);
1529
1500
  const trustedRequesterOpenId = ctx.messageChannel === "feishu" ? normalizeOptionalString(ctx.requesterSenderId) : void 0;
@@ -1537,12 +1508,23 @@ function registerFeishuDocTools(api) {
1537
1508
  const p = params;
1538
1509
  try {
1539
1510
  if (p.action === "create" && Object.hasOwn(p, "content")) return feishuExternalToolResult({ error: "Feishu document creation does not support content. Call action \"create\" first, then call action \"write\" with the returned document_id as doc_token." });
1540
- const client = getClient(p, defaultAccountId);
1511
+ const account = resolveFeishuToolAccount({
1512
+ cfg,
1513
+ executeParams: p,
1514
+ defaultAccountId,
1515
+ requiredTool: {
1516
+ family: "doc",
1517
+ label: "Doc"
1518
+ }
1519
+ });
1520
+ const client = createFeishuClient(account);
1521
+ const mediaMaxBytes = (account.config.mediaMaxMb ?? 30) * 1024 * 1024;
1522
+ const imageReadTimeoutMs = resolveConfiguredHttpTimeoutMs(account);
1541
1523
  switch (p.action) {
1542
1524
  case "read": return feishuExternalToolResult(await readDoc(client, p.doc_token));
1543
- case "write": return feishuExternalToolResult(await writeDoc(client, p.doc_token, p.content, getMediaMaxBytes(p, defaultAccountId), getImageReadTimeoutMs(p, defaultAccountId), api.logger));
1544
- case "append": return feishuExternalToolResult(await appendDoc(client, p.doc_token, p.content, getMediaMaxBytes(p, defaultAccountId), getImageReadTimeoutMs(p, defaultAccountId), api.logger));
1545
- case "insert": return feishuExternalToolResult(await insertDoc(client, p.doc_token, p.content, p.after_block_id, getMediaMaxBytes(p, defaultAccountId), getImageReadTimeoutMs(p, defaultAccountId), api.logger));
1525
+ case "write": return feishuExternalToolResult(await writeDoc(client, p.doc_token, p.content, mediaMaxBytes, imageReadTimeoutMs, api.logger));
1526
+ case "append": return feishuExternalToolResult(await appendDoc(client, p.doc_token, p.content, mediaMaxBytes, imageReadTimeoutMs, api.logger));
1527
+ case "insert": return feishuExternalToolResult(await insertDoc(client, p.doc_token, p.content, p.after_block_id, mediaMaxBytes, imageReadTimeoutMs, api.logger));
1546
1528
  case "create": return feishuExternalToolResult(await createDoc(client, p.title, p.folder_token, {
1547
1529
  grantToRequester: p.grant_to_requester,
1548
1530
  requesterOpenId: trustedRequesterOpenId
@@ -1554,8 +1536,8 @@ function registerFeishuDocTools(api) {
1554
1536
  case "create_table": return feishuExternalToolResult(await createTable(client, p.doc_token, p.row_size, p.column_size, p.parent_block_id, p.column_width));
1555
1537
  case "write_table_cells": return feishuExternalToolResult(await writeTableCells(client, p.doc_token, p.table_block_id, p.values));
1556
1538
  case "create_table_with_values": return feishuExternalToolResult(await createTableWithValues(client, p.doc_token, p.row_size, p.column_size, p.values, p.parent_block_id, p.column_width));
1557
- case "upload_image": return feishuExternalToolResult(await uploadImageBlock(client, p.doc_token, getMediaMaxBytes(p, defaultAccountId), getImageReadTimeoutMs(p, defaultAccountId), mediaLocalRoots, p.url, p.file_path, p.parent_block_id, p.filename, p.index, p.image));
1558
- case "upload_file": return feishuExternalToolResult(await uploadFileBlock(client, p.doc_token, getMediaMaxBytes(p, defaultAccountId), mediaLocalRoots, p.url, p.file_path, p.parent_block_id, p.filename));
1539
+ case "upload_image": return feishuExternalToolResult(await uploadImageBlock(client, p.doc_token, mediaMaxBytes, imageReadTimeoutMs, mediaLocalRoots, p.url, p.file_path, p.parent_block_id, p.filename, p.index, p.image));
1540
+ case "upload_file": return feishuExternalToolResult(await uploadFileBlock(client, p.doc_token, mediaMaxBytes, mediaLocalRoots, p.url, p.file_path, p.parent_block_id, p.filename));
1559
1541
  case "color_text": return feishuExternalToolResult(await updateColorText(client, p.doc_token, p.block_id, p.content));
1560
1542
  case "insert_table_row":
1561
1543
  case "insert_table_column":
@@ -1570,28 +1552,32 @@ function registerFeishuDocTools(api) {
1570
1552
  }
1571
1553
  };
1572
1554
  }, { name: "feishu_doc" });
1573
- if (toolsCfg.scopes) api.registerTool((ctx) => ({
1574
- name: "feishu_app_scopes",
1575
- resultContentSource: "network",
1576
- label: "Feishu App Scopes",
1577
- description: "List current app permissions (scopes). Use to debug permission issues or check available capabilities.",
1578
- parameters: Type.Object({}),
1579
- async execute() {
1580
- try {
1581
- const result = await listAppScopes(createFeishuToolClient({
1582
- api,
1583
- defaultAccountId: ctx.agentAccountId,
1584
- requiredTool: {
1585
- family: "scopes",
1586
- label: "App Scopes"
1587
- }
1588
- }));
1589
- return feishuExternalToolResult(result);
1590
- } catch (err) {
1591
- return feishuExternalToolResult({ error: formatErrorMessage(err) });
1555
+ api.registerTool((ctx) => {
1556
+ const cfg = ctx.runtimeConfig ?? ctx.config ?? api.config;
1557
+ if (!cfg || !resolveAnyEnabledFeishuToolsConfig(cfg).scopes) return null;
1558
+ return {
1559
+ name: "feishu_app_scopes",
1560
+ resultContentSource: "network",
1561
+ label: "Feishu App Scopes",
1562
+ description: "List current app permissions (scopes). Use to debug permission issues or check available capabilities.",
1563
+ parameters: Type.Object({}),
1564
+ async execute() {
1565
+ try {
1566
+ const result = await listAppScopes(createFeishuToolClient({
1567
+ cfg,
1568
+ defaultAccountId: ctx.agentAccountId,
1569
+ requiredTool: {
1570
+ family: "scopes",
1571
+ label: "App Scopes"
1572
+ }
1573
+ }));
1574
+ return feishuExternalToolResult(result);
1575
+ } catch (err) {
1576
+ return feishuExternalToolResult({ error: formatErrorMessage(err) });
1577
+ }
1592
1578
  }
1593
- }
1594
- }), { name: "feishu_app_scopes" });
1579
+ };
1580
+ }, { name: "feishu_app_scopes" });
1595
1581
  }
1596
1582
  //#endregion
1597
1583
  //#region extensions/feishu/src/wiki-schema.ts
@@ -1778,9 +1764,9 @@ async function renameNode(client, spaceId, nodeToken, title) {
1778
1764
  };
1779
1765
  }
1780
1766
  function registerFeishuWikiTools(api) {
1781
- if (!api.config) return;
1782
- if (!resolveAnyEnabledFeishuToolsConfig(api.config).wiki) return;
1783
1767
  api.registerTool((ctx) => {
1768
+ const cfg = ctx.runtimeConfig ?? ctx.config ?? api.config;
1769
+ if (!cfg || !resolveAnyEnabledFeishuToolsConfig(cfg).wiki) return null;
1784
1770
  const defaultAccountId = ctx.agentAccountId;
1785
1771
  return {
1786
1772
  name: "feishu_wiki",
@@ -1792,7 +1778,7 @@ function registerFeishuWikiTools(api) {
1792
1778
  const p = params;
1793
1779
  try {
1794
1780
  const createClient = () => createFeishuToolClient({
1795
- api,
1781
+ cfg,
1796
1782
  executeParams: p,
1797
1783
  defaultAccountId,
1798
1784
  requiredTool: {
@@ -1928,9 +1914,9 @@ async function removeMember(client, token, type, memberType, memberId) {
1928
1914
  return { success: true };
1929
1915
  }
1930
1916
  function registerFeishuPermTools(api) {
1931
- if (!api.config) return;
1932
- if (!resolveAnyEnabledFeishuToolsConfig(api.config).perm) return;
1933
1917
  api.registerTool((ctx) => {
1918
+ const cfg = ctx.runtimeConfig ?? ctx.config ?? api.config;
1919
+ if (!cfg || !resolveAnyEnabledFeishuToolsConfig(cfg).perm) return null;
1934
1920
  const defaultAccountId = ctx.agentAccountId;
1935
1921
  return {
1936
1922
  name: "feishu_perm",
@@ -1942,7 +1928,7 @@ function registerFeishuPermTools(api) {
1942
1928
  const p = params;
1943
1929
  try {
1944
1930
  const client = createFeishuToolClient({
1945
- api,
1931
+ cfg,
1946
1932
  executeParams: p,
1947
1933
  defaultAccountId,
1948
1934
  requiredTool: {
@@ -2376,43 +2362,45 @@ const UpdateRecordSchema = Type.Object({
2376
2362
  fields: Type.Record(Type.String(), BitableFieldValueSchema, { description: BITABLE_RECORD_FIELDS_DESCRIPTION })
2377
2363
  });
2378
2364
  function registerFeishuBitableTools(api) {
2379
- if (!api.config) return;
2380
- if (!resolveAnyEnabledFeishuToolsConfig(api.config).bitable) return;
2381
- const getClient = (params, defaultAccountId) => createFeishuToolClient({
2382
- api,
2383
- executeParams: params,
2384
- defaultAccountId,
2385
- requiredTool: {
2386
- family: "bitable",
2387
- label: "Bitable"
2388
- }
2389
- });
2390
2365
  const registerBitableTool = (params) => {
2391
- api.registerTool((ctx) => ({
2392
- name: params.name,
2393
- resultContentSource: "network",
2394
- label: params.label,
2395
- description: params.description,
2396
- parameters: params.parameters,
2397
- async execute(_toolCallId, rawParams) {
2398
- try {
2399
- return feishuExternalToolResult(await params.execute({
2400
- params: rawParams,
2401
- defaultAccountId: ctx.agentAccountId
2402
- }));
2403
- } catch (err) {
2404
- return feishuExternalToolResult({ error: formatErrorMessage(err) });
2366
+ api.registerTool((ctx) => {
2367
+ const cfg = ctx.runtimeConfig ?? ctx.config ?? api.config;
2368
+ if (!cfg || !resolveAnyEnabledFeishuToolsConfig(cfg).bitable) return null;
2369
+ return {
2370
+ name: params.name,
2371
+ resultContentSource: "network",
2372
+ label: params.label,
2373
+ description: params.description,
2374
+ parameters: params.parameters,
2375
+ async execute(_toolCallId, rawParams) {
2376
+ const executeParams = rawParams;
2377
+ try {
2378
+ return feishuExternalToolResult(await params.execute({
2379
+ params: executeParams,
2380
+ client: createFeishuToolClient({
2381
+ cfg,
2382
+ executeParams,
2383
+ defaultAccountId: ctx.agentAccountId,
2384
+ requiredTool: {
2385
+ family: "bitable",
2386
+ label: "Bitable"
2387
+ }
2388
+ })
2389
+ }));
2390
+ } catch (err) {
2391
+ return feishuExternalToolResult({ error: formatErrorMessage(err) });
2392
+ }
2405
2393
  }
2406
- }
2407
- }), { name: params.name });
2394
+ };
2395
+ }, { name: params.name });
2408
2396
  };
2409
2397
  registerBitableTool({
2410
2398
  name: "feishu_bitable_get_meta",
2411
2399
  label: "Feishu Bitable Get Meta",
2412
2400
  description: "Parse a Bitable URL and get app_token, table_id, and table list. Use this first when given a /wiki/ or /base/ URL.",
2413
2401
  parameters: GetMetaSchema,
2414
- async execute({ params, defaultAccountId }) {
2415
- return getBitableMeta(getClient(params, defaultAccountId), params.url);
2402
+ async execute({ params, client }) {
2403
+ return getBitableMeta(client, params.url);
2416
2404
  }
2417
2405
  });
2418
2406
  registerBitableTool({
@@ -2420,8 +2408,8 @@ function registerFeishuBitableTools(api) {
2420
2408
  label: "Feishu Bitable List Fields",
2421
2409
  description: "List all fields (columns) in a Bitable table with their types and properties",
2422
2410
  parameters: ListFieldsSchema,
2423
- async execute({ params, defaultAccountId }) {
2424
- return listFields(getClient(params, defaultAccountId), params.app_token, params.table_id);
2411
+ async execute({ params, client }) {
2412
+ return listFields(client, params.app_token, params.table_id);
2425
2413
  }
2426
2414
  });
2427
2415
  registerBitableTool({
@@ -2429,8 +2417,8 @@ function registerFeishuBitableTools(api) {
2429
2417
  label: "Feishu Bitable List Records",
2430
2418
  description: "List records (rows) from a Bitable table with pagination support",
2431
2419
  parameters: ListRecordsSchema,
2432
- async execute({ params, defaultAccountId }) {
2433
- return listRecords(getClient(params, defaultAccountId), params.app_token, params.table_id, readBitableListRecordsPageSize(params), params.page_token);
2420
+ async execute({ params, client }) {
2421
+ return listRecords(client, params.app_token, params.table_id, readBitableListRecordsPageSize(params), params.page_token);
2434
2422
  }
2435
2423
  });
2436
2424
  registerBitableTool({
@@ -2438,8 +2426,8 @@ function registerFeishuBitableTools(api) {
2438
2426
  label: "Feishu Bitable Get Record",
2439
2427
  description: "Get a single record by ID from a Bitable table",
2440
2428
  parameters: GetRecordSchema,
2441
- async execute({ params, defaultAccountId }) {
2442
- return getRecord(getClient(params, defaultAccountId), params.app_token, params.table_id, params.record_id);
2429
+ async execute({ params, client }) {
2430
+ return getRecord(client, params.app_token, params.table_id, params.record_id);
2443
2431
  }
2444
2432
  });
2445
2433
  registerBitableTool({
@@ -2447,8 +2435,8 @@ function registerFeishuBitableTools(api) {
2447
2435
  label: "Feishu Bitable Create Record",
2448
2436
  description: "Create a new record (row) in a Bitable table",
2449
2437
  parameters: CreateRecordSchema,
2450
- async execute({ params, defaultAccountId }) {
2451
- return createRecord(getClient(params, defaultAccountId), params.app_token, params.table_id, params.fields);
2438
+ async execute({ params, client }) {
2439
+ return createRecord(client, params.app_token, params.table_id, params.fields);
2452
2440
  }
2453
2441
  });
2454
2442
  registerBitableTool({
@@ -2456,8 +2444,8 @@ function registerFeishuBitableTools(api) {
2456
2444
  label: "Feishu Bitable Update Record",
2457
2445
  description: "Update an existing record (row) in a Bitable table",
2458
2446
  parameters: UpdateRecordSchema,
2459
- async execute({ params, defaultAccountId }) {
2460
- return updateRecord(getClient(params, defaultAccountId), params.app_token, params.table_id, params.record_id, params.fields);
2447
+ async execute({ params, client }) {
2448
+ return updateRecord(client, params.app_token, params.table_id, params.record_id, params.fields);
2461
2449
  }
2462
2450
  });
2463
2451
  registerBitableTool({
@@ -2465,8 +2453,8 @@ function registerFeishuBitableTools(api) {
2465
2453
  label: "Feishu Bitable Create App",
2466
2454
  description: "Create a new Bitable (multidimensional table) application",
2467
2455
  parameters: CreateAppSchema,
2468
- async execute({ params, defaultAccountId }) {
2469
- return createApp(getClient(params, defaultAccountId), params.name, params.folder_token, {
2456
+ async execute({ params, client }) {
2457
+ return createApp(client, params.name, params.folder_token, {
2470
2458
  debug: (msg) => api.logger.debug?.(msg),
2471
2459
  warn: (msg) => api.logger.warn?.(msg)
2472
2460
  });
@@ -2477,8 +2465,8 @@ function registerFeishuBitableTools(api) {
2477
2465
  label: "Feishu Bitable Create Field",
2478
2466
  description: "Create a new field (column) in a Bitable table",
2479
2467
  parameters: CreateFieldSchema,
2480
- async execute({ params, defaultAccountId }) {
2481
- return createField(getClient(params, defaultAccountId), params.app_token, params.table_id, params.field_name, params.field_type, params.property);
2468
+ async execute({ params, client }) {
2469
+ return createField(client, params.app_token, params.table_id, params.field_name, params.field_type, params.property);
2482
2470
  }
2483
2471
  });
2484
2472
  }
@@ -1,6 +1,6 @@
1
1
  import { a as resolveDefaultFeishuAccountId, i as listFeishuAccountIds, n as inspectFeishuCredentials, o as resolveFeishuAccount, r as listEnabledFeishuAccounts, s as resolveFeishuRuntimeAccount } from "./accounts-cCMNFBKg.js";
2
2
  import { i as resolveReceiveIdType, n as looksLikeFeishuId, r as normalizeFeishuTarget } from "./targets-BTQCYRZQ.js";
3
- import { B as deliverCommentThreadText, Ct as resolveFeishuGroupToolPolicy, D as sendMessageFeishu, E as sendCardFeishu, Et as resolveFeishuChatType, F as createFeishuSendReceipt, J as cleanupAmbientCommentTypingReaction, L as buildFeishuMediaFallbackText, O as sendStructuredCardFeishu, S as chunkFeishuCardMarkdown, Tt as normalizeFeishuChatType, _ as resolveFeishuRichReply, a as FEISHU_PRESENTATION_CAPABILITIES, bt as resolveFeishuGroupConfig, c as buildFeishuPresentationCard, ct as materializeFeishuPostMarkdownSoftBreaks, d as isFeishuCardWithinEnvelope, dt as authorizeFeishuChatMemberRead, f as markRenderedFeishuCard, ft as canEnumerateAllFeishuGroups, gt as resolveFeishuChatReadPreliminaryAuthorization, h as renderFeishuPresentationPayload, ht as isFeishuGroupReadEnabled, it as readNativeFeishuCardJson, l as buildFeishuPresentationFallback, m as renderFeishuPresentationFallbackText, mt as isFeishuGroupReadAllowed, n as createFeishuReplyDeliveryResult, o as assertFeishuCardWithinEnvelope, ot as chunkFeishuMarkdown, p as readNativeFeishuCard, pt as canEnumerateAllFeishuPeers, rt as parseFeishuCommentTarget, s as buildFeishuPayloadCard, st as chunkFeishuPostMarkdown, t as createFeishuPartialReplyDeliveryError, u as consumeFeishuPresentationFallbackMarker, ut as assertFeishuChatReadAllowed, x as shouldSuppressFeishuTextForVoiceMedia, y as sendMediaFeishu, z as resolveFeishuIdentityHeaderTitle } from "./reply-delivery-result-CYaKkbUN.js";
3
+ import { A as sendStructuredCardFeishu, B as buildFeishuMediaFallbackText, C as shouldSuppressFeishuTextForVoiceMedia, Ct as resolveFeishuGroupConfig, Et as resolveFeishuGroupToolPolicy, H as resolveFeishuIdentityHeaderTitle, O as sendCardFeishu, Ot as normalizeFeishuChatType, R as createFeishuSendReceipt, U as deliverCommentThreadText, Z as cleanupAmbientCommentTypingReaction, _t as isFeishuGroupReadAllowed, a as FEISHU_PRESENTATION_CAPABILITIES, c as buildFeishuPresentationCard, d as feishuCardWithinTableLimit, dt as materializeFeishuPostMarkdownSoftBreaks, f as isFeishuCardWithinEnvelope, g as renderFeishuPresentationPayload, gt as canEnumerateAllFeishuPeers, h as renderFeishuPresentationFallbackText, ht as canEnumerateAllFeishuGroups, k as sendMessageFeishu, kt as resolveFeishuChatType, l as buildFeishuPresentationFallback, lt as chunkFeishuMarkdown, m as readNativeFeishuCard, mt as authorizeFeishuChatMemberRead, n as createFeishuReplyDeliveryResult, o as assertFeishuCardWithinEnvelope, ot as parseFeishuCommentTarget, p as markRenderedFeishuCard, pt as assertFeishuChatReadAllowed, s as buildFeishuPayloadCard, st as readNativeFeishuCardJson, t as createFeishuPartialReplyDeliveryError, u as consumeFeishuPresentationFallbackMarker, ut as chunkFeishuPostMarkdown, v as resolveFeishuRichReply, vt as isFeishuGroupReadEnabled, w as chunkFeishuCardMarkdown, x as sendMediaFeishu, y as withinCardTableLimit, yt as resolveFeishuChatReadPreliminaryAuthorization } from "./reply-delivery-result-C3smdVzb.js";
4
4
  import { n as normalizeCompatibilityConfig, o as normalizeFeishuExternalKey, r as FeishuChannelConfigSchema, t as legacyConfigRules } from "./doctor-contract-w6FpMypv.js";
5
5
  import { a as parseFeishuTargetId, i as parseFeishuDirectConversationId, n as buildFeishuModelOverrideParentCandidates, o as resolveConfiguredFeishuGroupSessionScope, r as parseFeishuConversationId, t as buildFeishuConversationId } from "./conversation-id-VYgGQ-GX.js";
6
6
  import { t as messageActionTargetAliases } from "./security-audit-DKfR4Cv3.js";
@@ -25,6 +25,7 @@ import { applyDirectoryQueryAndLimit, createChannelDirectoryAdapter, createRunti
25
25
  import { PlatformMessageNotDispatchedError } from "openclaw/plugin-sdk/error-runtime";
26
26
  import { resolveLegacyInteractiveTextFallback } from "openclaw/plugin-sdk/interactive-runtime";
27
27
  import { parseStrictPositiveInteger } from "openclaw/plugin-sdk/number-runtime";
28
+ import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, createSetupTranslator, formatDocsLink, hasConfiguredSecretInput, mergeAllowFromEntries, patchScopedAccountConfig, patchTopLevelChannelConfigSection, promptSingleChannelSecretInput, setSetupChannelEnabled, splitSetupEntries } from "openclaw/plugin-sdk/setup";
28
29
  import { buildProbeChannelStatusSummary, createComputedAccountStatusAdapter, createDefaultChannelRuntimeState } from "openclaw/plugin-sdk/status-helpers";
29
30
  import { isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
30
31
  import { convertMarkdownTables, sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
@@ -44,7 +45,6 @@ import { getReplyPayloadTtsSupplement, resolvePayloadMediaUrls, sendPayloadMedia
44
45
  import { statRegularFileSync } from "openclaw/plugin-sdk/security-runtime";
45
46
  import { readStringParam } from "openclaw/plugin-sdk/param-readers";
46
47
  import { defineChannelSetupContract } from "openclaw/plugin-sdk/channel-setup";
47
- import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, createSetupTranslator, formatDocsLink, hasConfiguredSecretInput, mergeAllowFromEntries, patchScopedAccountConfig, promptSingleChannelSecretInput, setSetupChannelEnabled, splitSetupEntries } from "openclaw/plugin-sdk/setup";
48
48
  import { createChannelDmPolicy } from "openclaw/plugin-sdk/channel-dm-policy";
49
49
  //#region extensions/feishu/src/approval-auth.ts
50
50
  function normalizeFeishuApproverId(value) {
@@ -799,10 +799,6 @@ function partialFeishuSendError(error, results) {
799
799
  function readFeishuPropagateMediaUploadFailure(payload) {
800
800
  return (isRecord(payload.channelData?.feishu) ? payload.channelData.feishu : void 0)?.[FEISHU_PROPAGATE_MEDIA_UPLOAD_FAILURE_MARKER] === true;
801
801
  }
802
- function buildFeishuPropagationOnlyChannelData(payload) {
803
- if ((isRecord(payload.channelData?.feishu) ? payload.channelData.feishu : void 0)?.["__openclawPropagateMediaUploadFailure"] !== true) return;
804
- return { feishu: { [FEISHU_PROPAGATE_MEDIA_UPLOAD_FAILURE_MARKER]: true } };
805
- }
806
802
  function resolveFeishuReplyMode(params) {
807
803
  const replyToMessageId = params.replyToId?.trim();
808
804
  if (replyToMessageId) return {
@@ -867,7 +863,7 @@ async function sendOutboundText(params) {
867
863
  cfg,
868
864
  accountId
869
865
  }).config?.renderMode ?? "auto";
870
- const useCard = renderMode === "card" || renderMode === "auto" && shouldUseCard(text);
866
+ const useCard = (renderMode === "card" || renderMode === "auto" && shouldUseCard(text)) && withinCardTableLimit(text);
871
867
  const tableMode = resolveMarkdownTableMode({
872
868
  cfg,
873
869
  channel: "feishu"
@@ -1023,7 +1019,7 @@ const feishuOutbound = {
1023
1019
  text,
1024
1020
  interactive: void 0,
1025
1021
  presentation: void 0,
1026
- channelData: buildFeishuPropagationOnlyChannelData(payload)
1022
+ channelData: void 0
1027
1023
  },
1028
1024
  separateMediaAndText: true
1029
1025
  });
@@ -1355,36 +1351,22 @@ function resolveFeishuOutboundSessionRoute(params) {
1355
1351
  //#region extensions/feishu/src/setup-core.ts
1356
1352
  function setFeishuNamedAccountEnabled(cfg, accountId, enabled) {
1357
1353
  const feishuCfg = cfg.channels?.feishu;
1358
- return {
1359
- ...cfg,
1360
- channels: {
1361
- ...cfg.channels,
1362
- feishu: {
1363
- ...feishuCfg,
1364
- accounts: {
1365
- ...feishuCfg?.accounts,
1366
- [accountId]: {
1367
- ...feishuCfg?.accounts?.[accountId],
1368
- enabled
1369
- }
1370
- }
1354
+ return patchTopLevelChannelConfigSection({
1355
+ cfg,
1356
+ channel: "feishu",
1357
+ patch: { accounts: {
1358
+ ...feishuCfg?.accounts,
1359
+ [accountId]: {
1360
+ ...feishuCfg?.accounts?.[accountId],
1361
+ enabled
1371
1362
  }
1372
- }
1373
- };
1363
+ } }
1364
+ });
1374
1365
  }
1375
1366
  const feishuSetupAdapter = {
1376
1367
  resolveAccountId: ({ cfg, accountId }) => accountId?.trim() || resolveDefaultFeishuAccountId(cfg),
1377
1368
  applyAccountConfig: ({ cfg, accountId }) => {
1378
- if (!accountId || accountId === DEFAULT_ACCOUNT_ID$1) return {
1379
- ...cfg,
1380
- channels: {
1381
- ...cfg.channels,
1382
- feishu: {
1383
- ...cfg.channels?.feishu,
1384
- enabled: true
1385
- }
1386
- }
1387
- };
1369
+ if (!accountId || accountId === DEFAULT_ACCOUNT_ID$1) return setSetupChannelEnabled(cfg, "feishu", true);
1388
1370
  return setFeishuNamedAccountEnabled(cfg, accountId, true);
1389
1371
  }
1390
1372
  };
@@ -1900,7 +1882,7 @@ const meta = {
1900
1882
  order: 70,
1901
1883
  preferSessionLookupForAnnounceTarget: true
1902
1884
  };
1903
- const loadFeishuChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-CAD74kBO.js"), "feishuChannelRuntime");
1885
+ const loadFeishuChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-B-f6ajOp.js"), "feishuChannelRuntime");
1904
1886
  async function resolveFeishuMessageSender(params) {
1905
1887
  try {
1906
1888
  const sender = params.resolve(await loadFeishuChannelRuntime());
@@ -2407,19 +2389,13 @@ const feishuPlugin = createChatChannelPlugin({
2407
2389
  else delete next.channels;
2408
2390
  return next;
2409
2391
  }
2410
- const feishuCfg = cfg.channels?.feishu;
2411
- const accounts = { ...feishuCfg?.accounts };
2392
+ const accounts = { ...(cfg.channels?.feishu)?.accounts };
2412
2393
  delete accounts[accountId];
2413
- return {
2414
- ...cfg,
2415
- channels: {
2416
- ...cfg.channels,
2417
- feishu: {
2418
- ...feishuCfg,
2419
- accounts: Object.keys(accounts).length > 0 ? accounts : void 0
2420
- }
2421
- }
2422
- };
2394
+ return patchTopLevelChannelConfigSection({
2395
+ cfg,
2396
+ channel: "feishu",
2397
+ patch: { accounts: Object.keys(accounts).length > 0 ? accounts : void 0 }
2398
+ });
2423
2399
  },
2424
2400
  isConfigured: (account) => account.configured,
2425
2401
  describeAccount: (account) => describeAccountSnapshot({
@@ -2490,7 +2466,7 @@ const feishuPlugin = createChatChannelPlugin({
2490
2466
  interactive
2491
2467
  })
2492
2468
  }) : void 0;
2493
- const presentationCard = generatedCard && isFeishuCardWithinEnvelope(generatedCard) ? generatedCard : void 0;
2469
+ const presentationCard = generatedCard && feishuCardWithinTableLimit(generatedCard) && isFeishuCardWithinEnvelope(generatedCard) ? generatedCard : void 0;
2494
2470
  const presentationFellBack = Boolean(generatedCard && !presentationCard);
2495
2471
  const card = presentation ? presentationCard : textCard;
2496
2472
  if (card && mediaUrl) throw new Error(`Feishu ${ctx.action} does not support card with media.`);
@@ -3027,7 +3003,7 @@ const feishuPlugin = createChatChannelPlugin({
3027
3003
  })
3028
3004
  }),
3029
3005
  gateway: { startAccount: async (ctx) => {
3030
- const { monitorFeishuProvider } = await import("./monitor-rPJ_Mz4M.js");
3006
+ const { monitorFeishuProvider } = await import("./monitor-EuNsFn2T.js");
3031
3007
  const account = resolveFeishuRuntimeAccount({
3032
3008
  cfg: ctx.cfg,
3033
3009
  accountId: ctx.accountId
@@ -1,2 +1,2 @@
1
- import { t as feishuPlugin } from "./channel-VytDDz_B.js";
1
+ import { t as feishuPlugin } from "./channel-HDnQAH4Z.js";
2
2
  export { feishuPlugin };
@@ -1,8 +1,8 @@
1
1
  import { o as resolveFeishuAccount, s as resolveFeishuRuntimeAccount } from "./accounts-cCMNFBKg.js";
2
- import { c as listFeishuDirectoryPeers, o as feishuOutbound, s as listFeishuDirectoryGroups } from "./channel-VytDDz_B.js";
3
- import { C as editMessageFeishu, D as sendMessageFeishu, E as sendCardFeishu, I as assertFeishuApiSuccess, b as sendStickerFeishu, w as getMessageFeishu } from "./reply-delivery-result-CYaKkbUN.js";
2
+ import { c as listFeishuDirectoryPeers, o as feishuOutbound, s as listFeishuDirectoryGroups } from "./channel-HDnQAH4Z.js";
3
+ import { E as getMessageFeishu, O as sendCardFeishu, S as sendStickerFeishu, T as editMessageFeishu, k as sendMessageFeishu, z as assertFeishuApiSuccess } from "./reply-delivery-result-C3smdVzb.js";
4
4
  import { r as createFeishuClient } from "./client-DMbIL3UH.js";
5
- import { a as getFeishuMemberInfo, i as getChatMembers, n as buildFeishuDirectChatMembers, r as getChatInfo, t as assertFeishuChatMember } from "./chat-DDhIcPQy.js";
5
+ import { a as getFeishuMemberInfo, i as getChatMembers, n as buildFeishuDirectChatMembers, r as getChatInfo, t as assertFeishuChatMember } from "./chat-zhIPXu4X.js";
6
6
  import { t as probeFeishu } from "./probe-D_SatdZl.js";
7
7
  import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
8
8
  //#region extensions/feishu/src/directory.ts