mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-30 02:22:25 +00:00
refactor: extract memory host sdk package
This commit is contained in:
@@ -20,12 +20,21 @@ const resolveCommandSecretRefsViaGateway = vi.hoisted(() =>
|
||||
})),
|
||||
);
|
||||
|
||||
vi.mock("./api.js", async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import("./api.js")>();
|
||||
vi.mock("openclaw/plugin-sdk/memory-core-host-runtime-core", async (importOriginal) => {
|
||||
const actual =
|
||||
await importOriginal<typeof import("openclaw/plugin-sdk/memory-core-host-runtime-core")>();
|
||||
return {
|
||||
...actual,
|
||||
loadConfig,
|
||||
resolveDefaultAgentId,
|
||||
};
|
||||
});
|
||||
|
||||
vi.mock("openclaw/plugin-sdk/memory-core-host-runtime-cli", async (importOriginal) => {
|
||||
const actual =
|
||||
await importOriginal<typeof import("openclaw/plugin-sdk/memory-core-host-runtime-cli")>();
|
||||
return {
|
||||
...actual,
|
||||
resolveCommandSecretRefsViaGateway,
|
||||
};
|
||||
});
|
||||
@@ -39,13 +48,14 @@ vi.mock("./runtime-api.js", async (importOriginal) => {
|
||||
});
|
||||
|
||||
let registerMemoryCli: typeof import("./cli.js").registerMemoryCli;
|
||||
let defaultRuntime: typeof import("./api.js").defaultRuntime;
|
||||
let isVerbose: typeof import("./api.js").isVerbose;
|
||||
let setVerbose: typeof import("./api.js").setVerbose;
|
||||
let defaultRuntime: typeof import("openclaw/plugin-sdk/memory-core-host-runtime-cli").defaultRuntime;
|
||||
let isVerbose: typeof import("openclaw/plugin-sdk/memory-core-host-runtime-cli").isVerbose;
|
||||
let setVerbose: typeof import("openclaw/plugin-sdk/memory-core-host-runtime-cli").setVerbose;
|
||||
|
||||
beforeAll(async () => {
|
||||
({ registerMemoryCli } = await import("./cli.js"));
|
||||
({ defaultRuntime, isVerbose, setVerbose } = await import("./api.js"));
|
||||
({ defaultRuntime, isVerbose, setVerbose } =
|
||||
await import("openclaw/plugin-sdk/memory-core-host-runtime-cli"));
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
Reference in New Issue
Block a user