refactor: simplify plugin dependency handling

Simplify plugin installation and runtime loading around package-manager-owned dependencies, with Jiti reserved for local/TS fallback paths.

Also scans npm plugin install roots so hoisted transitive dependencies are covered by dependency denylist and node_modules symlink checks.
This commit is contained in:
Peter Steinberger
2026-05-01 21:32:22 +01:00
committed by GitHub
parent 2e8e9cd6ca
commit ed8f50f240
294 changed files with 2562 additions and 25454 deletions

View File

@@ -39,13 +39,6 @@ export type PluginRegistryOptions = {
refresh?: boolean;
};
export type PluginsDepsCliOptions = {
json?: boolean;
packageRoot?: string;
prune?: boolean;
repair?: boolean;
};
function countEnabledPlugins(plugins: readonly { enabled: boolean }[]): number {
return plugins.filter((plugin) => plugin.enabled).length;
}
@@ -81,21 +74,6 @@ export function registerPluginsCli(program: Command) {
await runPluginsListCommand(opts);
});
plugins
.command("deps")
.description("Inspect or repair bundled plugin runtime dependencies")
.option("--json", "Print JSON")
.option("--package-root <path>", "OpenClaw package root to inspect")
.option("--prune", "Prune stale unknown external runtime dependency roots", false)
.option("--repair", "Install missing bundled runtime dependencies", false)
.action(async (opts: PluginsDepsCliOptions) => {
const { runPluginsDepsCommand } = await import("./plugins-deps-command.js");
await runPluginsDepsCommand({
config: getRuntimeConfig(),
options: opts,
});
});
plugins
.command("inspect")
.alias("info")