feat(plugins): show clawpack source facts in inspect

This commit is contained in:
Vincent Koc
2026-05-01 17:37:18 -07:00
parent b0899f34f6
commit 824cfa196d
2 changed files with 39 additions and 0 deletions

View File

@@ -11,6 +11,7 @@ import {
runPluginsCommand,
runtimeErrors,
runtimeLogs,
setInstalledPluginIndexInstallRecords,
} from "./plugins-cli-test-helpers.js";
describe("plugins cli list", () => {
@@ -121,6 +122,20 @@ describe("plugins cli list", () => {
});
it("keeps inspect on the static snapshot by default", async () => {
setInstalledPluginIndexInstallRecords({
"openclaw-mem0": {
source: "clawhub",
spec: "clawhub:openclaw-mem0",
installPath: "/plugins/openclaw-mem0",
version: "2026.5.1",
clawhubPackage: "openclaw-mem0",
clawhubChannel: "official",
clawpackSha256: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
clawpackSpecVersion: 1,
clawpackManifestSha256: "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
clawpackSize: 4096,
},
});
buildPluginSnapshotReport.mockReturnValue({
plugins: [createPluginRecord({ id: "openclaw-mem0", name: "Mem0" })],
diagnostics: [],
@@ -159,6 +174,12 @@ describe("plugins cli list", () => {
expect(buildPluginDiagnosticsReport).not.toHaveBeenCalled();
expect(runtimeLogs.join("\n")).toContain("Policy");
expect(runtimeLogs.join("\n")).toContain("allowConversationAccess: true");
expect(runtimeLogs.join("\n")).toContain("ClawHub package: openclaw-mem0");
expect(runtimeLogs.join("\n")).toContain(
"ClawPack sha256: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
);
expect(runtimeLogs.join("\n")).toContain("ClawPack spec: 1");
expect(runtimeLogs.join("\n")).toContain("ClawPack size: 4096 bytes");
});
it("runtime-inspects without repairing deps", async () => {

View File

@@ -71,6 +71,24 @@ function formatInstallLines(install: PluginInstallRecord | undefined): string[]
if (install.version) {
lines.push(`Recorded version: ${install.version}`);
}
if (install.clawhubPackage) {
lines.push(`ClawHub package: ${install.clawhubPackage}`);
}
if (install.clawhubChannel) {
lines.push(`ClawHub channel: ${install.clawhubChannel}`);
}
if (install.clawpackSha256) {
lines.push(`ClawPack sha256: ${install.clawpackSha256}`);
}
if (install.clawpackSpecVersion !== undefined) {
lines.push(`ClawPack spec: ${install.clawpackSpecVersion}`);
}
if (install.clawpackManifestSha256) {
lines.push(`ClawPack manifest sha256: ${install.clawpackManifestSha256}`);
}
if (install.clawpackSize !== undefined) {
lines.push(`ClawPack size: ${install.clawpackSize} bytes`);
}
if (install.installedAt) {
lines.push(`Installed at: ${install.installedAt}`);
}