@linxin666/dsh-client-ui-plugin-manager 0.4.15 → 0.4.17

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.
@@ -16,7 +16,7 @@
16
16
  * @module @linxin666/dsh-client-ui-plugin-manager/client
17
17
  */
18
18
  import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
19
- import type { PluginUpdateItem, PluginUpdateResult, RestartMode, RestartPlanWire } from '../core/protocol.ts';
19
+ import type { PluginBatchUpdateResult, PluginUpdateItem, RestartMode, RestartPlanWire } from '../core/protocol.ts';
20
20
  /** The operations the toolbar drives (the package's dual-channel face). */
21
21
  export interface PluginListToolbarInjected {
22
22
  /** Whether this browser has loopback authority to use the host routes. */
@@ -24,11 +24,15 @@ export interface PluginListToolbarInjected {
24
24
  /** Compare every installed plugin against the version its source serves. */
25
25
  checkUpdates: () => Promise<PluginUpdateItem[]>;
26
26
  /**
27
- * Re-install one plugin from its recorded source. Resolves with what landed:
28
- * the row at the new version, plus the bundles only a restart loads. A landed
29
- * update that needs a restart keeps the batch running instead of failing it.
27
+ * Apply every listed update in one run and answer which rows landed and which
28
+ * did not.
29
+ *
30
+ * One call rather than one call per plugin: the sequence (and the decision that
31
+ * a refused row does not end the run) is the host's, so the toolbar no longer
32
+ * spends a request and a job on each row. A row that landed but needs a restart
33
+ * is still an applied row — it joins the restart list instead of failing.
30
34
  */
31
- update: (id: string) => Promise<PluginUpdateResult>;
35
+ updateAll: (ids: string[], onRow?: (row: UpdateCursor) => void) => Promise<PluginBatchUpdateResult>;
32
36
  /**
33
37
  * Read how a restart would be carried out, without carrying it out: the
34
38
  * confirmation must name the same consequence the host will produce (an
@@ -42,6 +46,15 @@ export interface PluginListToolbarInjected {
42
46
  }
43
47
  /** Full component props. */
44
48
  export type PluginListToolbarProps = PropsLocale<'settings.pluginManager'> & PluginListToolbarInjected;
49
+ /** Which row a running batch is on, as the face reports it. */
50
+ export interface UpdateCursor {
51
+ /** Package name of the row in flight. */
52
+ id: string;
53
+ /** One-based position of that row in the run. */
54
+ index: number;
55
+ /** How many rows the run was asked to apply. */
56
+ total: number;
57
+ }
45
58
  /**
46
59
  * The toolbar itself. All state is local: the page around it owns the plugin
47
60
  * list, and a restart tears this component down anyway.
@@ -25,7 +25,7 @@
25
25
  import type { Context as ClientContext } from '@deepseek-ai/cordis';
26
26
  import { type PluginUpdatePatchInjected } from './PluginUpdatePatch.tsx';
27
27
  import { type PluginManagerKey } from './locales.ts';
28
- import { type RestartMode, type RestartPlanWire } from '../core/protocol.ts';
28
+ import { type PluginBatchUpdateResult, type RestartMode, type RestartPlanWire } from '../core/protocol.ts';
29
29
  import { type PluginManagerService } from '../core/service.ts';
30
30
  declare module '@deepseek-ai/dsh-client-ui-slots' {
31
31
  interface LocaleNamespaceMap {
@@ -58,6 +58,18 @@ export type PluginManagerFace = PluginUpdatePatchInjected & PluginManagerService
58
58
  * user with either.
59
59
  */
60
60
  restartPlan: () => Promise<RestartPlanWire>;
61
+ /**
62
+ * Apply every listed update in one run, answering the rows that landed and the
63
+ * rows that did not.
64
+ *
65
+ * The list-level toolbar used to drive one update job per plugin from the
66
+ * browser, which spent a request and a job on each row and left the sequence —
67
+ * and the decision to stop at the first refusal — in the component. The gateway
68
+ * half now runs that sequence on the host as one job; the official installer
69
+ * channel has no batch endpoint, so there the batch stays a loop of its own
70
+ * single update, which is the only writer that channel accepts.
71
+ */
72
+ updateAll: (ids: readonly string[]) => Promise<PluginBatchUpdateResult>;
61
73
  };
62
74
  /**
63
75
  * Build the dual-channel face once: official-channel and gateway-channel
@@ -27,6 +27,9 @@ declare const STATIC_ZH: {
27
27
  updateAll: string;
28
28
  updatingAll: string;
29
29
  updateAllDone: string;
30
+ updateAllPartial: string;
31
+ updateFailedRow: string;
32
+ updateFailedUnknown: string;
30
33
  updateRestartRequired: string;
31
34
  updatesPanelTitle: string;
32
35
  thirdPartyOnly: string;
@@ -98,6 +101,9 @@ export declare const zh: {
98
101
  updateAll: string;
99
102
  updatingAll: string;
100
103
  updateAllDone: string;
104
+ updateAllPartial: string;
105
+ updateFailedRow: string;
106
+ updateFailedUnknown: string;
101
107
  updateRestartRequired: string;
102
108
  updatesPanelTitle: string;
103
109
  thirdPartyOnly: string;
@@ -169,6 +175,9 @@ export declare const en: {
169
175
  updateAll: string;
170
176
  updatingAll: string;
171
177
  updateAllDone: string;
178
+ updateAllPartial: string;
179
+ updateFailedRow: string;
180
+ updateFailedUnknown: string;
172
181
  updateRestartRequired: string;
173
182
  updatesPanelTitle: string;
174
183
  thirdPartyOnly: string;
@@ -89,6 +89,44 @@ export interface PluginUpdateResult {
89
89
  */
90
90
  restartRequired: string[];
91
91
  }
