mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 11:31:23 +00:00
test: share memory manager bootstrap helper
This commit is contained in:
13
src/memory/test-manager.ts
Normal file
13
src/memory/test-manager.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { getMemorySearchManager, type MemoryIndexManager } from "./index.js";
|
||||
|
||||
export async function createMemoryManagerOrThrow(
|
||||
cfg: OpenClawConfig,
|
||||
agentId = "main",
|
||||
): Promise<MemoryIndexManager> {
|
||||
const result = await getMemorySearchManager({ cfg, agentId });
|
||||
if (!result.manager) {
|
||||
throw new Error("manager missing");
|
||||
}
|
||||
return result.manager as unknown as MemoryIndexManager;
|
||||
}
|
||||
Reference in New Issue
Block a user