dsh-plugin-shop 0.5.3 → 0.5.4-beta.1

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.
package/lib/client.js CHANGED
@@ -4434,7 +4434,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4434
4434
  },
4435
4435
  sourceLocation: {
4436
4436
  "file": "packages/dsh-plugin-shop/src/host/index.ts",
4437
- "line": 521,
4437
+ "line": 525,
4438
4438
  "column": 9
4439
4439
  }
4440
4440
  },
@@ -4452,7 +4452,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4452
4452
  },
4453
4453
  sourceLocation: {
4454
4454
  "file": "packages/dsh-plugin-shop/src/host/index.ts",
4455
- "line": 677,
4455
+ "line": 681,
4456
4456
  "column": 9
4457
4457
  }
4458
4458
  },
@@ -4480,7 +4480,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4480
4480
  },
4481
4481
  sourceLocation: {
4482
4482
  "file": "packages/dsh-plugin-shop/src/host/index.ts",
4483
- "line": 547,
4483
+ "line": 551,
4484
4484
  "column": 9
4485
4485
  }
4486
4486
  },
@@ -4507,7 +4507,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4507
4507
  },
4508
4508
  sourceLocation: {
4509
4509
  "file": "packages/dsh-plugin-shop/src/host/index.ts",
4510
- "line": 666,
4510
+ "line": 670,
4511
4511
  "column": 3
4512
4512
  }
4513
4513
  },
@@ -4525,7 +4525,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4525
4525
  },
4526
4526
  sourceLocation: {
4527
4527
  "file": "packages/dsh-plugin-shop/src/host/index.ts",
4528
- "line": 827,
4528
+ "line": 831,
4529
4529
  "column": 9
4530
4530
  }
4531
4531
  },
@@ -4580,7 +4580,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4580
4580
  },
4581
4581
  sourceLocation: {
4582
4582
  "file": "packages/dsh-plugin-shop/src/host/index.ts",
4583
- "line": 769,
4583
+ "line": 773,
4584
4584
  "column": 9
4585
4585
  }
4586
4586
  },
@@ -4607,7 +4607,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4607
4607
  },
4608
4608
  sourceLocation: {
4609
4609
  "file": "packages/dsh-plugin-shop/src/host/index.ts",
4610
- "line": 887,
4610
+ "line": 891,
4611
4611
  "column": 9
4612
4612
  }
4613
4613
  },
@@ -4625,7 +4625,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4625
4625
  },
4626
4626
  sourceLocation: {
4627
4627
  "file": "packages/dsh-plugin-shop/src/host/index.ts",
4628
- "line": 871,
4628
+ "line": 875,
4629
4629
  "column": 9
4630
4630
  }
4631
4631
  }
@@ -4815,11 +4815,28 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4815
4815
  function categoryLocaleKey(category) {
4816
4816
  return CATEGORY_KEYS[category];
4817
4817
  }
4818
+ /**
4819
+ * One entry's star count from the sidecar, or undefined when it has none.
4820
+ *
4821
+ * The sidecar keys a github entry by its repo full name and an npm entry by
4822
+ * its package name — two disjoint keyspaces (registry `stars-assemble.ts`).
4823
+ * Every reader must go through this one function: the card read the repo key
4824
+ * and the shelf sort read the name, so for 2202 of the live catalog's 2210
4825
+ * github listings the number deciding a row's position was not the number
4826
+ * printed on it. 1590 of them sorted as unstarred — a 4014-star plugin at the
4827
+ * bottom of the shelf — and where an unrelated npm package happened to share
4828
+ * a listed entry's name, its stars ranked that entry instead: a 1-star
4829
+ * plugin held the first page on 13960 stars belonging to another project's
4830
+ * repo, one the catalog never even listed.
4831
+ */
4832
+ function starsOf(entry, stars) {
4833
+ return stars[entry.repo ?? entry.name];
4834
+ }
4818
4835
  /** Sort the shelf: stars descending, un-starred entries last, name ascending
4819
4836
  * (case-insensitive) on ties (spec 2026-08-26-github-stars-design.md D1).
4820
4837
  * Display-time only — the catalog's own name sort is untouched. */
