@dsh-workbench/core 1.1.4 → 1.1.6

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.
Files changed (48) hide show
  1. package/client.js +1298 -510
  2. package/dist/client/client.body.js +1298 -510
  3. package/dist/client/index.js +1160 -372
  4. package/dist/host/index.js +1151 -255
  5. package/dist/types/app/layouts/approval-detail.d.ts +6 -3
  6. package/dist/types/app/layouts/market/add-module-registry-prefs.d.ts +11 -0
  7. package/dist/types/app/layouts/market/market-check.d.ts +10 -1
  8. package/dist/types/app/layouts/market/market-header.d.ts +3 -1
  9. package/dist/types/app/layouts/market/section-check.d.ts +12 -0
  10. package/dist/types/app/layouts/market/use-market-reload.d.ts +14 -0
  11. package/dist/types/app/layouts/market/use-module-versions.d.ts +20 -4
  12. package/dist/types/app/layouts/rightbar/AskAgentButton.d.ts +6 -0
  13. package/dist/types/app/layouts/rightbar/FailureCard.d.ts +8 -0
  14. package/dist/types/app/layouts/rightbar/MarketView.d.ts +6 -3
  15. package/dist/types/app/layouts/rightbar/SharedSection.d.ts +5 -2
  16. package/dist/types/app/layouts/rightbar/failure-card-text.d.ts +20 -0
  17. package/dist/types/app/layouts/rightbar/market-act.d.ts +2 -5
  18. package/dist/types/app/layouts/rightbar/market-change.d.ts +1 -0
  19. package/dist/types/app/layouts/rightbar/market-hint.d.ts +2 -0
  20. package/dist/types/app/layouts/rightbar/market-install.d.ts +11 -0
  21. package/dist/types/app/layouts/rightbar/market-row-types.d.ts +9 -1
  22. package/dist/types/app/layouts/rightbar/market-rows.d.ts +14 -1
  23. package/dist/types/app/layouts/rightbar/market-section.d.ts +5 -3
  24. package/dist/types/app/layouts/rightbar/market-transient-state.d.ts +3 -8
  25. package/dist/types/app/layouts/rightbar/market-uninstall.d.ts +10 -0
  26. package/dist/types/app/layouts/rightbar/market-update-verdict.d.ts +2 -0
  27. package/dist/types/app/layouts/rightbar/market-view-text.d.ts +2 -0
  28. package/dist/types/kernel/client/registry.d.ts +1 -0
  29. package/dist/types/kernel/contract/bundle-install.d.ts +1 -1
  30. package/dist/types/kernel/contract/market-index.d.ts +1 -1
  31. package/dist/types/modules/panels/model/market-env.d.ts +2 -2
  32. package/dist/types/modules/panels/model/market-install-error.d.ts +3 -0
  33. package/dist/types/modules/panels/model/market-install-error.test.d.ts +1 -0
  34. package/dist/types/modules/panels/model/market-registry.d.ts +2 -1
  35. package/dist/types/modules/panels/model/market-remove.d.ts +13 -0
  36. package/dist/types/modules/panels/model/market-remove.test.d.ts +1 -0
  37. package/dist/types/modules/panels/model/market-route.d.ts +1 -1
  38. package/dist/types/modules/panels/model/market-swap-stuck.d.ts +20 -0
  39. package/dist/types/modules/panels/model/market-swap-stuck.test.d.ts +1 -0
  40. package/dist/types/modules/panels/model/market-types.d.ts +3 -0
  41. package/dist/types/modules/panels/model/market-update-bundle.d.ts +5 -0
  42. package/dist/types/modules/panels/model/market.d.ts +1 -0
  43. package/dist/types/modules/panels/model/plugin-actions.d.ts +1 -1
  44. package/dist/types/shared/api/host/self-update-marker.d.ts +5 -0
  45. package/dist/types/shared/api/host/self-update-marker.test.d.ts +1 -0
  46. package/package.json +3 -3
  47. package/skills/workbench-module-diy/TOOLS.md +11 -2
  48. package/skills/workbench-module-diy/WIRING.md +2 -1
@@ -1,4 +1,4 @@
1
- import type { ApprovalInput, ReactNode, Translate } from '@dsh-workbench/shared';
1
+ import type { ApprovalInput, ReactNode, Translate, UnitManifest, UnitToolOpencli } from '@dsh-workbench/shared';
2
2
  import type { MarketSourcesPayload, PublishPreview } from '../../kernel/contract/market-index';
