Files
openclaw/src/plugin-sdk/memory-host-search.ts
2026-04-06 04:56:52 +01:00

30 lines
1.0 KiB
TypeScript

import type { OpenClawConfig } from "../config/config.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<MemoryHostSearchRuntimeModule> {
return await import("./memory-host-search.runtime.js");
}
export async function getActiveMemorySearchManager(params: {
cfg: OpenClawConfig;
agentId: string;
purpose?: ActiveMemorySearchPurpose;
}): Promise<ActiveMemorySearchManagerResult> {
const runtime = await loadMemoryHostSearchRuntime();
return await runtime.getActiveMemorySearchManager(params);
}
export async function closeActiveMemorySearchManagers(cfg?: OpenClawConfig): Promise<void> {
const runtime = await loadMemoryHostSearchRuntime();
await runtime.closeActiveMemorySearchManagers(cfg);
}