dsh-plugin-shop 0.5.1 → 0.5.2

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/README.md CHANGED
@@ -52,9 +52,9 @@ install them once with `npm install -g @deepseek-ai/dsh pnpm` and verify with
52
52
  # holds back very recent releases, so a bare `add dsh-plugin-shop` can hand
53
53
  # you an older version for a while. Pin the current release — refresh it
54
54
  # with `npm view dsh-plugin-shop version`.
55
- dsh plugin --profile web add dsh-plugin-shop@0.5.1
55
+ dsh plugin --profile web add dsh-plugin-shop@0.5.2
56
56
  # or straight through npx, nothing installed:
57
- npx -y @deepseek-ai/dsh plugin --profile web add dsh-plugin-shop@0.5.1
57
+ npx -y @deepseek-ai/dsh plugin --profile web add dsh-plugin-shop@0.5.2
58
58
  ```
59
59
 
60
60
  Replace `web` with your profile if you use another one. Then restart `dsh` once — a
@@ -84,7 +84,7 @@ ls -1 "${DSH_HOME:-$HOME/.dsh}/profiles" | grep -v '^node_modules$'
84
84
  cooldown, and deterministic installs are the point of the agent path.
85
85
 
86
86
  ```sh
87
- dsh plugin --profile <profile> add dsh-plugin-shop@0.5.1
87
+ dsh plugin --profile <profile> add dsh-plugin-shop@0.5.2
88
88
  ```
89
89
 
90
90
  **3. Verify — do not skip this.** A zero exit from step 2 means pnpm resolved the
package/lib/client.js CHANGED
@@ -4427,7 +4427,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4427
4427
  },
4428
4428
  sourceLocation: {
4429
4429
  "file": "packages/dsh-plugin-shop/src/host/index.ts",
4430
- "line": 447,
4430
+ "line": 468,
4431
4431
  "column": 9
4432
4432
  }
4433
4433
  },
@@ -4445,7 +4445,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4445
4445
  },
4446
4446
  sourceLocation: {
4447
4447
  "file": "packages/dsh-plugin-shop/src/host/index.ts",
4448
- "line": 597,
4448
+ "line": 618,
4449
4449
  "column": 9
4450
4450
  }
4451
4451
  },
@@ -4473,7 +4473,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4473
4473
  },
4474
4474
  sourceLocation: {
4475
4475
  "file": "packages/dsh-plugin-shop/src/host/index.ts",
4476
- "line": 473,
4476
+ "line": 494,
4477
4477
  "column": 9
4478
4478
  }
4479
4479
  },
@@ -4500,7 +4500,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4500
4500
  },
4501
4501
  sourceLocation: {
4502
4502
  "file": "packages/dsh-plugin-shop/src/host/index.ts",
4503
- "line": 586,
4503
+ "line": 607,
4504
4504
  "column": 3
4505
4505
  }
4506
4506
  },
@@ -4518,7 +4518,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4518
4518
  },
4519
4519
  sourceLocation: {
4520
4520
  "file": "packages/dsh-plugin-shop/src/host/index.ts",
4521
- "line": 721,
4521
+ "line": 742,
4522
4522
  "column": 9
4523
4523
  }
4524
4524
  },
@@ -4545,8 +4545,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4545
4545
  },
4546
4546
  sourceLocation: {
4547
4547
  "file": "packages/dsh-plugin-shop/src/host/index.ts",
4548
- "line": 400,
4549
- "column": 3
4548
+ "line": 421,
4549
+ "column": 9
4550
4550
  }
4551
4551
  },
4552
4552
  {
@@ -4573,7 +4573,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4573
4573
  },
4574
4574
  sourceLocation: {
4575
4575
  "file": "packages/dsh-plugin-shop/src/host/index.ts",
4576
- "line": 668,
4576
+ "line": 689,
4577
4577
  "column": 9
4578
4578
  }
4579
4579
  },
@@ -4600,7 +4600,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4600
4600
  },
4601
4601
  sourceLocation: {
4602
4602
  "file": "packages/dsh-plugin-shop/src/host/index.ts",
4603
- "line": 781,
4603
+ "line": 802,
4604
4604
  "column": 9
4605
4605
  }
4606
4606
  },
@@ -4618,7 +4618,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4618
4618
  },
4619
4619
  sourceLocation: {
4620
4620
  "file": "packages/dsh-plugin-shop/src/host/index.ts",
4621
- "line": 765,
4621
+ "line": 786,
4622
4622
  "column": 9
4623
4623
  }
4624
4624
  }
package/lib/index.js CHANGED
@@ -1235,11 +1235,18 @@ let ShopGateway = (() => {
1235
1235
  if (this.profileDir !== void 0) return this.profileDir;
1236
1236
  return discoverProfile(fileURLToPath(import.meta.url), this.bootBaseDir()).dir;
1237
1237
  }
1238
- listInventory() {
1239
- if (this.inventory !== void 0) return this.inventory.list();
1240
- const inventory = this.ctx.get?.("pluginInventory");
1241
- if (inventory === void 0) throw new Error("dsh-plugin-shop: pluginInventory service is not mounted");
1242
- return inventory.list();
1238
+ /** The inventory, through the wire remote: an envelope `{ ok, value }` or
1239
+ * `{ ok: false, error }`. Each row is re-validated before trust (same
1240
+ * discipline as the rowConfig cast). */
1241
+ async listInventory() {
1242
+ const remote = this.inventory ?? this.ctx.get?.("pluginInventory");
1243
+ if (remote === void 0) throw new Error("dsh-plugin-shop: pluginInventory service is not mounted");
1244
+ const result = await remote.list();
1245
+ const list = Array.isArray(result) ? result : result.entries;
1246
+ if (!Array.isArray(list)) return [];
1247
+ const entries = [];
1248
+ for (const item of list) if (item !== null && typeof item === "object" && typeof item.entryId === "string" && typeof item.moduleName === "string" && typeof item.enabled === "boolean") entries.push(item);
1249
+ return entries;
1243
1250
  }
1244
1251
  /** The Loader's boot-layer entries; a harness without the loader answers
1245
1252
  * with an empty list (there is then nothing to live-disable). */
@@ -1276,12 +1283,12 @@ let ShopGateway = (() => {
1276
1283
  * rules — the CLI's watchUserPatches applies either through HMR. The shop's
1277
1284
  * own row and the framework's bundles are never toggleable: disabling the
1278
1285
  * host chain would break HMR itself. */
1279
- setEnabled(args) {
1286
+ async setEnabled(args) {
1280
1287
  if (args.name === "dsh-plugin-shop" || args.name.startsWith("@deepseek-ai/")) return {
1281
1288
  ok: false,
1282
1289
  detail: `dsh-plugin-shop: ${args.name} is part of the harness chain and cannot be toggled from the shop`
1283
1290
  };
1284
- const entry = this.listInventory().find((entry) => entry.moduleName === args.name);
1291
+ const entry = (await this.listInventory()).find((entry) => entry.moduleName === args.name);
1285
1292
  if (entry === void 0) return {
1286
1293
  ok: false,
1287
1294
  detail: `dsh-plugin-shop: ${args.name} is not installed`
@@ -1459,7 +1466,7 @@ let ShopGateway = (() => {
1459
1466
  const pins = readRepoPins(this.pinFs, this.pinsPath());
1460
1467
  let byName = /* @__PURE__ */ new Map();
1461
1468
  try {
1462
- byName = new Map(this.listInventory().map((entry) => [entry.moduleName, entry.enabled]));
1469
+ byName = new Map((await this.listInventory()).map((entry) => [entry.moduleName, entry.enabled]));
1463
1470
  } catch {}
1464
1471
  const installed = [];
1465
1472
  for (const entry of this.lastSnapshot.entries) {
@@ -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":447,"column":9},
154
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":468,"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":597,"column":9},
169
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":618,"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":473,"column":9},
195
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":494,"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":586,"column":3},
220
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":607,"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":721,"column":9},
235
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":742,"column":9},
236
236
  },
237
237
  {
238
238
  id: 'dsh-plugin-shop#shop/setEnabled',
@@ -257,7 +257,7 @@ export const TYPERT = {
257
257
  typeSymbol: 'dsh-plugin-shop/types#ShopSetEnabledResult',
258
258
  schema: dsh_plugin_shop_shop_setEnabled_result$schema,
259
259
  },
260
- sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":400,"column":3},
260
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":421,"column":9},
261
261
  },
262
262
  {
263
263
  id: 'dsh-plugin-shop#shop/uninstallStart',
@@ -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":668,"column":9},
286
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":689,"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":781,"column":9},
311
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":802,"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":765,"column":9},
326
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":786,"column":9},
327
327
  },
328
328
  ],
329
329
  model: {
@@ -345,7 +345,7 @@ export const TYPERT = {
345
345
  {
346
346
  "kind": "method",
347
347
  "name": "setEnabled",
348
- "signature": "@Remote('setEnabled') setEnabled(args: { name: string; enabled: boolean }): ShopSetEnabledResult",
348
+ "signature": "@Remote('setEnabled') async setEnabled(args: { name: string; enabled: boolean }): Promise<ShopSetEnabledResult>",
349
349
  "summary": "Enable or disable one installed plugin, hot (§8): a disable writes the row to the user layer, an enable drops it again so the bundle default rules — the CLI's watchUserPatches applies either through HMR.",
350
350
  "jsDoc": "/** Enable or disable one installed plugin, hot (§8): a disable writes the\n * row to the user layer, an enable drops it again so the bundle default\n * rules — the CLI's watchUserPatches applies either through HMR. The shop's\n * own row and the framework's bundles are never toggleable: disabling the\n * host chain would break HMR itself. */"
351
351
  },
@@ -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":447,"column":9},
151
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":468,"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":597,"column":9},
166
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":618,"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":473,"column":9},
192
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":494,"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":586,"column":3},
217
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":607,"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":721,"column":9},
232
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":742,"column":9},
233
233
  },
234
234
  {
235
235
  id: 'dsh-plugin-shop#shop/setEnabled',
@@ -254,7 +254,7 @@ export const TYPERT_REMOTE = {
254
254
  typeSymbol: 'dsh-plugin-shop/types#ShopSetEnabledResult',
255
255
  schema: dsh_plugin_shop_shop_setEnabled_result$schema,
256
256
  },
257
- sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":400,"column":3},
257
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":421,"column":9},
258
258
  },
259
259
  {
260
260
  id: 'dsh-plugin-shop#shop/uninstallStart',
@@ -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":668,"column":9},
283
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":689,"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":781,"column":9},
308
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":802,"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":765,"column":9},
323
+ sourceLocation: {"file":"packages/dsh-plugin-shop/src/host/index.ts","line":786,"column":9},
324
324
  },
325
325
  ],
326
326
  }
@@ -39,9 +39,16 @@ export interface ShopGatewayOptions {
39
39
  profile?: string;
40
40
  /** The profile directory the user layer lives in; discovered when omitted. */
41
41
  profileDir?: string;
42
- /** The Loader plugin inventory; read from `ctx` when omitted. */
42
+ /** The Loader plugin inventory; read from `ctx` when omitted. The REAL
43
+ * host-side service returns the bare snapshot OBJECT `{ entries: [...] }`,
44
+ * not a bare array and not a wire envelope (hub-borrowings B assumed the
45
+ * array and the toggle crashed on the real shape — 0.5.2 fix; the envelope
46
+ * exists only on the remote's client side). Both shapes normalize in
47
+ * `listInventory()`. */
43
48
  inventory?: {
44
- list(): InventoryEntry[];
49
+ list(): Promise<{
50
+ entries: InventoryEntry[];
51
+ } | InventoryEntry[]>;
45
52
  };
46
53
  /** Test-only injection: the hot-mount functions; production uses the real
47
54
  * hotMount/hotUnmount. */
@@ -238,6 +245,9 @@ export declare class ShopGateway extends TypertRemoteService {
238
245
  * stays lazy so `setEnabled` works in tests via the `profileDir` option
239
246
  * without requiring a real profile above this module. */
240
247
  private profileDirResolved;
248
+ /** The inventory, through the wire remote: an envelope `{ ok, value }` or
249
+ * `{ ok: false, error }`. Each row is re-validated before trust (same
250
+ * discipline as the rowConfig cast). */
241
251
  private listInventory;
242
252
  /** The Loader's boot-layer entries; a harness without the loader answers
243
253
  * with an empty list (there is then nothing to live-disable). */
@@ -257,7 +267,7 @@ export declare class ShopGateway extends TypertRemoteService {
257
267
  setEnabled(args: {
258
268
  name: string;
259
269
  enabled: boolean;
260
- }): ShopSetEnabledResult;
270
+ }): Promise<ShopSetEnabledResult>;
261
271
  private rowConfig;
262
272
  /** The explicit restart override. Only the row's `config:` sub-object is
263
273
  * passed to a plugin — a top-level `allowRestart:` beside `name:` would be
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-shop",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
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",