@linxin666/dsh-client-ui-plugin-manager 0.4.2 → 0.4.3

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.
@@ -4,19 +4,50 @@
4
4
  * the loader accepts a standalone install of the same package side by side;
5
5
  * without this guard the second instance would still re-register the same
6
6
  * webserver routes, tools, settings namespaces, and system-prompt sections
7
- * and fail the boot. mountOnce makes the second host apply a no-op for the
8
- * lifetime of the first instance (the browser half is already deduped by
9
- * package name in the client module host).
7
+ * and fail the boot. mountOnce makes a mount of an already-mounted package a
8
+ * no-op for as long as the first instance lives (the browser half is already
9
+ * deduped by package name in the client module host).
10
+ *
11
+ * A no-op is only safe while the holder is ALIVE. The holder can be disposed
12
+ * long after the refused mount ran its course: the Host reloads a profile by
13
+ * creating the new loader entries before the old ones are torn down (a
14
+ * plugin-manager enable/disable/install write, a settings-driven row reload,
15
+ * HMR), so the new aggregate shell entry mounts its family plugin while the
16
+ * previous entry still owns the name. Dropping that refused mount lost the
17
+ * plugin for good - the previous entry then disposed its own mount, releasing
18
+ * the name with nobody left to take it, and the family row stayed listed as
19
+ * active while its host routes 404ed (the task-board panel showed
20
+ * "board.hostError.notMounted", no degraded record appeared, and only a Host
21
+ * restart recovered it).
22
+ *
23
+ * The refused mount is therefore QUEUED, not dropped, and replayed the moment
24
+ * the holder releases the name - if the waiting fiber is still alive then. The
25
+ * single-instance guarantee is unchanged: exactly one mount is live per
26
+ * package name, and the replay re-enters the guard so a later mount still
27
+ * dedupes against it.
10
28
  *
11
29
  * The registry rides a global symbol so two module instances of the same
12
- * package (npm copy vs repository link) still share one verdict. cordis
13
- * `ctx.effect` runs its callback immediately and treats the callback's
30
+ * package (npm copy vs repository link) still share one verdict. That symbol
31
+ * is a CROSS-REPOSITORY contract, not this file's private state: the four
32
+ * satellite packages (dsh-skins / dsh-pet / dsh-presets /
33
+ * dsh-community-plugins) are separate repositories carrying their own copy of
34
+ * this guard, rebuilt on their own schedule, so the value under `MOUNTED`
35
+ * must keep the shape every published copy reads (a `Set` of package names
36
+ * with `has`/`add`/`delete`). The wait queues this guard added therefore live
37
+ * under their own additive key, and the registry reads back a `Set` even when
38
+ * some other build left a different value there. Changing `MOUNTED`'s shape
39
+ * in place broke that contract once: a satellite's legacy copy created a
40
+ * `Set`, the family's new copy read it as a `Map`, and every family row
41
+ * mounted after it failed with "claims.get is not a function".
42
+ *
43
+ * cordis `ctx.effect` runs its callback immediately and treats the callback's
14
44
  * return value as the fiber disposer, so the unmarker is returned, not run.
15
45
  */
