mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-25 00:42:24 +00:00
Plugins: surface compatibility notices
This commit is contained in:
@@ -22,6 +22,7 @@ import { applyExclusiveSlotSelection } from "../plugins/slots.js";
|
||||
import { resolvePluginSourceRoots, formatPluginSourceForTable } from "../plugins/source-display.js";
|
||||
import {
|
||||
buildAllPluginInspectReports,
|
||||
buildPluginCompatibilityNotices,
|
||||
buildPluginInspectReport,
|
||||
buildPluginStatusReport,
|
||||
} from "../plugins/status.js";
|
||||
@@ -652,6 +653,12 @@ export function registerPluginsCli(program: Command) {
|
||||
: theme.error("error"),
|
||||
Shape: inspect.shape,
|
||||
Capabilities: formatCapabilityKinds(inspect.capabilities),
|
||||
Compatibility:
|
||||
inspect.compatibility.length > 0
|
||||
? inspect.compatibility
|
||||
.map((entry) => (entry.severity === "warn" ? `warn:${entry.code}` : entry.code))
|
||||
.join(", ")
|
||||
: "none",
|
||||
Hooks: formatHookSummary({
|
||||
usesLegacyBeforeAgentStart: inspect.usesLegacyBeforeAgentStart,
|
||||
typedHookCount: inspect.typedHooks.length,
|
||||
@@ -667,6 +674,7 @@ export function registerPluginsCli(program: Command) {
|
||||
{ key: "Status", header: "Status", minWidth: 10 },
|
||||
{ key: "Shape", header: "Shape", minWidth: 18 },
|
||||
{ key: "Capabilities", header: "Capabilities", minWidth: 28, flex: true },
|
||||
{ key: "Compatibility", header: "Compatibility", minWidth: 24, flex: true },
|
||||
{ key: "Hooks", header: "Hooks", minWidth: 20, flex: true },
|
||||
],
|
||||
rows,
|
||||
@@ -751,6 +759,12 @@ export function registerPluginsCli(program: Command) {
|
||||
),
|
||||
),
|
||||
);
|
||||
lines.push(
|
||||
...formatInspectSection(
|
||||
"Compatibility warnings",
|
||||
inspect.compatibility.map((warning) => `${warning.pluginId} ${warning.message}`),
|
||||
),
|
||||
);
|
||||
lines.push(
|
||||
...formatInspectSection(
|
||||
"Custom hooks",
|
||||
@@ -1058,8 +1072,9 @@ export function registerPluginsCli(program: Command) {
|
||||
const report = buildPluginStatusReport();
|
||||
const errors = report.plugins.filter((p) => p.status === "error");
|
||||
const diags = report.diagnostics.filter((d) => d.level === "error");
|
||||
const compatibility = buildPluginCompatibilityNotices({ report });
|
||||
|
||||
if (errors.length === 0 && diags.length === 0) {
|
||||
if (errors.length === 0 && diags.length === 0 && compatibility.length === 0) {
|
||||
defaultRuntime.log("No plugin issues detected.");
|
||||
return;
|
||||
}
|
||||
@@ -1081,6 +1096,16 @@ export function registerPluginsCli(program: Command) {
|
||||
lines.push(`- ${target}${diag.message}`);
|
||||
}
|
||||
}
|
||||
if (compatibility.length > 0) {
|
||||
if (lines.length > 0) {
|
||||
lines.push("");
|
||||
}
|
||||
lines.push(theme.warn("Compatibility:"));
|
||||
for (const notice of compatibility) {
|
||||
const marker = notice.severity === "warn" ? theme.warn("warn") : theme.muted("info");
|
||||
lines.push(`- ${notice.pluginId} [${marker}]: ${notice.message}`);
|
||||
}
|
||||
}
|
||||
const docs = formatDocsLink("/plugin", "docs.openclaw.ai/plugin");
|
||||
lines.push("");
|
||||
lines.push(`${theme.muted("Docs:")} ${docs}`);
|
||||
|
||||
Reference in New Issue
Block a user