mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-15 19:21:08 +00:00
30 lines
1.0 KiB
TypeScript
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);
|
|
}
|