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

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.
@@ -0,0 +1,70 @@
1
+ import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
2
+ import type { InstallProgressItem, PluginUpdateItem } from '../core/protocol.ts';
3
+ /** One loader row of a bundle, as the official page's subject carries it. */
4
+ export interface PluginPageRowRef {
5
+ rowId: string;
6
+ moduleName: string;
7
+ enabled: boolean;
8
+ }
9
+ /** One bundle, as the official page's subject carries it. */
10
+ export interface PluginPageBundleRef {
11
+ name: string;
12
+ version?: string;
13
+ installed: boolean;
14
+ enabled: boolean;
15
+ rows: readonly PluginPageRowRef[];
16
+ }
17
+ /**
18
+ * The subject the official Plugins page renders a contributed section with:
19
+ * its bundle page, its row page, or an official plugin's page. This package
20
+ * only speaks to the bundle case.
21
+ */
22
+ export type PluginPageSubject = {
23
+ kind: 'bundle';
24
+ pkg: PluginPageBundleRef;
25
+ } | {
26
+ kind: 'row';
27
+ pkg: PluginPageBundleRef;
28
+ row: PluginPageRowRef;
29
+ } | {
30
+ kind: 'item';
31
+ id: string;
32
+ };
33
+ declare module '@deepseek-ai/dsh-client-ui-slots' {
34
+ interface SlotMap {
35
+ /**
36
+ * One section contributed under a Plugins page's own content. Declared at
37
+ * runtime by the official plugin-manager page's `main` registration; the
38
+ * type is re-declared here, identically, so this package can register into
39
+ * it without importing the page (the same way family plugins re-declare
40
+ * `plugins.bundle.config`).
41
+ */
42
+ 'plugins.detail.section': {
43
+ kind: 'list';
44
+ scope: 'root';
45
+ owner: {
46
+ subject: PluginPageSubject;
47
+ };
48
+ };
49
+ }
50
+ }
51
+ /** Registration-side wire face the patch consumes. */
52
+ export interface PluginUpdatePatchInjected {
53
+ /** Whether this browser has loopback authority to use the host routes. */
54
+ isLoopback: boolean;
55
+ /** Compare every installed plugin against the version its source serves. */
56
+ checkUpdates: () => Promise<PluginUpdateItem[]>;
57
+ /** Re-install one plugin from its recorded source. */
58
+ update: (id: string) => Promise<unknown>;
59
+ /** Read the current install/update progress. */
60
+ status: () => Promise<InstallProgressItem>;
61
+ }
62
+ /** Full component props assembled by the Plugins page's section renderer. */
63
+ export type PluginUpdatePatchProps = PropsRuntime<'plugins.detail.section'> & PropsLocale<'settings.pluginManager'> & InjectFace<PluginUpdatePatchInjected>;
64
+ /**
65
+ * The update block on one official Plugins page: one check action, the verdict
66
+ * for this page's bundle, and the update action it unlocks. The check is
67
+ * explicit rather than automatic because one check reads every installed
68
+ * plugin's registry manifest; a page visit must not fan that out.
69
+ */
70
+ export declare function PluginUpdatePatch(props: PluginUpdatePatchProps): import("react").JSX.Element | null;
@@ -1,42 +1,54 @@
1
1
  /**
2
- * Plugin-manager browser half: contributes the family plugin-manager tab to
3
- * the official Plugins settings section (`settings.plugins.tab` slot) and
4
- * provides the same dual-channel face as the `'pluginManager'` cordis
5
- * service for sibling client plugins. It is dual-channel: on runtimes with
6
- * the official installer services (DSHCode, the 1.0.4 checkout web) every
7
- * operation rides the official `/plugin-installer` and `/plugin-control`
8
- * loopback RPC channels (the single writer); on the npm-published web runtime
9
- * those channels do not exist, so the same face falls back to this package's
10
- * own loopback HTTP gateway, which spawns the official CLI for writes.
11
- * Neither the tab nor service consumers know which mode the face runs in.
2
+ * Plugin-manager browser half: contributes the package's one remaining
3
+ * surface — the check-for-updates block on the official Plugins page — and
4
+ * provides the dual-channel face as the `'pluginManager'` cordis service for
5
+ * sibling client plugins.
6
+ *
7
+ * It is dual-channel: on runtimes with the official installer services
8
+ * (DSHCode, the 1.0.4 checkout web) every operation rides the official
9
+ * `/plugin-installer` and `/plugin-control` loopback RPC channels (the single
10
+ * writer); on the npm-published web runtime those channels do not exist, so the
11
+ * same face falls back to this package's own loopback HTTP gateway, which
12
+ * spawns the official CLI for writes. Neither the patch nor service consumers
13
+ * know which mode the face runs in.
14
+ *
15
+ * The package used to register its own "Plugin manager" tab into the official
16
+ * Plugins settings section (`settings.plugins.tab`). Installing, uninstalling
17
+ * and enabling moved to the official page long ago, and the tab's remaining
18
+ * half was UI no official page renders; the tab is gone and its one genuinely
19
+ * missing capability — comparing an installed plugin against its registry
20
+ * source, with the DSH-runtime compatibility gate — now renders inside the
21
+ * official page through the `plugins.detail.section` seat it declares.
12
22
  * @module @linxin666/dsh-client-ui-plugin-manager/client
13
23
  */
