@deepseek-ai/dsh-client-ui-plugin-manager 0.1.6-alpha.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/LICENSE +21 -0
- package/README.i18n.yaml +6 -0
- package/README.md +129 -0
- package/README.zh.md +129 -0
- package/lib/client.js +2550 -0
- package/lib/index.js +6 -0
- package/lib/types/client/PluginManagerPage.d.ts +18 -0
- package/lib/types/client/PluginsPanelIcon.d.ts +10 -0
- package/lib/types/client/config-ledger.d.ts +38 -0
- package/lib/types/client/index.d.ts +35 -0
- package/lib/types/client/locales.d.ts +320 -0
- package/lib/types/client/manager-store.d.ts +330 -0
- package/lib/types/client/presentation.d.ts +42 -0
- package/lib/types/client/slot-contract.d.ts +56 -0
- package/lib/types/index.d.ts +4 -0
- package/package.json +71 -0
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The plugin manager's state: the Host's bundles joined with its plugin
|
|
3
|
+
* entries, the action in flight, the install run, and the confirmation an
|
|
4
|
+
* uninstall waits on. Every fact comes from the Host — the store re-reads
|
|
5
|
+
* after each action and after every `plugin-manager/changed` event, so a
|
|
6
|
+
* change made on another surface shows here without a manual refresh.
|
|
7
|
+
*/
|
|
8
|
+
import type { Context as ClientContext } from '@deepseek-ai/cordis';
|
|
9
|
+
import type { BundleInfo, ManagementError, PluginEntryId, PluginInfo, PluginInspectProblem, PluginInstallFailureKind, PluginInstallLogChunk, PluginInstallProgress, PluginInstallRequestId, PluginSpecInspection, ReadOnlyReason } from '@deepseek-ai/dsh-api-remotes/client';
|
|
10
|
+
import { type SnapshotStore } from '@deepseek-ai/dsh-client-store';
|
|
11
|
+
import type { HostObservable } from '@deepseek-ai/dsh-client-ui-slots';
|
|
12
|
+
import type { ConfigLedger } from './config-ledger.ts';
|
|
13
|
+
/** The action a failed notice names. */
|
|
14
|
+
export type FailedAction = 'enable' | 'disable' | 'uninstall' | 'rowEnable' | 'rowDisable';
|
|
15
|
+
/** What the last action left to say, shown as a toast; `seq` tells one showing from the next. */
|
|
16
|
+
export type ManagerNotice = {
|
|
17
|
+
readonly kind: 'restart';
|
|
18
|
+
readonly packageName: string;
|
|
19
|
+
readonly seq: number;
|
|
20
|
+
} | {
|
|
21
|
+
readonly kind: 'overridden';
|
|
22
|
+
readonly packageName: string;
|
|
23
|
+
readonly seq: number;
|
|
24
|
+
} | {
|
|
25
|
+
readonly kind: 'cancelled';
|
|
26
|
+
readonly seq: number;
|
|
27
|
+
} | {
|
|
28
|
+
readonly kind: 'failed';
|
|
29
|
+
/** What was being done when it failed. */
|
|
30
|
+
readonly action: FailedAction;
|
|
31
|
+
/** The Host's refusal, when the Host refused; absent when the transport failed. */
|
|
32
|
+
readonly code?: ManagementError['code'];
|
|
33
|
+
/** The Host's diagnostic or the transport's words, shown verbatim; empty when the code says it all. */
|
|
34
|
+
readonly reason: string;
|
|
35
|
+
readonly packageName?: string;
|
|
36
|
+
readonly seq: number;
|
|
37
|
+
};
|
|
38
|
+
/** One row a bundle contributes, as the page lists it: the patch's declaration joined with its live entry. */
|
|
39
|
+
export interface PackageRow {
|
|
40
|
+
/** The Loader entry carrying the row while the bundle is on; absent for a row of a bundle that is off. */
|
|
41
|
+
readonly entryId?: PluginEntryId;
|
|
42
|
+
/** The row id as the bundle declares it. */
|
|
43
|
+
readonly rowId: string;
|
|
44
|
+
/** The module the row names. */
|
|
45
|
+
readonly moduleName: string;
|
|
46
|
+
/** Whether the entry runs; false for a row without a live entry. */
|
|
47
|
+
readonly enabled: boolean;
|
|
48
|
+
/** The entry's fiber phase, null without a live fiber. */
|
|
49
|
+
readonly phase: PluginInfo['fiberPhase'];
|
|
50
|
+
/** Why the Host refuses to switch the row, when it does. */
|
|
51
|
+
readonly readOnlyReason?: ReadOnlyReason;
|
|
52
|
+
}
|
|
53
|
+
/** One bundle as the page shows it: the Host's bundle joined with the entries its rows run as. */
|
|
54
|
+
export interface PackageView {
|
|
55
|
+
readonly name: string;
|
|
56
|
+
readonly version?: string;
|
|
57
|
+
readonly description?: string;
|
|
58
|
+
/** Whether the profile's own dependencies hold the package; false for a bundle the installation supplies. */
|
|
59
|
+
readonly installed: boolean;
|
|
60
|
+
/** Whether the installation ships the bundle for the person to switch on: official, off until selected, never removable. */
|
|
61
|
+
readonly optional: boolean;
|
|
62
|
+
/** Whether the bundle is in the profile's layer list. */
|
|
63
|
+
readonly enabled: boolean;
|
|
64
|
+
/** Why the Host refuses to switch the bundle off or remove it, when it does. */
|
|
65
|
+
readonly readOnlyReason?: ReadOnlyReason;
|
|
66
|
+
/** Why the Host cannot read the bundle, when it cannot. */
|
|
67
|
+
readonly error?: ManagementError;
|
|
68
|
+
readonly rows: readonly PackageRow[];
|
|
69
|
+
}
|
|
70
|
+
/** The typed spec as the Host read it, on the installing, installed, and failed screens. */
|
|
71
|
+
export type InstallSubject = Extract<PluginSpecInspection, {
|
|
72
|
+
status: 'accepted';
|
|
73
|
+
}> & {
|
|
74
|
+
readonly spec: string;
|
|
75
|
+
};
|
|
76
|
+
/** Why the typed spec was refused before anything installed. */
|
|
77
|
+
export interface InstallInputError {
|
|
78
|
+
readonly problem: PluginInspectProblem;
|
|
79
|
+
readonly reason: string;
|
|
80
|
+
}
|
|
81
|
+
/** One pnpm run of an install, as the dialog's terminal draws it. */
|
|
82
|
+
export interface InstallRun {
|
|
83
|
+
readonly jobId: string;
|
|
84
|
+
/** The command line the Host ran, space-joined. */
|
|
85
|
+
readonly command: string;
|
|
86
|
+
/** The directory the Host ran pnpm in: the profile directory. */
|
|
87
|
+
readonly cwd: string;
|
|
88
|
+
/** stdout and stderr interleaved as they arrived, pnpm's colour escapes included. */
|
|
89
|
+
readonly output: string;
|
|
90
|
+
/** pnpm's exit code once the run settled, null when it ended by a signal or never started; absent while it runs. */
|
|
91
|
+
readonly exitCode?: number | null;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* The install dialog: the spec is typed while `idle`, read by the Host while
|
|
95
|
+
* `checking`, then installed through the Host-owned phases — `starting` until
|
|
96
|
+
* the Host acknowledges the run, `running`, `cancelling` while the Host stops
|
|
97
|
+
* it, `applying` once the bundle is being loaded, which closed the cancellation
|
|
98
|
+
* window — and the outcome shown as `done` or `failed`. A refused check, a
|
|
99
|
+
* confirmed cancellation, and the back control return to `idle` with the spec kept.
|
|
100
|
+
*/
|
|
101
|
+
export interface InstallState {
|
|
102
|
+
readonly open: boolean;
|
|
103
|
+
/** The package spec as typed. */
|
|
104
|
+
readonly spec: string;
|
|
105
|
+
readonly phase: 'idle' | 'checking' | 'starting' | 'running' | 'cancelling' | 'applying' | 'done' | 'failed';
|
|
106
|
+
/** Identifies this dialog's installation, including log and cancellation messages. */
|
|
107
|
+
readonly requestId?: PluginInstallRequestId;
|
|
108
|
+
/** Why the spec was refused before installing; shown under the field. */
|
|
109
|
+
readonly inputError: InstallInputError | null;
|
|
110
|
+
/** What the spec names, once the Host has read it. */
|
|
111
|
+
readonly subject: InstallSubject | null;
|
|
112
|
+
/** The pnpm runs of the open install, in the order they started. */
|
|
113
|
+
readonly runs: readonly InstallRun[];
|
|
114
|
+
/** Whether the run's command and output are unfolded. */
|
|
115
|
+
readonly detailsOpen: boolean;
|
|
116
|
+
/** The bundle the finished run added, left off until enabled from the installed screen. */
|
|
117
|
+
readonly installed: string | null;
|
|
118
|
+
/** Whether the finished run's bundle waits for the next start to load. */
|
|
119
|
+
readonly restartRequired: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* The run's failure, once one settled the dialog: the Host's refusal
|
|
122
|
+
* `code` with its diagnostic as `reason`, or the transport's words alone;
|
|
123
|
+
* `kind` classifies a pnpm failure, and `pendingBuilds` names the packages
|
|
124
|
+
* whose install scripts pnpm left undecided, offered for approval.
|
|
125
|
+
* `cancelUnconfirmed` is a stop the Host did not confirm, shown over the
|
|
126
|
+
* running screen while the run goes on.
|
|
127
|
+
*/
|
|
128
|
+
readonly failure: {
|
|
129
|
+
readonly reason: string;
|
|
130
|
+
readonly code?: ManagementError['code'];
|
|
131
|
+
readonly kind?: PluginInstallFailureKind;
|
|
132
|
+
readonly pendingBuilds?: readonly string[];
|
|
133
|
+
readonly cancelUnconfirmed?: true;
|
|
134
|
+
} | null;
|
|
135
|
+
/** The packages whose install scripts the finished run was allowed to execute, saved for this profile. */
|
|
136
|
+
readonly approvedBuilds: readonly string[];
|
|
137
|
+
/** Enabling the newly installed bundle from the installed screen is crossing the wire. */
|
|
138
|
+
readonly enabling: boolean;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Whether an installation is still owned by the Host.
|
|
142
|
+
* @param phase - the dialog's current installation phase.
|
|
143
|
+
* @returns true until an authoritative result settles the installation.
|
|
144
|
+
*/
|
|
145
|
+
export declare function isInstallPending(phase: InstallState['phase']): boolean;
|
|
146
|
+
/** A destructive action waiting for the user's confirmation: a package's uninstall. */
|
|
147
|
+
export interface ConfirmState {
|
|
148
|
+
readonly action: 'uninstall';
|
|
149
|
+
readonly packageName: string;
|
|
150
|
+
}
|
|
151
|
+
/** What the tab renders. */
|
|
152
|
+
export interface PluginManagerState {
|
|
153
|
+
/** `unavailable` when the Host runs without a managed profile; `error` keeps the last packages. */
|
|
154
|
+
readonly status: 'idle' | 'loading' | 'ready' | 'error' | 'unavailable';
|
|
155
|
+
readonly packages: readonly PackageView[];
|
|
156
|
+
/** Package names and row keys with an action crossing the wire. */
|
|
157
|
+
readonly busy: readonly string[];
|
|
158
|
+
readonly notice: ManagerNotice | null;
|
|
159
|
+
readonly install: InstallState;
|
|
160
|
+
readonly confirm: ConfirmState | null;
|
|
161
|
+
/** The package the list scrolls to and marks, once an install enabled it. */
|
|
162
|
+
readonly highlight: string | null;
|
|
163
|
+
}
|
|
164
|
+
/** The registration-side face the tab's slot entry injects. */
|
|
165
|
+
export interface PluginManagerFace {
|
|
166
|
+
hooks: {
|
|
167
|
+
/** Tab snapshot bound by the renderer as usePluginManager. */
|
|
168
|
+
pluginManager: SnapshotStore<PluginManagerState>;
|
|
169
|
+
/** The plugins carrying configuration, bound by the renderer as useConfigLedger. */
|
|
170
|
+
configLedger: HostObservable<ConfigLedger>;
|
|
171
|
+
};
|
|
172
|
+
/** Read the Host once the tab first renders. */
|
|
173
|
+
ensure: () => void;
|
|
174
|
+
/** Read the Host again. */
|
|
175
|
+
refresh: () => void;
|
|
176
|
+
openInstall: () => void;
|
|
177
|
+
/** Close the dialog; a check in flight is dropped, a Host-owned run has to be cancelled first. */
|
|
178
|
+
closeInstall: () => void;
|
|
179
|
+
editInstallSpec: (text: string) => void;
|
|
180
|
+
/** Check the spec with the Host, then install it; from the failed screen, run it again. */
|
|
181
|
+
runInstall: () => void;
|
|
182
|
+
/** Allow the install scripts the failed run left pending, saved for this profile, and run the same spec again. */
|
|
183
|
+
approveBuildsAndRetry: () => void;
|
|
184
|
+
/** Leave the check or the failed screen for the spec, or ask the Host to stop the run and wait for its cleanup. */
|
|
185
|
+
cancelInstall: () => void;
|
|
186
|
+
/**
|
|
187
|
+
* While the Host runs the install, ask it to stop and close the dialog once
|
|
188
|
+
* it confirms; the dialog stays when it cannot. Otherwise nothing.
|
|
189
|
+
*/
|
|
190
|
+
cancelInstallAndClose: () => void;
|
|
191
|
+
toggleInstallDetails: () => void;
|
|
192
|
+
/** Enable the bundle the finished install added, then close the dialog and mark it in the list. */
|
|
193
|
+
enableInstalled: () => void;
|
|
194
|
+
/** Drop the list mark once it has been shown. */
|
|
195
|
+
clearHighlight: () => void;
|
|
196
|
+
/** Put a bundle into, or take it out of, the profile's layer list. */
|
|
197
|
+
setEnabled: (packageName: string, enabled: boolean) => void;
|
|
198
|
+
/** Ask before removing a package from the profile. */
|
|
199
|
+
uninstall: (packageName: string) => void;
|
|
200
|
+
confirm: () => void;
|
|
201
|
+
cancelConfirm: () => void;
|
|
202
|
+
/** Switch one of a bundle's rows on or off in the profile's user layer. */
|
|
203
|
+
setRowEnabled: (entryId: PluginEntryId, enabled: boolean) => void;
|
|
204
|
+
dismissNotice: () => void;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* The key one row occupies in the busy list.
|
|
208
|
+
* @param entryId - the row's Loader entry id.
|
|
209
|
+
* @returns the busy key.
|
|
210
|
+
*/
|
|
211
|
+
export declare function rowKey(entryId: string): string;
|
|
212
|
+
/**
|
|
213
|
+
* One bundle as the page shows it: its rows joined with the Host's entries.
|
|
214
|
+
* @param bundle - the Host's bundle.
|
|
215
|
+
* @param plugins - the Host's plugin entries.
|
|
216
|
+
* @returns the package view.
|
|
217
|
+
*/
|
|
218
|
+
export declare function packageView(bundle: BundleInfo, plugins: readonly PluginInfo[]): PackageView;
|
|
219
|
+
/**
|
|
220
|
+
* The order the list shows packages in: by the short name a person reads, so a
|
|
221
|
+
* card stays put when its bundle is switched, whatever order the Host answers in.
|
|
222
|
+
* @param packages - the Host's bundles as views.
|
|
223
|
+
* @returns the views sorted by short name.
|
|
224
|
+
*/
|
|
225
|
+
export declare function sortPackages(packages: readonly PackageView[]): PackageView[];
|
|
226
|
+
/** Reads and mutates the profile's plugins through the `pluginManager` Remote. */
|
|
227
|
+
export declare class PluginManagerController {
|
|
228
|
+
private readonly ctx;
|
|
229
|
+
private readonly store;
|
|
230
|
+
private inFlight;
|
|
231
|
+
private rerun;
|
|
232
|
+
private generation;
|
|
233
|
+
private disposed;
|
|
234
|
+
private pendingConfirm;
|
|
235
|
+
/** Cancels the check the dialog has in flight. */
|
|
236
|
+
private inspectAbort;
|
|
237
|
+
private noticeSeq;
|
|
238
|
+
/**
|
|
239
|
+
* @param ctx - the tab plugin's context, whose `remote.pluginManager` and `remote.pluginInventory` namespaces answer.
|
|
240
|
+
*/
|
|
241
|
+
constructor(ctx: ClientContext);
|
|
242
|
+
/**
|
|
243
|
+
* Read the tab's state.
|
|
244
|
+
* @returns the current sync snapshot (stable reference until the next change).
|
|
245
|
+
*/
|
|
246
|
+
getSnapshot(): PluginManagerState;
|
|
247
|
+
/** Stop publishing and drop every late settlement. */
|
|
248
|
+
dispose(): void;
|
|
249
|
+
/**
|
|
250
|
+
* Build the face the tab's slot registration injects.
|
|
251
|
+
* @param configLedger - the projection of the plugins carrying configuration, bound beside the tab's own state.
|
|
252
|
+
* @returns the tab's snapshot sources and its actions.
|
|
253
|
+
*/
|
|
254
|
+
inject(configLedger: HostObservable<ConfigLedger>): PluginManagerFace;
|
|
255
|
+
/**
|
|
256
|
+
* Follow the Host's cancellation window for this dialog's installation.
|
|
257
|
+
* @param progress - a request id and phase received from the Host.
|
|
258
|
+
*/
|
|
259
|
+
installProgress(progress: PluginInstallProgress): void;
|
|
260
|
+
/**
|
|
261
|
+
* Fold a chunk belonging to this installation into its pnpm command.
|
|
262
|
+
* A final chunk may arrive after the install answer and still updates an existing run.
|
|
263
|
+
* @param chunk - the chunk the Host forwarded.
|
|
264
|
+
*/
|
|
265
|
+
appendLog(chunk: PluginInstallLogChunk): void;
|
|
266
|
+
/**
|
|
267
|
+
* Read the bundles and the entries their rows run as. A call during an
|
|
268
|
+
* in-flight read marks one rerun after it settles.
|
|
269
|
+
* @returns settlement after this call's freshness is reflected.
|
|
270
|
+
*/
|
|
271
|
+
load(): Promise<void>;
|
|
272
|
+
private read;
|
|
273
|
+
private shouldRerun;
|
|
274
|
+
private confirm;
|
|
275
|
+
/** Drop the check in flight; its answer is ignored. */
|
|
276
|
+
private abortInspect;
|
|
277
|
+
/** Whether a settlement arrives too late to matter: the store is disposed, or the dialog moved on. */
|
|
278
|
+
private gone;
|
|
279
|
+
/**
|
|
280
|
+
* Check the typed spec, then install it. The Host reads what the spec
|
|
281
|
+
* names first; a refused spec returns to the field with the reason, an
|
|
282
|
+
* accepted one becomes the subject the next screens show while pnpm runs.
|
|
283
|
+
*/
|
|
284
|
+
private runInstall;
|
|
285
|
+
/**
|
|
286
|
+
* Hand the checked spec to the Host and settle the dialog from its answer.
|
|
287
|
+
* `approvedBuilds` names the pending install scripts the person allowed;
|
|
288
|
+
* the Host saves that permission for this profile before pnpm runs.
|
|
289
|
+
*/
|
|
290
|
+
private startInstall;
|
|
291
|
+
/**
|
|
292
|
+
* Allow the install scripts the failed run left pending and run the same
|
|
293
|
+
* spec again. Only the failed screen with pending names offers this.
|
|
294
|
+
*/
|
|
295
|
+
private approveBuildsAndRetry;
|
|
296
|
+
/**
|
|
297
|
+
* Leave the check or the failed screen for the spec at once; a Host-owned
|
|
298
|
+
* run is asked to stop and the dialog waits for the Host's word, since
|
|
299
|
+
* neither a dropped RPC nor a closed connection means pnpm has stopped.
|
|
300
|
+
* @param closeAfter - stop only a running install, and close the dialog once the Host confirms the stop.
|
|
301
|
+
*/
|
|
302
|
+
private cancelInstall;
|
|
303
|
+
/**
|
|
304
|
+
* Back to the spec: the check, the run, and its request are forgotten and
|
|
305
|
+
* the spec is kept, with a toast when there is something to say — the Host
|
|
306
|
+
* stopped the run.
|
|
307
|
+
*/
|
|
308
|
+
private offerSpecAgain;
|
|
309
|
+
/**
|
|
310
|
+
* Enable the bundle the finished install added, then close the dialog and
|
|
311
|
+
* mark it in the list. A refusal toasts and still closes: the list shows
|
|
312
|
+
* what did not switch on.
|
|
313
|
+
*/
|
|
314
|
+
private enableInstalled;
|
|
315
|
+
/**
|
|
316
|
+
* Run one action under a busy key, turn its failure into the notice, and
|
|
317
|
+
* re-read the Host afterwards whatever happened.
|
|
318
|
+
*/
|
|
319
|
+
private run;
|
|
320
|
+
/**
|
|
321
|
+
* Publish a change's outcome: a refused answer or a change the Host could
|
|
322
|
+
* not apply throws for {@link run} to report; a change that waits for the
|
|
323
|
+
* next start, that a higher layer overrides, or that the Host stopped is
|
|
324
|
+
* said in passing.
|
|
325
|
+
*/
|
|
326
|
+
private applied;
|
|
327
|
+
private patch;
|
|
328
|
+
private patchInstall;
|
|
329
|
+
}
|
|
330
|
+
//# sourceMappingURL=manager-store.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/** Display labels and toast sentences for global plugin management. */
|
|
2
|
+
import type { ManagementError } from '@deepseek-ai/dsh-api-remotes/client';
|
|
3
|
+
import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
|
|
4
|
+
import type { ManagerNotice, PackageView } from './manager-store.ts';
|
|
5
|
+
/** The translate seat of the manager's dictionary. */
|
|
6
|
+
export type Translate = PropsLocale<'pluginManager'>['t'];
|
|
7
|
+
/**
|
|
8
|
+
* What a management error reads as: the code's sentence, or, for an
|
|
9
|
+
* operation error, the Host's diagnostic as it is.
|
|
10
|
+
* @param error - the Host's code and its diagnostic, when it has one.
|
|
11
|
+
* @param t - the manager's translate seat.
|
|
12
|
+
* @returns the sentence.
|
|
13
|
+
*/
|
|
14
|
+
export declare function managementText(error: {
|
|
15
|
+
readonly code: ManagementError['code'];
|
|
16
|
+
readonly diagnostic?: string;
|
|
17
|
+
}, t: Translate): string;
|
|
18
|
+
/**
|
|
19
|
+
* Compact a package name to what a person calls it.
|
|
20
|
+
* @param name - the package name.
|
|
21
|
+
* @returns the unscoped name without the harness prefixes.
|
|
22
|
+
*/
|
|
23
|
+
export declare function shortName(name: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* Localize known official packages by exact npm name at render time.
|
|
26
|
+
* @param pkg - original package identity and optional metadata description.
|
|
27
|
+
* @param t - the manager's current translate function.
|
|
28
|
+
* @returns localized copy and whether the package is a beta feature, or the package's short name and original description.
|
|
29
|
+
*/
|
|
30
|
+
export declare function packageText(pkg: Pick<PackageView, 'name' | 'description'>, t: Translate): {
|
|
31
|
+
title: string;
|
|
32
|
+
description: string | undefined;
|
|
33
|
+
beta: boolean;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* The sentence one notice shows.
|
|
37
|
+
* @param notice - the last action's outcome.
|
|
38
|
+
* @param t - the manager's translate seat.
|
|
39
|
+
* @returns the sentence.
|
|
40
|
+
*/
|
|
41
|
+
export declare function noticeText(notice: ManagerNotice, t: Translate): string;
|
|
42
|
+
//# sourceMappingURL=presentation.d.ts.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The slots the Plugins page declares for plugins that carry their own
|
|
3
|
+
* configuration: the official plugins listed beside the official bundles, one
|
|
4
|
+
* bundle's configuration on its page, and one row's configuration opened from
|
|
5
|
+
* that row. A registrant merges this contract with `import type` and registers
|
|
6
|
+
* through `ctx.slots`; it never imports this package at runtime.
|
|
7
|
+
*
|
|
8
|
+
* Every entry is rendered in two views the owner asks for: `summary` for the
|
|
9
|
+
* one-liner the page places under the title, `page` for the form with its own
|
|
10
|
+
* save control. The page draws the title, the icon, and the crumb itself.
|
|
11
|
+
*/
|
|
12
|
+
/** The view the page asks a configuration entry for. */
|
|
13
|
+
export interface PluginConfigViewProps {
|
|
14
|
+
/** `summary` renders the one-liner alone, as text or inline nodes; `page` renders the form with its save control. */
|
|
15
|
+
readonly view: 'summary' | 'page';
|
|
16
|
+
}
|
|
17
|
+
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
18
|
+
interface SlotMap {
|
|
19
|
+
/**
|
|
20
|
+
* One official plugin the Plugins page lists in its Official group after
|
|
21
|
+
* the official bundles: `label` is the card's title and `order` its place.
|
|
22
|
+
* The page renders the entry as the card's one-liner (`view: 'summary'`)
|
|
23
|
+
* and, once the card is opened, as the body of the plugin's own page
|
|
24
|
+
* (`view: 'page'`). OCCUPIED by the host-plane configuration pages
|
|
25
|
+
* `ui-settings-plugins` ships; a bundle's configuration belongs in
|
|
26
|
+
* `plugins.bundle.config` or `plugins.row.config` instead.
|
|
27
|
+
*/
|
|
28
|
+
'plugins.item': {
|
|
29
|
+
kind: 'list';
|
|
30
|
+
scope: 'root';
|
|
31
|
+
owner: PluginConfigViewProps;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* A bundle's own configuration, keyed by the bundle's package name and
|
|
35
|
+
* rendered on the bundle's page between its description and its rows
|
|
36
|
+
* (`view: 'page'` only).
|
|
37
|
+
*/
|
|
38
|
+
'plugins.bundle.config': {
|
|
39
|
+
kind: 'keyed';
|
|
40
|
+
scope: 'root';
|
|
41
|
+
owner: PluginConfigViewProps;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* The configuration of one row a bundle declares, keyed by
|
|
45
|
+
* `<package name>#<row id>` with the row id as the bundle's patch declares
|
|
46
|
+
* it: the row on the bundle's page gains a configure control that opens
|
|
47
|
+
* the entry's page, headed by the row id and the entry's summary.
|
|
48
|
+
*/
|
|
49
|
+
'plugins.row.config': {
|
|
50
|
+
kind: 'keyed';
|
|
51
|
+
scope: 'root';
|
|
52
|
+
owner: PluginConfigViewProps;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=slot-contract.d.ts.map
|
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@deepseek-ai/dsh-client-ui-plugin-manager",
|
|
3
|
+
"description": "Plugin management for the dsh web client: the sidebar Plugins panel installs, enables, disables, retries, and composes installed plugin packages",
|
|
4
|
+
"version": "0.1.6-alpha.2",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
|
|
11
|
+
"directory": "packages/client/ui-plugin-manager"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "lib/index.js",
|
|
15
|
+
"types": "lib/types/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./lib/types/index.d.ts",
|
|
19
|
+
"default": "./lib/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./client": {
|
|
22
|
+
"types": "./lib/types/client/index.d.ts",
|
|
23
|
+
"default": "./lib/client.js"
|
|
24
|
+
},
|
|
25
|
+
"./src/*": "./src/*",
|
|
26
|
+
"./package.json": "./package.json"
|
|
27
|
+
},
|
|
28
|
+
"dsh": {
|
|
29
|
+
"client": {
|
|
30
|
+
"inject": [
|
|
31
|
+
"@deepseek-ai/dsh-api-remotes",
|
|
32
|
+
"@deepseek-ai/dsh-client-locale",
|
|
33
|
+
"@deepseek-ai/dsh-client-ui-layout",
|
|
34
|
+
"@deepseek-ai/dsh-client-ui-sidebar"
|
|
35
|
+
],
|
|
36
|
+
"platform": "web"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"license": "MIT",
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"@deepseek-ai/cordis": "^4.0.2"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@testing-library/react": "^16.1.0",
|
|
45
|
+
"@types/react": "~18.3.1",
|
|
46
|
+
"clsx": "^2.1.1",
|
|
47
|
+
"react": "^18.2.0",
|
|
48
|
+
"react-dom": "^18.2.0",
|
|
49
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
50
|
+
"@deepseek-ai/dsh-api-remotes": "^0.1.6-alpha.2",
|
|
51
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.6-alpha.2",
|
|
52
|
+
"@deepseek-ai/dsh-client-store": "^0.1.6-alpha.2",
|
|
53
|
+
"@deepseek-ai/dsh-client-test-runtime": "^0.1.6-alpha.2",
|
|
54
|
+
"@deepseek-ai/dsh-client-ui-layout": "^0.1.6-alpha.2",
|
|
55
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.1.6-alpha.2",
|
|
56
|
+
"@deepseek-ai/dsh-client-ui-sidebar": "^0.1.6-alpha.2",
|
|
57
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.6-alpha.2",
|
|
58
|
+
"@deepseek-ai/dsh-plugin-manager": "^0.1.6-alpha.2",
|
|
59
|
+
"@deepseek-ai/dsh-util-crypto": "^0.1.6-alpha.2",
|
|
60
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.6-alpha.2"
|
|
61
|
+
},
|
|
62
|
+
"files": [
|
|
63
|
+
"lib/index.js",
|
|
64
|
+
"lib/client.js",
|
|
65
|
+
"lib/types/**/*.d.ts"
|
|
66
|
+
],
|
|
67
|
+
"scripts": {
|
|
68
|
+
"bundle": "tsdown",
|
|
69
|
+
"watch": "tsdown --watch"
|
|
70
|
+
}
|
|
71
|
+
}
|