3
3
  export interface ApprovalRow {
4
4
  readonly label: string;
@@ -12,6 +12,9 @@ export interface ApprovalPlanView {
12
12
  readonly warn?: string | undefined;
13
13
  }
14
14
  export declare function marketSourceRows(tool: string, args: Readonly<Record<string, unknown>>, payload: MarketSourcesPayload | null | undefined, t: Translate): readonly ApprovalRow[];
15
+ export declare function pluginToolIndexOf(manifests: readonly UnitManifest[]): ReadonlyMap<string, UnitToolOpencli>;
16
+ export declare function pluginApprovalRows(origin: UnitToolOpencli, args: Readonly<Record<string, unknown>>, t: Translate): readonly ApprovalRow[];
17
+ export declare function shellApprovalRenderer(manifests: () => readonly UnitManifest[]): (input: ApprovalInput, t: Translate) => ReactNode;
15
18
  export declare function shellClaimsApprovalDetail(tool: string): boolean;
16
- export declare function shellApprovalPlan(input: ApprovalInput, t: Translate): ApprovalPlanView | undefined;
17
- export declare function shellApprovalDetail(input: ApprovalInput, t: Translate): ReactNode;
19
+ export declare function shellApprovalPlan(input: ApprovalInput, t: Translate, pluginTools?: ReadonlyMap<string, UnitToolOpencli> | undefined): ApprovalPlanView | undefined;
20
+ export declare function shellApprovalDetail(input: ApprovalInput, t: Translate, pluginTools?: ReadonlyMap<string, UnitToolOpencli> | undefined): ReactNode;
@@ -0,0 +1,11 @@
1
+ import { type RegistryChoice, type RegistryOption } from './add-module-text';
2
+ export interface RegistryPrefs {
3
+ readonly choice: RegistryChoice;
4
+ readonly custom: string;
5
+ }
6
+ export declare const DEFAULT_REGISTRY_CHOICE: RegistryChoice;
7
+ export declare function parseRegistryChoice(raw: string | null): RegistryChoice;
8
+ export declare function readRegistryPrefs(): RegistryPrefs;
9
+ export declare function writeRegistryChoice(choice: RegistryChoice): void;
10
+ export declare function writeRegistryCustom(value: string): void;
11
+ export declare function reconcileRegistryChoice(choice: RegistryChoice, choices: readonly RegistryOption[]): RegistryChoice;
@@ -1,10 +1,19 @@
1
1
  import type { Translate } from '@dsh-workbench/shared';
2
+ import type { LatestCheckSummary } from '../rightbar/market-rows';
3
+ export interface MarketRefreshButtonProps {
4
+ readonly label: string;
5
+ readonly checking: boolean;
6
+ readonly disabled: boolean;
7
+ readonly onCheck: () => void;
8
+ }
9
+ export declare function MarketRefreshButton({ label, checking, disabled, onCheck }: MarketRefreshButtonProps): JSX.Element;
2
10
  export interface MarketCheckProps {
3
11
  readonly t: Translate;
4
12
  readonly checkedAt: number | null;
13
+ readonly latestCheck?: LatestCheckSummary | undefined;
5
14
  readonly checking: boolean;
6
15
  readonly failed: boolean;
7
16
  readonly disabled: boolean;
8
17
  readonly onCheck: () => void;
9
18
  }
10
- export declare function MarketCheck({ t, checkedAt, checking, failed, disabled, onCheck }: MarketCheckProps): JSX.Element;
19
+ export declare function MarketCheck({ t, checkedAt, latestCheck, checking, failed, disabled, onCheck, }: MarketCheckProps): JSX.Element;
@@ -5,7 +5,9 @@ export interface MarketHeaderProps {
5
5
  readonly idPrefix: string;
6
6
  readonly tab: MarketTab;
7
7
  readonly busy: boolean;
8
+ readonly checking: boolean;
8
9
  readonly onTab: (tab: MarketTab) => void;
10
+ readonly onReload: () => void;
9
11
  readonly onAdd: () => void;
10
12
  }
11
- export declare function MarketHeader({ t, idPrefix, tab, busy, onTab, onAdd }: MarketHeaderProps): JSX.Element;
13
+ export declare function MarketHeader({ t, idPrefix, tab, busy, checking, onTab, onReload, onAdd, }: MarketHeaderProps): JSX.Element;
@@ -0,0 +1,12 @@
1
+ import type { Translate } from '@dsh-workbench/shared';
2
+ import type { LatestCheckSummary } from '../rightbar/market-rows';
3
+ import type { VersionsCheck, VersionsPart } from './use-module-versions';
4
+ export interface SectionCheckProps {
5
+ readonly t: Translate;
6
+ readonly part: VersionsPart;
7
+ readonly seat: VersionsCheck;
8
+ readonly latest: LatestCheckSummary;
9
+ readonly disabled: boolean;
10
+ readonly onCheck?: ((part: VersionsPart) => void) | undefined;
11
+ }
12
+ export declare function SectionCheck({ t, part, seat, latest, disabled, onCheck, }: SectionCheckProps): JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { type ModuleVersionsView, type VersionsPart } from './use-module-versions';
2
+ export interface MarketReload {
3
+ readonly reload: (options?: {
4
+ readonly force?: boolean;
5
+ }) => void;
6
+ readonly checkPart: (part: VersionsPart) => void;
7
+ }
8
+ export interface MarketReloadInput {
9
+ readonly checkedAt: number | null;
10
+ readonly forceProbe: () => void;
11
+ readonly reloadCapability: () => void;
12
+ readonly reloadVersions: ModuleVersionsView['reload'];
13
+ }
14
+ export declare function useMarketReload(input: MarketReloadInput): MarketReload;
@@ -1,26 +1,42 @@
1
1
  import type { ModuleVersion, WorkbenchSelfUpdate, WorkbenchVersion } from '../../../kernel/contract/bundle-install';
2
2
  import type { MarketInstalledModule } from '../../../kernel/contract/market-index';
3
3
  import type { InstalledPlugin } from '../../../shared/api/installed-plugins';
4
+ export type VersionsScope = 'all' | 'modules' | 'plugins';
5
+ export type VersionsPart = Exclude<VersionsScope, 'all'>;
6
+ export interface VersionsCheck {
7
+ readonly checking: boolean;
8
+ readonly failed: boolean;
9
+ readonly checkedAt: number | null;
10
+ }
4
11
  export interface ModuleVersionsState {
5
12
  readonly modules: readonly ModuleVersion[] | null;
6
13
  readonly plugins: readonly InstalledPlugin[] | null;
7
14
  readonly workbench: WorkbenchVersion | null;
8
15
  readonly selfUpdate: WorkbenchSelfUpdate | null;
9
16
  readonly read: boolean;
10
- readonly checking: boolean;
11
- readonly failed: boolean;
12
- readonly checkedAt: number | null;
17
+ readonly allChecking: boolean;
18
+ readonly modulesCheck: VersionsCheck;
19
+ readonly pluginsCheck: VersionsCheck;
13
20
  }
14
21
  export interface ModuleVersionsView extends ModuleVersionsState {
22
+ readonly checking: boolean;
15
23
  reload(options?: {
16
24
  readonly force?: boolean;
17
25
  readonly fresh?: boolean;
26
+ readonly scope?: VersionsScope;
18
27
  }): void;
19
28
  }
29
+ export interface ModuleVersionsRead {
30
+ force?: boolean;
31
+ fresh?: boolean;
32
+ scope?: VersionsScope;
33
+ }
20
34
  export declare function bumpModuleVersionsEpoch(): void;
21
35
  export declare function moduleVersionsValue(): ModuleVersionsState;
22
36
  export declare function resetModuleVersions(): void;
23
37
  export declare function subscribeModuleVersions(listener: () => void): () => void;
24
38
  export declare function withMarketUpdates(modules: readonly ModuleVersion[], rows: readonly MarketInstalledModule[]): readonly ModuleVersion[];
25
- export declare function runModuleVersionsRead(force?: boolean, fresh?: boolean): Promise<void>;
39
+ export declare function moduleVersionsCheckedAt(now: ModuleVersionsState): number | null;
40
+ export declare function moduleVersionsChecking(value: ModuleVersionsState): boolean;
41
+ export declare function runModuleVersionsRead(force?: boolean, fresh?: boolean, scope?: VersionsScope): Promise<void>;
26
42
  export declare function useModuleVersions(): ModuleVersionsView;
@@ -0,0 +1,6 @@
1
+ import type { Translate } from '@dsh-workbench/shared';
2
+ export declare function AskAgentButton({ t, text, label, }: {
3
+ readonly t: Translate;
4
+ readonly text: string;
5
+ readonly label: string;
6
+ }): JSX.Element;
@@ -0,0 +1,8 @@
1
+ import type { Translate } from '@dsh-workbench/shared';
2
+ import type { FailureCardModel } from './failure-card-text';
3
+ export declare function FailureCard({ t, model, onRecheck, rechecking, }: {
4
+ readonly t: Translate;
5
+ readonly model: FailureCardModel;
6
+ readonly onRecheck: () => void;
7
+ readonly rechecking: boolean;
8
+ }): JSX.Element;
@@ -8,6 +8,7 @@ import type { TitleResolve } from './market-names';
8
8
  import type { MarketMock } from './market-mock';
9
9
  import type { ModuleUpdateMap } from './market-rows';
10
10
  import type { WorkbenchSelfUpdate, WorkbenchVersion } from '../../../kernel/contract/bundle-install';
11
+ import type { VersionsCheck, VersionsPart } from '../market/use-module-versions';
11
12
  export interface MarketViewProps {
12
13
  readonly t: Translate;
13
14
  readonly titleOf: TitleResolve;
@@ -20,16 +21,18 @@ export interface MarketViewProps {
20
21
  }) => void;
21
22
  readonly onPending?: ((pending: boolean) => void) | undefined;
22
23
  readonly updates?: ModuleUpdateMap | undefined;
23
- readonly updatesCheckedAt?: number | null | undefined;
24
- readonly updatesFailed?: boolean | undefined;
24
+ readonly modulesCheck?: VersionsCheck | undefined;
25
+ readonly pluginsCheck?: VersionsCheck | undefined;
26
+ readonly onCheck?: ((part: VersionsPart) => void) | undefined;
25
27
  readonly installed?: readonly InstalledWorkbenchModule[] | undefined;
26
28
  readonly installedRead?: boolean | undefined;
27
29
  readonly workbench?: WorkbenchVersion | null | undefined;
28
30
  readonly selfUpdate?: WorkbenchSelfUpdate | null | undefined;
29
31
  readonly plugins?: readonly InstalledPlugin[] | null | undefined;
30
32
  readonly settling?: ReadonlySet<string> | undefined;
33
+ readonly installing?: boolean | undefined;
31
34
  readonly mock?: MarketMock | undefined;
32
35
  readonly defaults?: readonly string[] | undefined;
33
36
  readonly changed?: Readonly<Record<string, number>> | undefined;
34
37
  }
