@openclaw/feishu 2026.7.2-beta.3 → 2026.7.2-beta.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.
Files changed (146) hide show
  1. package/dist/api.js +3 -3
  2. package/dist/{app-registration-BzkyrVZu.js → app-registration-cN1bVV6s.js} +5 -5
  3. package/dist/{channel-BdnXYU6g.js → channel-DB1x6UJX.js} +15 -8
  4. package/dist/channel-plugin-api.js +1 -1
  5. package/dist/{channel.runtime-CVIzo2dV.js → channel.runtime-B5yAAvbT.js} +5 -5
  6. package/dist/{client-87BmeMpj.js → client-Dee7cKsS.js} +62 -1
  7. package/dist/{doctor-contract-DXH5hux1.js → doctor-contract-Cw5sdjOm.js} +29 -41
  8. package/dist/doctor-contract-api.js +1 -1
  9. package/dist/{drive-BHv8WW9i.js → drive-_zrcOxzS.js} +1 -1
  10. package/dist/{send-DcrXbqqA.js → media-CRJunSRr.js} +1048 -1019
  11. package/dist/{monitor-BVQf7-Bl.js → monitor-8CLu6myv.js} +5 -4
  12. package/dist/{monitor.account-Blbf2T6J.js → monitor.account-CkYj45PC.js} +1563 -589
  13. package/dist/monitor.startup-CSUPT_U1.js +143 -0
  14. package/dist/{probe-BgboTHIn.js → probe-Za1kgUvx.js} +70 -10
  15. package/dist/setup-api.js +1 -1
  16. package/node_modules/@larksuiteoapi/node-sdk/README.md +13 -0
  17. package/node_modules/@larksuiteoapi/node-sdk/README.zh.md +12 -0
  18. package/node_modules/@larksuiteoapi/node-sdk/es/index.js +8950 -3084
  19. package/node_modules/@larksuiteoapi/node-sdk/lib/index.js +8951 -3083
  20. package/node_modules/@larksuiteoapi/node-sdk/package.json +1 -1
  21. package/node_modules/@larksuiteoapi/node-sdk/types/index.d.ts +12522 -698
  22. package/node_modules/@protobufjs/utf8/CHANGELOG.md +8 -0
  23. package/node_modules/@protobufjs/utf8/index.js +29 -18
  24. package/node_modules/@protobufjs/utf8/package.json +2 -2
  25. package/node_modules/@protobufjs/utf8/tests/index.js +5 -0
  26. package/node_modules/@types/node/README.md +1 -1
  27. package/node_modules/@types/node/fs/promises.d.ts +16 -6
  28. package/node_modules/@types/node/package.json +2 -2
  29. package/node_modules/agent-base/README.md +145 -0
  30. package/node_modules/agent-base/dist/src/index.d.ts +78 -0
  31. package/node_modules/agent-base/dist/src/index.js +203 -0
  32. package/node_modules/agent-base/dist/src/index.js.map +1 -0
  33. package/node_modules/agent-base/dist/src/promisify.d.ts +4 -0
  34. package/node_modules/agent-base/dist/src/promisify.js +18 -0
  35. package/node_modules/agent-base/dist/src/promisify.js.map +1 -0
  36. package/node_modules/agent-base/package.json +64 -0
  37. package/node_modules/agent-base/src/index.ts +345 -0
  38. package/node_modules/agent-base/src/promisify.ts +33 -0
  39. package/node_modules/axios/CHANGELOG.md +197 -1
  40. package/node_modules/axios/README.md +424 -256
  41. package/node_modules/axios/dist/axios.js +589 -204
  42. package/node_modules/axios/dist/axios.min.js +3 -3
  43. package/node_modules/axios/dist/axios.min.js.map +1 -1
  44. package/node_modules/axios/dist/browser/axios.cjs +630 -185
  45. package/node_modules/axios/dist/esm/axios.js +630 -185
  46. package/node_modules/axios/dist/esm/axios.min.js +2 -2
  47. package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
  48. package/node_modules/axios/dist/node/axios.cjs +949 -301
  49. package/node_modules/axios/index.d.cts +28 -5
  50. package/node_modules/axios/index.d.ts +24 -3
  51. package/node_modules/axios/lib/adapters/adapters.js +1 -1
  52. package/node_modules/axios/lib/adapters/fetch.js +223 -49
  53. package/node_modules/axios/lib/adapters/http.js +408 -193
  54. package/node_modules/axios/lib/adapters/xhr.js +3 -1
  55. package/node_modules/axios/lib/core/Axios.js +4 -2
  56. package/node_modules/axios/lib/core/AxiosError.js +13 -1
  57. package/node_modules/axios/lib/core/AxiosHeaders.js +13 -42
  58. package/node_modules/axios/lib/core/buildFullPath.js +29 -1
  59. package/node_modules/axios/lib/core/mergeConfig.js +35 -0
  60. package/node_modules/axios/lib/defaults/transitional.js +2 -0
  61. package/node_modules/axios/lib/env/data.js +1 -1
  62. package/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +1 -3
  63. package/node_modules/axios/lib/helpers/Http2Sessions.js +119 -0
  64. package/node_modules/axios/lib/helpers/buildURL.js +7 -4
  65. package/node_modules/axios/lib/helpers/composeSignals.js +48 -47
  66. package/node_modules/axios/lib/helpers/cookies.js +5 -1
  67. package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +16 -11
  68. package/node_modules/axios/lib/helpers/formDataToJSON.js +26 -4
  69. package/node_modules/axios/lib/helpers/formDataToStream.js +2 -2
  70. package/node_modules/axios/lib/helpers/fromDataURI.js +20 -5
  71. package/node_modules/axios/lib/helpers/progressEventReducer.js +3 -0
  72. package/node_modules/axios/lib/helpers/resolveConfig.js +26 -13
  73. package/node_modules/axios/lib/helpers/sanitizeHeaderValue.js +60 -0
  74. package/node_modules/axios/lib/helpers/shouldBypassProxy.js +33 -1
  75. package/node_modules/axios/lib/helpers/toFormData.js +48 -12
  76. package/node_modules/axios/lib/helpers/validator.js +1 -1
  77. package/node_modules/axios/lib/utils.js +105 -19
  78. package/node_modules/axios/package.json +31 -13
  79. package/node_modules/https-proxy-agent/README.md +137 -0
  80. package/node_modules/https-proxy-agent/dist/agent.d.ts +30 -0
  81. package/node_modules/https-proxy-agent/dist/agent.js +177 -0
  82. package/node_modules/https-proxy-agent/dist/agent.js.map +1 -0
  83. package/node_modules/https-proxy-agent/dist/index.d.ts +23 -0
  84. package/node_modules/https-proxy-agent/dist/index.js +14 -0
  85. package/node_modules/https-proxy-agent/dist/index.js.map +1 -0
  86. package/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts +7 -0
  87. package/node_modules/https-proxy-agent/dist/parse-proxy-response.js +66 -0
  88. package/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map +1 -0
  89. package/node_modules/https-proxy-agent/package.json +56 -0
  90. package/node_modules/protobufjs/dist/light/protobuf.js +145 -188
  91. package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
  92. package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
  93. package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
  94. package/node_modules/protobufjs/dist/minimal/protobuf.js +33 -76
  95. package/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -1
  96. package/node_modules/protobufjs/dist/minimal/protobuf.min.js +3 -3
  97. package/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -1
  98. package/node_modules/protobufjs/dist/protobuf.js +168 -208
  99. package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
  100. package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
  101. package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
  102. package/node_modules/protobufjs/index.d.ts +0 -8
  103. package/node_modules/protobufjs/package.json +2 -3
  104. package/node_modules/protobufjs/src/parse.js +3 -0
  105. package/node_modules/protobufjs/src/util/minimal.js +0 -3
  106. package/node_modules/qs/CHANGELOG.md +11 -0
  107. package/node_modules/qs/dist/qs.js +17 -17
  108. package/node_modules/qs/lib/parse.js +19 -8
  109. package/node_modules/qs/lib/utils.js +47 -8
  110. package/node_modules/qs/package.json +6 -5
  111. package/node_modules/qs/test/parse.js +230 -0
  112. package/node_modules/qs/test/utils.js +194 -0
  113. package/node_modules/typebox/build/compile/validator.d.mts +1 -4
  114. package/node_modules/typebox/build/guard/guard.d.mts +1 -1
  115. package/node_modules/typebox/build/guard/guard.mjs +5 -2
  116. package/node_modules/typebox/build/guard/string.mjs +16 -4
  117. package/node_modules/typebox/build/schema/engine/_functions.mjs +34 -15
  118. package/node_modules/typebox/build/type/action/readonly_object.d.mts +5 -0
  119. package/node_modules/typebox/build/type/action/readonly_object.mjs +8 -0
  120. package/node_modules/typebox/build/typebox.d.mts +1 -1
  121. package/node_modules/typebox/build/typebox.mjs +1 -1
  122. package/node_modules/typebox/package.json +1 -1
  123. package/node_modules/typebox/readme.md +29 -32
  124. package/node_modules/ws/lib/receiver.js +15 -32
  125. package/node_modules/ws/lib/websocket-server.js +4 -4
  126. package/node_modules/ws/lib/websocket.js +4 -4
  127. package/node_modules/ws/package.json +5 -1
  128. package/npm-shrinkwrap.json +58 -38
  129. package/openclaw.plugin.json +2 -10
  130. package/package.json +20 -7
  131. package/dist/monitor.startup-Cy8NPGAX.js +0 -43
  132. package/node_modules/@protobufjs/inquire/CHANGELOG.md +0 -8
  133. package/node_modules/@protobufjs/inquire/LICENSE +0 -26
  134. package/node_modules/@protobufjs/inquire/README.md +0 -13
  135. package/node_modules/@protobufjs/inquire/index.d.ts +0 -10
  136. package/node_modules/@protobufjs/inquire/index.js +0 -38
  137. package/node_modules/@protobufjs/inquire/package.json +0 -21
  138. package/node_modules/@protobufjs/inquire/tests/data/array.js +0 -1
  139. package/node_modules/@protobufjs/inquire/tests/data/emptyArray.js +0 -1
  140. package/node_modules/@protobufjs/inquire/tests/data/emptyObject.js +0 -1
  141. package/node_modules/@protobufjs/inquire/tests/data/object.js +0 -1
  142. package/node_modules/@protobufjs/inquire/tests/index.js +0 -20
  143. package/node_modules/axios/dist/axios.js.map +0 -1
  144. package/node_modules/axios/dist/browser/axios.cjs.map +0 -1
  145. package/node_modules/axios/dist/esm/axios.js.map +0 -1
  146. package/node_modules/axios/dist/node/axios.cjs.map +0 -1