92
+ /**
93
+ * One row of a batch update, as the host reported it.
94
+ *
95
+ * A batch is the host's sequence over the official manager's single-plugin
96
+ * update, so its progress is a row per requested plugin rather than one
97
+ * aggregate verdict: each row carries the version the host resolved, where it
98
+ * ended, and — when it could not be applied — the reason.
99
+ */
100
+ export interface PluginUpdateOutcome {
101
+ /** Installed package name this row applies. */
102
+ id: string;
103
+ /** Where this row is: still queued, in flight, applied, or refused. */
104
+ phase: 'pending' | 'running' | 'done' | 'error';
105
+ /** The exact version the host resolved for this row; absent when it was refused up front. */
106
+ targetVersion?: string;
107
+ /** The version that landed, present on an applied row. */
108
+ landed?: string;
109
+ /** Why this row could not be applied, present on a refused row. */
110
+ error?: string;
111
+ /**
112
+ * Whether the landed version is on disk but not loaded in the running host
113
+ * (the official manager answered `application: 'restart-required'`).
114
+ */
115
+ restartRequired?: boolean;
116
+ }
117
+ /**
118
+ * What one batch update run produced.
119
+ *
120
+ * Both halves are carried: the refused rows stay in the panel beside the version
121
+ * they are stuck on, and the applied rows leave it. Reporting only one half would
122
+ * make a partial run read as either a clean one or no run at all.
123
+ */
124
+ export interface PluginBatchUpdateResult {
125
+ /** Rows that landed, at the version that landed. */
126
+ applied: PluginUpdateOutcome[];
127
+ /** Rows that did not, each carrying the host's reason. */
128
+ failed: PluginUpdateOutcome[];
129
+ }
92
130
  /** Point-in-time install/update progress reported by the host. */
