fix: complete marketplace client remediation

This commit is contained in:
2026-08-28 23:14:41 +08:00
parent 2c3baf6dff
commit 11d0af0166
18 changed files with 1007 additions and 90 deletions

View File

@@ -85,6 +85,7 @@ export type PublicPluginInstallation = Readonly<{
pluginId: string;
releaseId?: string;
version?: string;
channel?: 'stable' | 'beta';
reason?: string;
}>;
@@ -122,6 +123,7 @@ function publicInstallation(snapshot: InstallationSnapshot): PublicPluginInstall
pluginId: snapshot.pluginId,
...(snapshot.releaseId ? { releaseId: snapshot.releaseId } : {}),
...(snapshot.version ? { version: snapshot.version } : {}),
...(snapshot.channel ? { channel: snapshot.channel } : {}),
...(snapshot.reason ? { reason: snapshot.reason } : {}),
};
}
@@ -134,10 +136,12 @@ async function publicLibrary(
try {
const record = await packageStore.getInstalled(pluginId);
return record ? {
status: 'installed' as const,
status: record.unavailableReason ? 'unavailable' as const : 'installed' as const,
pluginId: record.pluginId,
releaseId: record.releaseId,
version: record.version,
...(record.channel === undefined ? {} : { channel: record.channel }),
...(record.unavailableReason ? { reason: record.unavailableReason } : {}),
} : null;
} catch (error) {
const candidate = error && typeof error === 'object' && 'code' in error