package/dist/api.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { r as listEnabledFeishuAccounts } from "./accounts-BDoGHJDk.js";
2
- import { a as setFeishuNamedAccountEnabled, i as feishuSetupAdapter, n as feishuSetupWizard, r as runFeishuLogin, t as feishuPlugin } from "./channel-BdnXYU6g.js";
2
+ import { a as setFeishuNamedAccountEnabled, i as feishuSetupAdapter, n as feishuSetupWizard, r as runFeishuLogin, t as feishuPlugin } from "./channel-DB1x6UJX.js";
3
3
  import { p as parseFeishuMarkdown, u as chunkFeishuMarkdown } from "./send-result-DfE5Fhz6.js";
4
4
  import { a as parseFeishuTargetId, i as parseFeishuDirectConversationId, n as buildFeishuModelOverrideParentCandidates, r as parseFeishuConversationId, t as buildFeishuConversationId } from "./conversation-id-BeJL-wq7.js";
5
- import { r as createFeishuClient, s as resolveConfiguredHttpTimeoutMs } from "./client-87BmeMpj.js";
5
+ import { r as createFeishuClient, s as resolveConfiguredHttpTimeoutMs } from "./client-Dee7cKsS.js";
6
6
  import { t as getFeishuRuntime } from "./runtime-C5JxBWZp.js";