16
46
  /**
17
47
  * Wrap a cordis plugin apply so the package runs at most once per process.
18
- * The first mount registers normally and unmarks when its fiber disposes;
19
- * any later mount of the same package name is a no-op.
48
+ * The first mount registers normally and releases the name when its fiber
49
+ * disposes; a mount refused while that name is held waits for the release and
50
+ * then runs, unless its own fiber disposes first.
20
51
  * @param packageName - npm package identity shared by every install source.
21
52
  * @param fn - the original plugin apply.
22
53
  * @returns an apply of the same shape.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@linxin666/dsh-client-ui-plugin-manager",
3
- "description": "Plugin manager tab for the dsh web GUI Plugins settings section: installs plugins from npm or git through the official host channels, lists installed plugins with next-start enablement switches, surfaces install-time conflict actions with undo, and hands failures off to repair conversations.",
4
- "version": "0.4.2",
3
+ "description": "Update checking for the dsh web GUI's official Plugins page: compares installed plugins against the version their registry source serves, gates the update on the DSH runtime minimum the release declares, and drives the update through the official installer channel or this package's loopback CLI gateway.",
4
+ "version": "0.4.3",
5
5
  "icon": "icon.svg",
6
6
  "type": "module",
7
7
  "main": "lib/index.js",
@@ -27,12 +27,8 @@
27
27
  },
28
28
  "client": {
29
29
  "inject": [
30
- "@deepseek-ai/dsh-api-session-controller",
31
- "@deepseek-ai/dsh-api-workspace-controller",
32
30
  "@deepseek-ai/dsh-client-connection",
33
- "@deepseek-ai/dsh-client-ui-renderer",
34
- "@deepseek-ai/dsh-client-ui-settings",
35
- "@deepseek-ai/dsh-client-ui-workspace"
31
+ "@deepseek-ai/dsh-client-ui-renderer"
36
32
  ],
37
33
  "platform": "web"
38
34
  }
@@ -1,32 +0,0 @@
1
- import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
2
- import { type ControlChange } from '../core/conflict.ts';
3
- import type { InstallProgressItem, InstalledPluginItem, PluginControlItem, PluginFailuresSnapshot, PluginUpdateItem } from '../core/protocol.ts';
4
- /** Registration-side wire face used by the tab. */
5
- export interface PluginManagerTabInjected {
6
- /** Whether this browser has loopback authority to use the host routes. */
7
- isLoopback: boolean;
8
- /** Read the installed snapshot (the tab renders it read-only). */
9
- list: () => Promise<InstalledPluginItem[]>;
10
- /** Re-install one plugin from its recorded source. */
11
- update: (id: string) => Promise<InstalledPluginItem>;
12
- /** Compare installed versions against their sources. */
13
- checkUpdates: () => Promise<PluginUpdateItem[]>;
14
- /** Read the current install/update progress. */
15
- status: () => Promise<InstallProgressItem>;
16
- /** Read the recorded boot failures, plugin root, and safe-mode state. */
17
- failures: () => Promise<PluginFailuresSnapshot>;
18
- /** Persist the safe-mode marker (web: applied at the next manual restart). */
19
- setSafeMode: (enabled: boolean) => Promise<void>;
20
- /** Start a repair conversation over the plugin install root. */
21
- repairPlugin: (pluginRoot: string, message: string) => Promise<void>;
22
- /** Read the deployment-configured built-in product switches. */
23
- controlsList: () => Promise<PluginControlItem[]>;
24
- /** Persist one product's next-start enablement. */
25
- controlsSetEnabled: (pluginId: string, enabled: boolean) => Promise<PluginControlItem[]>;
26
- /** Conflicts the gateway host computed around the last install (gateway mode only). */
27
- lastInstallConflicts?: () => readonly ControlChange[];
28
- }
29
- /** Full component props assembled by the Settings slot renderer. */
30
- export type PluginManagerTabProps = PropsRuntime<'settings.plugins.tab'> & PropsLocale<'settings.pluginManager'> & InjectFace<PluginManagerTabInjected>;
31
- /** The plugin-manager settings tab. */
32
- export declare function PluginManagerTab(props: PluginManagerTabProps): import("react").JSX.Element;
@@ -1,58 +0,0 @@
1
- /**
2
- * Repair-conversation seed text. The failure surfaces this package still owns
3
- * hand off to the agent through the same shape: a recorded boot failure (the
4
- * failure-ring row) and an install-conflict change. The seeded message must be
5
- * self-contained — the repair session's workspace is the plugin install root,
6
- * so the agent's file tools reach the plugin code without leaving the
7
- * workspace boundary.
8
- *
9
- * Secret discipline: the seed carries only the spec, the host's truncated
10
- * failure message/stack, and paths. Callers must never append credentials,
11
- * tokens, or environment contents; the failure ring is the host's bounded,
12
- * pruned record and nothing else is added.
13
- * @module @linxin666/dsh-client-ui-plugin-manager/core
14
- */
15
- import type { PluginFailureItem } from './protocol.ts';
16
- import type { LayerState } from './patch-diff.ts';
17
- /** Localized fragments the builders assemble. */
18
- export interface RepairCopy {
19
- failureTitle: string;
20
- failurePluginLabel: string;
21
- failureKindLabel: string;
22
- failureAtLabel: string;
23
- failureMessageLabel: string;
24
- failureStackLabel: string;
25
- failurePathLabel: string;
26
- failureAsk: string;
27
- conflictTitle: string;
28
- conflictPluginLabel: string;
29
- conflictChangeLabel: string;
30
- conflictAsk: string;
31
- /** Localized names of the failure kinds. */
32
- kindNames: Record<PluginFailureItem['kind'], string>;
33
- /** Localized names of the layer states a conflict change traverses. */
34
- stateNames: Record<LayerState, string>;
35
- }
36
- /** Default copy (zh): the package's zh dictionary keys map onto these strings. */
37
- export declare const DEFAULT_REPAIR_COPY: RepairCopy;
38
- /**
39
- * Seed text for one boot-failure ring row: the failure record, so the agent
40
- * can attribute and fix it in place.
41
- * @param failure - the recorded failure row.
42
- * @param copy - localized fragments.
43
- * @returns the repair prompt text.
44
- */
45
- export declare function failureRepairMessage(failure: PluginFailureItem, copy?: RepairCopy): string;
46
- /**
47
- * Seed text for one install-conflict notice: the entry and its state change,
48
- * so the agent can attribute the conflict and resolve the double mount.
49
- * @param change - the conflict change (id, display name, from/to states).
50
- * @param copy - localized fragments.
51
- * @returns the repair prompt text.
52
- */
53
- export declare function conflictRepairMessage(change: {
54
- id: string;
55
- name: string;
56
- from: LayerState;
57
- to: LayerState;
58
- }, copy?: RepairCopy): string;