4821
4838
  function sortByStars(entries, stars) {
4822
- const count = (e) => stars[e.name] ?? -1;
4839
+ const count = (e) => starsOf(e, stars) ?? -1;
4823
4840
  return [...entries].sort((a, b) => {
4824
4841
  const byStars = count(b) - count(a);
4825
4842
  if (byStars !== 0) return byStars;
@@ -6247,7 +6264,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6247
6264
  className: _dsh_plugin_shop_css_e3675a89_default.cards,
6248
6265
  children: [visible.map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EntryCard, {
6249
6266
  entry,
6250
- stars: stars[entry.repo ?? entry.name],
6267
+ stars: starsOf(entry, stars),
6251
6268
  installed: installedByName.get(entry.name),
6252
6269
  t,
6253
6270
  install,
package/lib/index.js CHANGED
@@ -987,16 +987,31 @@ function collectEntryIds(entries, into) {
987
987
  /**
988
988
  * Does a live loader entry id belong to the package that owns `owned`?
989
989
  *
990
- * A boot-layer entry carries the bare id its bundle patch inserted. The
991
- * shop's own hot subtree mounts that same row as `mkt-<id>` inside an Include
992
- * tree, which the loader spells `include:<tree>:mkt-<id>` the same plugin,
993
- * one restart earlier. Both spellings are the package's own row.
990
+ * `owned` holds CONFIG ids the ids a bundle patch's `insert` declares. A
991
+ * LIVE id is that id under the namespace of every tree composed above it,
992
+ * colon-joined, so the last segment is the declared id and the segments
993
+ * before it name the trees:
994
+ *
995
+ * - `foo` — no tree above the entry at all (a harness that composes the
996
+ * entry list directly).
997
+ * - `include:foo` — what a REAL dsh boot produces: app-boot mounts the whole
998
+ * profile as one root Include entry (`id: include`), so EVERY entry any
999
+ * bundle patch inserted is namespaced by it. Matching only the bare
1000
+ * spelling found no row for any installed package, and the toggle answered
1001
+ * "not in the running plugin tree" for all of them.
1002
+ * - `include:<tree>:mkt-foo` — the shop's own hot subtree, which prefixes its
1003
+ * rows `mkt-` so a plugin installed this session cannot collide with a
1004
+ * boot-layer id. The same plugin, one restart earlier.
1005
+ *
1006
+ * The last segment is therefore the answer, with `mkt-` stripped when a tree
1007
+ * namespace is present.
994
1008
  */
995
1009
  function ownsEntryId(owned, entryId) {
996
1010
  if (owned.has(entryId)) return true;
997
1011
  const colon = entryId.lastIndexOf(":");
998
1012
  if (colon === -1) return false;
999
1013
  const tail = entryId.slice(colon + 1);
1014
+ if (owned.has(tail)) return true;
1000
1015
  return tail.startsWith("mkt-") && owned.has(tail.slice(4));
1001
1016
  }
1002
1017
  //#endregion
@@ -1407,14 +1422,13 @@ let ShopGateway = (() => {
1407
1422
  detail: `dsh-plugin-shop: ${args.name} contributes no plugin entries, so there is nothing to enable or disable`
1408
1423
  };
1409
1424
  const ownedSet = new Set(owned);
1410
- const rows = (await this.listInventory()).filter((entry) => ownsEntryId(ownedSet, entry.entryId)).map((entry) => entry.entryId);
1411
- if (rows.length === 0) return {
1425
+ if ((await this.listInventory()).filter((entry) => ownsEntryId(ownedSet, entry.entryId)).length === 0) return {
1412
1426
  ok: false,
1413
1427
  detail: `dsh-plugin-shop: ${args.name} is installed but its entries are not in the running plugin tree; restart dsh to compose them`
1414
1428
  };
1415
1429
  setUserLayerRows({
1416
1430
  profileDir,
1417
- rows: rows.map((id) => ({
1431
+ rows: owned.map((id) => ({
1418
1432
  id,
1419
1433
  disabled: !args.enabled
1420
1434
  }))
@@ -151,7 +151,7 @@ export const TYPERT = {
151
151
  typeSymbol: 'dsh-plugin-shop/types#ShopCatalogResult',
152
152
  schema: dsh_plugin_shop_shop_catalog_result$schema,
153
153
  },
154
- sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":521,"column":9},
154
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":525,"column":9},
155
155
  },
156
156
  {
157
157
  id: 'dsh-plugin-shop#shop/installed',
@@ -166,7 +166,7 @@ export const TYPERT = {
166
166
  typeSymbol: 'dsh-plugin-shop#shop/installed:result',
167
167
  schema: dsh_plugin_shop_shop_installed_result$schema,
168
168
  },
169
- sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":677,"column":9},
169
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":681,"column":9},
170
170
  },
171
171
  {
172
172
  id: 'dsh-plugin-shop#shop/installStart',
@@ -192,7 +192,7 @@ export const TYPERT = {
192
192
  typeSymbol: 'dsh-plugin-shop/types#ShopInstallResult',
193
193
  schema: dsh_plugin_shop_shop_installStart_result$schema,
194
194
  },
195
- sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":547,"column":9},
195
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":551,"column":9},
196
196
  },
197
197
  {
198
198
  id: 'dsh-plugin-shop#shop/installStatus',
@@ -217,7 +217,7 @@ export const TYPERT = {
217
217
  typeSymbol: 'dsh-plugin-shop/types#ShopInstallStatusResult',
218
218
  schema: dsh_plugin_shop_shop_installStatus_result$schema,
219
219
  },
220
- sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":666,"column":3},
220
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":670,"column":3},
221
221
  },
222
222
  {
223
223
  id: 'dsh-plugin-shop#shop/restart',
@@ -232,7 +232,7 @@ export const TYPERT = {
232
232
  typeSymbol: 'dsh-plugin-shop/types#ShopRestartResult',
233
233
  schema: dsh_plugin_shop_shop_restart_result$schema,
234
234
  },
235
- sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":827,"column":9},
235
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":831,"column":9},
236
236
  },
237
237
  {
238
238
  id: 'dsh-plugin-shop#shop/setEnabled',
@@ -283,7 +283,7 @@ export const TYPERT = {
283
283
  typeSymbol: 'dsh-plugin-shop/types#ShopUninstallResult',
284
284
  schema: dsh_plugin_shop_shop_uninstallStart_result$schema,
285
285
  },
286
- sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":769,"column":9},
286
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":773,"column":9},
287
287
  },
288
288
  {
289
289
  id: 'dsh-plugin-shop#shop/updateStart',
@@ -308,7 +308,7 @@ export const TYPERT = {
308
308
  typeSymbol: 'dsh-plugin-shop/types#ShopUpdateResult',
309
309
  schema: dsh_plugin_shop_shop_updateStart_result$schema,
310
310
  },
311
- sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":887,"column":9},
311
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":891,"column":9},
312
312
  },
313
313
  {
314
314
  id: 'dsh-plugin-shop#shop/version',
@@ -323,7 +323,7 @@ export const TYPERT = {
323
323
  typeSymbol: 'dsh-plugin-shop/types#ShopVersionResult',
324
324
  schema: dsh_plugin_shop_shop_version_result$schema,
325
325
  },
326
- sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":871,"column":9},
326
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":875,"column":9},
327
327
  },
328
328
  ],
329
329
  model: {
@@ -148,7 +148,7 @@ export const TYPERT_REMOTE = {
148
148
  typeSymbol: 'dsh-plugin-shop/types#ShopCatalogResult',
149
149
  schema: dsh_plugin_shop_shop_catalog_result$schema,
150
150
  },
151
- sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":521,"column":9},
151
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":525,"column":9},
152
152
  },
153
153
  {
154
154
  id: 'dsh-plugin-shop#shop/installed',
@@ -163,7 +163,7 @@ export const TYPERT_REMOTE = {
163
163
  typeSymbol: 'dsh-plugin-shop#shop/installed:result',
164
164
  schema: dsh_plugin_shop_shop_installed_result$schema,
165
165
  },
166
- sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":677,"column":9},
166
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":681,"column":9},
167
167
  },
168
168
  {
169
169
  id: 'dsh-plugin-shop#shop/installStart',
@@ -189,7 +189,7 @@ export const TYPERT_REMOTE = {
189
189
  typeSymbol: 'dsh-plugin-shop/types#ShopInstallResult',
190
190
  schema: dsh_plugin_shop_shop_installStart_result$schema,
191
191
  },
192
- sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":547,"column":9},
192
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":551,"column":9},
193
193
  },
194
194
  {
195
195
  id: 'dsh-plugin-shop#shop/installStatus',
@@ -214,7 +214,7 @@ export const TYPERT_REMOTE = {
214
214
  typeSymbol: 'dsh-plugin-shop/types#ShopInstallStatusResult',
215
215
  schema: dsh_plugin_shop_shop_installStatus_result$schema,
216
216
  },
217
- sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":666,"column":3},
217
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":670,"column":3},
218
218
  },
219
219
  {
220
220
  id: 'dsh-plugin-shop#shop/restart',
@@ -229,7 +229,7 @@ export const TYPERT_REMOTE = {
229
229
  typeSymbol: 'dsh-plugin-shop/types#ShopRestartResult',
230
230
  schema: dsh_plugin_shop_shop_restart_result$schema,
231
231
  },
232
- sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":827,"column":9},
232
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":831,"column":9},
233
233
  },
234
234
  {
235
235
  id: 'dsh-plugin-shop#shop/setEnabled',
@@ -280,7 +280,7 @@ export const TYPERT_REMOTE = {
280
280
  typeSymbol: 'dsh-plugin-shop/types#ShopUninstallResult',
281
281
  schema: dsh_plugin_shop_shop_uninstallStart_result$schema,
282
282
  },
283
- sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":769,"column":9},
283
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":773,"column":9},
284
284
  },
285
285
  {
286
286
  id: 'dsh-plugin-shop#shop/updateStart',
@@ -305,7 +305,7 @@ export const TYPERT_REMOTE = {
305
305
  typeSymbol: 'dsh-plugin-shop/types#ShopUpdateResult',
306
306
  schema: dsh_plugin_shop_shop_updateStart_result$schema,
307
307
  },
308
- sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":887,"column":9},
308
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":891,"column":9},
309
309
  },
310
310
  {
311
311
  id: 'dsh-plugin-shop#shop/version',
@@ -320,7 +320,7 @@ export const TYPERT_REMOTE = {
320
320
  typeSymbol: 'dsh-plugin-shop/types#ShopVersionResult',
321
321
  schema: dsh_plugin_shop_shop_version_result$schema,
322
322
  },
323
- sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":871,"column":9},
323
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":875,"column":9},
324
324
  },
325
325
  ],
326
326
  }
@@ -130,6 +130,21 @@ export type Category = keyof typeof CATEGORY_KEYS;
130
130
  export declare const CATEGORY_ORDER: Category[];
131
131
  /** The locale key for one bare category value (the filter buttons). */
132
132
  export declare function categoryLocaleKey(category: Category): ShopLocaleKey;
133
+ /**
134
+ * One entry's star count from the sidecar, or undefined when it has none.
135
+ *
136
+ * The sidecar keys a github entry by its repo full name and an npm entry by
137
+ * its package name — two disjoint keyspaces (registry `stars-assemble.ts`).
138
+ * Every reader must go through this one function: the card read the repo key
139
+ * and the shelf sort read the name, so for 2202 of the live catalog's 2210
140
+ * github listings the number deciding a row's position was not the number
141
+ * printed on it. 1590 of them sorted as unstarred — a 4014-star plugin at the
142
+ * bottom of the shelf — and where an unrelated npm package happened to share
143
+ * a listed entry's name, its stars ranked that entry instead: a 1-star
144
+ * plugin held the first page on 13960 stars belonging to another project's
145
+ * repo, one the catalog never even listed.
146
+ */
147
+ export declare function starsOf(entry: CatalogEntry, stars: Record<string, number>): number | undefined;
133
148
  /** Sort the shelf: stars descending, un-starred entries last, name ascending
134
149
  * (case-insensitive) on ties (spec 2026-08-26-github-stars-design.md D1).
135
150
  * Display-time only — the catalog's own name sort is untouched. */
@@ -68,9 +68,23 @@ export declare function ownedEntryIds(options: {
68
68
  /**
69
69
  * Does a live loader entry id belong to the package that owns `owned`?
70
70
  *
71
- * A boot-layer entry carries the bare id its bundle patch inserted. The
72
- * shop's own hot subtree mounts that same row as `mkt-<id>` inside an Include
73
- * tree, which the loader spells `include:<tree>:mkt-<id>` the same plugin,
74
- * one restart earlier. Both spellings are the package's own row.
71
+ * `owned` holds CONFIG ids the ids a bundle patch's `insert` declares. A
72
+ * LIVE id is that id under the namespace of every tree composed above it,
73
+ * colon-joined, so the last segment is the declared id and the segments
74
+ * before it name the trees:
75
+ *
76
+ * - `foo` — no tree above the entry at all (a harness that composes the
77
+ * entry list directly).
78
+ * - `include:foo` — what a REAL dsh boot produces: app-boot mounts the whole
79
+ * profile as one root Include entry (`id: include`), so EVERY entry any
80
+ * bundle patch inserted is namespaced by it. Matching only the bare
81
+ * spelling found no row for any installed package, and the toggle answered
82
+ * "not in the running plugin tree" for all of them.
83
+ * - `include:<tree>:mkt-foo` — the shop's own hot subtree, which prefixes its
84
+ * rows `mkt-` so a plugin installed this session cannot collide with a
85
+ * boot-layer id. The same plugin, one restart earlier.
86
+ *
87
+ * The last segment is therefore the answer, with `mkt-` stripped when a tree
88
+ * namespace is present.
75
89
  */
76
90
  export declare function ownsEntryId(owned: ReadonlySet<string>, entryId: string): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-shop",
3
- "version": "0.5.3",
3
+ "version": "0.5.4-beta.1",
4
4
  "description": "The DeepSeek Harness plugin shop: browse, install, enable, and update dsh plugins from a git-auditable catalog.",
5
5
  "repository": {
6
6
  "type": "git",