mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 02:00:43 +00:00
fix: scope plugin inspect runtime loading
This commit is contained in:
@@ -259,24 +259,26 @@ export function registerPluginsCli(program: Command) {
|
||||
buildAllPluginInspectReports,
|
||||
buildPluginDiagnosticsReport,
|
||||
buildPluginInspectReport,
|
||||
buildPluginSnapshotReport,
|
||||
formatPluginCompatibilityNotice,
|
||||
} = await import("../plugins/status.js");
|
||||
const { loadInstalledPluginIndexInstallRecords } =
|
||||
await import("../plugins/installed-plugin-index-records.js");
|
||||
const cfg = getRuntimeConfig();
|
||||
const installRecords = await loadInstalledPluginIndexInstallRecords();
|
||||
const report = buildPluginDiagnosticsReport({
|
||||
config: cfg,
|
||||
...(opts.json ? { logger: quietPluginJsonLogger } : {}),
|
||||
});
|
||||
const loggerParams = opts.json ? { logger: quietPluginJsonLogger } : {};
|
||||
if (opts.all) {
|
||||
if (id) {
|
||||
defaultRuntime.error("Pass either a plugin id or --all, not both.");
|
||||
return defaultRuntime.exit(1);
|
||||
}
|
||||
const report = buildPluginDiagnosticsReport({
|
||||
config: cfg,
|
||||
...loggerParams,
|
||||
});
|
||||
const inspectAll = buildAllPluginInspectReports({
|
||||
config: cfg,
|
||||
...(opts.json ? { logger: quietPluginJsonLogger } : {}),
|
||||
...loggerParams,
|
||||
report,
|
||||
});
|
||||
const inspectAllWithInstall = inspectAll.map((inspect) => ({
|
||||
@@ -342,10 +344,26 @@ export function registerPluginsCli(program: Command) {
|
||||
return defaultRuntime.exit(1);
|
||||
}
|
||||
|
||||
const inspect = buildPluginInspectReport({
|
||||
id,
|
||||
const snapshotReport = buildPluginSnapshotReport({
|
||||
config: cfg,
|
||||
...(opts.json ? { logger: quietPluginJsonLogger } : {}),
|
||||
...loggerParams,
|
||||
});
|
||||
const targetPlugin = snapshotReport.plugins.find(
|
||||
(entry) => entry.id === id || entry.name === id,
|
||||
);
|
||||
if (!targetPlugin) {
|
||||
defaultRuntime.error(`Plugin not found: ${id}`);
|
||||
return defaultRuntime.exit(1);
|
||||
}
|
||||
const report = buildPluginDiagnosticsReport({
|
||||
config: cfg,
|
||||
...loggerParams,
|
||||
onlyPluginIds: [targetPlugin.id],
|
||||
});
|
||||
const inspect = buildPluginInspectReport({
|
||||
id: targetPlugin.id,
|
||||
config: cfg,
|
||||
...loggerParams,
|
||||
report,
|
||||
});
|
||||
if (!inspect) {
|
||||
|
||||
Reference in New Issue
Block a user