From 16e3316beb60f00f48c6af8e54b9cce9c457febd Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Sat, 2 May 2026 07:37:25 -0700 Subject: [PATCH] fix(plugins): type channel clawhub install metadata --- src/channels/plugins/catalog.ts | 18 +++++++++++++++--- .../missing-configured-plugin-install.ts | 6 +++++- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/channels/plugins/catalog.ts b/src/channels/plugins/catalog.ts index ad6c3022537..331b7b4fed2 100644 --- a/src/channels/plugins/catalog.ts +++ b/src/channels/plugins/catalog.ts @@ -234,9 +234,7 @@ function resolveInstallInfo(params: { : localPath ? "local" : "npm"; - return { - ...(clawhubSpec ? { clawhubSpec } : {}), - ...(npmSpec ? { npmSpec } : {}), + const install = { ...(localPath ? { localPath } : {}), defaultChoice, ...(params.install?.minHostVersion ? { minHostVersion: params.install.minHostVersion } : {}), @@ -247,6 +245,20 @@ function resolveInstallInfo(params: { ? { allowInvalidConfigRecovery: true } : {}), }; + if (clawhubSpec) { + return { + clawhubSpec, + ...(npmSpec ? { npmSpec } : {}), + ...install, + }; + } + if (!npmSpec) { + return null; + } + return { + npmSpec, + ...install, + }; } function buildCatalogEntryFromManifest(params: { diff --git a/src/commands/doctor/shared/missing-configured-plugin-install.ts b/src/commands/doctor/shared/missing-configured-plugin-install.ts index 3048b76d671..8c131cf1945 100644 --- a/src/commands/doctor/shared/missing-configured-plugin-install.ts +++ b/src/commands/doctor/shared/missing-configured-plugin-install.ts @@ -68,10 +68,14 @@ function collectDownloadableInstallCandidates(params: { ) { continue; } + const npmSpec = entry.install.npmSpec?.trim(); + if (!npmSpec) { + continue; + } candidates.set(pluginId, { pluginId, label: entry.meta.label, - npmSpec: entry.install.npmSpec, + npmSpec, ...(entry.install.expectedIntegrity ? { expectedIntegrity: entry.install.expectedIntegrity } : {}),