@lark-project/openclaw-lark-project 2026.3.133 → 2026.3.161

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 (148) hide show
  1. package/dist/index.js +28 -28
  2. package/dist/src/card/builder.js +1 -1
  3. package/dist/src/card/cardkit.js +4 -4
  4. package/dist/src/card/flush-controller.js +1 -1
  5. package/dist/src/card/reply-dispatcher.js +9 -9
  6. package/dist/src/card/streaming-card-controller.js +10 -10
  7. package/dist/src/card/unavailable-guard.js +3 -3
  8. package/dist/src/channel/config-adapter.js +2 -2
  9. package/dist/src/channel/directory.js +3 -3
  10. package/dist/src/channel/event-handlers.js +8 -8
  11. package/dist/src/channel/monitor.js +6 -6
  12. package/dist/src/channel/onboarding-migrate.js +1 -1
  13. package/dist/src/channel/onboarding.js +4 -4
  14. package/dist/src/channel/plugin.js +13 -13
  15. package/dist/src/channel/probe.js +1 -1
  16. package/dist/src/commands/auth.js +8 -8
  17. package/dist/src/commands/diagnose.js +5 -5
  18. package/dist/src/commands/doctor.js +9 -9
  19. package/dist/src/commands/index.js +4 -4
  20. package/dist/src/core/api-error.js +2 -2
  21. package/dist/src/core/app-owner-fallback.js +2 -2
  22. package/dist/src/core/app-scope-checker.js +2 -2
  23. package/dist/src/core/chat-info-cache.js +2 -2
  24. package/dist/src/core/device-flow.js +2 -2
  25. package/dist/src/core/feishu-fetch.js +1 -1
  26. package/dist/src/core/lark-client.js +5 -5
  27. package/dist/src/core/lark-logger.js +2 -2
  28. package/dist/src/core/message-unavailable.js +3 -3
  29. package/dist/src/core/owner-policy.js +1 -1
  30. package/dist/src/core/project-auth.js +3 -3
  31. package/dist/src/core/project-oauth-flow.js +1 -1
  32. package/dist/src/core/project-token-store.js +2 -2
  33. package/dist/src/core/raw-request.js +1 -1
  34. package/dist/src/core/scope-manager.js +1 -1
  35. package/dist/src/core/security-check.js +1 -1
  36. package/dist/src/core/token-store.js +1 -1
  37. package/dist/src/core/tool-client.js +12 -12
  38. package/dist/src/core/uat-client.js +5 -5
  39. package/dist/src/messaging/converters/audio.js +2 -2
  40. package/dist/src/messaging/converters/calendar.js +1 -1
  41. package/dist/src/messaging/converters/content-converter.js +3 -3
  42. package/dist/src/messaging/converters/file.js +1 -1
  43. package/dist/src/messaging/converters/folder.js +1 -1
  44. package/dist/src/messaging/converters/hongbao.js +1 -1
  45. package/dist/src/messaging/converters/image.js +1 -1
  46. package/dist/src/messaging/converters/index.js +19 -19
  47. package/dist/src/messaging/converters/interactive/card-converter.js +3 -3
  48. package/dist/src/messaging/converters/interactive/index.js +3 -3
  49. package/dist/src/messaging/converters/location.js +1 -1
  50. package/dist/src/messaging/converters/merge-forward.js +2 -2
  51. package/dist/src/messaging/converters/post.js +2 -2
  52. package/dist/src/messaging/converters/share.js +1 -1
  53. package/dist/src/messaging/converters/sticker.js +1 -1
  54. package/dist/src/messaging/converters/system.js +1 -1
  55. package/dist/src/messaging/converters/text.js +2 -2
  56. package/dist/src/messaging/converters/todo.js +1 -1
  57. package/dist/src/messaging/converters/unknown.js +1 -1
  58. package/dist/src/messaging/converters/video-chat.js +1 -1
  59. package/dist/src/messaging/converters/video.js +2 -2
  60. package/dist/src/messaging/converters/vote.js +1 -1
  61. package/dist/src/messaging/inbound/dispatch-builders.js +2 -2
  62. package/dist/src/messaging/inbound/dispatch-commands.js +5 -5
  63. package/dist/src/messaging/inbound/dispatch-context.js +3 -3
  64. package/dist/src/messaging/inbound/dispatch.js +9 -9
  65. package/dist/src/messaging/inbound/enrich.js +5 -5
  66. package/dist/src/messaging/inbound/gate-effects.js +2 -2
  67. package/dist/src/messaging/inbound/gate.js +4 -4
  68. package/dist/src/messaging/inbound/handler.js +10 -10
  69. package/dist/src/messaging/inbound/media-resolver.js +2 -2
  70. package/dist/src/messaging/inbound/mention.js +1 -1
  71. package/dist/src/messaging/inbound/parse-io.js +2 -2
  72. package/dist/src/messaging/inbound/parse.js +6 -6
  73. package/dist/src/messaging/inbound/permission.js +2 -2
  74. package/dist/src/messaging/inbound/policy.js +1 -1
  75. package/dist/src/messaging/inbound/reaction-handler.js +7 -7
  76. package/dist/src/messaging/inbound/user-name-cache.js +2 -2
  77. package/dist/src/messaging/outbound/actions.js +6 -6
  78. package/dist/src/messaging/outbound/chat-manage.js +1 -1
  79. package/dist/src/messaging/outbound/deliver.js +6 -6
  80. package/dist/src/messaging/outbound/fetch.js +2 -2
  81. package/dist/src/messaging/outbound/forward.js +2 -2
  82. package/dist/src/messaging/outbound/media.js +4 -4
  83. package/dist/src/messaging/outbound/outbound.js +3 -3
  84. package/dist/src/messaging/outbound/reactions.js +1 -1
  85. package/dist/src/messaging/outbound/send.js +5 -5
  86. package/dist/src/messaging/outbound/typing.js +4 -4
  87. package/dist/src/messaging/shared/message-lookup.js +5 -5
  88. package/dist/src/tools/auto-auth.js +17 -13
  89. package/dist/src/tools/auto-auth.js.map +2 -2
  90. package/dist/src/tools/helpers.js +4 -4
  91. package/dist/src/tools/mcp/doc/create.js +1 -1
  92. package/dist/src/tools/mcp/doc/fetch.js +1 -1
  93. package/dist/src/tools/mcp/doc/index.js +6 -6
  94. package/dist/src/tools/mcp/doc/update.js +1 -1
  95. package/dist/src/tools/mcp/project/index.js +4 -4
  96. package/dist/src/tools/mcp/project/tools.js +5 -5
  97. package/dist/src/tools/mcp/shared.js +3 -3
  98. package/dist/src/tools/oapi/bitable/app-table-field.js +1 -1
  99. package/dist/src/tools/oapi/bitable/app-table-record.js +1 -1
  100. package/dist/src/tools/oapi/bitable/app-table-view.js +1 -1
  101. package/dist/src/tools/oapi/bitable/app-table.js +1 -1
  102. package/dist/src/tools/oapi/bitable/app.js +1 -1
  103. package/dist/src/tools/oapi/bitable/index.js +5 -5
  104. package/dist/src/tools/oapi/calendar/calendar.js +1 -1
  105. package/dist/src/tools/oapi/calendar/event-attendee.js +1 -1
  106. package/dist/src/tools/oapi/calendar/event.js +1 -1
  107. package/dist/src/tools/oapi/calendar/freebusy.js +1 -1
  108. package/dist/src/tools/oapi/calendar/index.js +4 -4
  109. package/dist/src/tools/oapi/chat/chat.js +1 -1
  110. package/dist/src/tools/oapi/chat/index.js +2 -2
  111. package/dist/src/tools/oapi/chat/members.js +1 -1
  112. package/dist/src/tools/oapi/common/get-user.js +1 -1
  113. package/dist/src/tools/oapi/common/index.js +2 -2
  114. package/dist/src/tools/oapi/common/search-user.js +1 -1
  115. package/dist/src/tools/oapi/drive/doc-comments.js +1 -1
  116. package/dist/src/tools/oapi/drive/doc-media.js +2 -2
  117. package/dist/src/tools/oapi/drive/file.js +1 -1
  118. package/dist/src/tools/oapi/drive/index.js +5 -5
  119. package/dist/src/tools/oapi/helpers.js +7 -7
  120. package/dist/src/tools/oapi/im/format-messages.js +4 -4
  121. package/dist/src/tools/oapi/im/index.js +3 -3
  122. package/dist/src/tools/oapi/im/message-read.js +4 -4
  123. package/dist/src/tools/oapi/im/message.js +1 -1
  124. package/dist/src/tools/oapi/im/resource.js +1 -1
  125. package/dist/src/tools/oapi/im/user-name-uat.js +1 -1
  126. package/dist/src/tools/oapi/index.js +11 -11
  127. package/dist/src/tools/oapi/search/doc-search.js +1 -1
  128. package/dist/src/tools/oapi/search/index.js +3 -3
  129. package/dist/src/tools/oapi/sheets/index.js +3 -3
  130. package/dist/src/tools/oapi/sheets/sheet.js +1 -1
  131. package/dist/src/tools/oapi/task/comment.js +1 -1
  132. package/dist/src/tools/oapi/task/index.js +4 -4
  133. package/dist/src/tools/oapi/task/subtask.js +1 -1
  134. package/dist/src/tools/oapi/task/task.js +1 -1
  135. package/dist/src/tools/oapi/task/tasklist.js +1 -1
  136. package/dist/src/tools/oapi/wiki/index.js +4 -4
  137. package/dist/src/tools/oapi/wiki/space-node.js +1 -1
  138. package/dist/src/tools/oapi/wiki/space.js +1 -1
  139. package/dist/src/tools/oauth-batch-auth.js +10 -10
  140. package/dist/src/tools/oauth-cards.js +89 -0
  141. package/dist/src/tools/oauth-cards.js.map +2 -2
  142. package/dist/src/tools/oauth.js +15 -15
  143. package/dist/src/tools/onboarding-auth.js +7 -7
  144. package/dist/src/tools/project-oauth.js +262 -94
  145. package/dist/src/tools/project-oauth.js.map +3 -3
  146. package/dist/src/tools/tat/im/index.js +1 -1
  147. package/dist/src/tools/tat/im/resource.js +1 -1
  148. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,26 +1,26 @@
