


















@@ -29,6 +29,25 @@ const memoryWikiCommandAliasRegistry: PluginManifestRegistry = {
2929diagnostics: [],
3030};
313132+const memoryCoreCommandAliasRegistry: PluginManifestRegistry = {
33+plugins: [
34+{
35+id: "memory-core",
36+channels: [],
37+providers: [],
38+cliBackends: [],
39+skills: [],
40+hooks: [],
41+origin: "bundled",
42+rootDir: "/tmp/memory-core",
43+source: "bundled",
44+manifestPath: "/tmp/memory-core/openclaw.plugin.json",
45+commandAliases: [{ name: "dreaming", kind: "runtime-slash", cliCommand: "memory" }],
46+},
47+],
48+diagnostics: [],
49+};
50+3251describe("rewriteUpdateFlagArgv", () => {
3352it("leaves argv unchanged when --update is absent", () => {
3453const argv = ["node", "entry.js", "status"];
@@ -182,44 +201,68 @@ describe("resolveMissingPluginCommandMessage", () => {
182201});
183202184203it("explains that dreaming is a runtime slash command, not a CLI command", () => {
185-const message = resolveMissingPluginCommandMessage("dreaming", {});
204+const message = resolveMissingPluginCommandMessage(
205+"dreaming",
206+{},
207+{
208+registry: memoryCoreCommandAliasRegistry,
209+},
210+);
186211expect(message).toContain("runtime slash command");
187212expect(message).toContain("/dreaming");
188213expect(message).toContain("memory-core");
189214expect(message).toContain("openclaw memory");
190215});
191216192217it("returns the runtime command message even when plugins.allow is set", () => {
193-const message = resolveMissingPluginCommandMessage("dreaming", {
194-plugins: {
195-allow: ["memory-core"],
218+const message = resolveMissingPluginCommandMessage(
219+"dreaming",
220+{
221+plugins: {
222+allow: ["memory-core"],
223+},
224+},
225+{
226+registry: memoryCoreCommandAliasRegistry,
196227},
197-});
228+);
198229expect(message).toContain("runtime slash command");
199230expect(message).not.toContain("plugins.allow");
200231});
201232202233it("points command names in plugins.allow at their parent plugin", () => {
203-const message = resolveMissingPluginCommandMessage("dreaming", {
204-plugins: {
205-allow: ["dreaming"],
234+const message = resolveMissingPluginCommandMessage(
235+"dreaming",
236+{
237+plugins: {
238+allow: ["dreaming"],
239+},
240+},
241+{
242+registry: memoryCoreCommandAliasRegistry,
206243},
207-});
244+);
208245expect(message).toContain('"dreaming" is not a plugin');
209246expect(message).toContain('"memory-core"');
210247expect(message).toContain("plugins.allow");
211248});
212249213250it("explains parent plugin disablement for runtime command aliases", () => {
214-const message = resolveMissingPluginCommandMessage("dreaming", {
215-plugins: {
216-entries: {
217-"memory-core": {
218-enabled: false,
251+const message = resolveMissingPluginCommandMessage(
252+"dreaming",
253+{
254+plugins: {
255+entries: {
256+"memory-core": {
257+enabled: false,
258+},
219259},
220260},
221261},
222-});
262+{
263+registry: memoryCoreCommandAliasRegistry,
264+},
265+);
223266expect(message).toContain("plugins.entries.memory-core.enabled=false");
224267expect(message).not.toContain("runtime slash command");
225268});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。