mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 20:30:21 +00:00
fix: repair latest-main ci gate
This commit is contained in:
@@ -1,61 +1,76 @@
|
||||
import type { getReplyFromConfig as getReplyFromConfigRuntime } from "./auto-reply/reply.runtime.js";
|
||||
import { applyTemplate } from "./auto-reply/templating.js";
|
||||
import { createDefaultDeps } from "./cli/deps.js";
|
||||
import type { promptYesNo as promptYesNoRuntime } from "./cli/prompt.js";
|
||||
import { waitForever } from "./cli/wait.js";
|
||||
import { loadConfig } from "./config/config.js";
|
||||
import { resolveStorePath } from "./config/sessions/paths.js";
|
||||
import { deriveSessionKey, resolveSessionKey } from "./config/sessions/session-key.js";
|
||||
import { loadSessionStore, saveSessionStore } from "./config/sessions/store.js";
|
||||
import type { ensureBinary as ensureBinaryRuntime } from "./infra/binaries.js";
|
||||
import {
|
||||
describePortOwner,
|
||||
ensurePortAvailable,
|
||||
handlePortError,
|
||||
PortInUseError,
|
||||
} from "./infra/ports.js";
|
||||
import type { monitorWebChannel as monitorWebChannelRuntime } from "./plugins/runtime/runtime-whatsapp-boundary.js";
|
||||
import type {
|
||||
runCommandWithTimeout as runCommandWithTimeoutRuntime,
|
||||
runExec as runExecRuntime,
|
||||
} from "./process/exec.js";
|
||||
import { assertWebChannel, normalizeE164, toWhatsappJid } from "./utils.js";
|
||||
|
||||
type ReplyRuntimeModule = typeof import("./auto-reply/reply.runtime.js");
|
||||
type PromptRuntimeModule = typeof import("./cli/prompt.runtime.js");
|
||||
type BinariesRuntimeModule = typeof import("./infra/binaries.runtime.js");
|
||||
type ExecRuntimeModule = typeof import("./process/exec.js");
|
||||
type WhatsAppRuntimeModule = typeof import("./plugins/runtime/runtime-whatsapp-boundary.js");
|
||||
type GetReplyFromConfig = typeof getReplyFromConfigRuntime;
|
||||
type PromptYesNo = typeof promptYesNoRuntime;
|
||||
type EnsureBinary = typeof ensureBinaryRuntime;
|
||||
type RunExec = typeof runExecRuntime;
|
||||
type RunCommandWithTimeout = typeof runCommandWithTimeoutRuntime;
|
||||
type MonitorWebChannel = typeof monitorWebChannelRuntime;
|
||||
|
||||
let replyRuntimePromise: Promise<ReplyRuntimeModule> | undefined;
|
||||
let promptRuntimePromise: Promise<PromptRuntimeModule> | undefined;
|
||||
let binariesRuntimePromise: Promise<BinariesRuntimeModule> | undefined;
|
||||
let execRuntimePromise: Promise<ExecRuntimeModule> | undefined;
|
||||
let whatsappRuntimePromise: Promise<WhatsAppRuntimeModule> | undefined;
|
||||
let replyRuntimePromise: Promise<typeof import("./auto-reply/reply.runtime.js")> | null = null;
|
||||
let promptRuntimePromise: Promise<typeof import("./cli/prompt.js")> | null = null;
|
||||
let binariesRuntimePromise: Promise<typeof import("./infra/binaries.js")> | null = null;
|
||||
let execRuntimePromise: Promise<typeof import("./process/exec.js")> | null = null;
|
||||
let whatsappRuntimePromise: Promise<
|
||||
typeof import("./plugins/runtime/runtime-whatsapp-boundary.js")
|
||||
> | null = null;
|
||||
|
||||
function loadReplyRuntime(): Promise<ReplyRuntimeModule> {
|
||||
return (replyRuntimePromise ??= import("./auto-reply/reply.runtime.js"));
|
||||
function loadReplyRuntime() {
|
||||
replyRuntimePromise ??= import("./auto-reply/reply.runtime.js");
|
||||
return replyRuntimePromise;
|
||||
}
|
||||
|
||||
function loadPromptRuntime(): Promise<PromptRuntimeModule> {
|
||||
return (promptRuntimePromise ??= import("./cli/prompt.runtime.js"));
|
||||
function loadPromptRuntime() {
|
||||
promptRuntimePromise ??= import("./cli/prompt.js");
|
||||
return promptRuntimePromise;
|
||||
}
|
||||
|
||||
function loadBinariesRuntime(): Promise<BinariesRuntimeModule> {
|
||||
return (binariesRuntimePromise ??= import("./infra/binaries.runtime.js"));
|
||||
function loadBinariesRuntime() {
|
||||
binariesRuntimePromise ??= import("./infra/binaries.js");
|
||||
return binariesRuntimePromise;
|
||||
}
|
||||
|
||||
function loadExecRuntime(): Promise<ExecRuntimeModule> {
|
||||
return (execRuntimePromise ??= import("./process/exec.js"));
|
||||
function loadExecRuntime() {
|
||||
execRuntimePromise ??= import("./process/exec.js");
|
||||
return execRuntimePromise;
|
||||
}
|
||||
|
||||
function loadWhatsAppRuntime(): Promise<WhatsAppRuntimeModule> {
|
||||
return (whatsappRuntimePromise ??= import("./plugins/runtime/runtime-whatsapp-boundary.js"));
|
||||
function loadWhatsAppRuntime() {
|
||||
whatsappRuntimePromise ??= import("./plugins/runtime/runtime-whatsapp-boundary.js");
|
||||
return whatsappRuntimePromise;
|
||||
}
|
||||
|
||||
export const getReplyFromConfig: ReplyRuntimeModule["getReplyFromConfig"] = async (...args) =>
|
||||
export const getReplyFromConfig: GetReplyFromConfig = async (...args) =>
|
||||
(await loadReplyRuntime()).getReplyFromConfig(...args);
|
||||
export const promptYesNo: PromptRuntimeModule["promptYesNo"] = async (...args) =>
|
||||
export const promptYesNo: PromptYesNo = async (...args) =>
|
||||
(await loadPromptRuntime()).promptYesNo(...args);
|
||||
export const ensureBinary: BinariesRuntimeModule["ensureBinary"] = async (...args) =>
|
||||
export const ensureBinary: EnsureBinary = async (...args) =>
|
||||
(await loadBinariesRuntime()).ensureBinary(...args);
|
||||
export const runExec: ExecRuntimeModule["runExec"] = async (...args) =>
|
||||
(await loadExecRuntime()).runExec(...args);
|
||||
export const runCommandWithTimeout: ExecRuntimeModule["runCommandWithTimeout"] = async (...args) =>
|
||||
export const runExec: RunExec = async (...args) => (await loadExecRuntime()).runExec(...args);
|
||||
export const runCommandWithTimeout: RunCommandWithTimeout = async (...args) =>
|
||||
(await loadExecRuntime()).runCommandWithTimeout(...args);
|
||||
export const monitorWebChannel: WhatsAppRuntimeModule["monitorWebChannel"] = async (...args) =>
|
||||
export const monitorWebChannel: MonitorWebChannel = async (...args) =>
|
||||
(await loadWhatsAppRuntime()).monitorWebChannel(...args);
|
||||
|
||||
export {
|
||||
|
||||
Reference in New Issue
Block a user