7
- import { a as toolExecutionErrorResult, f as registerFeishuChatTools, g as resolveToolsConfig, h as resolveFeishuToolAccount, m as resolveAnyEnabledFeishuToolsConfig, n as registerFeishuDriveTools, o as unknownToolActionResult, p as createFeishuToolClient } from "./drive-BHv8WW9i.js";
7
+ import { a as toolExecutionErrorResult, f as registerFeishuChatTools, g as resolveToolsConfig, h as resolveFeishuToolAccount, m as resolveAnyEnabledFeishuToolsConfig, n as registerFeishuDriveTools, o as unknownToolActionResult, p as createFeishuToolClient } from "./drive-_zrcOxzS.js";
8
8
  import { n as getFeishuThreadBindingManager, r as testing, t as createFeishuThreadBindingManager } from "./thread-bindings-V0bwk0A1.js";
9
9
  import { n as handleFeishuSubagentEnded, r as handleFeishuSubagentSpawning, t as handleFeishuSubagentDeliveryTarget } from "./subagent-hooks-BKTOxB-T.js";
10
10
  import { optionalPositiveIntegerSchema } from "openclaw/plugin-sdk/channel-actions";
@@ -1,7 +1,7 @@
1
1
  import { t as readFeishuJsonResponse } from "./json-response-CheljwGr.js";
2
2
  import { finiteSecondsToTimerSafeMilliseconds } from "openclaw/plugin-sdk/number-runtime";
3
3
  import { renderQrTerminal } from "openclaw/plugin-sdk/media-runtime";
