dsh-plugin-shop 0.4.7 → 0.4.8

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
@@ -50,9 +50,9 @@ install them once with `npm install -g @deepseek-ai/dsh pnpm` and verify with
50
50
  # holds back very recent releases, so a bare `add dsh-plugin-shop` can hand
51
51
  # you an older version for a while. Pin the current release — refresh it
52
52
  # with `npm view dsh-plugin-shop version`.
53
- dsh plugin --profile web add dsh-plugin-shop@0.4.7
53
+ dsh plugin --profile web add dsh-plugin-shop@0.4.8
54
54
  # or straight through npx, nothing installed:
55
- npx -y @deepseek-ai/dsh plugin --profile web add dsh-plugin-shop@0.4.7
55
+ npx -y @deepseek-ai/dsh plugin --profile web add dsh-plugin-shop@0.4.8
56
56
  ```
57
57
 
58
58
  Replace `web` with your profile if you use another one. Then restart `dsh` once — a
@@ -82,7 +82,7 @@ ls -1 "${DSH_HOME:-$HOME/.dsh}/profiles" | grep -v '^node_modules$'
82
82
  cooldown, and deterministic installs are the point of the agent path.
83
83
 
84
84
  ```sh
85
- dsh plugin --profile <profile> add dsh-plugin-shop@0.4.7
85
+ dsh plugin --profile <profile> add dsh-plugin-shop@0.4.8
86
86
  ```
87
87
 
88
88
  **3. Verify — do not skip this.** A zero exit from step 2 means pnpm resolved the
package/lib/client.js CHANGED
@@ -6106,6 +6106,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6106
6106
  //#region src/client/index.ts
6107
6107
  /** Dictionary namespace owned by this plugin. */
6108
6108
  const NS = "settings.shop";
6109
+ /** The boot-time warm fetch: the catalog the tab wants on its first open.
6110
+ * Started in apply — the client bundle boots with the web app, long before
6111
+ * the user reaches Settings — so the host's slow network fetch runs while
6112
+ * nobody is looking at the shop, and the tab's mount consumes this promise
6113
+ * instead of starting its own fetch. A rejection stays stored (the injected
6114
+ * catalog falls back to a fresh call); the extra catch keeps the
6115
+ * fire-and-forget from surfacing as an unhandled rejection. */
6116
+ let warmCatalog = null;
6109
6117
  /** Services required by the tab registration and the Remote mount.
6110
6118
  *
6111
6119
  * `remote.shop` is deliberately ABSENT: this package both mounts its own
@@ -6135,8 +6143,22 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6135
6143
  if (!result.ok) throw new Error(`shop remote: ${result.error.code}: ${result.error.message}`);
6136
6144
  return result.value;
6137
6145
  };
6146
+ warmCatalog = null;
6147
+ warmCatalog = Promise.resolve(ns.catalog(void 0)).then((result) => unwrap(result));
6148
+ warmCatalog.catch(() => {});
6149
+ Promise.resolve(ns.installed()).then((result) => unwrap(result)).catch(() => {});
6150
+ Promise.resolve(ns.version()).then((result) => unwrap(result)).catch(() => {});
6138
6151
  const injected = () => ({
6139
- catalog: async (args) => unwrap(await ns.catalog(args)),
6152
+ catalog: async (args) => {
6153
+ if (args?.refresh === true) return unwrap(await ns.catalog(args));
6154
+ const warm = warmCatalog;
6155
+ if (warm !== null) try {
6156
+ return await warm;
6157
+ } catch {}
6158
+ const fresh = unwrap(await ns.catalog(args));
6159
+ warmCatalog = Promise.resolve(fresh);
6160
+ return fresh;
6161
+ },
6140
6162
  install: async (args) => unwrap(await ns.installStart(args)),
6141
6163
  installStatus: async (args) => unwrap(await ns.installStatus(args)),
6142
6164
  setEnabled: async (args) => unwrap(await ns.setEnabled(args)),
@@ -3,7 +3,7 @@
3
3
  * that browses the catalog, installs with acknowledgement, toggles
4
4
  * enablement, lists installed plugins, and restarts dsh after installs.
5
5
  * Mounts the shop Remote itself (the assembly does not know this package)
6
- * and holds no privilege beyond the seven `shop/*` methods (§5.3).
6
+ * and holds no privilege beyond the nine `shop/*` methods (§5.3).
7
7
  */
8
8
  import type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client';
9
9
  import type { ShopLocaleKey } from './locales.ts';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-shop",
3
- "version": "0.4.7",
3
+ "version": "0.4.8",
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",