93
131
  export interface InstallProgressItem {
94
132
  kind: 'idle' | 'install' | 'update';
@@ -175,6 +213,27 @@ export declare function parseInstallStatus(value: unknown): InstallProgressItem;
175
213
  * @returns typed update rows.
176
214
  */
177
215
  export declare function parseUpdateList(value: unknown): PluginUpdateItem[];
216
+ /**
217
+ * Validate and normalize the rows of a batch update, as a gateway job carries
218
+ * them under `results`.
219
+ *
220
+ * Deliberately tolerant in the same way {@link parseRestartRequired} is: every
221
+ * row is an outcome the panel has to render, and refusing the whole list over one
222
+ * malformed row would hide the rows that did land. A row missing its id or phase
223
+ * is that row's problem, so it is dropped rather than thrown; an unreadable
224
+ * `results` value reads as "no rows", which the caller shows as a run without a
225
+ * per-row verdict.
226
+ * @param value - decoded but untrusted job value.
227
+ * @returns the typed rows, in the order the host applied them.
228
+ */
229
+ export declare function parseUpdateOutcomes(value: unknown): PluginUpdateOutcome[];
230
+ /**
231
+ * Split a finished batch's rows by outcome, the shape the toolbar renders.
232
+ * A row still in flight is neither: it is simply not in either half.
233
+ * @param rows - the rows the host reported.
234
+ * @returns the applied and failed rows.
235
+ */
236
+ export declare function batchUpdateResult(rows: readonly PluginUpdateOutcome[]): PluginBatchUpdateResult;
178
237
  /**
179
238
  * Validate and normalize a `restart` response value, reading the mode a POST
180
239
  * answer carries.
@@ -44,10 +44,47 @@ export declare function unsafeSpecReason(spec: string): string | undefined;
44
44
  * @returns true when pnpm named the build scripts it skipped.
45
45
  */
46
46
  export declare function reportsIgnoredBuilds(output: string): boolean;
47
+ /** One row of a batch update, as this gateway holds it. */
48
+ export interface GatewayUpdateOutcome {
49
+ /** Package name this row applies. */
50
+ id: string;
51
+ /** The exact version the route resolved for this row; absent when it was refused up front. */
52
+ targetVersion?: string;
53
+ /** What has happened to this row so far. */
54
+ phase: 'pending' | 'running' | 'done' | 'error';
55
+ /** The version that landed, present on a `done` row. */
56
+ landed?: string;
57
+ /** Why this row could not be applied, present on an `error` row. */
58
+ error?: string;
59
+ /** Whether the landed version is on disk but not loaded in this process. */
60
+ restartRequired?: boolean;
61
+ }
62
+ /**
63
+ * One row a batch update was asked to apply: a target the route resolved, or the
64
+ * refusal it produced instead. Refused rows are answers the run must not retry —
65
+ * already at the newest version, not a direct registry plugin, a DSH minimum this
66
+ * host does not satisfy — and carrying them in the same list means the caller
67
+ * reads one ledger for the whole batch.
68
+ */
69
+ export type GatewayUpdateEntry = {
70
+ kind: 'apply';
71
+ id: string;
72
+ version: string;
73
+ } | {
74
+ kind: 'migrate';
75
+ id: string;
76
+ targetId: string;
77
+ targetVersion: string;
78
+ targetSpec: string;
79
+ } | {
80
+ kind: 'refused';
81
+ id: string;
82
+ error: string;
83
+ };
47
84
  /** One CLI-backed operation in flight or settled. */
48
85
  export interface GatewayJob {
49
86
  id: string;
50
- action: 'install' | 'update' | 'migrate' | 'remove';
87
+ action: 'install' | 'update' | 'update-all' | 'migrate' | 'remove';
51
88
  spec: string;
52
89
  /** Installed package ID for an in-place npm update. */
53
90
  targetId?: string;
@@ -81,6 +118,16 @@ export interface GatewayJob {
81
118
  * reporting a clean in-place update.
82
119
  */
83
120
  restartRequired?: string[];
121
+ /**
122
+ * The rows a batch update (`update-all`) works through, in the order it was
123
+ * asked to apply them: the version the route resolved for each plugin, the
124
+ * phase it is in, and the reason it could not be applied. The batch job itself
125
+ * settles `done` once the last row is answered — the rows carry the failures,
126
+ * because one plugin that cannot move must not throw away the ones behind it.
127
+ */
128
+ results?: GatewayUpdateOutcome[];
129
+ /** The batch row in flight, present only while a batch job runs. */
130
+ current?: string;
84
131
  /**
85
132
  * Conditions a settled run reported while still carrying its change out:
86
133
  * pnpm's own words about a non-zero exit the gateway accepted because the
@@ -308,6 +355,23 @@ export interface NativePluginManager {
308
355
  enabled?: boolean;
309
356
  requestId?: string;
310
357
  }): Promise<unknown>;
358
+ /**
359
+ * Replace an installed bundle with a published version through the official
360
+ * manager (0.2.2-rc.1 and later). The manager checks the target on the
361
+ * registry first, removes the installed version when the host mounts `hmr`,
362
+ * installs the target with the same selection, and reinstalls the removed
363
+ * version when that installation fails or is cancelled — so an update is one
364
+ * official call, not a sequence this gateway assembles.
365
+ * Optional: the manager that ships with an older cohort has no update
366
+ * primitive, and this gateway names that instead of guessing.
367
+ * @param name - installed profile dependency name.
368
+ * @param version - exact published version newer than the installed one.
369
+ * @param options - the request id the run's progress and logs are tracked under.
370
+ * @returns the manager's own update verdict ({@link NativeUpdateOutcome}).
371
+ */
372
+ updateBundle?(name: string, version: string, options?: {
373
+ requestId?: string;
374
+ }): Promise<unknown>;
311
375
  /**
312
376
  * Remove one profile-owned bundle through the official manager.
313
377
  * @param name - installed dependency (bundle) name.
@@ -390,6 +454,58 @@ export declare function nativeManagerRefusalCode(outcome: unknown): string | und
390
454
  * @returns true when the run landed and a restart is what loads it.
391
455
  */
392
456
  export declare function nativeManagerRestartRequired(outcome: unknown): boolean;
457
+ /**
458
+ * The resolved value of the official manager's `updateBundle`
459
+ * (`PluginUpdateResult` in `@deepseek-ai/dsh-plugin-manager` 0.2.2-rc.1): the
460
+ * phase that ended the run, that phase's own verdict, and the reinstallation of
461
+ * the removed version when the target could not be installed.
462
+ */
463
+ export interface NativeUpdateOutcome {
464
+ /** Version the profile carried before the run. */
465
+ from?: string;
466
+ /** The version the run targeted. */
467
+ to?: string;
468
+ /** The phase that ended the run. */
469
+ step?: 'check' | 'remove' | 'install';
470
+ /** That phase's verdict ({@link NativeManagerOutcome}); the run failed when it says so. */
471
+ result?: unknown;
472
+ /** The reinstallation of `from`; present only when the target did not land. */
473
+ restore?: unknown;
474
+ }
475
+ /**
476
+ * What one official `updateBundle` run reported as its failure, or undefined
477
+ * when the target landed.
478
+ *
479
+ * The verdict of the phase that ended the run is the only place the reason
480
+ * lives — the manager folds a refused run into the resolved value instead of
481
+ * rejecting it — so the phase is named beside the manager's own words: a
482
+ * refusal to remove is a different fact from a refusal to install.
483
+ * @param outcome - the resolved value of `updateBundle`.
484
+ * @returns the failure text to report, or undefined for a run that landed.
485
+ */
486
+ export declare function nativeUpdateFailure(outcome: unknown): string | undefined;
487
+ /**
488
+ * The official manager's refusal code for one update, or undefined when the
489
+ * target landed. {@link nativeUpdateFailure} renders that verdict for the
490
+ * person; this is the same verdict read for a decision, which is how the update
491
+ * path recognises a `bundle-in-use` removal it answers with one retry.
492
+ * @param outcome - the resolved value of `updateBundle`.
493
+ */
494
+ export declare function nativeUpdateRefusalCode(outcome: unknown): string | undefined;
495
+ /**
496
+ * Whether one update landed on disk but is not loaded in this process: the
497
+ * phase that ended it answered `application: 'restart-required'`.
498
+ * @param outcome - the resolved value of `updateBundle`.
499
+ */
500
+ export declare function nativeUpdateRestartRequired(outcome: unknown): boolean;
501
+ /**
502
+ * How a failed update left the version it removed, as a clause appended to the
503
+ * failure: the official manager reinstalls that version itself, so the report
504
+ * says whether the plugin is back or the person has to reinstall it by hand.
505
+ * @param outcome - the resolved value of `updateBundle`.
506
+ * @returns the clause, or an empty string when no reinstallation ran.
507
+ */
508
+ export declare function nativeUpdateRestoreNote(outcome: unknown): string;
393
509
  /** The gateway: serializes CLI operations through one job table and one mutation queue. */
394
510
  export declare class CliGateway {
395
511
  private readonly facts;
@@ -504,6 +620,47 @@ export declare class CliGateway {
504
620
  update(id: string, version: string): {
505
621
  jobId: string;
506
622
  };
623
+ /**
624
+ * One update job, registered but not yet queued.
625
+ *
626
+ * Both the single-plugin update and the batch runner settle this same shape,
627
+ * so a batch row is applied by exactly the code an update from the plugin's
628
+ * own page runs: the official in-process manager on an application-owned
629
+ * profile, the CLI everywhere else.
630
+ * @param id - installed package name.
631
+ * @param version - the exact version the update must land on.
632
+ */
633
+ private newUpdateJob;
634
+ /**
635
+ * Apply a whole batch of updates in one run.
636
+ *
637
+ * The official manager only replaces one bundle at a time (`updateBundle`), and
638
+ * the CLI only adds one spec at a time, so a batch is this host's sequence over
639
+ * that single-plugin primitive rather than a second writer: one job, one
640
+ * mutation-lock slot, one poll. Rows are applied in the order given, and a row
641
+ * that cannot be applied — refused by the route's own gate before the run, or
642
+ * by the writer during it — is recorded and skipped instead of ending the run,
643
+ * because every managed writer below is atomic per plugin.
644
+ *
645
+ * The batch job settles `done` once the last row is answered: the rows carry
646
+ * the failures, and a run that failed every row is not a failed job but a job
647
+ * whose every row failed, which is what the caller renders.
648
+ * @param entries - the rows to apply, in order, each already resolved to the
649
+ * version it must land on or to the reason it was refused.
650
+ */
651
+ updateAll(entries: readonly GatewayUpdateEntry[]): {
652
+ jobId: string;
653
+ };
654
+ /**
655
+ * Run one update job to settlement through whichever writer owns this profile.
656
+ *
657
+ * An application-owned profile takes the official in-process manager, which is
658
+ * the only writer the CLI accepts there; every other runtime keeps the CLI,
659
+ * whose reconciliation guards this gateway compensates for (see {@link runInner}).
660
+ * @param job - the update job being settled.
661
+ * @param native - the official manager, or undefined when the CLI is the writer.
662
+ */
663
+ private settleUpdateJob;
507
664
  /** Start an install through the official in-process manager. */
508
665
  private enqueueNativeInstall;
509
666
  /**
@@ -523,67 +680,55 @@ export declare class CliGateway {
523
680
  * @param native - the official manager.
524
681
  */
525
682
  private runNativeInstall;
526
- /** Start an in-place update through the official in-process manager. */
527
- private enqueueNativeUpdate;
528
683
  /**
529
684
  * Run one update through the official in-process manager (an application-owned
530
- * profile, where the CLI refuses to write). The manager resolves the registry,
531
- * runs pnpm with the launcher's bundled toolchain and applies the bundle, then
532
- * this reads the profile the same way the CLI path does: the dependency must
533
- * still be there and the installed version must be the one the route resolved,
534
- * so a green manager call that changed nothing is still reported as a failure.
535
- * Its resolved verdict is read first ({@link nativeManagerFailure}): a refused
536
- * run (pnpm exited non-zero, an incompatible version, a cancellation) resolves
537
- * with `application: 'failed'`, and only that verdict carries the reason — the
538
- * profile re-read can only show that the version did not move.
685
+ * profile, where the CLI refuses to write).
539
686
  *
540
- * An `already-installed` refusal is answered by {@link replaceInstalled}: the
541
- * manager refuses to install a dependency the profile already carries while the
542
- * host mounts `hmr` (0.2.1-rc.2, and dsh-base mounts that service on every
543
- * profile host), so an in-place update there is only expressible as its two
544
- * phases. The single call stays first so the day the manager accepts an
545
- * in-place update this path needs no change.
687
+ * Since 0.2.2-rc.1 the manager owns the whole replacement: `updateBundle` checks
688
+ * the target on the registry first (it must exist, declare a bundle and accept
689
+ * the running DSH version), removes the installed version while the host mounts
690
+ * `hmr`, installs the target with the selection it found, and reinstalls the
691
+ * version it removed when that installation fails or is cancelled. This path
692
+ * therefore no longer sequences those phases itself, and no longer has to
693
+ * recognise the `already-installed` guard that made an in-place install
694
+ * impossible. It adds only the two facts the official call does not cover:
695
+ *
696
+ * - **The bundle keeps its layer index.** The official removal drops the name
697
+ * from `dsh.profile.bundles` and the reinstall appends it, and that array is
698
+ * the layer order the loader applies patches in, so a batch would drift every
699
+ * row's inheritance ({@link restoreBundleIndex} puts the name back).
700
+ * - **A `bundle-in-use` refusal is answered once, not repeated** (issue #1905):
701
+ * the official guard deselects the bundle and reloads before it judges whether
702
+ * the rows still run, so the retry reads the state that reload left on disk
703
+ * ({@link applyNativeUpdate}). A second refusal is final and names the restart.
704
+ *
705
+ * The verdict is read first ({@link nativeUpdateFailure}): a refused run
706
+ * resolves instead of rejecting, and only that verdict carries the reason — the
707
+ * profile re-read can only show that the version did not move. The version
708
+ * verification below is unchanged, so a green run that landed nothing is still
709
+ * reported as 更新未生效.
546
710
  * @param job - the update job being settled.
547
711
  * @param native - the official manager.
548
712
  */
549
713
  private runNativeUpdate;
550
714
  /**
551
- * Replace an installed bundle with the update job's target spec through the
552
- * official manager, the only writer an application-owned profile accepts.
553
- * Removing first is what makes the install possible: the manager's
554
- * `already-installed` guard reads the profile, so the same name is a fresh
555
- * dependency once the old one is gone.
556
- *
557
- * A failed second phase reinstalls the spec the profile carried before the run,
558
- * so an update that cannot land leaves a working plugin behind instead of an
559
- * empty slot; the report says which of the two happened.
560
- *
561
- * Two facts make the replacement safe to repeat in one session:
715
+ * Run one official update, answering its `bundle-in-use` removal refusal once.
562
716
  *
563
- * - **The bundle keeps its layer index.** A removal drops the name from
564
- * `dsh.profile.bundles` and the reinstall appends it, so a plain
565
- * remove-then-install moves the bundle behind every bundle that followed it
566
- * and its patch layer starts overriding rows it never overrode
567
- * ({@link restoreBundleIndex} puts it back).
568
- * - **A `bundle-in-use` refusal is answered once, not repeated.** The
569
- * official guard deselects the bundle and reloads before it checks whether
570
- * the bundle's rows still run, so a real occupant cleared by that reload is
571
- * gone on the second call: the update is retried exactly once against that
572
- * settled state, and a second refusal restores the selection and names the
573
- * restart the person has to do ({@link removeForReplacement}).
574
- * - **A landed replacement can still need a restart.** The guard answers
575
- * `application: 'restart-required'` when the removal applied and the
576
- * replaced bundle's rows are already gone from the running process (issue
577
- * #1905). The version does land, so that is a fact to report, not a failure:
578
- * the update is `done` and names what only a restart loads.
579
- *
580
- * @param job - the update job whose spec is installed.
581
- * @param native - the official manager.
717
+ * The official guard deselects the bundle, reloads the profile and only then
718
+ * checks whether the bundle's rows still hold a running fiber. A refusal is
719
+ * therefore answered against the state that reload left on disk, which covers a
720
+ * real occupant the reload cleared. It does not cover a reload that rebuilds
721
+ * the very rows it just unloaded — the fresh fiber matches the guard again — so
722
+ * the retry is worth exactly one call and never a loop, and a second refusal is
723
+ * returned with the restart the person has to do.
724
+ * @param updateBundle - the official manager's update primitive.
582
725
  * @param targetId - the installed bundle being replaced.
583
- * @param previousSpec - the dependency spec the profile carried before the run.
584
- * @returns the failure to report, or the restart fact once the target landed.
726
+ * @param targetVersion - the exact version the update must land on.
727
+ * @param requestId - the job id the run's progress and logs are tracked under.
728
+ * @returns the manager's verdict for the run that decided the outcome, plus the
729
+ * remedy text a refusal a retry could not clear needs.
585
730
  */
586
- private replaceInstalled;
731
+ private applyNativeUpdate;
587
732
  /**
588
733
  * Where a bundle sits in the layer order, read before the removal drops it.
589
734
  * @param name - the installed bundle name.
@@ -605,29 +750,6 @@ export declare class CliGateway {
605
750
  * @param index - the position captured before the removal.
606
751
  */
607
752
  private restoreBundleIndex;
608
- /**
609
- * Remove a bundle for the two-phase replacement, answering the official
610
- * manager's in-use refusal instead of repeating it.
611
- *
612
- * Read the official `removeBundle` guard in order: it deselects the bundle,
613
- * reloads the profile, and only then checks whether the bundle's own rows
614
- * still hold a running fiber, which it reports as `bundle-in-use`. A refusal
615
- * is therefore answered exactly once, against the state that reload left on
616
- * disk: that covers a real occupant whose fiber the reload did clear.
617
- *
618
- * It does not cover a reload that rebuilds the very rows it just unloaded —
619
- * the fresh fiber matches the guard again — so the retry is worth exactly one
620
- * call and never a loop, and the second refusal names the restart instead of
621
- * a bare code. A removal the guard does apply while the rows are already gone
622
- * resolves as `application: 'restart-required'`; that is a success carrying a
623
- * restart fact, which is reported as such rather than as a refusal.
624
- * @param native - the official manager.
625
- * @param name - the bundle to remove.
626
- * @returns the refusal to report, whether the profile lost the selection on the
627
- * way, the remedy text for that refusal, and whether the applied removal still
628
- * needs a restart to load.
629
- */
630
- private removeForReplacement;
631
753
  /** Whether a bundle is still an installed dependency but no longer selected. */
632
754
  private bundleSelectionLost;
633
755
  /** Put a selection back after a refused removal, so the profile is as it was found. */
@@ -636,6 +758,14 @@ export declare class CliGateway {
636
758
  migrate(sourceId: string, targetId: string, targetVersion: string, targetSpec: string): {
637
759
  jobId: string;
638
760
  };
761
+ /** One legacy aggregate migration job, registered but not yet queued. */
762
+ private newMigrationJob;
763
+ /**
764
+ * Run one migration job to settlement; an unexpected failure settles the job
765
+ * as an error without overwriting a verdict the run already recorded.
766
+ * @param job - the migration job being settled.
767
+ */
768
+ private settleMigrationJob;
639
769
  /**
640
770
  * Start a removal; the caller polls {@link status}. An application-owned
641
771
  * profile removes through the official in-process manager, the same writer
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@linxin666/dsh-client-ui-plugin-manager",
3
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.15",
4
+ "version": "0.4.17",
5
5
  "icon": "icon.svg",
6
6
  "type": "module",
7
7
  "main": "lib/index.js",
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "dsh": {
24
24
  "engines": {
25
- "dsh": ">=0.2.2-rc.1"
25
+ "dsh": ">=0.2.2-rc.2"
26
26
  },
27
27
  "bundle": {
28
28
  "patch": "./cordis.patch.yml"
@@ -36,21 +36,21 @@
36
36
  }
37
37
  },
38
38
  "peerDependencies": {
39
- "@deepseek-ai/dsh": ">=0.2.2-rc.1",
39
+ "@deepseek-ai/dsh": ">=0.2.2-rc.2",
40
40
  "react": "^18.2.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@deepseek-ai/cordis": "^4.1.0",
44
- "@deepseek-ai/dsh-api-session-controller": "^0.2.2-rc.1",
45
- "@deepseek-ai/dsh-api-workspace-controller": "^0.2.2-rc.1",
46
- "@deepseek-ai/dsh-client-connection": "^0.2.2-rc.1",
47
- "@deepseek-ai/dsh-client-locale": "^0.2.2-rc.1",
48
- "@deepseek-ai/dsh-client-ui-primitives": "^0.2.2-rc.1",
49
- "@deepseek-ai/dsh-client-ui-renderer": "^0.2.2-rc.1",
50
- "@deepseek-ai/dsh-client-ui-settings": "^0.2.2-rc.1",
51
- "@deepseek-ai/dsh-client-ui-slots": "^0.2.2-rc.1",
52
- "@deepseek-ai/dsh-client-ui-workspace": "^0.2.2-rc.1",
53
- "@deepseek-ai/dsh-host-webserver": "^0.2.2-rc.1",
44
+ "@deepseek-ai/dsh-api-session-controller": "^0.2.2-rc.2",
45
+ "@deepseek-ai/dsh-api-workspace-controller": "^0.2.2-rc.2",
46
+ "@deepseek-ai/dsh-client-connection": "^0.2.2-rc.2",
47
+ "@deepseek-ai/dsh-client-locale": "^0.2.2-rc.2",
48
+ "@deepseek-ai/dsh-client-ui-primitives": "^0.2.2-rc.2",
49
+ "@deepseek-ai/dsh-client-ui-renderer": "^0.2.2-rc.2",
50
+ "@deepseek-ai/dsh-client-ui-settings": "^0.2.2-rc.2",
51
+ "@deepseek-ai/dsh-client-ui-slots": "^0.2.2-rc.2",
52
+ "@deepseek-ai/dsh-client-ui-workspace": "^0.2.2-rc.2",
53
+ "@deepseek-ai/dsh-host-webserver": "^0.2.2-rc.2",
54
54
  "@testing-library/react": "^16.1.0",
55
55
  "@types/node": "^22.20.0",
56
56
  "@types/react": "~18.3.1",