pi-extmgr 0.1.12 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/ui/unified.ts +19 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-extmgr",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "Enhanced UX for managing local Pi extensions and community packages",
5
5
  "keywords": [
6
6
  "pi-package",
package/src/ui/unified.ts CHANGED
@@ -269,7 +269,7 @@ async function showInteractiveOnce(
269
269
  return await handleUnifiedAction(result, items, staged, byId, ctx, pi);
270
270
  }
271
271
 
272
- function buildUnifiedItems(
272
+ export function buildUnifiedItems(
273
273
  localEntries: Awaited<ReturnType<typeof discoverExtensions>>,
274
274
  installedPackages: InstalledPackage[],
275
275
  packageExtensions: PackageExtensionEntry[],
@@ -278,6 +278,23 @@ function buildUnifiedItems(
278
278
  const items: UnifiedItem[] = [];
279
279
  const localPaths = new Set<string>();
280
280
 
281
+ const packageExtensionGroups = new Map<string, PackageExtensionEntry[]>();
282
+ for (const entry of packageExtensions) {
283
+ const key = `${entry.packageScope}:${entry.packageSource.toLowerCase()}`;
284
+ const group = packageExtensionGroups.get(key) ?? [];
285
+ group.push(entry);
286
+ packageExtensionGroups.set(key, group);
287
+ }
288
+
289
+ const visiblePackageExtensions = packageExtensions.filter((entry) => {
290
+ const key = `${entry.packageScope}:${entry.packageSource.toLowerCase()}`;
291
+ const group = packageExtensionGroups.get(key) ?? [];
292
+
293
+ // Avoid duplicate-looking rows for packages that expose a single enabled extension entrypoint.
294
+ // Keep extension rows when there are multiple entrypoints, or when an entry is disabled so it can be re-enabled.
295
+ return group.length > 1 || entry.state === "disabled";
296
+ });
297
+
281
298
  // Add local extensions
282
299
  for (const entry of localEntries) {
283
300
  localPaths.add(entry.activePath?.toLowerCase() ?? "");
@@ -294,7 +311,7 @@ function buildUnifiedItems(
294
311
  });
295
312
  }
296
313
 
297
- for (const entry of packageExtensions) {
314
+ for (const entry of visiblePackageExtensions) {
298
315
  items.push({
299
316
  type: "package-extension",
300
317
  id: entry.id,