1
1
  import { emptyPluginConfigSchema } from "openclaw/plugin-sdk";
2
- import { feishuPlugin } from "./src/channel/plugin";
3
- import { LarkClient } from "./src/core/lark-client";
4
- import { registerOapiTools } from "./src/tools/oapi/index";
5
- import { registerFeishuMcpDocTools } from "./src/tools/mcp/doc/index";
6
- import { registerFeishuMcpProjectTools } from "./src/tools/mcp/project/index";
7
- import { registerFeishuOAuthTool } from "./src/tools/oauth";
8
- import { registerFeishuOAuthBatchAuthTool } from "./src/tools/oauth-batch-auth";
9
- import { registerFeishuProjectOAuthTool } from "./src/tools/project-oauth";
2
+ import { feishuPlugin } from "./src/channel/plugin.js";
3
+ import { LarkClient } from "./src/core/lark-client.js";
4
+ import { registerOapiTools } from "./src/tools/oapi/index.js";
5
+ import { registerFeishuMcpDocTools } from "./src/tools/mcp/doc/index.js";
6
+ import { registerFeishuMcpProjectTools } from "./src/tools/mcp/project/index.js";
7
+ import { registerFeishuOAuthTool } from "./src/tools/oauth.js";
8
+ import { registerFeishuOAuthBatchAuthTool } from "./src/tools/oauth-batch-auth.js";
9
+ import { registerFeishuProjectOAuthTool } from "./src/tools/project-oauth.js";
10
10
  import {
11
11
  runDiagnosis,
12
12
  formatDiagReportCli,
13
13
  traceByMessageId,
14
14
  formatTraceOutput,
15
15
  analyzeTrace
16
- } from "./src/commands/diagnose";
17
- import { registerCommands } from "./src/commands/index";
18
- import { larkLogger } from "./src/core/lark-logger";
19
- import { emitSecurityWarnings } from "./src/core/security-check";
16
+ } from "./src/commands/diagnose.js";
17
+ import { registerCommands } from "./src/commands/index.js";
18
+ import { larkLogger } from "./src/core/lark-logger.js";
19
+ import { emitSecurityWarnings } from "./src/core/security-check.js";
20
20
  const log = larkLogger("plugin");
