import type { OpenClawConfig } from "../config/types.openclaw.js"; import type { RegisteredMemorySearchManager } from "../plugins/memory-state.js"; type ActiveMemorySearchPurpose = "default" | "status"; export type ActiveMemorySearchManagerResult = { manager: RegisteredMemorySearchManager | null; error?: string; }; type MemoryHostSearchRuntimeModule = typeof import("./memory-host-search.runtime.js"); async function loadMemoryHostSearchRuntime(): Promise { return await import("./memory-host-search.runtime.js"); } export async function getActiveMemorySearchManager(params: { cfg: OpenClawConfig; agentId: string; purpose?: ActiveMemorySearchPurpose; }): Promise { const runtime = await loadMemoryHostSearchRuntime(); return await runtime.getActiveMemorySearchManager(params); } export async function closeActiveMemorySearchManagers(cfg?: OpenClawConfig): Promise { const runtime = await loadMemoryHostSearchRuntime(); await runtime.closeActiveMemorySearchManagers(cfg); }