import type {
OpenClawPluginCommandDefinition,
PluginCommandContext,
} from "openclaw/plugin-sdk/core"; import type { OpenClawConfig, OpenClawPluginApi } from "openclaw/plugin-sdk/memory-core"; import { describe, expect, it, vi } from "vitest"; import { registerDreamingCommand } from "./dreaming-command.js";
function asRecord(value: unknown): Record<string, unknown> | null { if (!value || typeof value !== "object" || Array.isArray(value)) { returnnull;
} return value as Record<string, unknown>;
}
describe("memory-core /dreaming command", () => {
it("registers with an enable/disable description", () => { const { command } = createHarness();
expect(command.name).toBe("dreaming");
expect(command.acceptsArgs).toBe(true);
expect(command.description).toContain("Enable or disable");
});
it("shows phase explanations when invoked without args", async () => { const { command } = createHarness(); const result = await command.handler(createCommandContext());
expect(result.text).toContain("Usage: /dreaming status");
expect(result.text).toContain("Dreaming status:");
expect(result.text).toContain("- implementation detail: each sweep runs light -> REM -> deep.");
expect(result.text).toContain( "- deep is the only stage that writes durable entries to MEMORY.md.",
);
});
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.