21
- import { monitorFeishuProvider } from "./src/channel/monitor";
22
- import { sendMessageFeishu, sendCardFeishu, updateCardFeishu, editMessageFeishu } from "./src/messaging/outbound/send";
23
- import { getMessageFeishu } from "./src/messaging/outbound/fetch";
21
+ import { monitorFeishuProvider } from "./src/channel/monitor.js";
22
+ import { sendMessageFeishu, sendCardFeishu, updateCardFeishu, editMessageFeishu } from "./src/messaging/outbound/send.js";
23
+ import { getMessageFeishu } from "./src/messaging/outbound/fetch.js";
24
24
  import {
25
25
  uploadImageLark,
26
26
  uploadFileLark,
@@ -28,28 +28,28 @@ import {
28
28
  sendFileLark,
29
29
  sendAudioLark,
30
30
  uploadAndSendMediaLark
31
- } from "./src/messaging/outbound/media";
31
+ } from "./src/messaging/outbound/media.js";
32
32
  import {
33
33
  sendTextLark,
34
34
  sendCardLark,
35
35
  sendMediaLark
36
- } from "./src/messaging/outbound/deliver";
37
- import { probeFeishu } from "./src/channel/probe";
36
+ } from "./src/messaging/outbound/deliver.js";
37
+ import { probeFeishu } from "./src/channel/probe.js";
38
38
  import {
39
39
  addReactionFeishu,
40
40
  removeReactionFeishu,
41
41
  listReactionsFeishu,
42
42
  FeishuEmoji,
43
43
  VALID_FEISHU_EMOJI_TYPES
44
- } from "./src/messaging/outbound/reactions";
45
- import { forwardMessageFeishu } from "./src/messaging/outbound/forward";
44
+ } from "./src/messaging/outbound/reactions.js";
45
+ import { forwardMessageFeishu } from "./src/messaging/outbound/forward.js";
46
46
  import {
47
47
  updateChatFeishu,
48
48
  addChatMembersFeishu,
49
49
  removeChatMembersFeishu,
50
50
  listChatMembersFeishu
51
- } from "./src/messaging/outbound/chat-manage";
52
- import { feishuMessageActions } from "./src/messaging/outbound/actions";
51
+ } from "./src/messaging/outbound/chat-manage.js";
52
+ import { feishuMessageActions } from "./src/messaging/outbound/actions.js";
53
53
  import {
54
54
  mentionedBot,
55
55
  nonBotMentions,
@@ -60,12 +60,12 @@ import {
60
60
  formatMentionAllForCard,
61
61
  buildMentionedMessage,
62
62
  buildMentionedCardContent
63
- } from "./src/messaging/inbound/mention";
64
- import { feishuPlugin as feishuPlugin2 } from "./src/channel/plugin";
65
- import { handleFeishuReaction } from "./src/messaging/inbound/reaction-handler";
66
- import { parseMessageEvent } from "./src/messaging/inbound/parse";
67
- import { checkMessageGate } from "./src/messaging/inbound/gate";
68
- import { isMessageExpired } from "./src/messaging/inbound/dedup";
63
+ } from "./src/messaging/inbound/mention.js";
64
+ import { feishuPlugin as feishuPlugin2 } from "./src/channel/plugin.js";
65
+ import { handleFeishuReaction } from "./src/messaging/inbound/reaction-handler.js";
66
+ import { parseMessageEvent } from "./src/messaging/inbound/parse.js";
67
+ import { checkMessageGate } from "./src/messaging/inbound/gate.js";
68
+ import { isMessageExpired } from "./src/messaging/inbound/dedup.js";
69
69
  const plugin = {
70
70
  id: "feishu-openclaw-plugin",
71
71
  name: "Feishu",
@@ -1,4 +1,4 @@
1
- import { optimizeMarkdownStyle } from "./markdown-style";
1
+ import { optimizeMarkdownStyle } from "./markdown-style.js";
2
2
  const STREAMING_ELEMENT_ID = "streaming_content";
3
3
  const REASONING_ELEMENT_ID = "reasoning_content";
4
4
  const REASONING_PREFIX = "Reasoning:\n";
@@ -1,7 +1,7 @@
1
- import { LarkClient } from "../core/lark-client";
2
- import { larkLogger } from "../core/lark-logger";
3
- import { normalizeFeishuTarget, normalizeMessageId, resolveReceiveIdType } from "../core/targets";
4
- import { runWithMessageUnavailableGuard } from "../core/message-unavailable";
1
+ import { LarkClient } from "../core/lark-client.js";
2
+ import { larkLogger } from "../core/lark-logger.js";
3
+ import { normalizeFeishuTarget, normalizeMessageId, resolveReceiveIdType } from "../core/targets.js";
4
+ import { runWithMessageUnavailableGuard } from "../core/message-unavailable.js";
5
5
  const log = larkLogger("card/cardkit");
6
6
  function logCardKitResponse(params) {
7
7
  const { resp, api, context } = params;
@@ -1,4 +1,4 @@
1
- import { THROTTLE_CONSTANTS } from "./reply-dispatcher-types";
1
+ import { THROTTLE_CONSTANTS } from "./reply-dispatcher-types.js";
2
2
  class FlushController {
3
3
  constructor(doFlush) {
4
4
  this.doFlush = doFlush;
@@ -3,15 +3,15 @@ import {
3
3
  createTypingCallbacks,
4
4
  logTypingFailure
5
5
  } from "openclaw/plugin-sdk";
6
- import { getLarkAccount } from "../core/accounts";
7
- import { resolveFooterConfig } from "../core/footer-config";
8
- import { LarkClient } from "../core/lark-client";
9
- import { larkLogger } from "../core/lark-logger";
10
- import { sendMessageFeishu, sendMarkdownCardFeishu } from "../messaging/outbound/send";
11
- import { addTypingIndicator, removeTypingIndicator } from "../messaging/outbound/typing";
12
- import { resolveReplyMode, expandAutoMode, shouldUseCard } from "./reply-mode";
13
- import { StreamingCardController } from "./streaming-card-controller";
14
- import { UnavailableGuard } from "./unavailable-guard";
6
+ import { getLarkAccount } from "../core/accounts.js";
7
+ import { resolveFooterConfig } from "../core/footer-config.js";
8
+ import { LarkClient } from "../core/lark-client.js";
9
+ import { larkLogger } from "../core/lark-logger.js";
10
+ import { sendMessageFeishu, sendMarkdownCardFeishu } from "../messaging/outbound/send.js";
11
+ import { addTypingIndicator, removeTypingIndicator } from "../messaging/outbound/typing.js";
12
+ import { resolveReplyMode, expandAutoMode, shouldUseCard } from "./reply-mode.js";
13
+ import { StreamingCardController } from "./streaming-card-controller.js";
14
+ import { UnavailableGuard } from "./unavailable-guard.js";
15
15
  const log = larkLogger("card/reply-dispatcher");
16
16
  function createFeishuReplyDispatcher(params) {
17
17
  const core = LarkClient.runtime;
@@ -1,25 +1,25 @@
1
1
  import { SILENT_REPLY_TOKEN } from "openclaw/plugin-sdk";
2
- import { extractLarkApiCode } from "../core/api-error";
3
- import { larkLogger } from "../core/lark-logger";
4
- import { sendCardFeishu, updateCardFeishu } from "../messaging/outbound/send";
2
+ import { extractLarkApiCode } from "../core/api-error.js";
3
+ import { larkLogger } from "../core/lark-logger.js";
4
+ import { sendCardFeishu, updateCardFeishu } from "../messaging/outbound/send.js";
5
5
  import {
6
6
  createCardEntity,
7
7
  sendCardByCardId,
8
8
  streamCardContent,
9
9
  updateCardKitCard,
10
10
  setCardStreamingMode
11
- } from "./cardkit";
12
- import { buildCardContent, splitReasoningText, stripReasoningTags, STREAMING_ELEMENT_ID, toCardKit2 } from "./builder";
13
- import { optimizeMarkdownStyle } from "./markdown-style";
14
- import { registerShutdownHook } from "../core/shutdown-hooks";
15
- import { FlushController } from "./flush-controller";
16
- import { UnavailableGuard } from "./unavailable-guard";
11
+ } from "./cardkit.js";
12
+ import { buildCardContent, splitReasoningText, stripReasoningTags, STREAMING_ELEMENT_ID, toCardKit2 } from "./builder.js";
13
+ import { optimizeMarkdownStyle } from "./markdown-style.js";
14
+ import { registerShutdownHook } from "../core/shutdown-hooks.js";
15
+ import { FlushController } from "./flush-controller.js";
16
+ import { UnavailableGuard } from "./unavailable-guard.js";
17
17
  import {
18
18
  TERMINAL_PHASES,
19
19
  PHASE_TRANSITIONS,
20
20
  THROTTLE_CONSTANTS,
21
21
  EMPTY_REPLY_FALLBACK_TEXT
22
- } from "./reply-dispatcher-types";
22
+ } from "./reply-dispatcher-types.js";
23
23
  const log = larkLogger("card/streaming");
24
24
  const STREAMING_THINKING_CARD = {
25
25
  schema: "2.0",
@@ -1,12 +1,12 @@
1
- import { larkLogger } from "../core/lark-logger";
2
- import { extractLarkApiCode } from "../core/api-error";
1
+ import { larkLogger } from "../core/lark-logger.js";
2
+ import { extractLarkApiCode } from "../core/api-error.js";
3
3
  import {
4
4
  getMessageUnavailableState,
5
5
  isMessageUnavailable,
6
6
  isMessageUnavailableError,
7
7
  isTerminalMessageApiCode,
8
8
  markMessageUnavailable
9
- } from "../core/message-unavailable";
9
+ } from "../core/message-unavailable.js";
10
10
  const log = larkLogger("card/unavailable-guard");
11
11
  class UnavailableGuard {
12
12
  terminated = false;
@@ -1,6 +1,6 @@
1
1
  import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk";
2
- import { getLarkAccount, getLarkAccountIds } from "../core/accounts";
3
- import { collectIsolationWarnings } from "../core/security-check";
2
+ import { getLarkAccount, getLarkAccountIds } from "../core/accounts.js";
3
+ import { collectIsolationWarnings } from "../core/security-check.js";
4
4
  function mergeFeishuAccountConfig(cfg, accountId, patch) {
5
5
  const isDefault = !accountId || accountId === DEFAULT_ACCOUNT_ID;
6
6
  if (isDefault) {
@@ -1,6 +1,6 @@
1
- import { getLarkAccount } from "../core/accounts";
2
- import { LarkClient } from "../core/lark-client";
3
- import { normalizeFeishuTarget } from "../core/targets";
1
+ import { getLarkAccount } from "../core/accounts.js";
2
+ import { LarkClient } from "../core/lark-client.js";
3
+ import { normalizeFeishuTarget } from "../core/targets.js";
4
4
  function matchesQuery(id, name, query) {
5
5
  if (!query) return true;
6
6
  return id.toLowerCase().includes(query) || (name?.toLowerCase().includes(query) ?? false);
@@ -1,11 +1,11 @@
1
- import { handleFeishuMessage } from "../messaging/inbound/handler";
2
- import { handleFeishuReaction, resolveReactionContext } from "../messaging/inbound/reaction-handler";
3
- import { isMessageExpired } from "../messaging/inbound/dedup";
4
- import { withTicket } from "../core/lark-ticket";
5
- import { larkLogger } from "../core/lark-logger";
6
- import { handleCardAction } from "../tools/auto-auth";
7
- import { enqueueFeishuChatTask, buildQueueKey, hasActiveTask, getActiveDispatcher } from "./chat-queue";
8
- import { extractRawTextFromEvent, isLikelyAbortText } from "./abort-detect";
1
+ import { handleFeishuMessage } from "../messaging/inbound/handler.js";
2
+ import { handleFeishuReaction, resolveReactionContext } from "../messaging/inbound/reaction-handler.js";
3
+ import { isMessageExpired } from "../messaging/inbound/dedup.js";
4
+ import { withTicket } from "../core/lark-ticket.js";
5
+ import { larkLogger } from "../core/lark-logger.js";
6
+ import { handleCardAction } from "../tools/auto-auth.js";
7
+ import { enqueueFeishuChatTask, buildQueueKey, hasActiveTask, getActiveDispatcher } from "./chat-queue.js";
8
+ import { extractRawTextFromEvent, isLikelyAbortText } from "./abort-detect.js";
9
9
  const elog = larkLogger("channel/event-handlers");
10
10
  function isEventOwnershipValid(ctx, data) {
11
11
  const expectedAppId = ctx.lark.account.appId;
@@ -1,14 +1,14 @@
1
- import { getLarkAccount, getEnabledLarkAccounts } from "../core/accounts";
2
- import { LarkClient } from "../core/lark-client";
3
- import { MessageDedup } from "../messaging/inbound/dedup";
4
- import { larkLogger } from "../core/lark-logger";
5
- import { drainShutdownHooks } from "../core/shutdown-hooks";
1
+ import { getLarkAccount, getEnabledLarkAccounts } from "../core/accounts.js";
2
+ import { LarkClient } from "../core/lark-client.js";
3
+ import { MessageDedup } from "../messaging/inbound/dedup.js";
4
+ import { larkLogger } from "../core/lark-logger.js";
5
+ import { drainShutdownHooks } from "../core/shutdown-hooks.js";
6
6
  import {
7
7
  handleMessageEvent,
8
8
  handleReactionEvent,
9
9
  handleBotMembershipEvent,
10
10
  handleCardActionEvent
11
- } from "./event-handlers";
11
+ } from "./event-handlers.js";
12
12
  const mlog = larkLogger("channel/monitor");
13
13
  async function monitorSingleAccount(params) {
14
14
  const { account, runtime, abortSignal } = params;
@@ -1,4 +1,4 @@
1
- import { setFeishuGroups, setFeishuGroupAllowFrom } from "./onboarding-config";
1
+ import { setFeishuGroups, setFeishuGroupAllowFrom } from "./onboarding-config.js";
2
2
  async function migrateLegacyGroupAllowFrom(params) {
3
3
  let next = params.cfg;
4
4
  const { prompter } = params;
@@ -1,14 +1,14 @@
1
1
  import { DEFAULT_ACCOUNT_ID, formatDocsLink } from "openclaw/plugin-sdk";
2
- import { getLarkCredentials } from "../core/accounts";
3
- import { probeFeishu } from "./probe";
2
+ import { getLarkCredentials } from "../core/accounts.js";
3
+ import { probeFeishu } from "./probe.js";
4
4
  import {
5
5
  setFeishuDmPolicy,
6
6
  setFeishuAllowFrom,
7
7
  setFeishuGroupPolicy,
8
8
  setFeishuGroupAllowFrom,
9
9
  parseAllowFromInput
10
- } from "./onboarding-config";
11
- import { migrateLegacyGroupAllowFrom } from "./onboarding-migrate";
10
+ } from "./onboarding-config.js";
11
+ import { migrateLegacyGroupAllowFrom } from "./onboarding-migrate.js";
12
12
  const channel = "feishu";
13
13
  async function noteFeishuCredentialHelp(prompter) {
14
14
  await prompter.note(
@@ -1,22 +1,22 @@
1
1
  import { DEFAULT_ACCOUNT_ID, PAIRING_APPROVED_MESSAGE } from "openclaw/plugin-sdk";
2
- import { getLarkAccount, getLarkAccountIds, getDefaultLarkAccountId } from "../core/accounts";
2
+ import { getLarkAccount, getLarkAccountIds, getDefaultLarkAccountId } from "../core/accounts.js";
3
3
  import {
4
4
  listFeishuDirectoryPeers,
5
5
  listFeishuDirectoryGroups,
6
6
  listFeishuDirectoryPeersLive,
7
7
  listFeishuDirectoryGroupsLive
8
- } from "./directory";
9
- import { feishuOnboardingAdapter } from "./onboarding";
10
- import { feishuOutbound } from "../messaging/outbound/outbound";
11
- import { feishuMessageActions } from "../messaging/outbound/actions";
12
- import { resolveFeishuGroupToolPolicy } from "../messaging/inbound/policy";
13
- import { LarkClient } from "../core/lark-client";
14
- import { sendMessageFeishu } from "../messaging/outbound/send";
15
- import { normalizeFeishuTarget, looksLikeFeishuId } from "../core/targets";
16
- import { triggerOnboarding } from "../tools/onboarding-auth";
17
- import { setAccountEnabled, applyAccountConfig, deleteAccount, collectFeishuSecurityWarnings } from "./config-adapter";
18
- import { larkLogger } from "../core/lark-logger";
19
- import { FEISHU_CONFIG_JSON_SCHEMA } from "../core/config-schema";
8
+ } from "./directory.js";
9
+ import { feishuOnboardingAdapter } from "./onboarding.js";
10
+ import { feishuOutbound } from "../messaging/outbound/outbound.js";
11
+ import { feishuMessageActions } from "../messaging/outbound/actions.js";
12
+ import { resolveFeishuGroupToolPolicy } from "../messaging/inbound/policy.js";
13
+ import { LarkClient } from "../core/lark-client.js";
14
+ import { sendMessageFeishu } from "../messaging/outbound/send.js";
15
+ import { normalizeFeishuTarget, looksLikeFeishuId } from "../core/targets.js";
16
+ import { triggerOnboarding } from "../tools/onboarding-auth.js";
17
+ import { setAccountEnabled, applyAccountConfig, deleteAccount, collectFeishuSecurityWarnings } from "./config-adapter.js";
18
+ import { larkLogger } from "../core/lark-logger.js";
19
+ import { FEISHU_CONFIG_JSON_SCHEMA } from "../core/config-schema.js";
20
20
  const pluginLog = larkLogger("channel/plugin");
21
21
  const PROBE_CACHE_TTL_MS = 10 * 60 * 1e3;
22
22
  function adaptDirectoryParams(params) {
@@ -1,4 +1,4 @@
1
- import { LarkClient } from "../core/lark-client";
1
+ import { LarkClient } from "../core/lark-client.js";
2
2
  async function probeFeishu(credentials) {
3
3
  if (!credentials?.appId || !credentials?.appSecret) {
4
4
  return {
@@ -1,11 +1,11 @@
1
- import { triggerOnboarding } from "../tools/onboarding-auth";
2
- import { getTicket } from "../core/lark-ticket";
3
- import { getLarkAccount } from "../core/accounts";
4
- import { LarkClient } from "../core/lark-client";
5
- import { getAppInfo, getAppGrantedScopes } from "../core/app-scope-checker";
6
- import { getStoredToken } from "../core/token-store";
7
- import { filterSensitiveScopes } from "../core/tool-scopes";
8
- import { assertOwnerAccessStrict, OwnerAccessDeniedError } from "../core/owner-policy";
1
+ import { triggerOnboarding } from "../tools/onboarding-auth.js";
2
+ import { getTicket } from "../core/lark-ticket.js";
3
+ import { getLarkAccount } from "../core/accounts.js";
4
+ import { LarkClient } from "../core/lark-client.js";
5
+ import { getAppInfo, getAppGrantedScopes } from "../core/app-scope-checker.js";
6
+ import { getStoredToken } from "../core/token-store.js";
7
+ import { filterSensitiveScopes } from "../core/tool-scopes.js";
8
+ import { assertOwnerAccessStrict, OwnerAccessDeniedError } from "../core/owner-policy.js";
9
9
  async function runFeishuAuth(config) {
10
10
  const ticket = getTicket();
11
11
  const senderOpenId = ticket?.senderOpenId;
@@ -1,14 +1,14 @@
1
1
  import * as fs from "node:fs/promises";
2
2
  import * as path from "node:path";
3
3
  import * as os from "node:os";
4
- import { probeFeishu } from "../channel/probe";
5
- import { getLarkAccountIds, getLarkAccount, getEnabledLarkAccounts } from "../core/accounts";
6
- import { LarkClient } from "../core/lark-client";
4
+ import { probeFeishu } from "../channel/probe.js";
5
+ import { getLarkAccountIds, getLarkAccount, getEnabledLarkAccounts } from "../core/accounts.js";
6
+ import { LarkClient } from "../core/lark-client.js";
7
7
  function resolveGlobalConfig(config) {
8
8
  return LarkClient.globalConfig ?? config;
9
9
  }
10
- import { assertLarkOk, formatLarkError } from "../core/api-error";
11
- import { resolveAnyEnabledToolsConfig } from "../core/tools-config";
10
+ import { assertLarkOk, formatLarkError } from "../core/api-error.js";
11
+ import { resolveAnyEnabledToolsConfig } from "../core/tools-config.js";
12
12
  const PLUGIN_VERSION = "2026.2.10";
13
13
  const LOG_READ_BYTES = 256 * 1024;
14
14
  const MAX_ERROR_LINES = 20;
@@ -1,15 +1,15 @@
1
- import { getEnabledLarkAccounts } from "../core/accounts";
2
- import { LarkClient } from "../core/lark-client";
1
+ import { getEnabledLarkAccounts } from "../core/accounts.js";
2
+ import { LarkClient } from "../core/lark-client.js";
3
3
  function resolveGlobalConfig(config) {
4
4
  return LarkClient.globalConfig ?? config;
5
5
  }
6
- import { getAppGrantedScopes, missingScopes } from "../core/app-scope-checker";
7
- import { getAppOwnerFallback } from "../core/app-owner-fallback";
8
- import { getStoredToken, tokenStatus } from "../core/token-store";
9
- import { filterSensitiveScopes, REQUIRED_APP_SCOPES, TOOL_SCOPES } from "../core/tool-scopes";
10
- import { probeFeishu } from "../channel/probe";
11
- import { AppScopeCheckFailedError } from "../core/tool-client";
12
- import { getPluginVersion } from "../core/version";
6
+ import { getAppGrantedScopes, missingScopes } from "../core/app-scope-checker.js";
7
+ import { getAppOwnerFallback } from "../core/app-owner-fallback.js";
8
+ import { getStoredToken, tokenStatus } from "../core/token-store.js";
9
+ import { filterSensitiveScopes, REQUIRED_APP_SCOPES, TOOL_SCOPES } from "../core/tool-scopes.js";
10
+ import { probeFeishu } from "../channel/probe.js";
11
+ import { AppScopeCheckFailedError } from "../core/tool-client.js";
12
+ import { getPluginVersion } from "../core/version.js";
13
13
  function formatTimestamp(date) {
14
14
  return date.toLocaleString("sv-SE", { timeZone: "Asia/Shanghai" }).replace("T", " ");
15
15
  }
@@ -1,7 +1,7 @@
1
- import { runDiagnosis, formatDiagReportText } from "./diagnose";
2
- import { runFeishuDoctor } from "./doctor";
3
- import { runFeishuAuth } from "./auth";
4
- import { getPluginVersion } from "../core/version";
1
+ import { runDiagnosis, formatDiagReportText } from "./diagnose.js";
2
+ import { runFeishuDoctor } from "./doctor.js";
3
+ import { runFeishuAuth } from "./auth.js";
4
+ import { getPluginVersion } from "../core/version.js";
5
5
  function registerCommands(api) {
6
6
  api.registerCommand({
7
7
  name: "feishu_diagnose",
@@ -1,5 +1,5 @@
1
- import { extractPermissionGrantUrl, extractPermissionScopes } from "./permission-url";
2
- import { LARK_ERROR } from "./auth-errors";
1
+ import { extractPermissionGrantUrl, extractPermissionScopes } from "./permission-url.js";
2
+ import { LARK_ERROR } from "./auth-errors.js";
3
3
  function formatPermissionError(code, msg) {
4
4
  if (code !== LARK_ERROR.APP_SCOPE_MISSING) return null;
5
5
  const authUrl = extractPermissionGrantUrl(msg);
@@ -1,5 +1,5 @@
1
- import { getAppInfo } from "./app-scope-checker";
2
- import { larkLogger } from "./lark-logger";
1
+ import { getAppInfo } from "./app-scope-checker.js";
2
+ import { larkLogger } from "./lark-logger.js";
3
3
  const log = larkLogger("core/app-owner-fallback");
4
4
  async function getAppOwnerFallback(account, sdk) {
5
5
  const { appId } = account;
@@ -1,6 +1,6 @@
1
- import { larkLogger } from "./lark-logger";
1
+ import { larkLogger } from "./lark-logger.js";
2
2
  const log = larkLogger("core/app-scope-checker");
3
- import { AppScopeCheckFailedError } from "./auth-errors";
3
+ import { AppScopeCheckFailedError } from "./auth-errors.js";
4
4
  const cache = /* @__PURE__ */ new Map();
5
5
  const CACHE_TTL_MS = 30 * 1e3;
6
6
  function invalidateAppScopeCache(appId) {
@@ -1,5 +1,5 @@
1
- import { LarkClient } from "./lark-client";
2
- import { larkLogger } from "./lark-logger";
1
+ import { LarkClient } from "./lark-client.js";
2
+ import { larkLogger } from "./lark-logger.js";
3
3
  const log = larkLogger("core/chat-info-cache");
4
4
  const DEFAULT_MAX_SIZE = 500;
5
5
  const DEFAULT_TTL_MS = 60 * 60 * 1e3;
@@ -1,6 +1,6 @@
1
- import { larkLogger } from "./lark-logger";
1
+ import { larkLogger } from "./lark-logger.js";
2
2
  const log = larkLogger("core/device-flow");
3
- import { feishuFetch } from "./feishu-fetch";
3
+ import { feishuFetch } from "./feishu-fetch.js";
4
4
  function resolveOAuthEndpoints(brand) {
5
5
  if (!brand || brand === "feishu") {
6
6
  return {
@@ -1,4 +1,4 @@
1
- import { getUserAgent } from "./version";
1
+ import { getUserAgent } from "./version.js";
2
2
  function feishuFetch(url, init) {
3
3
  const headers = {
4
4
  ...init?.headers,
@@ -1,9 +1,9 @@
1
1
  import * as Lark from "@larksuiteoapi/node-sdk";
2
- import { getLarkAccount } from "./accounts";
3
- import { clearUserNameCache } from "../messaging/inbound/user-name-cache";
4
- import { clearChatInfoCache } from "./chat-info-cache";
5
- import { getUserAgent } from "./version";
6
- import { larkLogger } from "./lark-logger";
2
+ import { getLarkAccount } from "./accounts.js";
3
+ import { clearUserNameCache } from "../messaging/inbound/user-name-cache.js";
4
+ import { clearChatInfoCache } from "./chat-info-cache.js";
5
+ import { getUserAgent } from "./version.js";
6
+ import { larkLogger } from "./lark-logger.js";
7
7
  const log = larkLogger("core/lark-client");
8
8
  const GLOBAL_LARK_USER_AGENT_KEY = "LARK_USER_AGENT";
9
9
  function installGlobalUserAgent() {
@@ -1,5 +1,5 @@
1
- import { LarkClient } from "./lark-client";
2
- import { getTicket } from "./lark-ticket";
1
+ import { LarkClient } from "./lark-client.js";
2
+ import { getTicket } from "./lark-ticket.js";
3
3
  const CYAN = "\x1B[36m";
4
4
  const YELLOW = "\x1B[33m";
5
5
  const RED = "\x1B[31m";
@@ -1,6 +1,6 @@
1
- import { MESSAGE_TERMINAL_CODES } from "./auth-errors";
2
- import { extractLarkApiCode } from "./api-error";
3
- import { normalizeMessageId } from "./targets";
1
+ import { MESSAGE_TERMINAL_CODES } from "./auth-errors.js";
2
+ import { extractLarkApiCode } from "./api-error.js";
3
+ import { normalizeMessageId } from "./targets.js";
4
4
  const UNAVAILABLE_CACHE_TTL_MS = 30 * 60 * 1e3;
5
5
  const MAX_CACHE_SIZE_BEFORE_PRUNE = 512;
6
6
  const unavailableMessageCache = /* @__PURE__ */ new Map();
@@ -1,4 +1,4 @@
1
- import { getAppOwnerFallback } from "./app-owner-fallback";
1
+ import { getAppOwnerFallback } from "./app-owner-fallback.js";
2
2
  class OwnerAccessDeniedError extends Error {
3
3
  userOpenId;
4
4
  appOwnerId;
@@ -1,6 +1,6 @@
1
1
  import http from "node:http";
2
2
  import { randomUUID } from "node:crypto";
3
- import { larkLogger } from "./lark-logger";
3
+ import { larkLogger } from "./lark-logger.js";
4
4
  import {
5
5
  discoverOAuthMetadata,
6
6
  registerOAuthClient,
@@ -9,8 +9,8 @@ import {
9
9
  exchangeCodeForTokens,
10
10
  extractCodeFromCallbackUrl,
11
11
  refreshAccessToken
12
- } from "./project-oauth-flow";
13
- import { getProjectMcpEndpoint } from "../tools/mcp/project/endpoint";
12
+ } from "./project-oauth-flow.js";
13
+ import { getProjectMcpEndpoint } from "../tools/mcp/project/endpoint.js";
14
14
  const log = larkLogger("core/project-auth");
15
15
  const CALLBACK_HOST = "127.0.0.1";
16
16
  const CALLBACK_PATH = "/callback";
@@ -1,5 +1,5 @@
1
1
  import { randomBytes, createHash } from "node:crypto";
2
- import { larkLogger } from "./lark-logger";
2
+ import { larkLogger } from "./lark-logger.js";
3
3
  const log = larkLogger("core/project-oauth-flow");
4
4
  async function discoverOAuthMetadata(serverUrl) {
5
5
  const base = serverUrl.replace(/\/+$/, "");
@@ -4,8 +4,8 @@ import { mkdir, unlink, readFile, writeFile, chmod } from "node:fs/promises";
4
4
  import { join } from "node:path";
5
5
  import { homedir } from "node:os";
6
6
  import { randomBytes, createCipheriv, createDecipheriv } from "node:crypto";
7
- import { larkLogger } from "./lark-logger";
8
- import { maskToken } from "./token-store";
7
+ import { larkLogger } from "./lark-logger.js";
8
+ import { maskToken } from "./token-store.js";
9
9
  const log = larkLogger("core/project-token-store");
10
10
  const execFile = promisify(execFileCb);
11
11
  const PROJECT_SERVICE = "openclaw-feishu-project-uat";
@@ -1,4 +1,4 @@
1
- import { feishuFetch } from "./feishu-fetch";
1
+ import { feishuFetch } from "./feishu-fetch.js";
2
2
  function resolveDomainUrl(brand) {
3
3
  const map = {
4
4
  feishu: "https://open.feishu.cn",
@@ -1,4 +1,4 @@
1
- import { TOOL_SCOPES } from "./tool-scopes";
1
+ import { TOOL_SCOPES } from "./tool-scopes.js";
2
2
  function getRequiredScopes(toolAction) {
3
3
  return TOOL_SCOPES[toolAction] ?? [];
4
4
  }
@@ -1,4 +1,4 @@
1
- import { getEnabledLarkAccounts } from "./accounts";
1
+ import { getEnabledLarkAccounts } from "./accounts.js";
2
2
  function checkMultiAccountIsolation(cfg) {
3
3
  const accounts = getEnabledLarkAccounts(cfg);
4
4
  if (accounts.length <= 1) return { mode: "not-applicable" };
@@ -4,7 +4,7 @@ import { mkdir, unlink, readFile, writeFile, chmod } from "node:fs/promises";
4
4
  import { join } from "node:path";
5
5
  import { homedir } from "node:os";
6
6
  import { randomBytes, createCipheriv, createDecipheriv } from "node:crypto";
7
- import { larkLogger } from "./lark-logger";
7
+ import { larkLogger } from "./lark-logger.js";
8
8
  const log = larkLogger("core/token-store");
9
9
  const execFile = promisify(execFileCb);
10
10
  const KEYCHAIN_SERVICE = "openclaw-feishu-uat";