35
- export declare function MarketView({ t, titleOf, manifests, installable, capabilities, freshness, onChanged, onPending, updates, updatesCheckedAt, updatesFailed, installed, installedRead, workbench, selfUpdate, plugins, settling, mock, defaults, changed, }: MarketViewProps): JSX.Element;
38
+ export declare function MarketView({ t, titleOf, manifests, installable, capabilities, freshness, onChanged, onPending, updates, modulesCheck, pluginsCheck, onCheck, installed, installedRead, workbench, selfUpdate, plugins, settling, installing, mock, defaults, changed, }: MarketViewProps): JSX.Element;
@@ -1,11 +1,14 @@
1
1
  import type { Translate } from '@dsh-workbench/shared';
2
2
  import { type SharedRow } from './market-rows';
3
+ import type { MarketFailure } from './market-row-types';
3
4
  import { type Pending } from './market-view-text';
4
5
  import type { MarketRowAction } from './market-rows';
5
- export declare function SharedSection({ t, rows, pending, failureOf, act, }: {
6
+ export declare function SharedSection({ t, rows, pending, failureOf, act, onRecheck, rechecking, }: {
6
7
  readonly t: Translate;
7
8
  readonly rows: readonly SharedRow[];
8
9
  readonly pending: Pending | null;
9
- readonly failureOf: (id: string) => string | null;
10
+ readonly failureOf: (id: string) => MarketFailure | null;
10
11
  readonly act: (id: string, action: MarketRowAction) => Promise<void>;
12
+ readonly onRecheck: () => void;
13
+ readonly rechecking: boolean;
11
14
  }): JSX.Element | null;
@@ -0,0 +1,20 @@
1
+ import type { InstallFailure, Translate } from '@dsh-workbench/shared';
2
+ export interface FailureCardModel {
3
+ readonly title: string;
4
+ readonly fact: string;
5
+ readonly fixLabel: string;
6
+ readonly fix: string;
7
+ readonly copiedHint: string;
8
+ readonly command: string;
9
+ readonly output: string;
10
+ readonly exitCode: number | null;
11
+ }
12
+ export declare function updateStuckCardOf(t: Translate, input: {
13
+ readonly command: string;
14
+ readonly fact?: string | undefined;
15
+ readonly from?: string | undefined;
16
+ readonly latest?: string | undefined;
17
+ }): FailureCardModel;
18
+ export declare function shellPath(path: string): string;
19
+ export declare function ownerLabel(uid: number): string;
20
+ export declare function failureCardOf(failure: InstallFailure, t: Translate): FailureCardModel;
@@ -1,15 +1,12 @@
1
1
  import type { Translate, WriteOutcome } from '@dsh-workbench/shared';
2
- import type { MarketRow } from './market-row-types';
2
+ import type { MarketFailure, MarketRow } from './market-row-types';
3
3
  import { type MarketRowAction } from './market-rows';
4
4
  import { type HeldRow, type Pending } from './market-view-text';
5
5
  export interface MarketActSeats {
6
6
  readonly setPending: (next: Pending | null) => void;
7
7
  readonly setHeld: (next: HeldRow | undefined) => void;
8
8
  readonly setConfirming: (next: string | null) => void;
9
- readonly setFailed: (next: {
10
- readonly id: string;
11
- readonly message: string;
12
- } | null) => void;
9
+ readonly setFailed: (next: MarketFailure | null) => void;
13
10
  readonly setNotice: (next: string | null) => void;
14
11
  }
15
12
  export interface MarketActOptions {
@@ -2,3 +2,4 @@ import type { Translate } from '@dsh-workbench/shared';
2
2
  import type { BundleChange } from '../../../kernel/contract/bundle-install';
3
3
  export declare function changeOf(value: unknown): BundleChange | undefined;
4
4
  export declare function changeFailure(change: BundleChange | undefined, t: Translate): string | undefined;
5
+ export declare function appliedUnitsOf(value: unknown): readonly string[];
@@ -13,5 +13,7 @@ export interface MarketHintInput {
13
13
  readonly plugins?: readonly InstalledPlugin[] | null | undefined;
14
14
  readonly workbench?: WorkbenchVersion | null | undefined;
15
15
  readonly busy?: ReadonlySet<string> | undefined;
16
+ readonly installing?: boolean | undefined;
17
+ readonly applied?: ReadonlySet<string> | undefined;
16
18
  }
17
19
  export declare function marketHintOf(input: MarketHintInput): PanelHint | null;
@@ -0,0 +1,11 @@
1
+ export interface MarketInstallState {
2
+ readonly installing: boolean;
3
+ readonly applied: ReadonlySet<string>;
4
+ }
5
+ export declare function marketInstallState(): MarketInstallState;
6
+ export declare function subscribeMarketInstall(listener: () => void): () => void;
7
+ export declare function publishMarketInstalling(token: string, active: boolean): void;
8
+ export declare function publishMarketApplied(units: readonly string[]): void;
9
+ export declare function resetMarketInstall(): void;
10
+ export declare function useMarketInstallState(): MarketInstallState;
11
+ export declare function usePublishMarketInstalling(token: string, active: boolean): void;
@@ -1,9 +1,17 @@
1
1
  import type { ModuleUpdateBlock } from '../../../kernel/contract/bundle-install';
2
2
  import type { MarketInstalledModule } from '../../../kernel/contract/market-index';
3
+ import type { InstallFailure } from '@dsh-workbench/shared';
4
+ import type { FailureCardModel } from './failure-card-text';
5
+ export interface MarketFailure {
6
+ readonly id: string;
7
+ readonly message: string;
8
+ readonly failure?: InstallFailure;
9
+ readonly card?: FailureCardModel;
10
+ }
3
11
  export type MarketRowAction = 'install' | 'update' | 'update-bundle' | 'install-version' | 'remove-bundle' | 'uninstall' | 'update-dependency' | 'update-plugin' | 'uninstall-plugin' | 'update-workbench' | 'migrate-workbench' | 'dismiss-followup';
4
12
  export type MarketState = 'checking' | 'installed' | 'inactive' | 'unusable' | 'broken' | 'outdated' | 'pending-restart' | 'pending-followup' | 'missing' | 'unchecked' | 'unknown';
5
13
  export interface MarketNote {
6
- readonly key: 'panels.market.needEnv' | 'panels.market.noSource' | 'panels.market.badSource' | 'panels.market.needCommands' | 'panels.market.needBinary' | 'panels.market.needLib' | 'panels.market.moduleRefused' | 'panels.market.moduleRestartHint' | 'panels.market.pluginAlsoKnownAs' | 'panels.market.pluginBroken';
14
+ readonly key: 'panels.market.needEnv' | 'panels.market.noSource' | 'panels.market.badSource' | 'panels.market.needCommands' | 'panels.market.needBinary' | 'panels.market.needLib' | 'panels.market.moduleRefused' | 'panels.market.moduleRestartHint' | 'panels.market.pluginAlsoKnownAs' | 'panels.market.pluginBroken' | 'panels.market.latestNoRegistry' | 'panels.market.latestProbeFailed';
7
15
  readonly params: Readonly<Record<string, string>>;
8
16
  readonly tone?: 'plain' | 'alert';
9
17
  }
@@ -1,6 +1,7 @@
1
- import type { ModuleUpdateBlock, ModuleVersion } from '../../../kernel/contract/bundle-install';
1
+ import type { LatestUnavailable, ModuleUpdateBlock, ModuleVersion } from '../../../kernel/contract/bundle-install';
2
2
  import type { MarketInstalledModule } from '../../../kernel/contract/market-index';
3
3
  import type { Translate, UnitManifest, UnitTitle } from '@dsh-workbench/shared';
4
+ import type { InstalledPlugin } from '../../../shared/api/installed-plugins';
4
5
  import type { MarketNameMap } from './market-names';
5
6
  import type { MarketRow, MarketRowAction, MarketState, ModuleUpdate } from './market-row-types';
6
7
  import type { SharedRow } from './market-shared-rows';
@@ -19,6 +20,7 @@ export interface InstalledWorkbenchModule {
19
20
  readonly title?: UnitTitle | undefined;
20
21
  readonly latest?: string | undefined;
21
22
  readonly latestBlocked?: ModuleUpdateBlock | undefined;
23
+ readonly latestUnavailable?: LatestUnavailable | undefined;
22
24
  readonly local?: boolean | undefined;
23
25
  readonly refused?: readonly string[] | undefined;
24
26
  readonly clientRefused?: readonly string[] | undefined;
@@ -31,8 +33,15 @@ export declare function withClientRefusals(modules: readonly InstalledWorkbenchM
31
33
  }[]): readonly InstalledWorkbenchModule[];
32
34
  export declare function refusalReasons(host: readonly string[] | undefined, client: readonly string[] | undefined): readonly string[];
33
35
  export declare function installedIdSet(installed: readonly InstalledWorkbenchModule[] | undefined): ReadonlySet<string> | null;
36
+ export interface LatestCheckSummary {
37
+ readonly checked: number;
38
+ readonly unknown: number;
39
+ }
40
+ export declare function latestCheckSummary(modules: readonly InstalledWorkbenchModule[] | undefined): LatestCheckSummary;
41
+ export declare function checkedPluginCount(plugins: readonly InstalledPlugin[] | null | undefined): number;
34
42
  export declare function installedRows(modules: readonly InstalledWorkbenchModule[], manifests: readonly UnitManifest[], listed: ReadonlySet<string>, names?: MarketNameMap | undefined, defaults?: ReadonlySet<string>, changed?: Readonly<Record<string, number>>): MarketRow[];
35
43
  export declare function marketSwitchLocked(row: MarketRow): boolean;
44
+ export declare function marketAsksAgent(row: MarketRow): boolean;
36
45
  export declare function marketActions(row: MarketRow): MarketRowAction[];
37
46
  export declare function capabilityOutdated(capabilities: CapabilityMap | null, unit: string): boolean;
38
47
  export declare function marketCatalog(manifests: readonly UnitManifest[], installable: ReadonlySet<string> | null | undefined): readonly UnitManifest[];
@@ -46,4 +55,8 @@ export interface MarketSection {
46
55
  }
47
56
  export declare function marketOrder(rows: readonly MarketRow[], titleOf: (row: MarketRow) => string): MarketRow[];
48
57
  export declare function marketSections(rows: readonly MarketRow[]): MarketSection[];
58
+ export declare function checkingRows(rows: readonly MarketRow[], scope: {
59
+ readonly all: boolean;
60
+ readonly units: ReadonlySet<string>;
61
+ }): MarketRow[];
49
62
  export declare function marketRows(manifests: readonly UnitManifest[], capabilities: CapabilityMap | null, updates?: ModuleUpdateMap, defaults?: ReadonlySet<string>, changed?: Readonly<Record<string, number>>): MarketRow[];
@@ -1,15 +1,15 @@
1
1
  import type { ReactNode, Translate } from '@dsh-workbench/shared';
2
- import type { MarketRow } from './market-row-types';
2
+ import type { MarketFailure, MarketRow } from './market-row-types';
3
3
  import { type MarketRowAction } from './market-rows';
4
4
  import type { MarketSectionIcon } from './market-section-icon';
5
5
  import { type Pending } from './market-view-text';
6
- export declare function MarketSection({ t, titleKey, icon, rows, pending, failureOf, act, confirmActions, onConfirming, onDefault, boardBusy, headAction, keepHead, }: {
6
+ export declare function MarketSection({ t, titleKey, icon, rows, pending, failureOf, act, confirmActions, onConfirming, onDefault, boardBusy, headAction, keepHead, onRecheck, rechecking, }: {
7
7
  readonly t: Translate;
8
8
  readonly titleKey?: string;
9
9
  readonly icon?: MarketSectionIcon;
10
10
  readonly rows: readonly MarketRow[];
11
11
  readonly pending: Pending | null;
12
- readonly failureOf: (id: string) => string | null;
12
+ readonly failureOf: (id: string) => MarketFailure | null;
13
13
  readonly act: (id: string, action: MarketRowAction) => Promise<void>;
14
14
  readonly onDefault?: ((id: string, next: boolean) => void) | undefined;
15
15
  readonly boardBusy?: boolean | undefined;
@@ -17,4 +17,6 @@ export declare function MarketSection({ t, titleKey, icon, rows, pending, failur
17
17
  readonly onConfirming: (id: string | null) => void;
18
18
  readonly headAction?: ReactNode;
19
19
  readonly keepHead?: boolean;
20
+ readonly onRecheck: () => void;
21
+ readonly rechecking: boolean;
20
22
  }): JSX.Element | null;
@@ -1,18 +1,13 @@
1
1
  import type { MarketMock } from './market-mock';
2
2
  import type { Pending } from './market-view-text';
3
+ import type { MarketFailure } from './market-row-types';
3
4
  export interface MarketTransient {
4
5
  readonly pending: Pending | null;
5
6
  readonly setPending: (next: Pending | null) => void;
6
7
  readonly confirming: string | null;
7
8
  readonly setConfirming: (next: string | null) => void;
8
- readonly failed: {
9
- readonly id: string;
10
- readonly message: string;
11
- } | null;
12
- readonly setFailed: (next: {
13
- readonly id: string;
14
- readonly message: string;
15
- } | null) => void;
9
+ readonly failed: MarketFailure | null;
10
+ readonly setFailed: (next: MarketFailure | null) => void;
16
11
  readonly notice: string | null;
17
12
  readonly setNotice: (next: string | null) => void;
18
13
  }
@@ -0,0 +1,10 @@
1
+ import type { Translate } from '@dsh-workbench/shared';
2
+ import type { MarketRow, MarketRowAction } from './market-rows';
3
+ export declare function UninstallConfirm({ t, confirming, row, onClose, act, rowById, }: {
4
+ readonly t: Translate;
5
+ readonly confirming: string | null;
6
+ readonly row: MarketRow | undefined;
7
+ readonly onClose: () => void;
8
+ readonly act: (id: string, action: MarketRowAction) => Promise<void>;
9
+ readonly rowById: ReadonlyMap<string, MarketRow>;
10
+ }): JSX.Element;
@@ -8,6 +8,8 @@ export interface UpdatedModule {
8
8
  }
9
9
  export type UpdateVerdict = {
10
10
  readonly kind: 'ok';
11
+ } | {
12
+ readonly kind: 'failed';
11
13
  } | {
12
14
  readonly kind: 'no-change';
13
15
  } | {
@@ -48,3 +48,5 @@ export declare function pendingRowOf(input: {
48
48
  readonly rows: readonly MarketRow[];
49
49
  readonly names: MarketNameMap;
50
50
  }): MarketRow | undefined;
51
+ export declare function askAgentReason(row: MarketRow, t: Translate): string;
52
+ export declare function askAgentText(row: MarketRow, t: Translate): string;
@@ -11,6 +11,7 @@ export interface ClientUnitRegistry {
11
11
  register(face: UnitClientFace): () => void;
12
12
  all(): readonly UnitClientFace[];
13
13
  manifests(): readonly UnitManifest[];
14
+ declared(): readonly UnitManifest[];
14
15
  installable(): ReadonlySet<string> | null;
15
16
  refusals(): readonly ClientUnitRefusal[];
16
17
  setManifests(manifests: readonly UnitManifest[], installable?: readonly string[]): void;
@@ -1,2 +1,2 @@
1
1
  export { BUNDLE_REGISTRIES_ROUTE, BUNDLE_INSPECT_ROUTE, BUNDLE_REGISTRY_DEFAULT, MODULE_VERSIONS_ROUTE, SELF_UPDATE_STATES, RESTART_REASONS } from '@dsh-workbench/shared/contract/protocol/bundle-install';
2
- export type { BundleRegistry, BundleRegistries, BundleInspectProblem, BundleSpecKind, BundleInspectionAccepted, BundleInspectionRefused, BundleInspectionPlugin, BundleInspection, BundleRegistriesPayload, BundleInspectionPayload, BundleApplication, SelfUpdateState, WorkbenchSelfUpdate, RestartReason, BundleChangeStage, BundleFailureKind, BundlePackageResult, BundleChange, BundleInstallRequest, BundleCancellation, BundleSupplyState, BundleModulePayload, BundleSupplyPayload, BundleInstalledPlugin, BundleInstallPayload, BundleRemovePayload, BundleCancellationPayload, ModuleVersion, ModuleUpdateBlock, WorkbenchVersion, ModuleVersionsPayload } from '@dsh-workbench/shared/contract/protocol/bundle-install';
2
+ export type { BundleRegistry, BundleRegistries, BundleInspectProblem, BundleSpecKind, BundleInspectionAccepted, BundleInspectionRefused, BundleInspectionPlugin, BundleInspection, BundleRegistriesPayload, BundleInspectionPayload, BundleApplication, SelfUpdateState, WorkbenchSelfUpdate, RestartReason, BundleChangeStage, BundleFailureKind, BundlePackageResult, BundleChange, BundleInstallRequest, BundleCancellation, BundleSupplyState, BundleModulePayload, BundleSupplyPayload, BundleInstalledPlugin, BundleInstallPayload, BundleRemovePayload, BundleCancellationPayload, LatestUnavailable, ModuleVersion, ModuleUpdateBlock, WorkbenchVersion, ModuleVersionsPayload } from '@dsh-workbench/shared/contract/protocol/bundle-install';
@@ -1,2 +1,2 @@
1
- export { MARKET_DISCOVER_ROUTE, MARKET_DOC_ROUTE, MARKET_GIT_PROBE_ROUTE, MARKET_INSTALLED_ROUTE, MARKET_INDEX_FORMAT, MARKET_INDEX_PATH, MARKET_PUBLISH_PREVIEW_ROUTE, MARKET_SOURCES_RESOURCE, MARKET_SOURCES_ROUTE, MARKET_WORKBENCH_LABEL, } from '@dsh-workbench/shared/contract/protocol/market-index';
1
+ export { MARKET_DISCOVER_ROUTE, MARKET_DOC_ROUTE, MARKET_GIT_PROBE_ROUTE, MARKET_INSTALLED_ROUTE, MARKET_INDEX_DIR, MARKET_INDEX_FORMAT, MARKET_INDEX_PATH, MARKET_PUBLISH_PREVIEW_ROUTE, MARKET_SOURCES_RESOURCE, MARKET_SOURCES_ROUTE, MARKET_WORKBENCH_LABEL, } from '@dsh-workbench/shared/contract/protocol/market-index';
2
2
  export type { DiscoverCompat, DiscoverDoc, DiscoverDocKind, DiscoverEntry, DiscoverFilter, DiscoverInstallState, DiscoverPayload, DiscoverProblem, DiscoverSourceRow, DiscoverState, DiscoverVersionRow, GitProbePayload, GitProbeStatus, GitTransportKind, MarketInstalledModule, MarketInstalledPayload, IndexSourceSpec, MarketClaim, MarketIndex, MarketIndexCategory, MarketIndexEngines, MarketIndexEntry, MarketIndexEntryMetadata, MarketIndexGitSource, MarketIndexLabel, MarketIndexMetadata, MarketIndexNpmSource, MarketIndexParse, MarketIndexProblem, MarketIndexProblemKind, MarketIndexSortKey, MarketIndexSource, MarketIndexVersion, MarketLocalizedText, MarketPublishDestination, MarketSourceConfig, MarketSourceKind, MarketSourcePolicy, MarketSourcesAction, MarketSourcesPayload, PublishChangelog, PublishPreview, } from '@dsh-workbench/shared/contract/protocol/market-index';
@@ -2,8 +2,8 @@ import type { Need, UnitCapability, UnitManifest } from '@dsh-workbench/shared/h
2
2
  import { type PluginReferences } from './plugin-actions';
3
3
  import type { PluginLedger } from './plugin-ledger';
4
4
  export interface EnvDropper {
5
- usersOf(plugin: string, except?: string): string[];
6
- drop(unit: string, needs: readonly Need[] | undefined, before: UnitCapability): Promise<string[]>;
5
+ usersOf(plugin: string, except?: string, roster?: readonly UnitManifest[]): string[];
6
+ drop(unit: string, needs: readonly Need[] | undefined, before: UnitCapability, roster?: readonly UnitManifest[]): Promise<string[]>;
7
7
  }
8
8
  export declare function createEnvDropper(options: {
9
9
  readonly catalog: () => readonly UnitManifest[];
@@ -0,0 +1,3 @@
1
+ import type { InstallFailure } from '@dsh-workbench/shared';
2
+ import { WorkbenchDataError } from '@dsh-workbench/shared/host';
3
+ export declare function installError(failure: InstallFailure): WorkbenchDataError;
@@ -3,10 +3,11 @@ import type { BundleManager } from '@dsh-workbench/shared/host';
3
3
  import type { RegistryNotebook } from '@dsh-workbench/shared/host';
4
4
  export interface RegistryFixDeps {
5
5
  readonly registries?: RegistryNotebook | undefined;
6
+ readonly profileDir?: string | null | undefined;
6
7
  readonly logger?: {
7
8
  info?(message: string): void;
8
9
  warn?(message: string): void;
9
10
  } | undefined;
10
11
  }
11
- export declare function rememberInstalledSource(deps: RegistryFixDeps, manager: BundleManager, pkg: string, registry: string | undefined): Promise<void>;
12
+ export declare function rememberInstalledSource(deps: RegistryFixDeps, manager: BundleManager, pkg: string, registry: string | undefined, version?: string | undefined): Promise<void>;
12
13
  export declare function retryAfterRegistryFix(deps: RegistryFixDeps, manager: BundleManager, pkg: string, change: BundleChange): Promise<BundleChange>;
@@ -0,0 +1,13 @@
1
+ import type { BundleChange } from '../../../kernel/contract/bundle-install';
2
+ import type { BundleManager } from '@dsh-workbench/shared/host';
3
+ import { type RegistryFixDeps } from './market-registry';
4
+ export interface RemoveBundleOptions {
5
+ readonly manager: BundleManager;
6
+ readonly pkg: string;
7
+ readonly profileDir?: string | null | undefined;
8
+ readonly registryFix: RegistryFixDeps;
9
+ readonly logger?: {
10
+ warn?(message: string): void;
11
+ } | undefined;
12
+ }
13
+ export declare function removeDshBundle(options: RemoveBundleOptions): Promise<BundleChange>;
@@ -22,7 +22,7 @@ export interface BundleInstallDeps {
22
22
  readonly ledger?: PluginLedger | undefined;
23
23
  readonly runAll: (commands: readonly PluginSourceCommand[]) => Promise<void>;
24
24
  readonly supplyAfter: (module: InstalledModule, change: BundleChange) => Promise<BundleSupply>;
25
- readonly rememberSource: (manager: BundleManager, pkg: string, registry: string | undefined) => Promise<void>;
25
+ readonly rememberSource: (manager: BundleManager, pkg: string, registry: string | undefined, version?: string | undefined) => Promise<void>;
26
26
  readonly remove?: ((pkg: string) => Promise<BundleChange>) | undefined;
27
27
  }
28
28
  export declare function bundleNameOf(change: BundleChange, spec: string): string;
@@ -0,0 +1,20 @@
1
+ import type { InstalledModule, SupplyPort } from '@dsh-workbench/shared/host';
2
+ export interface ExternalSwapDeps {
3
+ readonly supply: Pick<SupplyPort, 'startSelfUpdate'>;
4
+ readonly installed: ((pkg: string) => InstalledModule) | undefined;
5
+ readonly dshHome: string;
6
+ readonly profile: string;
7
+ readonly pollMs?: number | undefined;
8
+ readonly waitMs?: number | undefined;
9
+ readonly logger?: {
10
+ info?(message: string): void;
11
+ warn?(message: string): void;
12
+ } | undefined;
13
+ }
14
+ export interface ExternalSwapInput {
15
+ readonly pkg: string;
16
+ readonly from: string;
17
+ readonly to: string;
18
+ readonly pinned: boolean;
19
+ }
20
+ export declare function swapExternally(deps: ExternalSwapDeps, input: ExternalSwapInput): Promise<InstalledModule | undefined>;
@@ -41,6 +41,9 @@ export interface BundleInstallOutcome {
41
41
  readonly supply: BundleSupply;
42
42
  readonly plugin?: BundleInstalledPlugin;
43
43
  readonly restored?: string;
44
+ readonly remedy?: {
45
+ readonly command: string;
46
+ };
44
47
  }
45
48
  export interface BundleRemoveOutcome {
46
49
  readonly change: BundleChange;
@@ -15,5 +15,10 @@ export interface BundleUpdateDeps {
15
15
  warn?(message: string): void;
16
16
  } | undefined;
17
17
  readonly supply?: SupplyPort | undefined;
18
+ readonly profile?: string | undefined;
19
+ readonly dshHome?: string | undefined;
20
+ readonly profileName?: string | undefined;
21
+ readonly swapWaitMs?: number | undefined;
22
+ readonly swapPollMs?: number | undefined;
18
23
  }
19
24
  export declare function updateModuleBundle(unit: string, deps: BundleUpdateDeps): Promise<BundleInstallOutcome | null>;
@@ -25,6 +25,7 @@ export declare function createMarketService(options: {
25
25
  modules?: (() => readonly ProfileModule[]) | undefined;
26
26
  workbench?: ((pkg: string) => ProfilePackage | undefined) | undefined;
27
27
  registries?: RegistryNotebook | undefined;
28
+ profileDir?: string | null | undefined;
28
29
  ledger?: PluginLedger | undefined;
29
30
  references?: (() => PluginReferences) | undefined;
30
31
  dshHome?: (() => string) | undefined;
@@ -34,7 +34,7 @@ export declare function pluginSweptText(pkg: string): string;
34
34
  export interface PluginActions {
35
35
  update(pkg: string): Promise<PluginUpdateOutcome>;
36
36
  uninstall(pkg: string): Promise<PluginUninstallOutcome>;
37
- sweep(): Promise<readonly string[]>;
37
+ sweep(claimedBy?: (plugin: string) => readonly string[]): Promise<readonly string[]>;
38
38
  }
39
39
  export declare function createPluginActions(options: {
40
40
  readonly ledger?: PluginLedger | undefined;
@@ -0,0 +1,5 @@
1
+ export interface SelfUpdateMarkerRead {
2
+ readonly pkg?: string | undefined;
3
+ readonly state?: string | undefined;
4
+ }
5
+ export declare function readSelfUpdateMarker(file: string): SelfUpdateMarkerRead;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsh-workbench/core",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "个人工作台:Agent 工作台(左栏 + 常驻对话 + 自研右侧数据面板)。",
5
5
  "type": "module",
6
6
  "icon": "./icon.svg",
@@ -100,8 +100,8 @@
100
100
  "proper-lockfile": "^4.1.2",
101
101
  "which": "^7.0.0",
102
102
  "write-file-atomic": "^8.0.0",
103
- "@dsh-workbench/shared": "1.1.4",
104
- "@dsh-workbench/adapters-default": "1.1.4"
103
+ "@dsh-workbench/shared": "1.1.6",
104
+ "@dsh-workbench/adapters-default": "1.1.6"
105
105
  },
106
106
  "license": "MIT",
107
107
  "repository": {