14
24
  import type { Context as ClientContext } from '@deepseek-ai/cordis';
15
- import { type PluginManagerTabInjected } from './PluginManagerTab.tsx';
25
+ import { type PluginUpdatePatchInjected } from './PluginUpdatePatch.tsx';
16
26
  import { type PluginManagerKey } from './locales.ts';
17
27
  import { type PluginManagerService } from '../core/service.ts';
18
28
  declare module '@deepseek-ai/dsh-client-ui-slots' {
19
29
  interface LocaleNamespaceMap {
20
- /** Copy for the family plugin-manager tab. */
30
+ /** Copy for the check-for-updates patch. */
21
31
  'settings.pluginManager': PluginManagerKey;
22
32
  }
23
33
  }
24
- /** Services required by the slot registration and both channels. */
34
+ /** Services required by the patch registration and both channels. */
25
35
  export declare const inject: string[];
26
36
  /**
27
- * The face the Plugin manager tab and the `'pluginManager'` cordis service
28
- * share: the full tab surface plus the cross-plugin service contract.
37
+ * The face the update patch and the `'pluginManager'` cordis service share:
38
+ * the patch's wire surface plus the cross-plugin service contract. The gateway
39
+ * host still records install conflicts and boot failures; no client surface
40
+ * consumes either since the tab left, so neither is on this face.
29
41
  */
30
- export type PluginManagerFace = PluginManagerTabInjected & PluginManagerService;
42
+ export type PluginManagerFace = PluginUpdatePatchInjected & PluginManagerService;
31
43
  /**
32
44
  * Build the dual-channel face once: official-channel and gateway-channel
33
- * implementations, the mode detection that picks between them, the repair
34
- * handoff, and the change-notification listener set. The returned face is
35
- * both the tab's injected props and the value provided as the
45
+ * implementations, the mode detection that picks between them, and the
46
+ * change-notification listener set. The returned face is both the update
47
+ * patch's injected props and the value provided as the
36
48
  * `'pluginManager'` cordis service.
37
- * @param ctx - the client context (connection, workspaces, sessions).
49
+ * @param ctx - the client context (connection).
38
50
  * @returns the shared face.
39
51
  */
40
52
  export declare function createPluginManagerFace(ctx: ClientContext): PluginManagerFace;
41
- /** Contribute the family plugin-manager tab and provide the shared face. */
53
+ /** Contribute the check-for-updates patch and provide the shared face. */
42
54
  export declare function apply(ctx: ClientContext): void;
@@ -1,40 +1,26 @@
1
1
  /**
2
- * Locale dictionaries for the plugin-manager tab. The zh dictionary is the
3
- * key source; the en dictionary mirrors the exact key set.
2
+ * Locale dictionaries for the plugin-manager's official-page patch. The zh
3
+ * dictionary is the key source; the en dictionary mirrors the exact key set.
4
+ *
5
+ * The key set covers only what this package still renders: the
6
+ * check-for-updates block on a bundle's page in the official Plugins panel.
7
+ * The former tab's keys (inventory, conflicts, repair seeds, safe mode,
8
+ * aggregate children) left with that tab.
4
9
  * @module @linxin666/dsh-client-ui-plugin-manager/client
5
10
  */
