@dsh-workbench/core 0.1.1 → 0.1.3
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/README.md +2 -2
- package/client.js +2236 -701
- package/dist/client/client.body.js +2235 -700
- package/dist/client/index.js +2228 -693
- package/dist/host/index.js +728 -2047
- package/dist/types/app/client.d.ts +774 -69
- package/dist/types/app/layouts/market/AddModuleDialog.d.ts +8 -0
- package/dist/types/app/layouts/market/AddModuleForm.d.ts +6 -0
- package/dist/types/app/layouts/market/AddModuleRegistry.d.ts +6 -0
- package/dist/types/app/layouts/market/AddModuleStages.d.ts +14 -0
- package/dist/types/app/layouts/market/SafetyNote.d.ts +4 -0
- package/dist/types/app/layouts/market/__tests__/add-module-mock.test.d.ts +1 -0
- package/dist/types/app/layouts/market/__tests__/add-module-text.test.d.ts +1 -0
- package/dist/types/app/layouts/market/add-module-mock.d.ts +15 -0
- package/dist/types/app/layouts/market/add-module-text.d.ts +31 -0
- package/dist/types/app/layouts/market/panel.d.ts +2 -2
- package/dist/types/app/layouts/market/use-add-module.d.ts +49 -0
- package/dist/types/app/layouts/rightbar/MarketView.d.ts +6 -1
- package/dist/types/app/layouts/rightbar/__tests__/market-installed.test.d.ts +1 -0
- package/dist/types/app/layouts/rightbar/market-mock.d.ts +11 -4
- package/dist/types/app/layouts/rightbar/market-rows.d.ts +19 -5
- package/dist/types/app/units/__tests__/fixture-unit-mock.test.d.ts +1 -0
- package/dist/types/app/units/fixture-unit-mock.d.ts +5 -0
- package/dist/types/app/units/registry.d.ts +2 -1
- package/dist/types/modules/panels/__tests__/market-bundle.test.d.ts +1 -0
- package/dist/types/modules/panels/__tests__/market-dispatch.test.d.ts +1 -0
- package/dist/types/modules/panels/model/handoff.d.ts +1 -1
- package/dist/types/modules/panels/model/market-dependency.d.ts +1 -1
- package/dist/types/modules/panels/model/market-dispatch.d.ts +19 -1
- package/dist/types/modules/panels/model/market.d.ts +39 -0
- package/dist/types/shared/api/bundle-install.d.ts +97 -0
- package/dist/types/shared/api/dsh-plugins.d.ts +11 -0
- package/dist/types/shared/api/dsh-plugins.test.d.ts +1 -0
- package/dist/types/shared/api/host/bundle-manager.d.ts +10 -0
- package/dist/types/shared/api/host/bundle-manager.test.d.ts +1 -0
- package/dist/types/shared/api/host/bundle-routes.d.ts +5 -0
- package/dist/types/shared/api/host/bundle-routes.test.d.ts +1 -0
- package/dist/types/shared/api/host/context-inject.d.ts +1 -1
- package/dist/types/shared/api/host/dsh-plugins.d.ts +5 -0
- package/dist/types/shared/api/host/dsh-plugins.test.d.ts +1 -0
- package/dist/types/shared/api/host/installed-module.d.ts +22 -0
- package/dist/types/shared/api/host/installed-module.test.d.ts +1 -0
- package/dist/types/shared/api/host/mount-units.d.ts +1 -1
- package/dist/types/shared/api/host/probe-libs.d.ts +1 -1
- package/dist/types/shared/components/PanelFoot.d.ts +7 -0
- package/dist/types/shared/hooks/bundle-queries.d.ts +5 -0
- package/docs/OPERATIONS.md +10 -2
- package/package.json +4 -3
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Translate } from '@dsh-workbench/shared';
|
|
2
|
+
export interface AddModuleDialogProps {
|
|
3
|
+
readonly t: Translate;
|
|
4
|
+
readonly open: boolean;
|
|
5
|
+
readonly onClose: () => void;
|
|
6
|
+
readonly onInstalled: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function AddModuleDialog({ t, open, onClose, onInstalled }: AddModuleDialogProps): JSX.Element | null;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Translate } from '@dsh-workbench/shared';
|
|
2
|
+
import type { AddModuleState } from './use-add-module';
|
|
3
|
+
export declare function AddModulePending({ t, kind }: {
|
|
4
|
+
t: Translate;
|
|
5
|
+
kind: 'inspecting' | 'installing';
|
|
6
|
+
}): JSX.Element;
|
|
7
|
+
export declare function AddModulePreview({ t, state }: {
|
|
8
|
+
t: Translate;
|
|
9
|
+
state: AddModuleState;
|
|
10
|
+
}): JSX.Element | null;
|
|
11
|
+
export declare function AddModuleResult({ t, state }: {
|
|
12
|
+
t: Translate;
|
|
13
|
+
state: AddModuleState;
|
|
14
|
+
}): JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AddModuleOutcome, AddModulePhase, AddModulePreview, AddModuleProblem, AddModuleState } from './use-add-module';
|
|
2
|
+
export interface AddModuleMock {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly label: string;
|
|
5
|
+
readonly phase: AddModulePhase;
|
|
6
|
+
readonly spec: string;
|
|
7
|
+
readonly guideOpen?: boolean;
|
|
8
|
+
readonly problem?: AddModuleProblem;
|
|
9
|
+
readonly preview?: AddModulePreview;
|
|
10
|
+
readonly outcome?: AddModuleOutcome;
|
|
11
|
+
readonly failure?: string;
|
|
12
|
+
readonly removed?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const ADD_MODULE_MOCKS: readonly AddModuleMock[];
|
|
15
|
+
export declare function stateOfMock(base: AddModuleState, mock: AddModuleMock): AddModuleState;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Translate } from '@dsh-workbench/shared';
|
|
2
|
+
import type { BundleChange, BundleInspectProblem, BundleRegistries } from '../../../shared/api/bundle-install';
|
|
3
|
+
export type RegistryKind = 'default' | 'url' | 'custom';
|
|
4
|
+
export interface RegistryChoice {
|
|
5
|
+
readonly kind: RegistryKind;
|
|
6
|
+
readonly value: string;
|
|
7
|
+
}
|
|
8
|
+
export interface RegistryOption {
|
|
9
|
+
readonly choice: RegistryChoice;
|
|
10
|
+
readonly host?: string;
|
|
11
|
+
readonly nameKey?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface GuideItem {
|
|
14
|
+
readonly titleKey: string;
|
|
15
|
+
readonly exampleKey: string;
|
|
16
|
+
readonly hintKey: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const GUIDE_ITEMS: readonly GuideItem[];
|
|
19
|
+
export declare function hostOf(url: string): string;
|
|
20
|
+
export declare function registryNameKey(host: string): string | undefined;
|
|
21
|
+
export declare function registryOptions(registries: BundleRegistries | null): readonly RegistryOption[];
|
|
22
|
+
export declare function customRegistryAllowed(value: string): boolean;
|
|
23
|
+
export declare function registryOf(choice: RegistryChoice, custom: string): string | undefined;
|
|
24
|
+
export declare function registryName(option: RegistryOption, t: Translate): string;
|
|
25
|
+
export declare function optionLabel(option: RegistryOption, t: Translate): string;
|
|
26
|
+
export declare function problemKey(problem: BundleInspectProblem): string;
|
|
27
|
+
export declare function failureCode(change: BundleChange): string;
|
|
28
|
+
export declare function failureReasonKey(code: string): string | undefined;
|
|
29
|
+
export declare function failureReason(code: string, application: string, t: Translate): string;
|
|
30
|
+
export declare function supplyKey(state: string): string | undefined;
|
|
31
|
+
export declare function verdictKey(change: BundleChange): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { DshClientContext } from '@dsh-workbench/shared';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ClientUnitRegistry } from '../../units/registry';
|
|
3
3
|
export declare const MARKET_PANEL_ID = "workbench-market";
|
|
4
|
-
export declare function registerMarketPanel(ctx: DshClientContext,
|
|
4
|
+
export declare function registerMarketPanel(ctx: DshClientContext, units: ClientUnitRegistry): void;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { BundleChange, BundleInspectProblem, BundleModulePayload, BundleSupplyPayload } from '../../../shared/api/bundle-install';
|
|
2
|
+
import { type RegistryChoice, type RegistryOption } from './add-module-text';
|
|
3
|
+
export type AddModulePhase = 'idle' | 'inspecting' | 'preview' | 'installing' | 'result';
|
|
4
|
+
export interface AddModulePreview {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly version: string;
|
|
7
|
+
readonly description: string;
|
|
8
|
+
readonly registry: string;
|
|
9
|
+
}
|
|
10
|
+
export interface AddModuleOutcome {
|
|
11
|
+
readonly change: BundleChange;
|
|
12
|
+
readonly module: BundleModulePayload;
|
|
13
|
+
readonly supply: BundleSupplyPayload;
|
|
14
|
+
}
|
|
15
|
+
export interface AddModuleProblem {
|
|
16
|
+
readonly problem: BundleInspectProblem;
|
|
17
|
+
readonly reason: string;
|
|
18
|
+
}
|
|
19
|
+
export interface AddModuleState {
|
|
20
|
+
readonly spec: string;
|
|
21
|
+
readonly choice: RegistryChoice;
|
|
22
|
+
readonly custom: string;
|
|
23
|
+
readonly registryOpen: boolean;
|
|
24
|
+
readonly guideOpen: boolean;
|
|
25
|
+
readonly phase: AddModulePhase;
|
|
26
|
+
readonly choices: readonly RegistryOption[];
|
|
27
|
+
readonly problem: AddModuleProblem | null;
|
|
28
|
+
readonly preview: AddModulePreview | null;
|
|
29
|
+
readonly outcome: AddModuleOutcome | null;
|
|
30
|
+
readonly failure: string | null;
|
|
31
|
+
readonly removed: boolean;
|
|
32
|
+
readonly builds: readonly string[];
|
|
33
|
+
setSpec(value: string): void;
|
|
34
|
+
setChoice(choice: RegistryChoice): void;
|
|
35
|
+
setCustom(value: string): void;
|
|
36
|
+
toggleRegistry(): void;
|
|
37
|
+
closeRegistry(): void;
|
|
38
|
+
toggleGuide(): void;
|
|
39
|
+
check(): void;
|
|
40
|
+
edit(): void;
|
|
41
|
+
install(builds?: readonly string[]): void;
|
|
42
|
+
cancelInstall(): void;
|
|
43
|
+
removeIt(): void;
|
|
44
|
+
}
|
|
45
|
+
export declare function useAddModule(options: {
|
|
46
|
+
readonly open: boolean;
|
|
47
|
+
readonly onInstalled: () => void;
|
|
48
|
+
readonly failedText: string;
|
|
49
|
+
}): AddModuleState;
|
|
@@ -2,13 +2,18 @@ import type { Translate } from '@dsh-workbench/shared';
|
|
|
2
2
|
import type { UnitManifest } from '@dsh-workbench/shared';
|
|
3
3
|
import type { CapabilityMap } from '../../../shared/hooks/use-capabilities';
|
|
4
4
|
import type { MarketFreshness } from './market-freshness';
|
|
5
|
+
import { type InstalledWorkbenchModule } from './market-rows';
|
|
5
6
|
import type { MarketMock } from './market-mock';
|
|
7
|
+
import type { ModuleUpdateMap } from './market-rows';
|
|
6
8
|
export interface MarketViewProps {
|
|
7
9
|
readonly t: Translate;
|
|
8
10
|
readonly manifests: readonly UnitManifest[];
|
|
9
11
|
readonly capabilities: CapabilityMap | null;
|
|
10
12
|
readonly freshness: MarketFreshness;
|
|
11
13
|
readonly onChanged: () => void;
|
|
14
|
+
readonly updates?: ModuleUpdateMap | undefined;
|
|
15
|
+
readonly installed?: readonly InstalledWorkbenchModule[] | undefined;
|
|
16
|
+
readonly installedRead?: boolean | undefined;
|
|
12
17
|
readonly mock?: MarketMock | undefined;
|
|
13
18
|
}
|
|
14
|
-
export declare function MarketView({ t, manifests, capabilities, freshness, onChanged, mock }: MarketViewProps): JSX.Element
|
|
19
|
+
export declare function MarketView({ t, manifests, capabilities, freshness, onChanged, updates, installed, installedRead, mock, }: MarketViewProps): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
+
import type { InstalledWorkbenchModule } from './market-rows';
|
|
1
2
|
import type { UnitManifest } from '@dsh-workbench/shared';
|
|
2
|
-
import type {
|
|
3
|
+
import type { MarketRowAction, ModuleUpdateMap } from './market-rows';
|
|
3
4
|
import type { CapabilityMap } from '../../../shared/hooks/use-capabilities';
|
|
4
5
|
import type { MarketState } from './market-rows';
|
|
5
6
|
export interface MarketMockExpect {
|
|
6
7
|
readonly rows: number;
|
|
7
8
|
readonly state?: MarketState;
|
|
8
|
-
readonly actions?: readonly
|
|
9
|
+
readonly actions?: readonly MarketRowAction[];
|
|
9
10
|
readonly titleChars?: number;
|
|
10
11
|
readonly shared?: number;
|
|
11
|
-
readonly
|
|
12
|
+
readonly installed?: number;
|
|
13
|
+
readonly installedActions?: readonly MarketRowAction[];
|
|
14
|
+
readonly sharedActions?: readonly MarketRowAction[];
|
|
12
15
|
}
|
|
13
16
|
export interface MarketMock {
|
|
14
17
|
readonly id: string;
|
|
@@ -17,8 +20,12 @@ export interface MarketMock {
|
|
|
17
20
|
readonly capabilities: CapabilityMap | null;
|
|
18
21
|
readonly pending?: {
|
|
19
22
|
readonly id: string;
|
|
20
|
-
readonly action:
|
|
23
|
+
readonly action: MarketRowAction;
|
|
21
24
|
};
|
|
25
|
+
readonly updates?: ModuleUpdateMap;
|
|
26
|
+
readonly installed?: readonly InstalledWorkbenchModule[];
|
|
27
|
+
readonly installedRead?: boolean;
|
|
28
|
+
readonly loaded?: boolean;
|
|
22
29
|
readonly confirming?: string;
|
|
23
30
|
readonly failure?: {
|
|
24
31
|
readonly id: string;
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import type { UnitManifest } from '@dsh-workbench/shared';
|
|
2
|
-
|
|
2
|
+
export type MarketRowAction = 'install' | 'update' | 'update-bundle' | 'remove-bundle' | 'uninstall' | 'update-dependency';
|
|
3
3
|
import type { CapabilityMap } from '../../../shared/hooks/use-capabilities';
|
|
4
4
|
export type MarketState = 'checking' | 'installed' | 'outdated' | 'missing' | 'unchecked' | 'unknown';
|
|
5
5
|
export declare const MARKET_STATE_KEY: Readonly<Record<MarketState, string>>;
|
|
6
6
|
export declare const MARKET_DOT: Readonly<Record<MarketState, 'ongoing' | 'done' | 'warning' | 'idle'>>;
|
|
7
7
|
export interface MarketNote {
|
|
8
|
-
readonly key: 'panels.market.needEnv' | 'panels.market.noSource' | 'panels.market.badSource';
|
|
8
|
+
readonly key: 'panels.market.needEnv' | 'panels.market.noSource' | 'panels.market.badSource' | 'panels.market.moduleUpdate';
|
|
9
9
|
readonly params: Readonly<Record<string, string>>;
|
|
10
10
|
}
|
|
11
|
+
export interface ModuleUpdate {
|
|
12
|
+
readonly installed: string;
|
|
13
|
+
readonly latest: string;
|
|
14
|
+
}
|
|
15
|
+
export type ModuleUpdateMap = Readonly<Record<string, ModuleUpdate>>;
|
|
11
16
|
export interface MarketRow {
|
|
12
17
|
readonly id: string;
|
|
13
18
|
readonly titleKey: string;
|
|
@@ -16,8 +21,17 @@ export interface MarketRow {
|
|
|
16
21
|
readonly canUpdate: boolean;
|
|
17
22
|
readonly canUninstall: boolean;
|
|
18
23
|
readonly note?: MarketNote;
|
|
24
|
+
readonly moduleUpdate?: ModuleUpdate;
|
|
25
|
+
readonly pkg?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface InstalledWorkbenchModule {
|
|
28
|
+
readonly unit: string;
|
|
29
|
+
readonly pkg: string;
|
|
30
|
+
readonly installed: string;
|
|
31
|
+
readonly latest?: string | undefined;
|
|
19
32
|
}
|
|
20
|
-
export declare function
|
|
33
|
+
export declare function installedRows(modules: readonly InstalledWorkbenchModule[], manifests: readonly UnitManifest[], listed: ReadonlySet<string>): MarketRow[];
|
|
34
|
+
export declare function marketActions(row: MarketRow): MarketRowAction[];
|
|
21
35
|
export declare function marketHasUpdates(rows: readonly MarketRow[], shared?: readonly SharedRow[]): boolean;
|
|
22
36
|
export interface MarketSection {
|
|
23
37
|
readonly id: 'installed' | 'not-installed';
|
|
@@ -25,7 +39,7 @@ export interface MarketSection {
|
|
|
25
39
|
readonly rows: readonly MarketRow[];
|
|
26
40
|
}
|
|
27
41
|
export declare function marketSections(rows: readonly MarketRow[]): MarketSection[];
|
|
28
|
-
export declare function marketRows(manifests: readonly UnitManifest[], capabilities: CapabilityMap | null): MarketRow[];
|
|
42
|
+
export declare function marketRows(manifests: readonly UnitManifest[], capabilities: CapabilityMap | null, updates?: ModuleUpdateMap): MarketRow[];
|
|
29
43
|
export type SharedState = 'checking' | 'installed' | 'outdated' | 'unsatisfied' | 'missing' | 'unchecked';
|
|
30
44
|
export declare const SHARED_STATE_KEY: Readonly<Record<SharedState, string>>;
|
|
31
45
|
export declare const SHARED_DOT: Readonly<Record<SharedState, 'ongoing' | 'done' | 'warning' | 'idle'>>;
|
|
@@ -41,5 +55,5 @@ export interface SharedRow {
|
|
|
41
55
|
};
|
|
42
56
|
readonly detail?: string;
|
|
43
57
|
}
|
|
44
|
-
export declare function sharedActions(row: SharedRow):
|
|
58
|
+
export declare function sharedActions(row: SharedRow): MarketRowAction[];
|
|
45
59
|
export declare function sharedRows(manifests: readonly UnitManifest[], capabilities: CapabilityMap | null): SharedRow[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { BoardModule, UnitClientFace, UnitManifest } from '@dsh-workbench/shared';
|
|
2
|
+
export declare const FIXTURE_UNIT_ID = "wb-fixture";
|
|
3
|
+
export declare const FIXTURE_FACE: UnitClientFace;
|
|
4
|
+
export declare function fixtureRoster(roster: readonly UnitManifest[]): readonly UnitManifest[];
|
|
5
|
+
export declare function fixtureSeed(roster: readonly UnitManifest[], all: readonly BoardModule[]): readonly BoardModule[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UnitManifest } from '@dsh-workbench/shared';
|
|
2
|
-
import type { UnitClientFace } from '@dsh-workbench/shared';
|
|
2
|
+
import type { BoardModule, UnitClientFace } from '@dsh-workbench/shared';
|
|
3
3
|
import { type BoardRegistry } from '../layouts/rightbar/registry';
|
|
4
4
|
export interface ClientUnitRegistry {
|
|
5
5
|
register(face: UnitClientFace): () => void;
|
|
@@ -9,4 +9,5 @@ export interface ClientUnitRegistry {
|
|
|
9
9
|
subscribe(listener: () => void): () => void;
|
|
10
10
|
version(): number;
|
|
11
11
|
}
|
|
12
|
+
export declare function toBoardModule(face: UnitClientFace): BoardModule;
|
|
12
13
|
export declare function createClientUnitRegistry(): ClientUnitRegistry;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { UnitCall } from '@dsh-workbench/shared/host';
|
|
2
2
|
import type { HandoffEntry } from '@dsh-workbench/shared/host';
|
|
3
|
-
import type { UnitManifest } from '@dsh-workbench/shared';
|
|
3
|
+
import type { UnitManifest } from '@dsh-workbench/shared/host';
|
|
4
4
|
export declare const PANELS_FACT = "panels";
|
|
5
5
|
export declare function panelsHandoffEntry(target?: {
|
|
6
6
|
readonly path?: string | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { UnitCapability } from '../../../shared/api/host/probe-units';
|
|
2
2
|
import { type ProvisionRequest } from '@dsh-workbench/shared/host';
|
|
3
|
-
import type { UnitManifest } from '@dsh-workbench/shared';
|
|
3
|
+
import type { UnitManifest } from '@dsh-workbench/shared/host';
|
|
4
4
|
import { type PluginSourceCommand, type PluginSourceProblem } from '@dsh-workbench/shared/host';
|
|
5
5
|
export type DependencyKind = 'plugin' | 'lib';
|
|
6
6
|
export interface SharedDependency {
|
|
@@ -1,14 +1,32 @@
|
|
|
1
1
|
import type { ProvisionRequest } from '@dsh-workbench/shared/host';
|
|
2
|
-
import type {
|
|
2
|
+
import type { BundleCancellation, BundleChange } from '../../../shared/api/bundle-install';
|
|
3
|
+
import type { InstalledModule } from '../../../shared/api/host/installed-module';
|
|
4
|
+
import type { BundleSupply, MarketEntry, MarketService } from './market';
|
|
3
5
|
import type { SharedDependency } from './market-dependency';
|
|
4
6
|
export type ProvisionResult = {
|
|
5
7
|
readonly ok: true;
|
|
6
8
|
readonly action: 'install' | 'update' | 'uninstall';
|
|
7
9
|
readonly module: MarketEntry;
|
|
8
10
|
readonly keptFor?: readonly string[];
|
|
11
|
+
readonly change?: BundleChange;
|
|
9
12
|
} | {
|
|
10
13
|
readonly ok: true;
|
|
11
14
|
readonly action: 'update-dependency';
|
|
12
15
|
readonly shared: readonly SharedDependency[];
|
|
16
|
+
} | {
|
|
17
|
+
readonly ok: true;
|
|
18
|
+
readonly action: 'install-bundle' | 'update-bundle';
|
|
19
|
+
readonly change: BundleChange;
|
|
20
|
+
readonly module: InstalledModule;
|
|
21
|
+
readonly supply: BundleSupply;
|
|
22
|
+
} | {
|
|
23
|
+
readonly ok: true;
|
|
24
|
+
readonly action: 'remove-bundle';
|
|
25
|
+
readonly change: BundleChange;
|
|
26
|
+
readonly keptFor: readonly string[];
|
|
27
|
+
} | {
|
|
28
|
+
readonly ok: true;
|
|
29
|
+
readonly action: 'cancel-install';
|
|
30
|
+
readonly cancellation: BundleCancellation | null;
|
|
13
31
|
};
|
|
14
32
|
export declare function dispatchMarket(market: MarketService, request: ProvisionRequest): Promise<ProvisionResult>;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { DshShell } from '@dsh-workbench/shared';
|
|
2
2
|
import type { PluginSource, UnitManifest } from '@dsh-workbench/shared';
|
|
3
|
+
import type { BundleCancellation, BundleChange } from '../../../shared/api/bundle-install';
|
|
4
|
+
import type { BundleManager } from '../../../shared/api/host/bundle-manager';
|
|
5
|
+
import type { InstalledModule, ProfileModule } from '../../../shared/api/host/installed-module';
|
|
3
6
|
import type { UnitCapability } from '../../../shared/api/host/probe-units';
|
|
4
7
|
import type { ProvisionAction } from '@dsh-workbench/shared/host';
|
|
5
8
|
import type { UnitMountDeps } from '@dsh-workbench/shared/host';
|
|
@@ -23,6 +26,34 @@ export interface MarketEntry {
|
|
|
23
26
|
export interface UninstallResult {
|
|
24
27
|
readonly entry: MarketEntry;
|
|
25
28
|
readonly keptFor: readonly string[];
|
|
29
|
+
readonly change?: BundleChange;
|
|
30
|
+
}
|
|
31
|
+
export interface BundleInstallOptions {
|
|
32
|
+
readonly registry?: string | undefined;
|
|
33
|
+
readonly approvedBuilds?: readonly string[] | undefined;
|
|
34
|
+
readonly requestId?: string | undefined;
|
|
35
|
+
}
|
|
36
|
+
export type BundleSupply = {
|
|
37
|
+
readonly state: 'not-a-module';
|
|
38
|
+
} | {
|
|
39
|
+
readonly state: 'no-needs';
|
|
40
|
+
} | {
|
|
41
|
+
readonly state: 'installed';
|
|
42
|
+
readonly entry: MarketEntry;
|
|
43
|
+
} | {
|
|
44
|
+
readonly state: 'failed';
|
|
45
|
+
readonly reason: string;
|
|
46
|
+
} | {
|
|
47
|
+
readonly state: 'pending-restart';
|
|
48
|
+
};
|
|
49
|
+
export interface BundleInstallOutcome {
|
|
50
|
+
readonly change: BundleChange;
|
|
51
|
+
readonly module: InstalledModule;
|
|
52
|
+
readonly supply: BundleSupply;
|
|
53
|
+
}
|
|
54
|
+
export interface BundleRemoveOutcome {
|
|
55
|
+
readonly change: BundleChange;
|
|
56
|
+
readonly keptFor: readonly string[];
|
|
26
57
|
}
|
|
27
58
|
export interface MarketService {
|
|
28
59
|
list(): Promise<{
|
|
@@ -33,15 +64,23 @@ export interface MarketService {
|
|
|
33
64
|
update(unit: string): Promise<MarketEntry>;
|
|
34
65
|
uninstall(unit: string): Promise<UninstallResult>;
|
|
35
66
|
updateDependency(id: string): Promise<readonly SharedDependency[]>;
|
|
67
|
+
installBundle(spec: string, options?: BundleInstallOptions): Promise<BundleInstallOutcome>;
|
|
68
|
+
updateBundle(unit: string): Promise<BundleInstallOutcome | null>;
|
|
69
|
+
removeBundle(pkg: string): Promise<BundleRemoveOutcome>;
|
|
70
|
+
cancelInstall(requestId: string): Promise<BundleCancellation | null>;
|
|
36
71
|
}
|
|
37
72
|
export declare function createMarketService(options: {
|
|
38
73
|
manifests: readonly UnitManifest[];
|
|
74
|
+
manifestsNow?: (() => readonly UnitManifest[]) | undefined;
|
|
39
75
|
probe?: UnitMountDeps['probe'];
|
|
40
76
|
shell?: DshShell | undefined;
|
|
41
77
|
command?: string | undefined;
|
|
42
78
|
onInstalled?: (unit: string) => void;
|
|
43
79
|
onUninstalled?: (unit: string) => void;
|
|
44
80
|
isReleased?: (unit: string) => boolean;
|
|
81
|
+
bundles?: BundleManager | undefined;
|
|
82
|
+
installed?: ((pkg: string) => InstalledModule) | undefined;
|
|
83
|
+
modules?: (() => readonly ProfileModule[]) | undefined;
|
|
45
84
|
logger?: {
|
|
46
85
|
info?(message: string): void;
|
|
47
86
|
warn?(message: string): void;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export declare const BUNDLE_REGISTRIES_ROUTE = "bundle-registries";
|
|
2
|
+
export declare const BUNDLE_INSPECT_ROUTE = "bundle-inspect";
|
|
3
|
+
export declare const BUNDLE_REGISTRY_DEFAULT = "default";
|
|
4
|
+
export declare const MODULE_VERSIONS_ROUTE = "module-versions";
|
|
5
|
+
export type BundleRegistry = string | null;
|
|
6
|
+
export interface BundleRegistries {
|
|
7
|
+
readonly registry: BundleRegistry;
|
|
8
|
+
readonly fallbackRegistries: readonly BundleRegistry[];
|
|
9
|
+
readonly resolved: string | null;
|
|
10
|
+
}
|
|
11
|
+
export type BundleInspectProblem = 'invalid-spec' | 'already-installed' | 'not-found' | 'not-a-package' | 'not-a-bundle' | 'network' | 'unknown';
|
|
12
|
+
export type BundleSpecKind = 'registry' | 'path' | 'git' | 'tarball';
|
|
13
|
+
export interface BundleInspectionAccepted {
|
|
14
|
+
readonly status: 'accepted';
|
|
15
|
+
readonly kind: BundleSpecKind;
|
|
16
|
+
readonly name?: string;
|
|
17
|
+
readonly version?: string;
|
|
18
|
+
readonly description?: string;
|
|
19
|
+
readonly bundle: boolean | null;
|
|
20
|
+
readonly registry: BundleRegistry;
|
|
21
|
+
readonly host?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface BundleInspectionRefused {
|
|
24
|
+
readonly status: 'refused';
|
|
25
|
+
readonly problem: BundleInspectProblem;
|
|
26
|
+
readonly reason: string;
|
|
27
|
+
readonly registries?: readonly BundleRegistry[];
|
|
28
|
+
}
|
|
29
|
+
export type BundleInspection = BundleInspectionAccepted | BundleInspectionRefused;
|
|
30
|
+
export interface BundleRegistriesPayload {
|
|
31
|
+
readonly available: boolean;
|
|
32
|
+
readonly registries: BundleRegistries | null;
|
|
33
|
+
}
|
|
34
|
+
export interface BundleInspectionPayload {
|
|
35
|
+
readonly inspection: BundleInspection;
|
|
36
|
+
}
|
|
37
|
+
export type BundleApplication = 'applied' | 'restart-required' | 'overridden' | 'failed' | 'cancelled';
|
|
38
|
+
export type BundleChangeStage = 'install' | 'enable' | 'remove';
|
|
39
|
+
export type BundleFailureKind = 'pnpm-missing' | 'timeout' | 'not-found' | 'no-matching-version' | 'network' | 'disk-full' | 'permission' | 'build-blocked' | 'integrity' | 'unknown';
|
|
40
|
+
export interface BundlePackageResult {
|
|
41
|
+
readonly exitCode: number;
|
|
42
|
+
readonly output: string;
|
|
43
|
+
readonly truncated: boolean;
|
|
44
|
+
readonly logPath: string;
|
|
45
|
+
readonly kind?: BundleFailureKind;
|
|
46
|
+
}
|
|
47
|
+
export interface BundleChange {
|
|
48
|
+
readonly application: BundleApplication;
|
|
49
|
+
readonly stage: BundleChangeStage;
|
|
50
|
+
readonly changed: boolean;
|
|
51
|
+
readonly target: string;
|
|
52
|
+
readonly bundle?: string;
|
|
53
|
+
readonly errorCode?: string;
|
|
54
|
+
readonly errorDetail?: string;
|
|
55
|
+
readonly packageResult?: BundlePackageResult;
|
|
56
|
+
readonly pendingBuilds?: readonly string[];
|
|
57
|
+
readonly failedAt?: 'registry' | 'spec-host';
|
|
58
|
+
}
|
|
59
|
+
export interface BundleInstallRequest {
|
|
60
|
+
readonly spec: string;
|
|
61
|
+
readonly registry?: BundleRegistry;
|
|
62
|
+
readonly requestId?: string;
|
|
63
|
+
readonly approvedBuilds?: readonly string[];
|
|
64
|
+
}
|
|
65
|
+
export type BundleCancellation = 'cancelled' | 'too-late' | 'not-running';
|
|
66
|
+
export type BundleSupplyState = 'not-a-module' | 'no-needs' | 'installed' | 'failed' | 'pending-restart';
|
|
67
|
+
export interface BundleModulePayload {
|
|
68
|
+
readonly kind: 'module' | 'not-module' | 'unknown';
|
|
69
|
+
readonly pkg: string;
|
|
70
|
+
readonly unit?: string;
|
|
71
|
+
readonly version?: string;
|
|
72
|
+
}
|
|
73
|
+
export interface BundleSupplyPayload {
|
|
74
|
+
readonly state: BundleSupplyState;
|
|
75
|
+
readonly reason?: string;
|
|
76
|
+
}
|
|
77
|
+
export interface BundleInstallPayload {
|
|
78
|
+
readonly change: BundleChange;
|
|
79
|
+
readonly module: BundleModulePayload;
|
|
80
|
+
readonly supply: BundleSupplyPayload;
|
|
81
|
+
}
|
|
82
|
+
export interface BundleRemovePayload {
|
|
83
|
+
readonly change: BundleChange;
|
|
84
|
+
readonly keptFor: readonly string[];
|
|
85
|
+
}
|
|
86
|
+
export interface BundleCancellationPayload {
|
|
87
|
+
readonly cancellation: BundleCancellation | null;
|
|
88
|
+
}
|
|
89
|
+
export interface ModuleVersion {
|
|
90
|
+
readonly unit: string;
|
|
91
|
+
readonly pkg: string;
|
|
92
|
+
readonly installed: string;
|
|
93
|
+
readonly latest?: string;
|
|
94
|
+
}
|
|
95
|
+
export interface ModuleVersionsPayload {
|
|
96
|
+
readonly modules: readonly ModuleVersion[];
|
|
97
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const DSH_PLUGINS_ROUTE = "dsh-plugins";
|
|
2
|
+
export interface DshPluginRow {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly version: string;
|
|
5
|
+
readonly enabled: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface DshPluginsSnapshot {
|
|
8
|
+
readonly available: boolean;
|
|
9
|
+
readonly bundles: readonly DshPluginRow[];
|
|
10
|
+
readonly plugins: readonly DshPluginRow[];
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DshHostContext } from '@dsh-workbench/shared';
|
|
2
|
+
import type { BundleCancellation, BundleChange, BundleInspection, BundleInstallRequest, BundleRegistries, BundleRegistry } from '../bundle-install.js';
|
|
3
|
+
export interface BundleManager {
|
|
4
|
+
registries(): Promise<BundleRegistries | null>;
|
|
5
|
+
inspect(spec: string, registry?: BundleRegistry): Promise<BundleInspection | null>;
|
|
6
|
+
install(request: BundleInstallRequest): Promise<BundleChange | null>;
|
|
7
|
+
remove(name: string): Promise<BundleChange | null>;
|
|
8
|
+
cancel(requestId: string): Promise<BundleCancellation | null>;
|
|
9
|
+
}
|
|
10
|
+
export declare function readBundleManager(ctx: DshHostContext): BundleManager | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DshHostContext } from '@dsh-workbench/shared';
|
|
2
|
+
import { type RouteHandler } from '@dsh-workbench/shared/host';
|
|
3
|
+
export declare function bundleRegistriesHandler(ctx: DshHostContext): RouteHandler;
|
|
4
|
+
export declare function moduleVersionsHandler(ctx: DshHostContext): RouteHandler;
|
|
5
|
+
export declare function bundleInspectHandler(ctx: DshHostContext): RouteHandler;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ContextRef } from '@dsh-workbench/shared';
|
|
1
|
+
import { type ContextRef } from '@dsh-workbench/shared/host';
|
|
2
2
|
import type { ContextRenderer } from '@dsh-workbench/shared/host';
|
|
3
3
|
export declare const CONTEXT_SOURCE_KIND = "workbench";
|
|
4
4
|
export interface ScannableMessage {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DshHostContext } from '@dsh-workbench/shared';
|
|
2
|
+
import type { RouteHandler } from '@dsh-workbench/shared/host';
|
|
3
|
+
import type { DshPluginsSnapshot } from '../dsh-plugins.js';
|
|
4
|
+
export declare function readDshPlugins(ctx: DshHostContext): Promise<DshPluginsSnapshot>;
|
|
5
|
+
export declare function dshPluginsHandler(ctx: DshHostContext): RouteHandler;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { DshHostContext } from '@dsh-workbench/shared';
|
|
2
|
+
export type InstalledModule = {
|
|
3
|
+
readonly kind: 'module';
|
|
4
|
+
readonly pkg: string;
|
|
5
|
+
readonly unit: string;
|
|
6
|
+
readonly version: string;
|
|
7
|
+
} | {
|
|
8
|
+
readonly kind: 'not-module';
|
|
9
|
+
readonly pkg: string;
|
|
10
|
+
} | {
|
|
11
|
+
readonly kind: 'unknown';
|
|
12
|
+
readonly pkg: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function isPackageName(value: string): boolean;
|
|
15
|
+
export declare function profileDirOf(ctx: DshHostContext): string | null;
|
|
16
|
+
export interface ProfileModule {
|
|
17
|
+
readonly pkg: string;
|
|
18
|
+
readonly unit: string;
|
|
19
|
+
readonly version: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function profileModules(profileDir: string | null): readonly ProfileModule[];
|
|
22
|
+
export declare function readInstalledModule(profileDir: string | null, pkg: string): InstalledModule;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DshHostContext } from '@dsh-workbench/shared';
|
|
2
|
-
import type { UnitManifest } from '@dsh-workbench/shared';
|
|
2
|
+
import type { UnitManifest } from '@dsh-workbench/shared/host';
|
|
3
3
|
import { type RouteTable } from '@dsh-workbench/shared/host';
|
|
4
4
|
import type { ContextRenderer, UnitHostFace, UnitMountDeps, UnitMountResult, UnitCall } from '@dsh-workbench/shared/host';
|
|
5
5
|
import { type UnitReadiness } from './unit-readiness';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DshShell } from '@dsh-workbench/shared';
|
|
2
2
|
export type { UnitCapability, UnitCommands, UnitLibState, UnitPluginState } from '@dsh-workbench/shared/host';
|
|
3
3
|
import type { UnitLibState } from '@dsh-workbench/shared/host';
|
|
4
|
-
import type { UnitLibNeed } from '@dsh-workbench/shared';
|
|
4
|
+
import type { UnitLibNeed } from '@dsh-workbench/shared/host';
|
|
5
5
|
export declare function installedLibVersion(name: string): string | undefined;
|
|
6
6
|
export declare function probeLibs(options: {
|
|
7
7
|
readonly needs: readonly UnitLibNeed[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReactNode } from '@dsh-workbench/shared';
|
|
2
|
+
export interface PanelFootProps {
|
|
3
|
+
readonly text: string;
|
|
4
|
+
readonly size?: 'sm' | 'md';
|
|
5
|
+
readonly children?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare function PanelFoot({ text, size, children }: PanelFootProps): JSX.Element;
|