From 824cfa196dbd3aeb7168e02b3d6e674c15b38d69 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Fri, 1 May 2026 17:37:18 -0700 Subject: [PATCH] feat(plugins): show clawpack source facts in inspect --- src/cli/plugins-cli.list.test.ts | 21 +++++++++++++++++++++ src/cli/plugins-inspect-command.ts | 18 ++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/src/cli/plugins-cli.list.test.ts b/src/cli/plugins-cli.list.test.ts index 2519198c8de..a8ed65f4dd2 100644 --- a/src/cli/plugins-cli.list.test.ts +++ b/src/cli/plugins-cli.list.test.ts @@ -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 () => { diff --git a/src/cli/plugins-inspect-command.ts b/src/cli/plugins-inspect-command.ts index 9895f9e5173..60fead43655 100644 --- a/src/cli/plugins-inspect-command.ts +++ b/src/cli/plugins-inspect-command.ts @@ -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}`); }