@dsh-workbench/core 0.1.18 → 0.2.0
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/client.js +1003 -537
- package/dist/client/client.body.js +1003 -537
- package/dist/client/index.js +1004 -538
- package/dist/host/index.js +1162 -145
- package/dist/types/app/client.d.ts +99 -39
- package/dist/types/app/layouts/market/__tests__/add-module-stages.test.d.ts +1 -0
- package/dist/types/app/layouts/market/add-module-text.d.ts +16 -1
- package/dist/types/app/layouts/market/use-add-module.d.ts +2 -8
- package/dist/types/app/layouts/market/use-module-versions.d.ts +2 -1
- package/dist/types/app/layouts/rightbar/MarketView.d.ts +5 -1
- package/dist/types/app/layouts/rightbar/ModulesPage.d.ts +4 -2
- package/dist/types/app/layouts/rightbar/PanelModules.d.ts +2 -2
- package/dist/types/app/layouts/rightbar/PanelPluginRows.d.ts +9 -0
- package/dist/types/app/layouts/rightbar/PanelRowControls.d.ts +14 -0
- package/dist/types/app/layouts/rightbar/__tests__/market-row-icon.test.d.ts +1 -0
- package/dist/types/app/layouts/rightbar/__tests__/market-section-icon.test.d.ts +1 -0
- package/dist/types/app/layouts/rightbar/__tests__/market-workbench.test.d.ts +1 -0
- package/dist/types/app/layouts/rightbar/__tests__/panel-plugin-rows.test.d.ts +1 -0
- package/dist/types/app/layouts/rightbar/__tests__/panel-scope-ui.test.d.ts +1 -0
- package/dist/types/app/layouts/rightbar/board-selection.d.ts +11 -0
- package/dist/types/app/layouts/rightbar/market-act.d.ts +21 -0
- package/dist/types/app/layouts/rightbar/market-mock.d.ts +6 -1
- package/dist/types/app/layouts/rightbar/market-plugin-rows.d.ts +3 -1
- package/dist/types/app/layouts/rightbar/market-row-icon.d.ts +7 -0
- package/dist/types/app/layouts/rightbar/market-row-types.d.ts +35 -0
- package/dist/types/app/layouts/rightbar/market-rows.d.ts +8 -35
- package/dist/types/app/layouts/rightbar/market-section-icon.d.ts +3 -0
- package/dist/types/app/layouts/rightbar/market-section.d.ts +18 -0
- package/dist/types/app/layouts/rightbar/market-view-text.d.ts +7 -1
- package/dist/types/app/layouts/rightbar/market-workbench-row.d.ts +5 -0
- package/dist/types/app/layouts/rightbar/panel-mock.d.ts +2 -1
- package/dist/types/app/layouts/rightbar/use-panels.d.ts +15 -1
- package/dist/types/app/units/registry.d.ts +1 -1
- package/dist/types/modules/panels/__tests__/plugin-panel-market-parity.test.d.ts +1 -0
- package/dist/types/modules/panels/__tests__/plugin-panel.test.d.ts +1 -0
- package/dist/types/modules/panels/__tests__/plugin-tool-units.test.d.ts +1 -0
- package/dist/types/modules/panels/__tests__/scope-machine.test.d.ts +1 -0
- package/dist/types/modules/panels/__tests__/scope-support.d.ts +51 -0
- package/dist/types/modules/panels/model/config.d.ts +19 -0
- package/dist/types/modules/panels/model/market-dispatch.d.ts +4 -0
- package/dist/types/modules/panels/model/market-registry.d.ts +12 -0
- package/dist/types/modules/panels/model/market-registry.test.d.ts +1 -0
- package/dist/types/modules/panels/model/market-types.d.ts +1 -0
- package/dist/types/modules/panels/model/market.d.ts +3 -2
- package/dist/types/modules/panels/model/plugin-panel.d.ts +3 -0
- package/dist/types/modules/panels/model/prefs.d.ts +3 -1
- package/dist/types/modules/panels/model/service.d.ts +5 -1
- package/dist/types/shared/api/bundle-install.d.ts +15 -1
- package/dist/types/shared/api/host/__tests__/plugin-catalog.test.d.ts +1 -0
- package/dist/types/shared/api/host/__tests__/plugin-login-hint.test.d.ts +1 -0
- package/dist/types/shared/api/host/__tests__/plugin-tools.test.d.ts +1 -0
- package/dist/types/shared/api/host/bundle-inspect-kind.test.d.ts +1 -0
- package/dist/types/shared/api/host/bundle-routes-self.test.d.ts +1 -0
- package/dist/types/shared/api/host/installed-module.d.ts +10 -0
- package/dist/types/shared/api/host/plugin-catalog.d.ts +60 -0
- package/dist/types/shared/api/host/plugin-login-hint.d.ts +2 -0
- package/dist/types/shared/api/host/plugin-tools.d.ts +10 -0
- package/dist/types/shared/api/host/plugin-units.d.ts +47 -0
- package/dist/types/shared/api/host/unit-registry.d.ts +3 -0
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import type { Translate } from '@dsh-workbench/shared';
|
|
2
|
-
import type { BundleChange, BundleInspectProblem, BundleRegistries } from '../../../shared/api/bundle-install';
|
|
2
|
+
import type { BundleChange, BundleInspectProblem, BundleInspectionAccepted, BundleInspectionPlugin, BundleRegistries } from '../../../shared/api/bundle-install';
|
|
3
3
|
export type AddModulePhase = 'idle' | 'inspecting' | 'preview' | 'installing' | 'result';
|
|
4
|
+
export interface AddModulePreview {
|
|
5
|
+
readonly kind: 'module' | 'plugin';
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly version: string;
|
|
8
|
+
readonly description: string;
|
|
9
|
+
readonly registry: string;
|
|
10
|
+
readonly pluginName?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function previewOf(inspection: BundleInspectionAccepted | BundleInspectionPlugin, fallback: string): AddModulePreview;
|
|
13
|
+
export type AddModuleResultKind = 'plugin' | 'failed' | 'cancelled' | 'restart' | 'took-effect' | 'quiet';
|
|
14
|
+
export declare function resultKindOf(input: {
|
|
15
|
+
readonly change: Pick<BundleChange, 'application'>;
|
|
16
|
+
readonly supplyState: string;
|
|
17
|
+
readonly plugin: boolean;
|
|
18
|
+
}): AddModuleResultKind;
|
|
4
19
|
export type RegistryKind = 'default' | 'url' | 'custom';
|
|
5
20
|
export interface RegistryChoice {
|
|
6
21
|
readonly kind: RegistryKind;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import type { BundleChange, BundleInspectProblem, BundleInstalledPlugin, BundleModulePayload, BundleSupplyPayload } from '../../../shared/api/bundle-install';
|
|
2
|
-
import { type AddModulePhase, type RegistryChoice, type RegistryOption } from './add-module-text';
|
|
3
|
-
export type { AddModulePhase } from './add-module-text';
|
|
4
|
-
export interface AddModulePreview {
|
|
5
|
-
readonly name: string;
|
|
6
|
-
readonly version: string;
|
|
7
|
-
readonly description: string;
|
|
8
|
-
readonly registry: string;
|
|
9
|
-
}
|
|
2
|
+
import { type AddModulePhase, type AddModulePreview, type RegistryChoice, type RegistryOption } from './add-module-text';
|
|
3
|
+
export type { AddModulePhase, AddModulePreview } from './add-module-text';
|
|
10
4
|
export interface AddModuleOutcome {
|
|
11
5
|
readonly change: BundleChange;
|
|
12
6
|
readonly module: BundleModulePayload;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { ModuleVersion } from '../../../shared/api/bundle-install';
|
|
1
|
+
import type { ModuleVersion, WorkbenchVersion } from '../../../shared/api/bundle-install';
|
|
2
2
|
import type { InstalledPlugin } from '../../../shared/api/installed-plugins';
|
|
3
3
|
export interface ModuleVersionsState {
|
|
4
4
|
readonly modules: readonly ModuleVersion[] | null;
|
|
5
5
|
readonly plugins: readonly InstalledPlugin[] | null;
|
|
6
|
+
readonly workbench: WorkbenchVersion | null;
|
|
6
7
|
readonly read: boolean;
|
|
7
8
|
readonly checkedAt: number | null;
|
|
8
9
|
}
|
|
@@ -6,6 +6,7 @@ import type { InstalledPlugin } from '../../../shared/api/installed-plugins';
|
|
|
6
6
|
import { type InstalledWorkbenchModule } from './market-rows';
|
|
7
7
|
import type { MarketMock } from './market-mock';
|
|
8
8
|
import type { ModuleUpdateMap } from './market-rows';
|
|
9
|
+
import type { WorkbenchVersion } from '../../../shared/api/bundle-install';
|
|
9
10
|
export interface MarketViewProps {
|
|
10
11
|
readonly t: Translate;
|
|
11
12
|
readonly manifests: readonly UnitManifest[];
|
|
@@ -15,8 +16,11 @@ export interface MarketViewProps {
|
|
|
15
16
|
readonly updates?: ModuleUpdateMap | undefined;
|
|
16
17
|
readonly installed?: readonly InstalledWorkbenchModule[] | undefined;
|
|
17
18
|
readonly installedRead?: boolean | undefined;
|
|
19
|
+
readonly workbench?: WorkbenchVersion | null | undefined;
|
|
18
20
|
readonly plugins?: readonly InstalledPlugin[] | null | undefined;
|
|
19
21
|
readonly settling?: ReadonlySet<string> | undefined;
|
|
20
22
|
readonly mock?: MarketMock | undefined;
|
|
23
|
+
readonly defaults?: readonly string[] | undefined;
|
|
24
|
+
readonly changed?: Readonly<Record<string, number>> | undefined;
|
|
21
25
|
}
|
|
22
|
-
export declare function MarketView({ t, manifests, capabilities, freshness, onChanged, updates, installed, installedRead, plugins, settling, mock, }: MarketViewProps): JSX.Element;
|
|
26
|
+
export declare function MarketView({ t, manifests, capabilities, freshness, onChanged, updates, installed, installedRead, workbench, plugins, settling, mock, defaults, changed, }: MarketViewProps): JSX.Element;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import type { Translate } from '@dsh-workbench/shared';
|
|
2
2
|
import type { CapabilityMap } from '../../../shared/hooks/use-capabilities';
|
|
3
3
|
import type { PanelMock } from './panel-mock';
|
|
4
|
-
import type { PanelUnit } from './use-panels';
|
|
4
|
+
import type { PanelPluginUnit, PanelUnit } from './use-panels';
|
|
5
5
|
export interface ModulesPageProps {
|
|
6
6
|
readonly t: Translate;
|
|
7
7
|
readonly units: readonly PanelUnit[];
|
|
8
|
+
readonly plugins?: readonly PanelPluginUnit[];
|
|
8
9
|
readonly workspace: string | null;
|
|
9
10
|
readonly capabilities: CapabilityMap | null;
|
|
10
11
|
readonly loading?: boolean;
|
|
11
12
|
readonly onOpenMarket: () => void;
|
|
12
13
|
readonly mocked?: boolean;
|
|
13
14
|
readonly mock?: PanelMock | undefined;
|
|
15
|
+
readonly own?: boolean;
|
|
14
16
|
}
|
|
15
|
-
export declare function ModulesPage({ t, units, workspace, capabilities, loading, onOpenMarket, mocked, mock, }: ModulesPageProps): JSX.Element;
|
|
17
|
+
export declare function ModulesPage({ t, units, plugins, workspace, capabilities, loading, onOpenMarket, mocked, mock, own, }: ModulesPageProps): JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Translate } from '@dsh-workbench/shared';
|
|
2
2
|
import type { UnitManifest } from '@dsh-workbench/shared';
|
|
3
|
-
import type {
|
|
3
|
+
import type { PanelBoardView } from './use-panels';
|
|
4
4
|
export interface PanelModulesProps {
|
|
5
5
|
readonly t: Translate;
|
|
6
6
|
readonly open: boolean;
|
|
7
7
|
readonly onOpenChange: (open: boolean) => void;
|
|
8
|
-
readonly enabledUnits:
|
|
8
|
+
readonly enabledUnits: PanelBoardView | null;
|
|
9
9
|
readonly workspace: string | null;
|
|
10
10
|
readonly refreshToken: number;
|
|
11
11
|
readonly manifests: readonly UnitManifest[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Translate } from '@dsh-workbench/shared';
|
|
2
|
+
import type { PanelRow } from './board-selection';
|
|
3
|
+
export interface PanelPluginRowsProps {
|
|
4
|
+
readonly t: Translate;
|
|
5
|
+
readonly rows: readonly PanelRow[];
|
|
6
|
+
readonly busy: boolean;
|
|
7
|
+
readonly onWrite: (body: Record<string, unknown>) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function PanelPluginRows({ t, rows, busy, onWrite }: PanelPluginRowsProps): JSX.Element | null;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Translate } from '@dsh-workbench/shared';
|
|
2
|
+
export interface PanelRowUnit {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly shown: boolean;
|
|
5
|
+
readonly source: 'default' | 'user';
|
|
6
|
+
}
|
|
7
|
+
export interface PanelRowControlsProps {
|
|
8
|
+
readonly t: Translate;
|
|
9
|
+
readonly unit: PanelRowUnit;
|
|
10
|
+
readonly label: string;
|
|
11
|
+
readonly busy: boolean;
|
|
12
|
+
readonly onWrite: (body: Record<string, unknown>) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function PanelRowControls({ t, unit, label, busy, onWrite }: PanelRowControlsProps): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
import type { ModuleSummary } from '@dsh-workbench/shared';
|
|
2
2
|
import type { BoardModule } from '@dsh-workbench/shared';
|
|
3
3
|
import type { CapabilityMap } from '../../../shared/hooks/use-capabilities';
|
|
4
|
+
import type { PanelPluginUnit, PanelUnit } from './use-panels';
|
|
4
5
|
export interface SelectableUnit {
|
|
5
6
|
readonly id: string;
|
|
6
7
|
readonly shown: boolean;
|
|
7
8
|
}
|
|
9
|
+
export interface PanelRow {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly titleKey?: string;
|
|
12
|
+
readonly title?: string;
|
|
13
|
+
readonly plugin: boolean;
|
|
14
|
+
readonly badgeKey?: string;
|
|
15
|
+
readonly shown: boolean;
|
|
16
|
+
readonly source: 'default' | 'user';
|
|
17
|
+
}
|
|
8
18
|
export declare function available(capability: CapabilityMap[string] | undefined): boolean;
|
|
9
19
|
export declare function selectPanelUnits<T extends SelectableUnit>(units: readonly T[], capabilities: CapabilityMap | null): T[];
|
|
10
20
|
export declare function panelBadgeKey(capability: CapabilityMap[string] | undefined): string | undefined;
|
|
21
|
+
export declare function selectPanelRows(units: readonly PanelUnit[], plugins: readonly PanelPluginUnit[], capabilities: CapabilityMap | null): PanelRow[];
|
|
11
22
|
export declare function selectBoardModules(units: readonly SelectableUnit[] | null, byId: (id: string) => BoardModule | undefined, capabilities: CapabilityMap | null): BoardModule[];
|
|
12
23
|
export declare function aggregateSummaries(summaries: readonly ModuleSummary[]): {
|
|
13
24
|
readonly refreshing: boolean;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Translate, WriteOutcome } from '@dsh-workbench/shared';
|
|
2
|
+
import type { MarketRow } from './market-row-types';
|
|
3
|
+
import { type MarketRowAction } from './market-rows';
|
|
4
|
+
import type { Pending } from './market-view-text';
|
|
5
|
+
export interface MarketActSeats {
|
|
6
|
+
readonly setPending: (next: Pending | null) => void;
|
|
7
|
+
readonly setConfirming: (next: string | null) => void;
|
|
8
|
+
readonly setFailed: (next: {
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly message: string;
|
|
11
|
+
} | null) => void;
|
|
12
|
+
readonly setNotice: (next: string | null) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function marketActOf(options: {
|
|
15
|
+
readonly t: Translate;
|
|
16
|
+
readonly mocked: boolean;
|
|
17
|
+
readonly rowOf: (id: string) => MarketRow | undefined;
|
|
18
|
+
readonly seats: MarketActSeats;
|
|
19
|
+
readonly send: (body: Record<string, unknown>) => Promise<WriteOutcome<unknown>>;
|
|
20
|
+
readonly onChanged: () => void;
|
|
21
|
+
}): (id: string, action: MarketRowAction) => Promise<void>;
|
|
@@ -4,6 +4,7 @@ import type { UnitManifest } from '@dsh-workbench/shared';
|
|
|
4
4
|
import type { MarketRowAction, ModuleUpdateMap } from './market-rows';
|
|
5
5
|
import type { CapabilityMap } from '../../../shared/hooks/use-capabilities';
|
|
6
6
|
import type { MarketState } from './market-rows';
|
|
7
|
+
import type { WorkbenchVersion } from '../../../shared/api/bundle-install';
|
|
7
8
|
export interface MarketMockExpect {
|
|
8
9
|
readonly rows: number;
|
|
9
10
|
readonly state?: MarketState;
|
|
@@ -17,8 +18,11 @@ export interface MarketMockExpect {
|
|
|
17
18
|
readonly plugins?: number;
|
|
18
19
|
readonly pluginActions?: readonly MarketRowAction[];
|
|
19
20
|
readonly pluginNote?: boolean;
|
|
20
|
-
readonly pluginNoteKey?: 'panels.market.
|
|
21
|
+
readonly pluginNoteKey?: 'panels.market.pluginBroken';
|
|
21
22
|
readonly notice?: boolean;
|
|
23
|
+
readonly workbenchState?: MarketState;
|
|
24
|
+
readonly workbenchActions?: readonly MarketRowAction[];
|
|
25
|
+
readonly workbenchNoteKey?: 'panels.market.workbenchLocal';
|
|
22
26
|
}
|
|
23
27
|
export interface MarketMock {
|
|
24
28
|
readonly id: string;
|
|
@@ -31,6 +35,7 @@ export interface MarketMock {
|
|
|
31
35
|
};
|
|
32
36
|
readonly updates?: ModuleUpdateMap;
|
|
33
37
|
readonly installed?: readonly InstalledWorkbenchModule[];
|
|
38
|
+
readonly workbench?: WorkbenchVersion;
|
|
34
39
|
readonly installedRead?: boolean;
|
|
35
40
|
readonly plugins?: readonly InstalledPlugin[];
|
|
36
41
|
readonly loaded?: boolean;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { InstalledPlugin } from '../../../shared/api/installed-plugins';
|
|
2
|
+
import type { Translate } from '@dsh-workbench/shared';
|
|
2
3
|
import type { MarketRow } from './market-rows';
|
|
3
4
|
export interface InstalledPluginKept {
|
|
4
5
|
readonly key: 'panels.market.pluginKeptInUse' | 'panels.market.pluginKeptUnsure' | 'panels.market.pluginKeptHeld' | 'panels.market.pluginKeptUnnamed';
|
|
5
6
|
readonly names?: readonly string[];
|
|
6
7
|
}
|
|
7
8
|
export declare function installedPluginKept(value: unknown): InstalledPluginKept | undefined;
|
|
8
|
-
export declare function
|
|
9
|
+
export declare function installedPluginNotice(value: unknown, t: Translate): string | null;
|
|
10
|
+
export declare function installedPluginRows(plugins: readonly InstalledPlugin[], defaults?: ReadonlySet<string>, changed?: Readonly<Record<string, number>>): MarketRow[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { MarketRow } from './market-row-types';
|
|
2
|
+
import type { SharedRow } from './market-rows';
|
|
3
|
+
export type PackageKind = 'module' | 'plugin' | 'lib' | 'workbench';
|
|
4
|
+
export declare function packageIcon(kind: PackageKind): import("react").FunctionComponentElement<import("@deepseek-ai/dsh-client-ui-primitives").IconProps> | import("react").FunctionComponentElement<import("@dsh-workbench/shared").IconProps>;
|
|
5
|
+
export declare function marketRowKind(row: MarketRow): PackageKind;
|
|
6
|
+
export declare function sharedRowKind(row: SharedRow): PackageKind;
|
|
7
|
+
export type PackageIcon = ReturnType<typeof packageIcon>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type MarketState = 'checking' | 'installed' | 'outdated' | 'missing' | 'unchecked' | 'unknown';
|
|
2
|
+
export interface MarketNote {
|
|
3
|
+
readonly key: 'panels.market.needEnv' | 'panels.market.noSource' | 'panels.market.badSource' | 'panels.market.moduleRefused' | 'panels.market.moduleRestartHint' | 'panels.market.pluginAlsoKnownAs' | 'panels.market.pluginBroken' | 'panels.market.workbenchLocal';
|
|
4
|
+
readonly params: Readonly<Record<string, string>>;
|
|
5
|
+
readonly tone?: 'plain' | 'alert';
|
|
6
|
+
}
|
|
7
|
+
export type MarketHintKey = 'panels.market.moduleRestartHint';
|
|
8
|
+
export interface ModuleUpdate {
|
|
9
|
+
readonly installed: string;
|
|
10
|
+
readonly latest?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface MarketRow {
|
|
13
|
+
readonly id: string;
|
|
14
|
+
readonly titleKey: string;
|
|
15
|
+
readonly label?: string;
|
|
16
|
+
readonly state: MarketState;
|
|
17
|
+
readonly canInstall: boolean;
|
|
18
|
+
readonly canUpdate: boolean;
|
|
19
|
+
readonly canUninstall: boolean;
|
|
20
|
+
readonly plugin?: boolean;
|
|
21
|
+
readonly workbench?: boolean;
|
|
22
|
+
readonly note?: MarketNote;
|
|
23
|
+
readonly hint?: MarketHintKey;
|
|
24
|
+
readonly version?: {
|
|
25
|
+
readonly installed?: string;
|
|
26
|
+
readonly latest?: string;
|
|
27
|
+
};
|
|
28
|
+
readonly moduleUpdate?: ModuleUpdate;
|
|
29
|
+
readonly pkg?: string;
|
|
30
|
+
readonly local?: boolean;
|
|
31
|
+
readonly versionLabel?: string;
|
|
32
|
+
readonly defaultShown?: boolean;
|
|
33
|
+
readonly defaultChanged?: number;
|
|
34
|
+
readonly broken?: boolean;
|
|
35
|
+
}
|
|
@@ -1,40 +1,12 @@
|
|
|
1
|
-
import type { ModuleVersion } from '../../../shared/api/bundle-install';
|
|
1
|
+
import type { ModuleVersion, WorkbenchVersion } from '../../../shared/api/bundle-install';
|
|
2
2
|
import type { Translate, UnitManifest } from '@dsh-workbench/shared';
|
|
3
|
-
|
|
3
|
+
import type { MarketRow, MarketState, ModuleUpdate } from './market-row-types';
|
|
4
|
+
export type MarketRowAction = 'install' | 'update' | 'update-bundle' | 'remove-bundle' | 'uninstall' | 'update-dependency' | 'update-plugin' | 'uninstall-plugin' | 'update-workbench';
|
|
4
5
|
import type { CapabilityMap } from '../../../shared/hooks/use-capabilities';
|
|
5
|
-
export type
|
|
6
|
+
export type { MarketHintKey, MarketNote, MarketRow, MarketState, ModuleUpdate, } from './market-row-types';
|
|
6
7
|
export declare const MARKET_STATE_KEY: Readonly<Record<MarketState, string>>;
|
|
7
8
|
export declare const MARKET_DOT: Readonly<Record<MarketState, 'ongoing' | 'done' | 'warning' | 'idle'>>;
|
|
8
|
-
export interface MarketNote {
|
|
9
|
-
readonly key: 'panels.market.needEnv' | 'panels.market.noSource' | 'panels.market.badSource' | 'panels.market.moduleRefused' | 'panels.market.moduleRestartHint' | 'panels.market.pluginAlsoKnownAs' | 'panels.market.pluginBroken';
|
|
10
|
-
readonly params: Readonly<Record<string, string>>;
|
|
11
|
-
}
|
|
12
|
-
export type MarketHintKey = 'panels.market.moduleRestartHint';
|
|
13
|
-
export interface ModuleUpdate {
|
|
14
|
-
readonly installed: string;
|
|
15
|
-
readonly latest?: string;
|
|
16
|
-
}
|
|
17
9
|
export type ModuleUpdateMap = Readonly<Record<string, ModuleUpdate>>;
|
|
18
|
-
export interface MarketRow {
|
|
19
|
-
readonly id: string;
|
|
20
|
-
readonly titleKey: string;
|
|
21
|
-
readonly label?: string;
|
|
22
|
-
readonly state: MarketState;
|
|
23
|
-
readonly canInstall: boolean;
|
|
24
|
-
readonly canUpdate: boolean;
|
|
25
|
-
readonly canUninstall: boolean;
|
|
26
|
-
readonly plugin?: boolean;
|
|
27
|
-
readonly note?: MarketNote;
|
|
28
|
-
readonly hint?: MarketHintKey;
|
|
29
|
-
readonly version?: {
|
|
30
|
-
readonly installed?: string;
|
|
31
|
-
readonly latest?: string;
|
|
32
|
-
};
|
|
33
|
-
readonly moduleUpdate?: ModuleUpdate;
|
|
34
|
-
readonly pkg?: string;
|
|
35
|
-
readonly local?: boolean;
|
|
36
|
-
readonly broken?: boolean;
|
|
37
|
-
}
|
|
38
10
|
export declare function marketRowTitle(row: MarketRow, t: Translate): string;
|
|
39
11
|
export interface InstalledWorkbenchModule {
|
|
40
12
|
readonly unit: string;
|
|
@@ -51,24 +23,25 @@ export declare function withClientRefusals(modules: readonly InstalledWorkbenchM
|
|
|
51
23
|
}[]): readonly InstalledWorkbenchModule[];
|
|
52
24
|
export declare function refusalReasons(host: readonly string[] | undefined, client: readonly string[] | undefined): readonly string[];
|
|
53
25
|
export declare function mergeTitles(known: ReadonlyMap<string, string>, manifests: readonly UnitManifest[]): ReadonlyMap<string, string>;
|
|
54
|
-
export declare function installedRows(modules: readonly InstalledWorkbenchModule[], manifests: readonly UnitManifest[], listed: ReadonlySet<string>, known?: ReadonlyMap<string, string> | undefined): MarketRow[];
|
|
26
|
+
export declare function installedRows(modules: readonly InstalledWorkbenchModule[], manifests: readonly UnitManifest[], listed: ReadonlySet<string>, known?: ReadonlyMap<string, string> | undefined, defaults?: ReadonlySet<string>, changed?: Readonly<Record<string, number>>): MarketRow[];
|
|
55
27
|
export declare function marketActions(row: MarketRow): MarketRowAction[];
|
|
56
28
|
export declare function liveManifests(manifests: readonly UnitManifest[], capabilities: CapabilityMap | null, installed: ReadonlySet<string> | null): readonly UnitManifest[];
|
|
57
29
|
export declare function marketHasUpdates(rows: readonly MarketRow[], shared?: readonly SharedRow[]): boolean;
|
|
58
30
|
export declare function marketUpdatesOf(modules: readonly ModuleVersion[] | null): ModuleUpdateMap;
|
|
59
|
-
export declare function marketHintVisible(manifests: readonly UnitManifest[], capabilities: CapabilityMap | null, modules: readonly ModuleVersion[] | null): boolean;
|
|
31
|
+
export declare function marketHintVisible(manifests: readonly UnitManifest[], capabilities: CapabilityMap | null, modules: readonly ModuleVersion[] | null, workbench?: WorkbenchVersion | null | undefined): boolean;
|
|
60
32
|
export interface MarketSection {
|
|
61
33
|
readonly id: 'installed' | 'not-installed';
|
|
62
34
|
readonly titleKey: string;
|
|
63
35
|
readonly rows: readonly MarketRow[];
|
|
64
36
|
}
|
|
65
37
|
export declare function marketSections(rows: readonly MarketRow[]): MarketSection[];
|
|
66
|
-
export declare function marketRows(manifests: readonly UnitManifest[], capabilities: CapabilityMap | null, updates?: ModuleUpdateMap): MarketRow[];
|
|
38
|
+
export declare function marketRows(manifests: readonly UnitManifest[], capabilities: CapabilityMap | null, updates?: ModuleUpdateMap, defaults?: ReadonlySet<string>, changed?: Readonly<Record<string, number>>): MarketRow[];
|
|
67
39
|
export type SharedState = 'checking' | 'installed' | 'outdated' | 'unsatisfied' | 'missing' | 'unchecked';
|
|
68
40
|
export declare const SHARED_STATE_KEY: Readonly<Record<SharedState, string>>;
|
|
69
41
|
export declare const SHARED_DOT: Readonly<Record<SharedState, 'ongoing' | 'done' | 'warning' | 'idle'>>;
|
|
70
42
|
export interface SharedRow {
|
|
71
43
|
readonly id: string;
|
|
44
|
+
readonly kind: 'plugin' | 'lib';
|
|
72
45
|
readonly label: string;
|
|
73
46
|
readonly usedByKeys: readonly string[];
|
|
74
47
|
readonly state: SharedState;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type MarketSectionKind = 'installed' | 'pending' | 'plugins' | 'local' | 'shared';
|
|
2
|
+
export declare function marketSectionIcon(kind: MarketSectionKind): import("react").FunctionComponentElement<import("@deepseek-ai/dsh-client-ui-primitives").IconProps> | import("react").FunctionComponentElement<import("@dsh-workbench/shared").IconProps>;
|
|
3
|
+
export type MarketSectionIcon = ReturnType<typeof marketSectionIcon>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Translate } from '@dsh-workbench/shared';
|
|
2
|
+
import type { MarketRow } from './market-row-types';
|
|
3
|
+
import { type MarketRowAction } from './market-rows';
|
|
4
|
+
import type { MarketSectionIcon } from './market-section-icon';
|
|
5
|
+
import { type Pending } from './market-view-text';
|
|
6
|
+
export declare function MarketSection({ t, titleKey, icon, rows, pending, failureOf, act, confirmActions, onConfirming, onDefault, boardBusy, }: {
|
|
7
|
+
readonly t: Translate;
|
|
8
|
+
readonly titleKey?: string;
|
|
9
|
+
readonly icon?: MarketSectionIcon;
|
|
10
|
+
readonly rows: readonly MarketRow[];
|
|
11
|
+
readonly pending: Pending | null;
|
|
12
|
+
readonly failureOf: (id: string) => string | null;
|
|
13
|
+
readonly act: (id: string, action: MarketRowAction) => Promise<void>;
|
|
14
|
+
readonly onDefault?: ((id: string, next: boolean) => void) | undefined;
|
|
15
|
+
readonly boardBusy?: boolean | undefined;
|
|
16
|
+
readonly confirmActions: readonly MarketRowAction[];
|
|
17
|
+
readonly onConfirming: (id: string | null) => void;
|
|
18
|
+
}): JSX.Element | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MarketRowAction } from './market-rows';
|
|
1
|
+
import type { MarketRow, MarketRowAction } from './market-rows';
|
|
2
2
|
export declare const PROGRESS_KEY: Readonly<Record<MarketRowAction, string>>;
|
|
3
3
|
export declare const ACTION_LABEL_KEY: Readonly<Record<MarketRowAction, string>>;
|
|
4
4
|
export interface Pending {
|
|
@@ -8,3 +8,9 @@ export interface Pending {
|
|
|
8
8
|
readonly pkg?: string | undefined;
|
|
9
9
|
readonly version?: string | undefined;
|
|
10
10
|
}
|
|
11
|
+
export declare function pendingRowOf(input: {
|
|
12
|
+
readonly pending: Pending | null;
|
|
13
|
+
readonly removing: string | null;
|
|
14
|
+
readonly rows: readonly MarketRow[];
|
|
15
|
+
readonly titles: ReadonlyMap<string, string>;
|
|
16
|
+
}): MarketRow | undefined;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { WorkbenchVersion } from '../../../shared/api/bundle-install';
|
|
2
|
+
import type { MarketRow } from './market-row-types';
|
|
3
|
+
export declare const WORKBENCH_ROW_ID = "workbench:self";
|
|
4
|
+
export declare const WORKBENCH_TITLE_KEY = "panels.market.workbenchName";
|
|
5
|
+
export declare function workbenchRow(version: WorkbenchVersion | null | undefined): MarketRow | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { UnitManifest } from '@dsh-workbench/shared';
|
|
2
2
|
import type { CapabilityMap } from '../../../shared/hooks/use-capabilities';
|
|
3
|
-
import type { PanelUnit } from './use-panels';
|
|
3
|
+
import type { PanelPluginUnit, PanelUnit } from './use-panels';
|
|
4
4
|
export interface PanelMockExpect {
|
|
5
5
|
readonly rows: number;
|
|
6
6
|
readonly badge?: string | null;
|
|
@@ -10,6 +10,7 @@ export interface PanelMock {
|
|
|
10
10
|
readonly id: string;
|
|
11
11
|
readonly label: string;
|
|
12
12
|
readonly units: readonly PanelUnit[];
|
|
13
|
+
readonly plugins?: readonly PanelPluginUnit[];
|
|
13
14
|
readonly capabilities: CapabilityMap | null;
|
|
14
15
|
readonly busy?: boolean;
|
|
15
16
|
readonly failed?: boolean;
|
|
@@ -6,8 +6,22 @@ export interface PanelUnit {
|
|
|
6
6
|
readonly source: 'default' | 'user';
|
|
7
7
|
readonly hasCard: boolean;
|
|
8
8
|
}
|
|
9
|
+
export interface PanelPluginUnit {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly pkg: string;
|
|
12
|
+
readonly title: string;
|
|
13
|
+
readonly shown: boolean;
|
|
14
|
+
readonly source: 'default' | 'user';
|
|
15
|
+
}
|
|
16
|
+
export interface PanelBoardView {
|
|
17
|
+
readonly units: readonly PanelUnit[];
|
|
18
|
+
readonly plugins: readonly PanelPluginUnit[];
|
|
19
|
+
readonly defaults: readonly string[];
|
|
20
|
+
readonly own: boolean;
|
|
21
|
+
readonly changed: Readonly<Record<string, number>>;
|
|
22
|
+
}
|
|
9
23
|
export declare function shouldDropPanels(workspace: string | null, previous: string | null): boolean;
|
|
10
|
-
export declare function useEnabledUnits(refreshToken: number, workspace: string | null):
|
|
24
|
+
export declare function useEnabledUnits(refreshToken: number, workspace: string | null): PanelBoardView | null;
|
|
11
25
|
export declare function useSelectedProjectId(): string | null;
|
|
12
26
|
export declare function useBoardWorkspace(workspaces: WorkspaceSnapshot, sessions: SessionsSnapshot): {
|
|
13
27
|
readonly workspace: WorkspaceView | null;
|
|
@@ -15,7 +15,7 @@ export interface ClientUnitRegistry {
|
|
|
15
15
|
subscribe(listener: () => void): () => void;
|
|
16
16
|
version(): number;
|
|
17
17
|
}
|
|
18
|
-
export declare function toBoardModule(face: UnitClientFace, manifest: UnitManifest): BoardModule;
|
|
18
|
+
export declare function toBoardModule(face: UnitClientFace, manifest: UnitManifest): BoardModule | undefined;
|
|
19
19
|
export declare function createClientUnitRegistry(options?: {
|
|
20
20
|
readonly onUnknownUnit?: (unit: string) => void;
|
|
21
21
|
}): ClientUnitRegistry;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { UnitManifest, UnitTool } from '@dsh-workbench/shared';
|
|
2
|
+
import { type WorkspaceStore } from '@dsh-workbench/shared/host';
|
|
3
|
+
import type { PanelEntry } from '../model/config';
|
|
4
|
+
import { type PanelsService } from '../model/service';
|
|
5
|
+
export declare const A = "/w/a";
|
|
6
|
+
export declare const B = "/w/b";
|
|
7
|
+
export declare const MACHINE_BOARD: string[];
|
|
8
|
+
export declare const WORKSPACE_BOARD: string[];
|
|
9
|
+
export declare function tool(name: string): UnitTool;
|
|
10
|
+
export declare function unit(id: string, order: number, tools?: readonly UnitTool[], card?: boolean): UnitManifest;
|
|
11
|
+
export declare const MACHINE_UNIT: UnitManifest;
|
|
12
|
+
export declare const BOARDED_UNIT: UnitManifest;
|
|
13
|
+
export declare const PROJECT_UNIT: UnitManifest;
|
|
14
|
+
export declare const MIXED_UNIT: UnitManifest;
|
|
15
|
+
export declare const UNITS: UnitManifest[];
|
|
16
|
+
export declare let root: string;
|
|
17
|
+
export declare let store: WorkspaceStore;
|
|
18
|
+
export declare function mount(manifests?: readonly UnitManifest[], owned?: readonly string[]): PanelsService;
|
|
19
|
+
export declare function writeBoard(workspace: string | null, shown: readonly string[]): void;
|
|
20
|
+
export declare function writeBoardWith(workspace: string | null, shown: readonly string[], hidden: readonly string[]): void;
|
|
21
|
+
export declare function fakeCtx(): {
|
|
22
|
+
get: () => undefined;
|
|
23
|
+
provide: () => () => void;
|
|
24
|
+
logger: {
|
|
25
|
+
info: () => void;
|
|
26
|
+
warn: () => void;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export declare function gate(manifests?: readonly UnitManifest[], owned?: readonly string[], ctx?: unknown): import("@dsh-workbench/shared/host").UnitMountResult;
|
|
30
|
+
export declare function denied(mounted: ReturnType<typeof gate>, workspace: string): string[];
|
|
31
|
+
export declare const EXEC: {
|
|
32
|
+
agent: {
|
|
33
|
+
session: {
|
|
34
|
+
header: {
|
|
35
|
+
cwd: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
interface RanTool {
|
|
41
|
+
readonly text: string;
|
|
42
|
+
readonly units: PanelEntry[];
|
|
43
|
+
}
|
|
44
|
+
export declare function toolHarness(manifests?: readonly UnitManifest[], owned?: readonly string[]): {
|
|
45
|
+
panels: PanelsService;
|
|
46
|
+
run: (args: Record<string, unknown>, exec?: unknown) => Promise<RanTool>;
|
|
47
|
+
};
|
|
48
|
+
export declare function machineConfig(): string;
|
|
49
|
+
export declare function workspaceConfig(workspace: string): string;
|
|
50
|
+
export declare function readJson(file: string): unknown;
|
|
51
|
+
export {};
|
|
@@ -16,6 +16,8 @@ export interface ScopeQuery {
|
|
|
16
16
|
readonly id: string;
|
|
17
17
|
readonly boards: ScopeBoards;
|
|
18
18
|
}
|
|
19
|
+
export declare function overrideOf(board: PanelBoard | null, id: string): boolean | undefined;
|
|
20
|
+
export declare function defaultOf(board: PanelBoard | null, id: string): boolean;
|
|
19
21
|
export declare function resolveScope(query: ScopeQuery): boolean;
|
|
20
22
|
export interface PanelEntry {
|
|
21
23
|
readonly id: string;
|
|
@@ -28,6 +30,23 @@ export interface PanelEntry {
|
|
|
28
30
|
export declare function parseBoard(raw: unknown): PanelBoard;
|
|
29
31
|
export declare function parseReleased(raw: unknown): string[];
|
|
30
32
|
export declare function resolvePanels(manifests: readonly UnitManifest[], boards: ScopeBoards): PanelEntry[];
|
|
33
|
+
export interface PanelPluginRef {
|
|
34
|
+
readonly pkg: string;
|
|
35
|
+
readonly title: string;
|
|
36
|
+
readonly name?: string | undefined;
|
|
37
|
+
}
|
|
38
|
+
export interface PanelPluginEntry {
|
|
39
|
+
readonly id: string;
|
|
40
|
+
readonly pkg: string;
|
|
41
|
+
readonly title: string;
|
|
42
|
+
readonly name?: string | undefined;
|
|
43
|
+
readonly order: number;
|
|
44
|
+
readonly shown: boolean;
|
|
45
|
+
readonly source: 'default' | 'user';
|
|
46
|
+
}
|
|
47
|
+
export declare const PLUGIN_PANEL_PREFIX = "plugin:";
|
|
48
|
+
export declare function pluginPanelId(pkg: string): string;
|
|
49
|
+
export declare function resolvePluginPanels(plugins: readonly PanelPluginRef[], boards: ScopeBoards): PanelPluginEntry[];
|
|
31
50
|
export declare function withoutReleased(released: PanelList, id: string): string[];
|
|
32
51
|
export declare function withReleased(released: PanelList, id: string): string[];
|
|
33
52
|
export declare function withShown(board: PanelBoard, id: string): PanelBoard;
|
|
@@ -32,6 +32,10 @@ export type ProvisionResult = {
|
|
|
32
32
|
} | {
|
|
33
33
|
readonly ok: true;
|
|
34
34
|
readonly action: 'update-plugin';
|
|
35
|
+
} | {
|
|
36
|
+
readonly ok: true;
|
|
37
|
+
readonly action: 'update-workbench';
|
|
38
|
+
readonly change: BundleChange;
|
|
35
39
|
} | {
|
|
36
40
|
readonly ok: true;
|
|
37
41
|
readonly action: 'uninstall-plugin';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BundleChange } from '../../../shared/api/bundle-install';
|
|
2
|
+
import type { BundleManager } from '../../../shared/api/host/bundle-manager';
|
|
3
|
+
import { type RegistryNotebook } from '../../../shared/api/host/profile-registries';
|
|
4
|
+
export interface RegistryFixDeps {
|
|
5
|
+
readonly registries?: RegistryNotebook | undefined;
|
|
6
|
+
readonly logger?: {
|
|
7
|
+
info?(message: string): void;
|
|
8
|
+
warn?(message: string): void;
|
|
9
|
+
} | undefined;
|
|
10
|
+
}
|
|
11
|
+
export declare function rememberInstalledSource(deps: RegistryFixDeps, manager: BundleManager, pkg: string, registry: string | undefined): Promise<void>;
|
|
12
|
+
export declare function retryAfterRegistryFix(deps: RegistryFixDeps, manager: BundleManager, pkg: string, change: BundleChange): Promise<BundleChange>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -64,6 +64,7 @@ export interface MarketService {
|
|
|
64
64
|
updateDependency(id: string): Promise<readonly SharedDependency[]>;
|
|
65
65
|
installBundle(spec: string, options?: BundleInstallOptions): Promise<BundleInstallOutcome>;
|
|
66
66
|
updateBundle(unit: string): Promise<BundleInstallOutcome | null>;
|
|
67
|
+
updateWorkbench(pkg: string): Promise<BundleInstallOutcome>;
|
|
67
68
|
removeBundle(pkg: string): Promise<BundleRemoveOutcome>;
|
|
68
69
|
cancelInstall(requestId: string): Promise<BundleCancellation | null>;
|
|
69
70
|
updatePlugin(pkg: string): Promise<PluginUpdateOutcome>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { DshShell } from '@dsh-workbench/shared';
|
|
2
2
|
import type { UnitManifest } from '@dsh-workbench/shared';
|
|
3
3
|
import type { BundleManager } from '../../../shared/api/host/bundle-manager';
|
|
4
|
-
import type { InstalledModule, ProfileModule } from '../../../shared/api/host/installed-module';
|
|
5
|
-
import {
|
|
4
|
+
import type { InstalledModule, ProfileModule, ProfilePackage } from '../../../shared/api/host/installed-module';
|
|
5
|
+
import type { RegistryNotebook } from '../../../shared/api/host/profile-registries';
|
|
6
6
|
import type { UnitMountDeps } from '@dsh-workbench/shared/host';
|
|
7
7
|
import { type PluginReferences } from './plugin-actions';
|
|
8
8
|
import type { PluginLedger } from './plugin-ledger';
|
|
@@ -21,6 +21,7 @@ export declare function createMarketService(options: {
|
|
|
21
21
|
bundles?: BundleManager | undefined;
|
|
22
22
|
installed?: ((pkg: string) => InstalledModule) | undefined;
|
|
23
23
|
modules?: (() => readonly ProfileModule[]) | undefined;
|
|
24
|
+
workbench?: ((pkg: string) => ProfilePackage | undefined) | undefined;
|
|
24
25
|
registries?: RegistryNotebook | undefined;
|
|
25
26
|
ledger?: PluginLedger | undefined;
|
|
26
27
|
references?: (() => PluginReferences) | undefined;
|