4
- import { sleep } from "openclaw/plugin-sdk/runtime-env";
4
+ import { sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
5
5
  import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime";
6
6
  //#region extensions/feishu/src/app-registration.ts
7
7
  /**
@@ -108,7 +108,7 @@ async function pollAppRegistration(params) {
108
108
  lookupFn
109
109
  });
110
110
  } catch {
111
- await sleepRegistrationPollInterval(currentInterval);
111
+ await sleepRegistrationPollInterval(currentInterval, abortSignal);
112
112
  continue;
113
113
  }
114
114
  if (pollRes.user_info?.tenant_brand) {
@@ -135,7 +135,7 @@ async function pollAppRegistration(params) {
135
135
  status: "error",
136
136
  message: `${pollRes.error}: ${pollRes.error_description ?? "unknown"}`
137
137
  };
138
- await sleepRegistrationPollInterval(currentInterval);
138
+ await sleepRegistrationPollInterval(currentInterval, abortSignal);
139
139
  }
140
140
  return { status: "timeout" };
141
141
  }
@@ -194,8 +194,8 @@ async function getAppOwnerOpenId(params) {
194
194
  return;
195
195
  }
196
196
  }
197
- function sleepRegistrationPollInterval(intervalSeconds) {
198
- return sleep(finiteSecondsToTimerSafeMilliseconds(intervalSeconds) ?? DEFAULT_REGISTRATION_POLL_INTERVAL_SECONDS * 1e3);
197
+ async function sleepRegistrationPollInterval(intervalSeconds, abortSignal) {
198
+ await sleepWithAbort(finiteSecondsToTimerSafeMilliseconds(intervalSeconds) ?? DEFAULT_REGISTRATION_POLL_INTERVAL_SECONDS * 1e3, abortSignal).catch(() => {});
199
199
  }
200
200
  //#endregion
201
201
  export { beginAppRegistration, getAppOwnerOpenId, initAppRegistration, pollAppRegistration, printQrCode };
@@ -2,7 +2,7 @@ import { a as resolveDefaultFeishuAccountId, d as isRecord$1, i as listFeishuAcc
2
2
  import { i as resolveReceiveIdType, n as looksLikeFeishuId, r as normalizeFeishuTarget } from "./targets-BUjQ1TcA.js";
3
3
  import { A as resolveFeishuChatType, D as resolveFeishuGroupToolPolicy, N as createFeishuCardInteractionEnvelope, _ as canEnumerateAllFeishuPeers, a as readNativeFeishuCardJson, b as resolveFeishuChatReadPreliminaryAuthorization, g as canEnumerateAllFeishuGroups, h as authorizeFeishuChatMemberRead, k as normalizeFeishuChatType, m as assertFeishuChatReadAllowed, n as createFeishuSendReceipt, u as chunkFeishuMarkdown, v as isFeishuGroupReadAllowed, w as resolveFeishuGroupConfig, y as isFeishuGroupReadEnabled } from "./send-result-DfE5Fhz6.js";
4
4
  import { a as parseFeishuTargetId, i as parseFeishuDirectConversationId, n as buildFeishuModelOverrideParentCandidates, o as resolveConfiguredFeishuGroupSessionScope, r as parseFeishuConversationId, t as buildFeishuConversationId } from "./conversation-id-BeJL-wq7.js";
5
- import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-DXH5hux1.js";
5
+ import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-Cw5sdjOm.js";
6
6
  import { t as messageActionTargetAliases } from "./security-audit-BIeA3W3Q.js";
7
7
  import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-BCpDLdg9.js";
8
8
  import { t as collectFeishuSecurityAuditFindings } from "./security-audit-shared-BIHeF-S_.js";
@@ -36,6 +36,7 @@ import path from "node:path";
36
36
  import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
37
37
  import { deleteSessionEntry, isValidAgentHarnessSessionStoreEntry, listSessionEntries, loadTranscriptEventsSync, parseSqliteSessionFileMarker, resolveSessionStoreBackupPaths, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
38
38
  import { resolveStateDir } from "openclaw/plugin-sdk/state-paths";
39
+ import { defineChannelSetupContract } from "openclaw/plugin-sdk/channel-setup";
39
40
  import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$2, createSetupTranslator, formatDocsLink, hasConfiguredSecretInput as hasConfiguredSecretInput$1, mergeAllowFromEntries, patchTopLevelChannelConfigSection, promptSingleChannelSecretInput, setSetupChannelEnabled, splitSetupEntries } from "openclaw/plugin-sdk/setup";
40
41
  //#region extensions/feishu/src/approval-auth.ts
41
42
  function normalizeFeishuApproverId(value) {
@@ -212,7 +213,7 @@ const FeishuSharedConfigShape = {
212
213
  textChunkLimit: z.number().int().positive().optional(),
213
214
  mediaMaxMb: z.number().positive().optional(),
214
215
  httpTimeoutMs: z.number().int().positive().max(3e5).optional(),
215
- heartbeat: ChannelHeartbeatVisibilitySchema,
216
+ heartbeatVisibility: ChannelHeartbeatVisibilitySchema,
216
217
  renderMode: RenderModeSchema,
217
218
  streaming: FeishuStreamingSchema,
218
219
  tools: FeishuToolsConfigSchema,
@@ -1232,6 +1233,10 @@ const feishuSetupAdapter = {
1232
1233
  return setFeishuNamedAccountEnabled$1(cfg, accountId, true);
1233
1234
  }
1234
1235
  };
1236
+ const feishuSetupContract = defineChannelSetupContract({
1237
+ fields: {},
1238
+ legacyAdapter: feishuSetupAdapter
1239
+ });
1235
1240
  //#endregion
1236
1241
  //#region extensions/feishu/src/setup-surface.ts
1237
1242
  const t = createSetupTranslator();
@@ -1371,7 +1376,7 @@ function applyNewAppSecurityPolicy(cfg, accountId, openId, groupPolicy) {
1371
1376
  next = patchFeishuConfig(next, accountId, groupPatch);
1372
1377
  return next;
1373
1378
  }
1374
- const loadAppRegistrationModule = createLazyRuntimeModule(() => import("./app-registration-BzkyrVZu.js"));
1379
+ const loadAppRegistrationModule = createLazyRuntimeModule(() => import("./app-registration-cN1bVV6s.js"));
1375
1380
  async function promptFeishuDomain(params) {
1376
1381
  return await params.prompter.select({
1377
1382
  message: t("wizard.feishu.domainPrompt"),
@@ -1596,7 +1601,7 @@ const feishuSetupWizard = {
1596
1601
  });
1597
1602
  let probeResult = null;
1598
1603
  if (configured && account.configured) try {
1599
- const { probeFeishu } = await import("./probe-BgboTHIn.js").then((n) => n.n);
1604
+ const { probeFeishu } = await import("./probe-Za1kgUvx.js").then((n) => n.n);
1600
1605
  probeResult = await probeFeishu(account);
1601
1606
  } catch {}
1602
1607
  if (!configured) return [formatFeishuStatusLine("needs-credentials")];
@@ -1668,7 +1673,7 @@ const meta = {
1668
1673
  order: 70,
1669
1674
  preferSessionLookupForAnnounceTarget: true
1670
1675
  };
1671
- const loadFeishuChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-CVIzo2dV.js"), "feishuChannelRuntime");
1676
+ const loadFeishuChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-B5yAAvbT.js"), "feishuChannelRuntime");
1672
1677
  function toFeishuMessageSendResult(result, kind) {
1673
1678
  const receipt = result.receipt ?? createFeishuSendReceipt({
1674
1679
  messageId: result.messageId,
@@ -1712,7 +1717,7 @@ const feishuMessageAdapter = defineChannelMessageAdapter({
1712
1717
  }
1713
1718
  });
1714
1719
  async function createFeishuActionClient(account) {
1715
- const { createFeishuClient } = await import("./client-87BmeMpj.js").then((n) => n.t);
1720
+ const { createFeishuClient } = await import("./client-Dee7cKsS.js").then((n) => n.t);
1716
1721
  return createFeishuClient(account);
1717
1722
  }
1718
1723
  async function resolveFeishuChatTypeById(params) {
@@ -1933,7 +1938,8 @@ function readFirstString(params, keys, fallback) {
1933
1938
  }
1934
1939
  const UNRESOLVED_RESPONSE_PREFIX_VAR_PATTERN = /\{[a-zA-Z][a-zA-Z0-9.]*\}/;
1935
1940
  function resolveFeishuMessageActionResponsePrefix(ctx) {
1936
- const configured = ctx.cfg.messages?.responsePrefix;
1941
+ const channel = ctx.cfg.channels?.feishu;
1942
+ const configured = (ctx.accountId ? channel?.accounts?.[ctx.accountId]?.responsePrefix : void 0) ?? channel?.responsePrefix ?? (channel === void 0 ? ctx.cfg.messages?.responsePrefix : void 0);
1937
1943
  if (!configured) return;
1938
1944
  const agentId = (ctx.agentId?.trim() || "main").toLowerCase();
1939
1945
  const identityName = ctx.cfg.agents?.list?.find((agent) => agent.id.trim().toLowerCase() === agentId)?.identity?.name?.trim();
@@ -2687,6 +2693,7 @@ const feishuPlugin = createChatChannelPlugin({
2687
2693
  });
2688
2694
  } },
2689
2695
  setup: feishuSetupAdapter,
2696
+ setupContract: feishuSetupContract,
2690
2697
  setupWizard: feishuSetupWizard,
2691
2698
  messaging: {
2692
2699
  targetPrefixes: ["feishu", "lark"],
@@ -2757,7 +2764,7 @@ const feishuPlugin = createChatChannelPlugin({
2757
2764
  })
2758
2765
  }),
2759
2766
  gateway: { startAccount: async (ctx) => {
2760
- const { monitorFeishuProvider } = await import("./monitor-BVQf7-Bl.js");
2767
+ const { monitorFeishuProvider } = await import("./monitor-8CLu6myv.js");
2761
2768
  const account = resolveFeishuRuntimeAccount({
2762
2769
  cfg: ctx.cfg,
2763
2770
  accountId: ctx.accountId
@@ -1,2 +1,2 @@
1
- import { t as feishuPlugin } from "./channel-BdnXYU6g.js";
1
+ import { t as feishuPlugin } from "./channel-DB1x6UJX.js";
2
2
  export { feishuPlugin };
@@ -1,10 +1,10 @@
1
1
  import { o as resolveFeishuAccount, s as resolveFeishuRuntimeAccount, v as parseFeishuCommentTarget } from "./accounts-BDoGHJDk.js";
2
- import { c as isFeishuCardWithinEnvelope, l as listFeishuDirectoryGroups, o as assertFeishuCardWithinEnvelope, s as buildFeishuPresentationCardElements, u as listFeishuDirectoryPeers } from "./channel-BdnXYU6g.js";
2
+ import { c as isFeishuCardWithinEnvelope, l as listFeishuDirectoryGroups, o as assertFeishuCardWithinEnvelope, s as buildFeishuPresentationCardElements, u as listFeishuDirectoryPeers } from "./channel-DB1x6UJX.js";
3
3
  import { a as readNativeFeishuCardJson, d as chunkFeishuPostMarkdown, f as materializeFeishuPostMarkdownSoftBreaks, o as resolveFeishuCardTemplate, s as sanitizeNativeFeishuCard, u as chunkFeishuMarkdown } from "./send-result-DfE5Fhz6.js";
4
- import { r as createFeishuClient } from "./client-87BmeMpj.js";
5
- import { c as buildFeishuDirectChatMembers, d as getFeishuMemberInfo, l as getChatInfo, r as cleanupAmbientCommentTypingReaction, s as assertFeishuChatMember, t as deliverCommentThreadText, u as getChatMembers } from "./drive-BHv8WW9i.js";
6
- import { _ as buildFeishuMediaFallbackText, a as sendMarkdownCardFeishu, h as shouldSuppressFeishuTextForVoiceMedia, i as sendCardFeishu, m as sendMediaFeishu, n as getMessageFeishu, o as sendMessageFeishu, s as sendStructuredCardFeishu, t as editMessageFeishu, y as resolveFeishuIdentityHeaderTitle } from "./send-DcrXbqqA.js";
7
- import { t as probeFeishu } from "./probe-BgboTHIn.js";
4
+ import { r as createFeishuClient } from "./client-Dee7cKsS.js";
5
+ import { c as buildFeishuDirectChatMembers, d as getFeishuMemberInfo, l as getChatInfo, r as cleanupAmbientCommentTypingReaction, s as assertFeishuChatMember, t as deliverCommentThreadText, u as getChatMembers } from "./drive-_zrcOxzS.js";
6
+ import { _ as buildFeishuMediaFallbackText, a as getMessageFeishu, c as sendMarkdownCardFeishu, i as editMessageFeishu, l as sendMessageFeishu, n as sendMediaFeishu, r as shouldSuppressFeishuTextForVoiceMedia, s as sendCardFeishu, u as sendStructuredCardFeishu, y as resolveFeishuIdentityHeaderTitle } from "./media-CRJunSRr.js";
7
+ import { t as probeFeishu } from "./probe-Za1kgUvx.js";
8
8
  import { createReplyToFanout } from "openclaw/plugin-sdk/channel-outbound";
9
9
  import { legacyInteractiveReplyToPresentation, normalizeLegacyInteractiveReply, normalizeMessagePresentation, renderMessagePresentationFallbackText, resolveLegacyInteractiveTextFallback } from "openclaw/plugin-sdk/interactive-runtime";
10
10
  import { isRecord, normalizeLowercaseStringOrEmpty, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -62,6 +62,67 @@ function setRequestUserAgent(req) {
62
62
  return req;
63
63
  }
64
64
  Lark.defaultHttpInstance.interceptors?.request?.use(setRequestUserAgent);
65
+ function isRecord(value) {
66
+ return typeof value === "object" && value !== null && !Array.isArray(value);
67
+ }
68
+ function readHeader(headers, name) {
69
+ if (!isRecord(headers)) return;
70
+ const normalizedName = name.toLowerCase();
71
+ for (const [key, value] of Object.entries(headers)) {
72
+ if (key.toLowerCase() !== normalizedName) continue;
73
+ if (typeof value === "string") return value;
74
+ if (Array.isArray(value)) {
75
+ const first = value.find((entry) => typeof entry === "string");
76
+ return typeof first === "string" ? first : void 0;
77
+ }
78
+ }
79
+ }
80
+ function isMultipartFormRequest(opts) {
81
+ return /^multipart\/form-data(?:;|$)/i.test(readHeader(opts.headers, "content-type") ?? "");
82
+ }
83
+ const FEISHU_MESSAGE_MEDIA_UPLOAD_PATHS = /* @__PURE__ */ new Set(["/open-apis/im/v1/files", "/open-apis/im/v1/images"]);
84
+ function isFeishuMessageMediaUploadRequest(opts, data) {
85
+ if (typeof opts.url !== "string" || opts.method?.toUpperCase() !== "POST") return false;
86
+ let pathname;
87
+ try {
88
+ pathname = new URL(opts.url).pathname;
89
+ } catch {
90
+ return false;
91
+ }
92
+ return FEISHU_MESSAGE_MEDIA_UPLOAD_PATHS.has(pathname) && (Buffer.isBuffer(data.file) || Buffer.isBuffer(data.image));
93
+ }
94
+ function stringifyMultipartFieldValue(value) {
95
+ switch (typeof value) {
96
+ case "string": return value;
97
+ case "number":
98
+ case "boolean":
99
+ case "bigint": return String(value);
100
+ default: return;
101
+ }
102
+ }
103
+ function bufferToBlobPart(value) {
104
+ const bytes = new Uint8Array(value.byteLength);
105
+ bytes.set(value);
106
+ return bytes;
107
+ }
108
+ function normalizeMultipartUploadData(opts) {
109
+ if (!isMultipartFormRequest(opts) || !isRecord(opts.data) || !isFeishuMessageMediaUploadRequest(opts, opts.data)) return opts;
110
+ const form = new FormData();
111
+ const fileName = typeof opts.data.file_name === "string" && opts.data.file_name ? opts.data.file_name : void 0;
112
+ for (const [key, value] of Object.entries(opts.data)) {
113
+ if (value === void 0 || value === null) continue;
114
+ if (Buffer.isBuffer(value)) {
115
+ form.append(key, new Blob([bufferToBlobPart(value)]), key === "file" && fileName ? fileName : `${key}.bin`);
116
+ continue;
117
+ }
118
+ const fieldValue = stringifyMultipartFieldValue(value);
119
+ if (fieldValue !== void 0) form.append(key, fieldValue);
120
+ }
121
+ return {
122
+ ...opts,
123
+ data: form
124
+ };
125
+ }
65
126
  function isManagedProxyActive() {
66
127
  return process.env["OPENCLAW_PROXY_ACTIVE"] === "1";
67
128
  }
@@ -118,7 +179,7 @@ function createFeishuHttpInstance(defaultTimeoutMs) {
118
179
  return next;
119
180
  }
120
181
  return {
121
- request: async (opts) => base.request(await injectRequestOptions(opts)),
182
+ request: async (opts) => base.request(await injectRequestOptions(normalizeMultipartUploadData(opts))),
122
183
  get: async (url, opts) => base.get(url, await injectRequestOptions(opts)),
123
184
  post: async (url, data, opts) => base.post(url, data, await injectRequestOptions(opts)),
124
185
  put: async (url, data, opts) => base.put(url, data, await injectRequestOptions(opts)),
@@ -1,4 +1,4 @@
1
- import { asObjectRecord, defineChannelAliasMigration } from "openclaw/plugin-sdk/runtime-doctor";
1
+ import { asObjectRecord, defineChannelAliasMigration, normalizeChannelConfigEntries } from "openclaw/plugin-sdk/runtime-doctor";
2
2
  //#region extensions/feishu/src/doctor-contract.ts
3
3
  const streamingAliasMigration = defineChannelAliasMigration({
4
4
  channelId: "feishu",
@@ -10,6 +10,21 @@ const LEGACY_COALESCE_FIELDS = [
10
10
  "minDelayMs",
11
11
  "maxDelayMs"
12
12
  ];
13
+ const LEGACY_HEARTBEAT_FIELDS = ["visibility", "intervalMs"];
14
+ function sanitizeLegacyHeartbeatFields(params) {
15
+ const heartbeat = asObjectRecord(params.entry.heartbeat);
16
+ if (!heartbeat || Object.keys(heartbeat).length > 0 && !LEGACY_HEARTBEAT_FIELDS.some((field) => Object.hasOwn(heartbeat, field))) return {
17
+ entry: params.entry,
18
+ changed: false
19
+ };
20
+ const next = { ...params.entry };
21
+ delete next.heartbeat;
22
+ params.changes.push(`Removed ${params.pathPrefix}.heartbeat (legacy Feishu fields were never read by runtime).`);
23
+ return {
24
+ entry: next,
25
+ changed: true
26
+ };
27
+ }
13
28
  function sanitizeLegacyCoalesceFields(params) {
14
29
  const streaming = asObjectRecord(params.entry.streaming);
15
30
  const block = asObjectRecord(streaming?.block);
@@ -41,49 +56,22 @@ function sanitizeLegacyCoalesceFields(params) {
41
56
  };
42
57
  }
43
58
  function sanitizeFeishuCoalesce(cfg, changes) {
44
- const channels = cfg.channels;
45
- const entry = asObjectRecord(channels?.feishu);
46
- if (!entry) return cfg;
47
- const root = sanitizeLegacyCoalesceFields({
48
- entry,
49
- pathPrefix: "channels.feishu",
50
- changes
51
- });
52
- let updated = root.entry;
53
- let changed = root.changed;
54
- const accounts = asObjectRecord(updated.accounts);
55
- if (accounts) {
56
- let accountsChanged = false;
57
- const nextAccounts = { ...accounts };
58
- for (const [accountId, rawAccount] of Object.entries(accounts)) {
59
- const account = asObjectRecord(rawAccount);
60
- if (!account) continue;
61
- const sanitized = sanitizeLegacyCoalesceFields({
62
- entry: account,
63
- pathPrefix: `channels.feishu.accounts.${accountId}`,
64
- changes
59
+ return normalizeChannelConfigEntries({
60
+ cfg,
61
+ channelId: "feishu",
62
+ changes,
63
+ normalizeEntry: (params) => {
64
+ const coalesce = sanitizeLegacyCoalesceFields(params);
65
+ const heartbeat = sanitizeLegacyHeartbeatFields({
66
+ ...params,
67
+ entry: coalesce.entry
65
68
  });
66
- if (sanitized.changed) {
67
- nextAccounts[accountId] = sanitized.entry;
68
- accountsChanged = true;
69
- }
70
- }
71
- if (accountsChanged) {
72
- updated = {
73
- ...updated,
74
- accounts: nextAccounts
69
+ return {
70
+ entry: heartbeat.entry,
71
+ changed: coalesce.changed || heartbeat.changed
75
72
  };
76
- changed = true;
77
73
  }
78
- }
79
- if (!changed) return cfg;
80
- return {
81
- ...cfg,
82
- channels: {
83
- ...channels,
84
- feishu: updated
85
- }
86
- };
74
+ }).config;
87
75
  }
88
76
  const legacyConfigRules = streamingAliasMigration.legacyConfigRules;
89
77
  function normalizeCompatibilityConfig({ cfg }) {
@@ -1,2 +1,2 @@
1
- import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-DXH5hux1.js";
1
+ import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-Cw5sdjOm.js";
2
2
  export { legacyConfigRules, normalizeCompatibilityConfig };
@@ -1,6 +1,6 @@
1
1
  import { c as encodeQuery, d as isRecord$1, i as listFeishuAccountIds, l as extractReplyText, m as readString, o as resolveFeishuAccount, r as listEnabledFeishuAccounts, s as resolveFeishuRuntimeAccount, u as formatFeishuApiError, v as parseFeishuCommentTarget } from "./accounts-BDoGHJDk.js";
2
2
  import { A as resolveFeishuChatType, b as resolveFeishuChatReadPreliminaryAuthorization, h as authorizeFeishuChatMemberRead, m as assertFeishuChatReadAllowed } from "./send-result-DfE5Fhz6.js";
3
- import { r as createFeishuClient } from "./client-87BmeMpj.js";
3
+ import { r as createFeishuClient } from "./client-Dee7cKsS.js";
4
4
  import { optionalPositiveIntegerSchema } from "openclaw/plugin-sdk/channel-actions";
5
5
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
6
6
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";