fix(plugins): type channel clawhub install metadata

This commit is contained in:
Vincent Koc
2026-05-02 07:37:25 -07:00
parent 9281eee702
commit 16e3316beb
2 changed files with 20 additions and 4 deletions

View File

@@ -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: {

View File

@@ -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 }
: {}),