mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-26 11:05:15 +00:00
fix(cli): avoid plugin allowlist hints for unknown commands
Co-authored-by: kagura-agent <kagura.agent.ai@gmail.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { OpenClawConfig } from "../config/types.openclaw.js";
|
||||
import { normalizeOptionalLowercaseString } from "../shared/string-coerce.js";
|
||||
import { resolveManifestActivationPluginIds } from "./activation-planner.js";
|
||||
import {
|
||||
resolveManifestCommandAliasOwnerInRegistry,
|
||||
resolveManifestToolOwnerInRegistry,
|
||||
@@ -34,6 +35,31 @@ export function resolveManifestCommandAliasOwner(params: {
|
||||
});
|
||||
}
|
||||
|
||||
export function resolveManifestCliCommandSurfaceOwner(params: {
|
||||
command: string | undefined;
|
||||
config?: OpenClawConfig;
|
||||
workspaceDir?: string;
|
||||
env?: NodeJS.ProcessEnv;
|
||||
registry?: PluginManifestCommandAliasRegistry;
|
||||
}): string | undefined {
|
||||
const normalizedCommand = normalizeOptionalLowercaseString(params.command);
|
||||
if (!normalizedCommand) {
|
||||
return undefined;
|
||||
}
|
||||
if (params.registry) {
|
||||
return resolveManifestCommandAliasOwnerInRegistry({
|
||||
command: normalizedCommand,
|
||||
registry: params.registry,
|
||||
})?.pluginId;
|
||||
}
|
||||
return resolveManifestActivationPluginIds({
|
||||
trigger: { kind: "command", command: normalizedCommand },
|
||||
config: params.config,
|
||||
workspaceDir: params.workspaceDir,
|
||||
env: params.env,
|
||||
})[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve which plugin owns an agent-tool name, applying control-plane
|
||||
* availability filters so disabled/denied plugins are not falsely attributed.
|
||||
|
||||
Reference in New Issue
Block a user