mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-14 10:41:23 +00:00
* fix(talk): fix ensure permissions on first execution of Talk Mode in MacOS * macos: fix talk mode formatting * test: fix CI shard regressions * docs: add talk mode changelog --------- Co-authored-by: ImLukeF <92253590+ImLukeF@users.noreply.github.com>
62 lines
1.7 KiB
TypeScript
62 lines
1.7 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import plugin from "./index.js";
|
|
import { createMemoryWikiTestHarness } from "./src/test-helpers.js";
|
|
|
|
const { createPluginApi } = createMemoryWikiTestHarness();
|
|
|
|
describe("memory-wiki plugin", () => {
|
|
it("registers prompt supplement, gateway methods, tools, and wiki cli surface", async () => {
|
|
const {
|
|
api,
|
|
registerCli,
|
|
registerGatewayMethod,
|
|
registerMemoryCorpusSupplement,
|
|
registerMemoryPromptSupplement,
|
|
registerTool,
|
|
} = createPluginApi();
|
|
|
|
await plugin.register(api);
|
|
|
|
expect(registerMemoryCorpusSupplement).toHaveBeenCalledTimes(1);
|
|
expect(registerMemoryPromptSupplement).toHaveBeenCalledTimes(1);
|
|
expect(registerGatewayMethod.mock.calls.map((call) => call[0])).toEqual([
|
|
"wiki.status",
|
|
"wiki.importRuns",
|
|
"wiki.importInsights",
|
|
"wiki.palace",
|
|
"wiki.init",
|
|
"wiki.doctor",
|
|
"wiki.compile",
|
|
"wiki.ingest",
|
|
"wiki.lint",
|
|
"wiki.bridge.import",
|
|
"wiki.unsafeLocal.import",
|
|
"wiki.search",
|
|
"wiki.apply",
|
|
"wiki.get",
|
|
"wiki.obsidian.status",
|
|
"wiki.obsidian.search",
|
|
"wiki.obsidian.open",
|
|
"wiki.obsidian.command",
|
|
"wiki.obsidian.daily",
|
|
]);
|
|
expect(registerTool).toHaveBeenCalledTimes(5);
|
|
expect(registerTool.mock.calls.map((call) => call[1]?.name)).toEqual([
|
|
"wiki_status",
|
|
"wiki_lint",
|
|
"wiki_apply",
|
|
"wiki_search",
|
|
"wiki_get",
|
|
]);
|
|
expect(registerCli).toHaveBeenCalledTimes(1);
|
|
expect(registerCli.mock.calls[0]?.[1]).toMatchObject({
|
|
descriptors: [
|
|
expect.objectContaining({
|
|
name: "wiki",
|
|
hasSubcommands: true,
|
|
}),
|
|
],
|
|
});
|
|
});
|
|
});
|