






















@@ -1,10 +1,5 @@
11import type { ClawdbotConfig, RuntimeEnv } from "../runtime-api.js";
22import { listEnabledFeishuAccounts, resolveFeishuRuntimeAccount } from "./accounts.js";
3-import {
4-monitorSingleAccount,
5-resolveReactionSyntheticEvent,
6-type FeishuReactionCreatedEvent,
7-} from "./monitor.account.js";
83import { fetchBotIdentityForMonitor } from "./monitor.startup.js";
94import {
105clearFeishuWebhookRateLimitStateForTest,
@@ -20,13 +15,18 @@ export type MonitorFeishuOpts = {
2015accountId?: string;
2116};
221718+let monitorAccountRuntimePromise: Promise<typeof import("./monitor.account.js")> | undefined;
19+20+async function loadMonitorAccountRuntime() {
21+monitorAccountRuntimePromise ??= import("./monitor.account.js");
22+return await monitorAccountRuntimePromise;
23+}
24+2325export {
2426clearFeishuWebhookRateLimitStateForTest,
2527getFeishuWebhookRateLimitStateSizeForTest,
2628isWebhookRateLimitedForTest,
27-resolveReactionSyntheticEvent,
2829};
29-export type { FeishuReactionCreatedEvent };
30303131export async function monitorFeishuProvider(opts: MonitorFeishuOpts = {}): Promise<void> {
3232const cfg = opts.config;
@@ -44,6 +44,7 @@ export async function monitorFeishuProvider(opts: MonitorFeishuOpts = {}): Promi
4444if (!account.enabled || !account.configured) {
4545throw new Error(`Feishu account "${opts.accountId}" not configured or disabled`);
4646}
47+const { monitorSingleAccount } = await loadMonitorAccountRuntime();
4748return monitorSingleAccount({
4849 cfg,
4950 account,
@@ -61,6 +62,7 @@ export async function monitorFeishuProvider(opts: MonitorFeishuOpts = {}): Promi
6162`feishu: starting ${accounts.length} account(s): ${accounts.map((a) => a.accountId).join(", ")}`,
6263);
636465+const { monitorSingleAccount } = await loadMonitorAccountRuntime();
6466const monitorPromises: Promise<void>[] = [];
6567for (const account of accounts) {
6668if (opts.abortSignal?.aborted) {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。