6
11
  /** Simplified Chinese copy (the key-set source of truth). */
7
12
  declare const STATIC_ZH: {
8
- tab: string;
9
- manageElsewhere: string;
10
- loading: string;
11
- empty: string;
12
- userPlugins: string;
13
- products: string;
14
- conflictTitle: string;
15
- conflictDisabled: string;
16
- conflictEnabled: string;
17
- conflictChanged: string;
18
- undoConflict: string;
19
- conflictHint: string;
20
- version: string;
21
- latest: string;
22
- update: string;
23
- updating: string;
13
+ updateSection: string;
24
14
  checkUpdates: string;
25
15
  checking: string;
26
16
  noUpdates: string;
17
+ update: string;
18
+ updating: string;
19
+ latest: string;
27
20
  updateRequiresDsh: string;
28
21
  updateBlockedDsh: string;
29
22
  restartHint: string;
30
23
  failed: string;
31
- enabled: string;
32
- disabled: string;
33
- mixed: string;
34
- unavailable: string;
35
- uninstalled: string;
36
- source: string;
37
- applying: string;
38
24
  fetching: string;
39
25
  downloading: string;
40
26
  downloadingPercent: string;
@@ -42,71 +28,19 @@ declare const STATIC_ZH: {
42
28
  writing: string;
43
29
  localOnlyTitle: string;
44
30
  localOnlyBody: string;
45
- failureBadge: string;
46
- failureGroupTitle: string;
47
- repair: string;
48
- repairing: string;
49
- copyError: string;
50
- copied: string;
51
- safeModeBanner: string;
52
- exitSafeMode: string;
53
- npmSource: string;
54
- gitSource: string;
55
- lockedRowHint: string;
56
- childrenHint: string;
57
- childrenSummary: string;
58
- childrenShow: string;
59
- childrenHide: string;
60
- repairFailureTitle: string;
61
- repairFailurePluginLabel: string;
62
- repairFailureKindLabel: string;
63
- repairFailureAtLabel: string;
64
- repairFailureMessageLabel: string;
65
- repairFailureStackLabel: string;
66
- repairFailurePathLabel: string;
67
- repairFailureAsk: string;
68
- repairKindLoad: string;
69
- repairKindHang: string;
70
- repairKindLate: string;
71
- repairConflictTitle: string;
72
- repairConflictPluginLabel: string;
73
- repairConflictChangeLabel: string;
74
- repairConflictAsk: string;
75
- repairStateEnabled: string;
76
- repairStateDisabled: string;
77
- repairStateUninstalled: string;
78
31
  };
79
32
  export declare const zh: {
80
- tab: string;
81
- manageElsewhere: string;
82
- loading: string;
83
- empty: string;
84
- userPlugins: string;
85
- products: string;
86
- conflictTitle: string;
87
- conflictDisabled: string;
88
- conflictEnabled: string;
89
- conflictChanged: string;
90
- undoConflict: string;
91
- conflictHint: string;
92
- version: string;
93
- latest: string;
94
- update: string;
95
- updating: string;
33
+ updateSection: string;
96
34
  checkUpdates: string;
97
35
  checking: string;
98
36
  noUpdates: string;
37
+ update: string;
38
+ updating: string;
39
+ latest: string;
99
40
  updateRequiresDsh: string;
100
41
  updateBlockedDsh: string;
101
42
  restartHint: string;
102
43
  failed: string;
103
- enabled: string;
104
- disabled: string;
105
- mixed: string;
106
- unavailable: string;
107
- uninstalled: string;
108
- source: string;
109
- applying: string;
110
44
  fetching: string;
111
45
  downloading: string;
112
46
  downloadingPercent: string;
@@ -114,71 +48,19 @@ export declare const zh: {
114
48
  writing: string;
115
49
  localOnlyTitle: string;
116
50
  localOnlyBody: string;
117
- failureBadge: string;
118
- failureGroupTitle: string;
119
- repair: string;
120
- repairing: string;
121
- copyError: string;
122
- copied: string;
123
- safeModeBanner: string;
124
- exitSafeMode: string;
125
- npmSource: string;
126
- gitSource: string;
127
- lockedRowHint: string;
128
- childrenHint: string;
129
- childrenSummary: string;
130
- childrenShow: string;
131
- childrenHide: string;
132
- repairFailureTitle: string;
133
- repairFailurePluginLabel: string;
134
- repairFailureKindLabel: string;
135
- repairFailureAtLabel: string;
136
- repairFailureMessageLabel: string;
137
- repairFailureStackLabel: string;
138
- repairFailurePathLabel: string;
139
- repairFailureAsk: string;
140
- repairKindLoad: string;
141
- repairKindHang: string;
142
- repairKindLate: string;
143
- repairConflictTitle: string;
144
- repairConflictPluginLabel: string;
145
- repairConflictChangeLabel: string;
146
- repairConflictAsk: string;
147
- repairStateEnabled: string;
148
- repairStateDisabled: string;
149
- repairStateUninstalled: string;
150
51
  };
151
52
  export declare const en: {
152
- tab: string;
153
- manageElsewhere: string;
154
- loading: string;
155
- empty: string;
156
- userPlugins: string;
157
- products: string;
158
- conflictTitle: string;
159
- conflictDisabled: string;
160
- conflictEnabled: string;
161
- conflictChanged: string;
162
- undoConflict: string;
163
- conflictHint: string;
164
- version: string;
165
- latest: string;
166
- update: string;
167
- updating: string;
53
+ updateSection: string;
168
54
  checkUpdates: string;
169
55
  checking: string;
170
56
  noUpdates: string;
57
+ update: string;
58
+ updating: string;
59
+ latest: string;
171
60
  updateRequiresDsh: string;
172
61
  updateBlockedDsh: string;
173
62
  restartHint: string;
174
63
  failed: string;
175
- enabled: string;
176
- disabled: string;
177
- mixed: string;
178
- unavailable: string;
179
- uninstalled: string;
180
- source: string;
181
- applying: string;
182
64
  fetching: string;
183
65
  downloading: string;
184
66
  downloadingPercent: string;
@@ -186,39 +68,6 @@ export declare const en: {
186
68
  writing: string;
187
69
  localOnlyTitle: string;
188
70
  localOnlyBody: string;
189
- failureBadge: string;
190
- failureGroupTitle: string;
191
- repair: string;
192
- repairing: string;
193
- copyError: string;
194
- copied: string;
195
- safeModeBanner: string;
196
- exitSafeMode: string;
197
- npmSource: string;
198
- gitSource: string;
199
- lockedRowHint: string;
200
- childrenHint: string;
201
- childrenSummary: string;
202
- childrenShow: string;
203
- childrenHide: string;
204
- repairFailureTitle: string;
205
- repairFailurePluginLabel: string;
206
- repairFailureKindLabel: string;
207
- repairFailureAtLabel: string;
208
- repairFailureMessageLabel: string;
209
- repairFailureStackLabel: string;
210
- repairFailurePathLabel: string;
211
- repairFailureAsk: string;
212
- repairKindLoad: string;
213
- repairKindHang: string;
214
- repairKindLate: string;
215
- repairConflictTitle: string;
216
- repairConflictPluginLabel: string;
217
- repairConflictChangeLabel: string;
218
- repairConflictAsk: string;
219
- repairStateEnabled: string;
220
- repairStateDisabled: string;
221
- repairStateUninstalled: string;
222
71
  };
223
72
  export type PluginManagerKey = keyof typeof STATIC_ZH;
224
73
  export {};
@@ -1,43 +1,21 @@
1
1
  /**
2
- * Conflict-ledger diffing. The official host applies structural conflict
3
- * rules at install time (disableControlsOnInstall: installing the dsh-web
4
- * family disables the built-in web-ui product rows so the two never
5
- * double-mount), but no UI surfaces what the rules just did. This module
6
- * diffs the plugin-control snapshots taken before and after an install and
7
- * classifies every state change so the tab can render it as a reversible,
8
- * attributable conflict notice.
2
+ * The install-conflict ledger row. The official host applies structural
3
+ * conflict rules at install time (disableControlsOnInstall: installing the
4
+ * dsh-web family disables the built-in web-ui product rows so the two never
5
+ * double-mount) and the gateway host records what the official CLI moved
6
+ * around an install, so a failure can be attributed to a concrete row rather
7
+ * than to an unknown install side effect.
9
8
  *
10
- * The install-time authority ends here: duplicate insert-id claims between
11
- * two user plugins carry no at-install signal through the RPC channels (the
12
- * Loader only re-reads the composition at the next start), so that failure
13
- * shape is left to the boot-failure ring — the real start is the authoritative
14
- * conflict detector.
9
+ * This is host-side bookkeeping. The panel that rendered these rows as
10
+ * reversible conflict notices lived in the removed "Plugin manager" tab, so
11
+ * only the row shape remains here.
15
12
  * @module @linxin666/dsh-client-ui-plugin-manager/core
16
13
  */
17
- import type { PluginControlItem } from './protocol.ts';
18
- /** One observed product-control state change between two snapshots. */
14
+ import type { LayerState } from './patch-diff.ts';
15
+ /** One observed row membership change between two layer snapshots. */
19
16
  export interface ControlChange {
20
17
  id: string;
21
18
  name: string;
22
- from: PluginControlItem['state'];
23
- to: PluginControlItem['state'];
19
+ from: LayerState;
20
+ to: LayerState;
24
21
  }
25
- /** Meaningful change kinds a conflict notice distinguishes. */
26
- export type ControlChangeKind = 'rule-disabled' | 'rule-enabled' | 'state-change';
27
- /**
28
- * Diff two plugin-control snapshots by id. Only entries present in both
29
- * snapshots with a changed state are reported; entries appearing or
30
- * disappearing are ordinary install/uninstall outcomes, not conflicts.
31
- * @param before - snapshot taken before the install.
32
- * @param after - snapshot taken after the install.
33
- * @returns one change per id whose state moved, in id order.
34
- */
35
- export declare function diffControls(before: readonly PluginControlItem[], after: readonly PluginControlItem[]): ControlChange[];
36
- /**
37
- * Classify one control-state change for messaging. A change into `disabled`
38
- * is the conflict rule's action (reversible by re-enabling); a change out of
39
- * `disabled` is a manual undo; anything else is reported neutrally.
40
- * @param change - one diff entry.
41
- * @returns the message kind.
42
- */
43
- export declare function classifyChange(change: ControlChange): ControlChangeKind;
@@ -85,13 +85,6 @@ export interface PluginFailuresSnapshot {
85
85
  /** Whether the host is running in safe mode (user plugins skipped). */
86
86
  safeMode: boolean;
87
87
  }
88
- /** One deployment-configured logical product switch. */
89
- export interface PluginControlItem {
90
- id: string;
91
- name: string;
92
- repository: string;
93
- state: 'enabled' | 'disabled' | 'mixed' | 'unavailable' | 'uninstalled';
94
- }
95
88
  /**
96
89
  * Validate and normalize a `list` / `uninstall` response value.
97
90
  * @param value - decoded but untrusted response value.
@@ -104,12 +97,6 @@ export declare function parsePluginList(value: unknown): InstalledPluginItem[];
104
97
  * @returns the typed installed-plugin row.
105
98
  */
106
99
  export declare function parseInstalledPlugin(value: unknown): InstalledPluginItem;
107
- /**
108
- * Validate and normalize a plugin-control `list` / `set-enabled` response value.
109
- * @param value - decoded but untrusted response value.
110
- * @returns the typed control items.
111
- */
112
- export declare function parsePluginControlSnapshot(value: unknown): PluginControlItem[];
113
100
  /**
114
101
  * Validate and normalize a `status` response value.
115
102
  * @param value - decoded but untrusted response value.