@trops/dash-core 0.1.531 → 0.1.532

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.
@@ -62327,6 +62327,55 @@ function buildGrantsListing$1(
62327
62327
 
62328
62328
  var widgetMcpGrantsListing = { buildGrantsListing: buildGrantsListing$1 };
62329
62329
 
62330
+ /**
62331
+ * expandToComponentRows
62332
+ *
62333
+ * Expand a registry's package-level installed-widget entries to one
62334
+ * row per component, mirroring the dotted form (`<scope>.<pkg>.<comp>`)
62335
+ * that the runtime grant store keys grants by. Without this fan-out,
62336
+ * the Privacy & Security panel only ever sees package-level rows
62337
+ * (`@trops/gmail`), and component-level rows had to be smuggled in
62338
+ * via the orphan-grant loop — disappearing the moment a user
62339
+ * fully-revoked their last tool grant for that component.
62340
+ *
62341
+ * Each fanned-out row preserves `packageId` so groupRowsByPackage
62342
+ * still buckets sibling components under the same package header.
62343
+ * Entries without a `componentNames` array (or with an empty one)
62344
+ * pass through unchanged — the package itself stays as the row.
62345
+ *
62346
+ * Pure function. No side effects. Mirrors the construction in
62347
+ * `src/Components/Dashboard/WidgetsTab.js:31`.
62348
+ */
62349
+
62350
+ function expandToComponentRows$1(installedWidgets) {
62351
+ if (!Array.isArray(installedWidgets)) return [];
62352
+ const out = [];
62353
+ for (const w of installedWidgets) {
62354
+ if (!w || typeof w !== "object") continue;
62355
+ if (typeof w.name !== "string" || !w.name) continue;
62356
+ const components = Array.isArray(w.componentNames) ? w.componentNames : [];
62357
+ if (components.length === 0) {
62358
+ out.push(w);
62359
+ continue;
62360
+ }
62361
+ const scope = w.scope ? String(w.scope).replace(/^@/, "") : null;
62362
+ const pkgName = w.packageId
62363
+ ? String(w.packageId).replace(/^@[^/]+\//, "")
62364
+ : null;
62365
+ for (const comp of components) {
62366
+ if (typeof comp !== "string" || !comp) continue;
62367
+ let id;
62368
+ if (scope && pkgName) id = `${scope}.${pkgName}.${comp}`;
62369
+ else if (pkgName) id = `${pkgName}.${comp}`;
62370
+ else id = comp;
62371
+ out.push({ ...w, name: id });
62372
+ }
62373
+ }
62374
+ return out;
62375
+ }
62376
+
62377
+ var expandToComponentRows_1 = { expandToComponentRows: expandToComponentRows$1 };
62378
+
62330
62379
  /**
62331
62380
  * grantDiff.js
62332
62381
  *
@@ -62480,6 +62529,7 @@ const {
62480
62529
  const { getWidgetMcpPermissions } = widgetPermissions;
62481
62530
  const { getWidgetRegistry } = widgetRegistryExports;
62482
62531
  const { buildGrantsListing } = widgetMcpGrantsListing;
62532
+ const { expandToComponentRows } = expandToComponentRows_1;
62483
62533
  const { isBroadening } = grantDiff;
62484
62534
 
62485
62535
  // Native confirm dialog for any set-grant call that broadens the
@@ -62565,6 +62615,13 @@ function setupWidgetMcpGrantsHandlers() {
62565
62615
  } catch (_e) {
62566
62616
  // Registry not initialized yet; fall back to grants-only listing.
62567
62617
  }
62618
+ // Slice 13e.1: expand each installed package to one row per
62619
+ // component so the Privacy panel keeps showing the per-widget
62620
+ // entry even after a full revoke. Without this, rows for
62621
+ // dotted-form widgetIds (`trops.gmail.GmailCompose`) only
62622
+ // appeared via the orphan-grant loop, vanishing the moment the
62623
+ // last tool grant was revoked.
62624
+ installedWidgets = expandToComponentRows(installedWidgets);
62568
62625
 
62569
62626
  const declaredByWidget = new Map();
62570
62627
  for (const w of installedWidgets) {