mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:40:44 +00:00
ci: fix main gate
This commit is contained in:
6
pnpm-lock.yaml
generated
6
pnpm-lock.yaml
generated
@@ -463,6 +463,12 @@ importers:
|
||||
specifier: workspace:*
|
||||
version: link:../../packages/plugin-sdk
|
||||
|
||||
extensions/diagnostics-prometheus:
|
||||
devDependencies:
|
||||
'@openclaw/plugin-sdk':
|
||||
specifier: workspace:*
|
||||
version: link:../../packages/plugin-sdk
|
||||
|
||||
extensions/diffs:
|
||||
dependencies:
|
||||
'@pierre/diffs':
|
||||
|
||||
@@ -29,6 +29,25 @@ const memoryWikiCommandAliasRegistry: PluginManifestRegistry = {
|
||||
diagnostics: [],
|
||||
};
|
||||
|
||||
const memoryCoreCommandAliasRegistry: PluginManifestRegistry = {
|
||||
plugins: [
|
||||
{
|
||||
id: "memory-core",
|
||||
channels: [],
|
||||
providers: [],
|
||||
cliBackends: [],
|
||||
skills: [],
|
||||
hooks: [],
|
||||
origin: "bundled",
|
||||
rootDir: "/tmp/memory-core",
|
||||
source: "bundled",
|
||||
manifestPath: "/tmp/memory-core/openclaw.plugin.json",
|
||||
commandAliases: [{ name: "dreaming", kind: "runtime-slash", cliCommand: "memory" }],
|
||||
},
|
||||
],
|
||||
diagnostics: [],
|
||||
};
|
||||
|
||||
describe("rewriteUpdateFlagArgv", () => {
|
||||
it("leaves argv unchanged when --update is absent", () => {
|
||||
const argv = ["node", "entry.js", "status"];
|
||||
@@ -182,7 +201,13 @@ describe("resolveMissingPluginCommandMessage", () => {
|
||||
});
|
||||
|
||||
it("explains that dreaming is a runtime slash command, not a CLI command", () => {
|
||||
const message = resolveMissingPluginCommandMessage("dreaming", {});
|
||||
const message = resolveMissingPluginCommandMessage(
|
||||
"dreaming",
|
||||
{},
|
||||
{
|
||||
registry: memoryCoreCommandAliasRegistry,
|
||||
},
|
||||
);
|
||||
expect(message).toContain("runtime slash command");
|
||||
expect(message).toContain("/dreaming");
|
||||
expect(message).toContain("memory-core");
|
||||
@@ -190,36 +215,54 @@ describe("resolveMissingPluginCommandMessage", () => {
|
||||
});
|
||||
|
||||
it("returns the runtime command message even when plugins.allow is set", () => {
|
||||
const message = resolveMissingPluginCommandMessage("dreaming", {
|
||||
plugins: {
|
||||
allow: ["memory-core"],
|
||||
const message = resolveMissingPluginCommandMessage(
|
||||
"dreaming",
|
||||
{
|
||||
plugins: {
|
||||
allow: ["memory-core"],
|
||||
},
|
||||
},
|
||||
});
|
||||
{
|
||||
registry: memoryCoreCommandAliasRegistry,
|
||||
},
|
||||
);
|
||||
expect(message).toContain("runtime slash command");
|
||||
expect(message).not.toContain("plugins.allow");
|
||||
});
|
||||
|
||||
it("points command names in plugins.allow at their parent plugin", () => {
|
||||
const message = resolveMissingPluginCommandMessage("dreaming", {
|
||||
plugins: {
|
||||
allow: ["dreaming"],
|
||||
const message = resolveMissingPluginCommandMessage(
|
||||
"dreaming",
|
||||
{
|
||||
plugins: {
|
||||
allow: ["dreaming"],
|
||||
},
|
||||
},
|
||||
});
|
||||
{
|
||||
registry: memoryCoreCommandAliasRegistry,
|
||||
},
|
||||
);
|
||||
expect(message).toContain('"dreaming" is not a plugin');
|
||||
expect(message).toContain('"memory-core"');
|
||||
expect(message).toContain("plugins.allow");
|
||||
});
|
||||
|
||||
it("explains parent plugin disablement for runtime command aliases", () => {
|
||||
const message = resolveMissingPluginCommandMessage("dreaming", {
|
||||
plugins: {
|
||||
entries: {
|
||||
"memory-core": {
|
||||
enabled: false,
|
||||
const message = resolveMissingPluginCommandMessage(
|
||||
"dreaming",
|
||||
{
|
||||
plugins: {
|
||||
entries: {
|
||||
"memory-core": {
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
{
|
||||
registry: memoryCoreCommandAliasRegistry,
|
||||
},
|
||||
);
|
||||
expect(message).toContain("plugins.entries.memory-core.enabled=false");
|
||||
expect(message).not.toContain("runtime slash command");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user