@dsh-workbench/core 0.1.16 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client.js +660 -128
- package/dist/client/client.body.js +660 -128
- package/dist/client/index.js +660 -128
- package/dist/host/index.js +1498 -263
- package/dist/types/app/client.d.ts +124 -9
- package/dist/types/app/layouts/market/add-module-text.d.ts +2 -0
- package/dist/types/app/layouts/market/use-add-module.d.ts +4 -3
- package/dist/types/app/layouts/market/use-module-versions.d.ts +2 -0
- package/dist/types/app/layouts/rightbar/MarketView.d.ts +3 -1
- package/dist/types/app/layouts/rightbar/__tests__/market-rows-plugins.test.d.ts +1 -0
- package/dist/types/app/layouts/rightbar/market-mock.d.ts +9 -0
- package/dist/types/app/layouts/rightbar/market-plugin-rows.d.ts +8 -0
- package/dist/types/app/layouts/rightbar/market-rows.d.ts +14 -3
- package/dist/types/app/layouts/rightbar/registry.d.ts +0 -1
- package/dist/types/app/units/__tests__/manifests.test.d.ts +1 -0
- package/dist/types/app/units/fixture-unit-mock.d.ts +3 -3
- package/dist/types/app/units/host.d.ts +2 -2
- package/dist/types/app/units/manifests.d.ts +5 -0
- package/dist/types/app/units/registry.d.ts +10 -2
- package/dist/types/modules/panels/__tests__/market-env.test.d.ts +1 -0
- package/dist/types/modules/panels/__tests__/market-plugin.test.d.ts +1 -0
- package/dist/types/modules/panels/__tests__/market-route.test.d.ts +1 -0
- package/dist/types/modules/panels/__tests__/plugin-actions.test.d.ts +1 -0
- package/dist/types/modules/panels/__tests__/plugin-ledger.test.d.ts +1 -0
- package/dist/types/modules/panels/__tests__/plugin-section.test.d.ts +1 -0
- package/dist/types/modules/panels/__tests__/scope.test.d.ts +1 -0
- package/dist/types/modules/panels/__tests__/service-release.test.d.ts +1 -0
- package/dist/types/modules/panels/index.d.ts +2 -2
- package/dist/types/modules/panels/model/config.d.ts +27 -9
- package/dist/types/modules/panels/model/market-dispatch.d.ts +9 -0
- package/dist/types/modules/panels/model/market-env.d.ts +20 -0
- package/dist/types/modules/panels/model/market-route.d.ts +26 -0
- package/dist/types/modules/panels/model/market-types.d.ts +71 -0
- package/dist/types/modules/panels/model/market.d.ts +7 -66
- package/dist/types/modules/panels/model/plugin-actions.d.ts +50 -0
- package/dist/types/modules/panels/model/plugin-ledger.d.ts +22 -0
- package/dist/types/modules/panels/model/plugin-name.d.ts +8 -0
- package/dist/types/modules/panels/model/plugin-name.test.d.ts +1 -0
- package/dist/types/modules/panels/model/plugin-section.d.ts +13 -0
- package/dist/types/modules/panels/model/service.d.ts +8 -6
- package/dist/types/shared/api/bundle-install.d.ts +8 -1
- package/dist/types/shared/api/host/__tests__/registry-declaration.test.d.ts +1 -0
- package/dist/types/shared/api/host/__tests__/unit-roster-facts.test.d.ts +1 -0
- package/dist/types/shared/api/host/bundle-routes.d.ts +1 -0
- package/dist/types/shared/api/host/installed-module.d.ts +7 -0
- package/dist/types/shared/api/host/mount-units.d.ts +5 -3
- package/dist/types/shared/api/host/package-content.d.ts +6 -0
- package/dist/types/shared/api/host/package-content.test.d.ts +1 -0
- package/dist/types/shared/api/host/package-kind.d.ts +21 -0
- package/dist/types/shared/api/host/package-kind.test.d.ts +1 -0
- package/dist/types/shared/api/host/package-route.d.ts +23 -0
- package/dist/types/shared/api/host/package-route.test.d.ts +1 -0
- package/dist/types/shared/api/host/registry-declaration.d.ts +23 -0
- package/dist/types/shared/api/host/unit-registry.d.ts +33 -4
- package/dist/types/shared/api/host/unit-roster-facts.d.ts +5 -0
- package/dist/types/shared/api/installed-plugins.d.ts +12 -0
- package/dist/types/shared/api/unit-manifests.d.ts +5 -0
- package/dist/types/shared/api/unit-manifests.test.d.ts +1 -0
- package/dist/types/shared/hooks/bundle-queries.d.ts +2 -0
- package/dist/types/shared/hooks/use-facts.d.ts +1 -0
- package/package.json +2 -2
- package/skills/workbench-module-diy/BUILD.md +5 -5
- package/skills/workbench-module-diy/DESIGN.md +7 -1
- package/skills/workbench-module-diy/REVIEW.md +3 -2
- package/skills/workbench-module-diy/TOOLING.md +2 -2
- package/skills/workbench-module-diy/TOOLS.md +9 -2
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { ModuleVersion } from '../../../shared/api/bundle-install';
|
|
2
|
+
import type { InstalledPlugin } from '../../../shared/api/installed-plugins';
|
|
2
3
|
export interface ModuleVersionsState {
|
|
3
4
|
readonly modules: readonly ModuleVersion[] | null;
|
|
5
|
+
readonly plugins: readonly InstalledPlugin[] | null;
|
|
4
6
|
readonly read: boolean;
|
|
5
7
|
readonly checkedAt: number | null;
|
|
6
8
|
}
|
|
@@ -2,6 +2,7 @@ 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 { InstalledPlugin } from '../../../shared/api/installed-plugins';
|
|
5
6
|
import { type InstalledWorkbenchModule } from './market-rows';
|
|
6
7
|
import type { MarketMock } from './market-mock';
|
|
7
8
|
import type { ModuleUpdateMap } from './market-rows';
|
|
@@ -14,7 +15,8 @@ export interface MarketViewProps {
|
|
|
14
15
|
readonly updates?: ModuleUpdateMap | undefined;
|
|
15
16
|
readonly installed?: readonly InstalledWorkbenchModule[] | undefined;
|
|
16
17
|
readonly installedRead?: boolean | undefined;
|
|
18
|
+
readonly plugins?: readonly InstalledPlugin[] | null | undefined;
|
|
17
19
|
readonly settling?: ReadonlySet<string> | undefined;
|
|
18
20
|
readonly mock?: MarketMock | undefined;
|
|
19
21
|
}
|
|
20
|
-
export declare function MarketView({ t, manifests, capabilities, freshness, onChanged, updates, installed, installedRead, settling, mock, }: MarketViewProps): JSX.Element;
|
|
22
|
+
export declare function MarketView({ t, manifests, capabilities, freshness, onChanged, updates, installed, installedRead, plugins, settling, mock, }: MarketViewProps): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { InstalledWorkbenchModule } from './market-rows';
|
|
2
|
+
import type { InstalledPlugin } from '../../../shared/api/installed-plugins';
|
|
2
3
|
import type { UnitManifest } from '@dsh-workbench/shared';
|
|
3
4
|
import type { MarketRowAction, ModuleUpdateMap } from './market-rows';
|
|
4
5
|
import type { CapabilityMap } from '../../../shared/hooks/use-capabilities';
|
|
@@ -11,7 +12,13 @@ export interface MarketMockExpect {
|
|
|
11
12
|
readonly shared?: number;
|
|
12
13
|
readonly installed?: number;
|
|
13
14
|
readonly installedActions?: readonly MarketRowAction[];
|
|
15
|
+
readonly installedNote?: boolean;
|
|
14
16
|
readonly sharedActions?: readonly MarketRowAction[];
|
|
17
|
+
readonly plugins?: number;
|
|
18
|
+
readonly pluginActions?: readonly MarketRowAction[];
|
|
19
|
+
readonly pluginNote?: boolean;
|
|
20
|
+
readonly pluginNoteKey?: 'panels.market.pluginLocalNoUpdate' | 'panels.market.pluginAlsoKnownAs' | 'panels.market.pluginBroken';
|
|
21
|
+
readonly notice?: boolean;
|
|
15
22
|
}
|
|
16
23
|
export interface MarketMock {
|
|
17
24
|
readonly id: string;
|
|
@@ -25,12 +32,14 @@ export interface MarketMock {
|
|
|
25
32
|
readonly updates?: ModuleUpdateMap;
|
|
26
33
|
readonly installed?: readonly InstalledWorkbenchModule[];
|
|
27
34
|
readonly installedRead?: boolean;
|
|
35
|
+
readonly plugins?: readonly InstalledPlugin[];
|
|
28
36
|
readonly loaded?: boolean;
|
|
29
37
|
readonly confirming?: string;
|
|
30
38
|
readonly failure?: {
|
|
31
39
|
readonly id: string;
|
|
32
40
|
readonly message: string;
|
|
33
41
|
};
|
|
42
|
+
readonly notice?: string;
|
|
34
43
|
readonly expect: MarketMockExpect;
|
|
35
44
|
}
|
|
36
45
|
export declare function buildMarketMocks(roster: readonly UnitManifest[]): readonly MarketMock[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { InstalledPlugin } from '../../../shared/api/installed-plugins';
|
|
2
|
+
import type { MarketRow } from './market-rows';
|
|
3
|
+
export interface InstalledPluginKept {
|
|
4
|
+
readonly key: 'panels.market.pluginKeptInUse' | 'panels.market.pluginKeptUnsure' | 'panels.market.pluginKeptHeld' | 'panels.market.pluginKeptUnnamed';
|
|
5
|
+
readonly names?: readonly string[];
|
|
6
|
+
}
|
|
7
|
+
export declare function installedPluginKept(value: unknown): InstalledPluginKept | undefined;
|
|
8
|
+
export declare function installedPluginRows(plugins: readonly InstalledPlugin[]): MarketRow[];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { ModuleVersion } from '../../../shared/api/bundle-install';
|
|
2
|
-
import type { UnitManifest } from '@dsh-workbench/shared';
|
|
3
|
-
export type MarketRowAction = 'install' | 'update' | 'update-bundle' | 'remove-bundle' | 'uninstall' | 'update-dependency';
|
|
2
|
+
import type { Translate, UnitManifest } from '@dsh-workbench/shared';
|
|
3
|
+
export type MarketRowAction = 'install' | 'update' | 'update-bundle' | 'remove-bundle' | 'uninstall' | 'update-dependency' | 'update-plugin' | 'uninstall-plugin';
|
|
4
4
|
import type { CapabilityMap } from '../../../shared/hooks/use-capabilities';
|
|
5
5
|
export type MarketState = 'checking' | 'installed' | 'outdated' | 'missing' | 'unchecked' | 'unknown';
|
|
6
6
|
export declare const MARKET_STATE_KEY: Readonly<Record<MarketState, string>>;
|
|
7
7
|
export declare const MARKET_DOT: Readonly<Record<MarketState, 'ongoing' | 'done' | 'warning' | 'idle'>>;
|
|
8
8
|
export interface MarketNote {
|
|
9
|
-
readonly key: 'panels.market.needEnv' | 'panels.market.noSource' | 'panels.market.badSource' | 'panels.market.moduleRestartHint';
|
|
9
|
+
readonly key: 'panels.market.needEnv' | 'panels.market.noSource' | 'panels.market.badSource' | 'panels.market.moduleRefused' | 'panels.market.moduleRestartHint' | 'panels.market.pluginLocalNoUpdate' | 'panels.market.pluginAlsoKnownAs' | 'panels.market.pluginBroken';
|
|
10
10
|
readonly params: Readonly<Record<string, string>>;
|
|
11
11
|
}
|
|
12
12
|
export type MarketHintKey = 'panels.market.moduleRestartHint';
|
|
@@ -18,10 +18,12 @@ export type ModuleUpdateMap = Readonly<Record<string, ModuleUpdate>>;
|
|
|
18
18
|
export interface MarketRow {
|
|
19
19
|
readonly id: string;
|
|
20
20
|
readonly titleKey: string;
|
|
21
|
+
readonly label?: string;
|
|
21
22
|
readonly state: MarketState;
|
|
22
23
|
readonly canInstall: boolean;
|
|
23
24
|
readonly canUpdate: boolean;
|
|
24
25
|
readonly canUninstall: boolean;
|
|
26
|
+
readonly plugin?: boolean;
|
|
25
27
|
readonly note?: MarketNote;
|
|
26
28
|
readonly hint?: MarketHintKey;
|
|
27
29
|
readonly version?: {
|
|
@@ -31,14 +33,23 @@ export interface MarketRow {
|
|
|
31
33
|
readonly moduleUpdate?: ModuleUpdate;
|
|
32
34
|
readonly pkg?: string;
|
|
33
35
|
readonly local?: boolean;
|
|
36
|
+
readonly broken?: boolean;
|
|
34
37
|
}
|
|
38
|
+
export declare function marketRowTitle(row: MarketRow, t: Translate): string;
|
|
35
39
|
export interface InstalledWorkbenchModule {
|
|
36
40
|
readonly unit: string;
|
|
37
41
|
readonly pkg: string;
|
|
38
42
|
readonly installed: string;
|
|
39
43
|
readonly latest?: string | undefined;
|
|
40
44
|
readonly local?: boolean | undefined;
|
|
45
|
+
readonly refused?: readonly string[] | undefined;
|
|
46
|
+
readonly clientRefused?: readonly string[] | undefined;
|
|
41
47
|
}
|
|
48
|
+
export declare function withClientRefusals(modules: readonly InstalledWorkbenchModule[], refusals: readonly {
|
|
49
|
+
readonly unit: string;
|
|
50
|
+
readonly reasons: readonly string[];
|
|
51
|
+
}[]): readonly InstalledWorkbenchModule[];
|
|
52
|
+
export declare function refusalReasons(host: readonly string[] | undefined, client: readonly string[] | undefined): readonly string[];
|
|
42
53
|
export declare function mergeTitles(known: ReadonlyMap<string, string>, manifests: readonly UnitManifest[]): ReadonlyMap<string, string>;
|
|
43
54
|
export declare function installedRows(modules: readonly InstalledWorkbenchModule[], manifests: readonly UnitManifest[], listed: ReadonlySet<string>, known?: ReadonlyMap<string, string> | undefined): MarketRow[];
|
|
44
55
|
export declare function marketActions(row: MarketRow): MarketRowAction[];
|
|
@@ -2,7 +2,6 @@ import type { BoardModule } from '@dsh-workbench/shared';
|
|
|
2
2
|
export interface BoardRegistry {
|
|
3
3
|
register(module: BoardModule): () => void;
|
|
4
4
|
all(): readonly BoardModule[];
|
|
5
|
-
visible(): readonly BoardModule[];
|
|
6
5
|
byId(id: string): BoardModule | undefined;
|
|
7
6
|
stepOwner(kind: string): BoardModule | undefined;
|
|
8
7
|
subscribe(listener: () => void): () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { BoardModule,
|
|
1
|
+
import type { BoardModule, UnitManifest, UnitOwnedClientFace } from '@dsh-workbench/shared';
|
|
2
2
|
export declare const FIXTURE_UNIT_ID = "wb-fixture";
|
|
3
3
|
export declare const CRASH_UNIT_ID = "wb-fixture-crash";
|
|
4
|
-
export declare const FIXTURE_FACE:
|
|
5
|
-
export declare const CRASH_FACE:
|
|
4
|
+
export declare const FIXTURE_FACE: UnitOwnedClientFace;
|
|
5
|
+
export declare const CRASH_FACE: UnitOwnedClientFace;
|
|
6
6
|
export declare function fixtureRoster(roster: readonly UnitManifest[]): readonly UnitManifest[];
|
|
7
7
|
export declare function fixtureSeed(roster: readonly UnitManifest[], all: readonly BoardModule[], crash?: boolean): readonly BoardModule[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { UnitOwnedFace } from '@dsh-workbench/shared/host';
|
|
2
2
|
export declare function assembleHostUnits(registry: {
|
|
3
|
-
|
|
3
|
+
registerOwned(face: UnitOwnedFace): () => void;
|
|
4
4
|
}): void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ClientUnitRegistry } from './registry';
|
|
2
|
+
export interface UnitManifestLoaderOptions {
|
|
3
|
+
readonly subscribeFacts?: (fact: string, listener: () => void) => () => void;
|
|
4
|
+
}
|
|
5
|
+
export declare function createUnitManifestLoader(options?: UnitManifestLoaderOptions): (registry: ClientUnitRegistry) => void;
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import type { UnitManifest } from '@dsh-workbench/shared';
|
|
2
2
|
import type { BoardModule, UnitClientFace } from '@dsh-workbench/shared';
|
|
3
3
|
import { type BoardRegistry } from '../layouts/rightbar/registry';
|
|
4
|
+
export interface ClientUnitRefusal {
|
|
5
|
+
readonly unit: string;
|
|
6
|
+
readonly reasons: readonly string[];
|
|
7
|
+
}
|
|
4
8
|
export interface ClientUnitRegistry {
|
|
5
9
|
register(face: UnitClientFace): () => void;
|
|
6
10
|
all(): readonly UnitClientFace[];
|
|
7
11
|
manifests(): readonly UnitManifest[];
|
|
12
|
+
refusals(): readonly ClientUnitRefusal[];
|
|
13
|
+
setManifests(manifests: readonly UnitManifest[]): void;
|
|
8
14
|
readonly board: BoardRegistry;
|
|
9
15
|
subscribe(listener: () => void): () => void;
|
|
10
16
|
version(): number;
|
|
11
17
|
}
|
|
12
|
-
export declare function toBoardModule(face: UnitClientFace): BoardModule;
|
|
13
|
-
export declare function createClientUnitRegistry(
|
|
18
|
+
export declare function toBoardModule(face: UnitClientFace, manifest: UnitManifest): BoardModule;
|
|
19
|
+
export declare function createClientUnitRegistry(options?: {
|
|
20
|
+
readonly onUnknownUnit?: (unit: string) => void;
|
|
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 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const panelsHost:
|
|
1
|
+
import type { UnitOwnedFace } from '@dsh-workbench/shared/host';
|
|
2
|
+
export declare const panelsHost: UnitOwnedFace;
|
|
@@ -1,5 +1,22 @@
|
|
|
1
|
-
import type { UnitManifest } from '@dsh-workbench/shared';
|
|
2
|
-
export type
|
|
1
|
+
import type { UnitManifest } from '@dsh-workbench/shared/host';
|
|
2
|
+
export type PanelList = readonly string[];
|
|
3
|
+
export interface PanelBoard {
|
|
4
|
+
readonly shown: PanelList;
|
|
5
|
+
readonly hidden: PanelList;
|
|
6
|
+
}
|
|
7
|
+
export declare const EMPTY_BOARD: PanelBoard;
|
|
8
|
+
export interface ScopeBoards {
|
|
9
|
+
readonly workspace: PanelBoard | null;
|
|
10
|
+
readonly machine: PanelBoard | null;
|
|
11
|
+
}
|
|
12
|
+
export type BoardTarget = 'machine' | 'workspace';
|
|
13
|
+
export declare const BOARD_TARGETS: readonly BoardTarget[];
|
|
14
|
+
export declare const DEFAULT_BOARD_TARGET: BoardTarget;
|
|
15
|
+
export interface ScopeQuery {
|
|
16
|
+
readonly id: string;
|
|
17
|
+
readonly boards: ScopeBoards;
|
|
18
|
+
}
|
|
19
|
+
export declare function resolveScope(query: ScopeQuery): boolean;
|
|
3
20
|
export interface PanelEntry {
|
|
4
21
|
readonly id: string;
|
|
5
22
|
readonly titleKey: string;
|
|
@@ -8,11 +25,12 @@ export interface PanelEntry {
|
|
|
8
25
|
readonly source: 'default' | 'user';
|
|
9
26
|
readonly hasCard: boolean;
|
|
10
27
|
}
|
|
11
|
-
export declare function
|
|
28
|
+
export declare function parseBoard(raw: unknown): PanelBoard;
|
|
12
29
|
export declare function parseReleased(raw: unknown): string[];
|
|
13
|
-
export declare function resolvePanels(manifests: readonly UnitManifest[],
|
|
14
|
-
export declare function withoutReleased(released:
|
|
15
|
-
export declare function withReleased(released:
|
|
16
|
-
export declare function withShown(
|
|
17
|
-
export declare function withHidden(
|
|
18
|
-
export declare function
|
|
30
|
+
export declare function resolvePanels(manifests: readonly UnitManifest[], boards: ScopeBoards): PanelEntry[];
|
|
31
|
+
export declare function withoutReleased(released: PanelList, id: string): string[];
|
|
32
|
+
export declare function withReleased(released: PanelList, id: string): string[];
|
|
33
|
+
export declare function withShown(board: PanelBoard, id: string): PanelBoard;
|
|
34
|
+
export declare function withHidden(board: PanelBoard, id: string): PanelBoard;
|
|
35
|
+
export declare function withoutPanel(board: PanelBoard, id: string): PanelBoard;
|
|
36
|
+
export declare function withMoved(board: PanelBoard, id: string, index: number): PanelBoard;
|
|
@@ -2,6 +2,7 @@ import type { ProvisionRequest } from '@dsh-workbench/shared/host';
|
|
|
2
2
|
import type { BundleCancellation, BundleChange } from '../../../shared/api/bundle-install';
|
|
3
3
|
import type { InstalledModule } from '../../../shared/api/host/installed-module';
|
|
4
4
|
import type { BundleSupply, MarketEntry, MarketService } from './market';
|
|
5
|
+
import type { PluginKept } from './plugin-actions';
|
|
5
6
|
import type { SharedDependency } from './market-dependency';
|
|
6
7
|
export type ProvisionResult = {
|
|
7
8
|
readonly ok: true;
|
|
@@ -28,5 +29,13 @@ export type ProvisionResult = {
|
|
|
28
29
|
readonly ok: true;
|
|
29
30
|
readonly action: 'cancel-install';
|
|
30
31
|
readonly cancellation: BundleCancellation | null;
|
|
32
|
+
} | {
|
|
33
|
+
readonly ok: true;
|
|
34
|
+
readonly action: 'update-plugin';
|
|
35
|
+
} | {
|
|
36
|
+
readonly ok: true;
|
|
37
|
+
readonly action: 'uninstall-plugin';
|
|
38
|
+
readonly removed: boolean;
|
|
39
|
+
readonly kept?: PluginKept;
|
|
31
40
|
};
|
|
32
41
|
export declare function dispatchMarket(market: MarketService, request: ProvisionRequest): Promise<ProvisionResult>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { UnitEnvNeeds, UnitManifest } from '@dsh-workbench/shared';
|
|
2
|
+
import type { UnitCapability } from '../../../shared/api/host/probe-units';
|
|
3
|
+
import { type PluginReferences } from './plugin-actions';
|
|
4
|
+
import type { PluginLedger } from './plugin-ledger';
|
|
5
|
+
export interface EnvDropper {
|
|
6
|
+
usersOf(plugin: string, except?: string): string[];
|
|
7
|
+
drop(unit: string, env: UnitEnvNeeds | undefined, before: UnitCapability): Promise<string[]>;
|
|
8
|
+
}
|
|
9
|
+
export declare function createEnvDropper(options: {
|
|
10
|
+
readonly catalog: () => readonly UnitManifest[];
|
|
11
|
+
readonly isReleased?: ((unit: string) => boolean) | undefined;
|
|
12
|
+
readonly ledger?: PluginLedger | undefined;
|
|
13
|
+
readonly references?: (() => PluginReferences) | undefined;
|
|
14
|
+
readonly command: string;
|
|
15
|
+
readonly run: (line: string, optional?: boolean) => Promise<void>;
|
|
16
|
+
readonly logger?: {
|
|
17
|
+
info?(message: string): void;
|
|
18
|
+
warn?(message: string): void;
|
|
19
|
+
} | undefined;
|
|
20
|
+
}): EnvDropper;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { DshShell } from '@dsh-workbench/shared';
|
|
2
|
+
import type { PluginSourceCommand } from '@dsh-workbench/shared/host';
|
|
3
|
+
import type { BundleChange } from '../../../shared/api/bundle-install';
|
|
4
|
+
import type { BundleManager } from '../../../shared/api/host/bundle-manager';
|
|
5
|
+
import type { InstalledModule } from '../../../shared/api/host/installed-module';
|
|
6
|
+
import type { PluginLedger } from './plugin-ledger';
|
|
7
|
+
import type { BundleInstallOptions, BundleInstallOutcome, BundleSupply } from './market-types';
|
|
8
|
+
export interface BundleInstallDeps {
|
|
9
|
+
readonly spec: string;
|
|
10
|
+
readonly options?: BundleInstallOptions | undefined;
|
|
11
|
+
readonly registry?: string | undefined;
|
|
12
|
+
readonly command: string;
|
|
13
|
+
readonly shell?: DshShell | undefined;
|
|
14
|
+
readonly manager: BundleManager;
|
|
15
|
+
readonly installed?: ((pkg: string) => InstalledModule) | undefined;
|
|
16
|
+
readonly logger?: {
|
|
17
|
+
info?(message: string): void;
|
|
18
|
+
warn?(message: string): void;
|
|
19
|
+
} | undefined;
|
|
20
|
+
readonly ledger?: PluginLedger | undefined;
|
|
21
|
+
readonly runAll: (commands: readonly PluginSourceCommand[]) => Promise<void>;
|
|
22
|
+
readonly supplyAfter: (module: InstalledModule, change: BundleChange) => Promise<BundleSupply>;
|
|
23
|
+
readonly rememberSource: (manager: BundleManager, pkg: string, registry: string | undefined) => Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
export declare function installDshBundle(deps: Omit<BundleInstallDeps, 'spec' | 'options'>, spec: string, options?: BundleInstallOptions): Promise<BundleInstallOutcome>;
|
|
26
|
+
export declare function installRouted(deps: BundleInstallDeps): Promise<BundleInstallOutcome>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { PluginSource } from '@dsh-workbench/shared';
|
|
2
|
+
import type { ProvisionAction } from '@dsh-workbench/shared/host';
|
|
3
|
+
import type { BundleCancellation, BundleChange, BundleInstalledPlugin } from '../../../shared/api/bundle-install';
|
|
4
|
+
import type { InstalledModule } from '../../../shared/api/host/installed-module';
|
|
5
|
+
import type { UnitCapability } from '../../../shared/api/host/probe-units';
|
|
6
|
+
import type { PluginUninstallOutcome, PluginUpdateOutcome } from './plugin-actions';
|
|
7
|
+
import type { SharedDependency } from './market-dependency';
|
|
8
|
+
export type MarketAction = ProvisionAction;
|
|
9
|
+
export interface MarketEntry {
|
|
10
|
+
readonly unit: string;
|
|
11
|
+
readonly titleKey: string;
|
|
12
|
+
readonly plugins: readonly {
|
|
13
|
+
readonly name: string;
|
|
14
|
+
readonly source?: PluginSource;
|
|
15
|
+
}[];
|
|
16
|
+
readonly libs: readonly {
|
|
17
|
+
readonly name: string;
|
|
18
|
+
readonly version?: string | undefined;
|
|
19
|
+
readonly purpose: string;
|
|
20
|
+
}[];
|
|
21
|
+
readonly capability: UnitCapability;
|
|
22
|
+
}
|
|
23
|
+
export interface UninstallResult {
|
|
24
|
+
readonly entry: MarketEntry;
|
|
25
|
+
readonly keptFor: readonly string[];
|
|
26
|
+
readonly change?: BundleChange;
|
|
27
|
+
}
|
|
28
|
+
export interface BundleInstallOptions {
|
|
29
|
+
readonly registry?: string | undefined;
|
|
30
|
+
readonly approvedBuilds?: readonly string[] | undefined;
|
|
31
|
+
readonly requestId?: string | undefined;
|
|
32
|
+
}
|
|
33
|
+
export type BundleSupply = {
|
|
34
|
+
readonly state: 'not-a-module';
|
|
35
|
+
} | {
|
|
36
|
+
readonly state: 'no-needs';
|
|
37
|
+
} | {
|
|
38
|
+
readonly state: 'installed';
|
|
39
|
+
readonly entry: MarketEntry;
|
|
40
|
+
} | {
|
|
41
|
+
readonly state: 'failed';
|
|
42
|
+
readonly reason: string;
|
|
43
|
+
} | {
|
|
44
|
+
readonly state: 'pending-restart';
|
|
45
|
+
};
|
|
46
|
+
export interface BundleInstallOutcome {
|
|
47
|
+
readonly change: BundleChange;
|
|
48
|
+
readonly module: InstalledModule;
|
|
49
|
+
readonly supply: BundleSupply;
|
|
50
|
+
readonly plugin?: BundleInstalledPlugin;
|
|
51
|
+
}
|
|
52
|
+
export interface BundleRemoveOutcome {
|
|
53
|
+
readonly change: BundleChange;
|
|
54
|
+
readonly keptFor: readonly string[];
|
|
55
|
+
}
|
|
56
|
+
export interface MarketService {
|
|
57
|
+
list(): Promise<{
|
|
58
|
+
readonly modules: MarketEntry[];
|
|
59
|
+
readonly shared: readonly SharedDependency[];
|
|
60
|
+
}>;
|
|
61
|
+
install(unit: string): Promise<MarketEntry>;
|
|
62
|
+
update(unit: string): Promise<MarketEntry>;
|
|
63
|
+
uninstall(unit: string): Promise<UninstallResult>;
|
|
64
|
+
updateDependency(id: string): Promise<readonly SharedDependency[]>;
|
|
65
|
+
installBundle(spec: string, options?: BundleInstallOptions): Promise<BundleInstallOutcome>;
|
|
66
|
+
updateBundle(unit: string): Promise<BundleInstallOutcome | null>;
|
|
67
|
+
removeBundle(pkg: string): Promise<BundleRemoveOutcome>;
|
|
68
|
+
cancelInstall(requestId: string): Promise<BundleCancellation | null>;
|
|
69
|
+
updatePlugin(pkg: string): Promise<PluginUpdateOutcome>;
|
|
70
|
+
uninstallPlugin(pkg: string): Promise<PluginUninstallOutcome>;
|
|
71
|
+
}
|
|
@@ -1,75 +1,14 @@
|
|
|
1
1
|
import type { DshShell } from '@dsh-workbench/shared';
|
|
2
|
-
import type {
|
|
3
|
-
import type { BundleCancellation, BundleChange } from '../../../shared/api/bundle-install';
|
|
2
|
+
import type { UnitManifest } from '@dsh-workbench/shared';
|
|
4
3
|
import type { BundleManager } from '../../../shared/api/host/bundle-manager';
|
|
5
4
|
import type { InstalledModule, ProfileModule } from '../../../shared/api/host/installed-module';
|
|
6
5
|
import { type RegistryNotebook } from '../../../shared/api/host/profile-registries';
|
|
7
|
-
import type { UnitCapability } from '../../../shared/api/host/probe-units';
|
|
8
|
-
import type { ProvisionAction } from '@dsh-workbench/shared/host';
|
|
9
6
|
import type { UnitMountDeps } from '@dsh-workbench/shared/host';
|
|
10
|
-
import { type
|
|
7
|
+
import { type PluginReferences } from './plugin-actions';
|
|
8
|
+
import type { PluginLedger } from './plugin-ledger';
|
|
9
|
+
import type { MarketService } from './market-types';
|
|
11
10
|
export type { SharedDependency } from './market-dependency';
|
|
12
|
-
export type MarketAction
|
|
13
|
-
export interface MarketEntry {
|
|
14
|
-
readonly unit: string;
|
|
15
|
-
readonly titleKey: string;
|
|
16
|
-
readonly plugins: readonly {
|
|
17
|
-
readonly name: string;
|
|
18
|
-
readonly source?: PluginSource;
|
|
19
|
-
}[];
|
|
20
|
-
readonly libs: readonly {
|
|
21
|
-
readonly name: string;
|
|
22
|
-
readonly version?: string | undefined;
|
|
23
|
-
readonly purpose: string;
|
|
24
|
-
}[];
|
|
25
|
-
readonly capability: UnitCapability;
|
|
26
|
-
}
|
|
27
|
-
export interface UninstallResult {
|
|
28
|
-
readonly entry: MarketEntry;
|
|
29
|
-
readonly keptFor: readonly string[];
|
|
30
|
-
readonly change?: BundleChange;
|
|
31
|
-
}
|
|
32
|
-
export interface BundleInstallOptions {
|
|
33
|
-
readonly registry?: string | undefined;
|
|
34
|
-
readonly approvedBuilds?: readonly string[] | undefined;
|
|
35
|
-
readonly requestId?: string | undefined;
|
|
36
|
-
}
|
|
37
|
-
export type BundleSupply = {
|
|
38
|
-
readonly state: 'not-a-module';
|
|
39
|
-
} | {
|
|
40
|
-
readonly state: 'no-needs';
|
|
41
|
-
} | {
|
|
42
|
-
readonly state: 'installed';
|
|
43
|
-
readonly entry: MarketEntry;
|
|
44
|
-
} | {
|
|
45
|
-
readonly state: 'failed';
|
|
46
|
-
readonly reason: string;
|
|
47
|
-
} | {
|
|
48
|
-
readonly state: 'pending-restart';
|
|
49
|
-
};
|
|
50
|
-
export interface BundleInstallOutcome {
|
|
51
|
-
readonly change: BundleChange;
|
|
52
|
-
readonly module: InstalledModule;
|
|
53
|
-
readonly supply: BundleSupply;
|
|
54
|
-
}
|
|
55
|
-
export interface BundleRemoveOutcome {
|
|
56
|
-
readonly change: BundleChange;
|
|
57
|
-
readonly keptFor: readonly string[];
|
|
58
|
-
}
|
|
59
|
-
export interface MarketService {
|
|
60
|
-
list(): Promise<{
|
|
61
|
-
readonly modules: MarketEntry[];
|
|
62
|
-
readonly shared: readonly SharedDependency[];
|
|
63
|
-
}>;
|
|
64
|
-
install(unit: string): Promise<MarketEntry>;
|
|
65
|
-
update(unit: string): Promise<MarketEntry>;
|
|
66
|
-
uninstall(unit: string): Promise<UninstallResult>;
|
|
67
|
-
updateDependency(id: string): Promise<readonly SharedDependency[]>;
|
|
68
|
-
installBundle(spec: string, options?: BundleInstallOptions): Promise<BundleInstallOutcome>;
|
|
69
|
-
updateBundle(unit: string): Promise<BundleInstallOutcome | null>;
|
|
70
|
-
removeBundle(pkg: string): Promise<BundleRemoveOutcome>;
|
|
71
|
-
cancelInstall(requestId: string): Promise<BundleCancellation | null>;
|
|
72
|
-
}
|
|
11
|
+
export type { BundleInstallOptions, BundleInstallOutcome, BundleRemoveOutcome, BundleSupply, MarketAction, MarketEntry, MarketService, UninstallResult, } from './market-types';
|
|
73
12
|
export declare function createMarketService(options: {
|
|
74
13
|
manifests: readonly UnitManifest[];
|
|
75
14
|
manifestsNow?: (() => readonly UnitManifest[]) | undefined;
|
|
@@ -83,6 +22,8 @@ export declare function createMarketService(options: {
|
|
|
83
22
|
installed?: ((pkg: string) => InstalledModule) | undefined;
|
|
84
23
|
modules?: (() => readonly ProfileModule[]) | undefined;
|
|
85
24
|
registries?: RegistryNotebook | undefined;
|
|
25
|
+
ledger?: PluginLedger | undefined;
|
|
26
|
+
references?: (() => PluginReferences) | undefined;
|
|
86
27
|
logger?: {
|
|
87
28
|
info?(message: string): void;
|
|
88
29
|
warn?(message: string): void;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { DshShell } from '@dsh-workbench/shared';
|
|
2
|
+
import { type PluginSourceCommand } from '@dsh-workbench/shared/host';
|
|
3
|
+
import type { PluginLedger } from './plugin-ledger';
|
|
4
|
+
export type PluginKept = {
|
|
5
|
+
readonly kind: 'held';
|
|
6
|
+
} | {
|
|
7
|
+
readonly kind: 'claimed';
|
|
8
|
+
readonly by: readonly string[];
|
|
9
|
+
} | {
|
|
10
|
+
readonly kind: 'unsure';
|
|
11
|
+
readonly unreadable: readonly string[];
|
|
12
|
+
} | {
|
|
13
|
+
readonly kind: 'unnamed';
|
|
14
|
+
};
|
|
15
|
+
export interface PluginUninstallOutcome {
|
|
16
|
+
readonly removed: boolean;
|
|
17
|
+
readonly name?: string;
|
|
18
|
+
readonly kept?: PluginKept;
|
|
19
|
+
}
|
|
20
|
+
export interface PluginUpdateOutcome {
|
|
21
|
+
readonly name?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface PluginReferences {
|
|
24
|
+
readonly trustworthy: boolean;
|
|
25
|
+
readonly unreadable: readonly string[];
|
|
26
|
+
}
|
|
27
|
+
export declare function pluginKeptOf(retention: 'keep-held' | 'keep-claimed' | 'keep-unsure', detail: {
|
|
28
|
+
readonly by: readonly string[];
|
|
29
|
+
readonly unreadable: readonly string[];
|
|
30
|
+
}): PluginKept;
|
|
31
|
+
export declare function pluginKeptText(kept: PluginKept): string;
|
|
32
|
+
export declare function pluginRemovedText(pkg: string): string;
|
|
33
|
+
export declare function pluginSweptText(pkg: string): string;
|
|
34
|
+
export interface PluginActions {
|
|
35
|
+
update(pkg: string): Promise<PluginUpdateOutcome>;
|
|
36
|
+
uninstall(pkg: string): Promise<PluginUninstallOutcome>;
|
|
37
|
+
sweep(): Promise<readonly string[]>;
|
|
38
|
+
}
|
|
39
|
+
export declare function createPluginActions(options: {
|
|
40
|
+
readonly ledger?: PluginLedger | undefined;
|
|
41
|
+
readonly shell?: DshShell | undefined;
|
|
42
|
+
readonly command: string;
|
|
43
|
+
readonly runAll: (commands: readonly PluginSourceCommand[]) => Promise<void>;
|
|
44
|
+
readonly claimedBy?: ((plugin: string) => readonly string[]) | undefined;
|
|
45
|
+
readonly references?: (() => PluginReferences) | undefined;
|
|
46
|
+
readonly logger?: {
|
|
47
|
+
info?(message: string): void;
|
|
48
|
+
warn?(message: string): void;
|
|
49
|
+
} | undefined;
|
|
50
|
+
}): PluginActions;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PluginLedgerEntry, WorkspaceStore } from '@dsh-workbench/shared/host';
|
|
2
|
+
export interface PluginLedgerIntent {
|
|
3
|
+
readonly package: string;
|
|
4
|
+
readonly registry?: string | undefined;
|
|
5
|
+
readonly local?: boolean | undefined;
|
|
6
|
+
}
|
|
7
|
+
export interface PluginLedger {
|
|
8
|
+
readonly home: string;
|
|
9
|
+
list(): readonly PluginLedgerEntry[];
|
|
10
|
+
all(): readonly PluginLedgerEntry[];
|
|
11
|
+
read(pkg: string): PluginLedgerEntry | undefined;
|
|
12
|
+
held(pkg: string): boolean;
|
|
13
|
+
heldAsPlugin(plugin: string): PluginLedgerEntry | undefined;
|
|
14
|
+
intend(intent: PluginLedgerIntent): void;
|
|
15
|
+
complete(pkg: string, name: string | undefined): void;
|
|
16
|
+
release(pkg: string): void;
|
|
17
|
+
drop(pkg: string): void;
|
|
18
|
+
}
|
|
19
|
+
export declare function createPluginLedger(options: {
|
|
20
|
+
readonly store: WorkspaceStore;
|
|
21
|
+
readonly home: string;
|
|
22
|
+
}): PluginLedger;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface PluginEntryRef {
|
|
2
|
+
readonly package: string;
|
|
3
|
+
readonly local?: boolean | undefined;
|
|
4
|
+
readonly name?: string | undefined;
|
|
5
|
+
}
|
|
6
|
+
export declare function pluginDirOf(entry: PluginEntryRef): string;
|
|
7
|
+
export declare function pluginOnDisk(entry: PluginEntryRef): boolean;
|
|
8
|
+
export declare function pluginNameOf(entry: PluginEntryRef): string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DshShell } from '@dsh-workbench/shared';
|
|
2
|
+
import { type RouteTable } from '@dsh-workbench/shared/host';
|
|
3
|
+
import type { InstalledPlugin } from '../../../shared/api/installed-plugins';
|
|
4
|
+
import type { PluginLedger } from './plugin-ledger';
|
|
5
|
+
export declare function installedPlugins(options: {
|
|
6
|
+
readonly ledger: PluginLedger;
|
|
7
|
+
readonly shell?: DshShell | undefined;
|
|
8
|
+
readonly force?: boolean;
|
|
9
|
+
}): Promise<readonly InstalledPlugin[]>;
|
|
10
|
+
export declare function pluginRoutes(options: {
|
|
11
|
+
readonly ledger: PluginLedger;
|
|
12
|
+
readonly shell?: DshShell | undefined;
|
|
13
|
+
}): RouteTable;
|
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
import type { WorkspaceStore } from '@dsh-workbench/shared/host';
|
|
2
2
|
import type { UnitManifest } from '@dsh-workbench/shared';
|
|
3
|
-
import { type PanelEntry } from './config';
|
|
3
|
+
import { type BoardTarget, type PanelEntry, type ScopeBoards } from './config';
|
|
4
4
|
export declare const PANELS_MODULE_ID = "panels";
|
|
5
5
|
export declare const PANELS_FILE = "config.json";
|
|
6
6
|
export declare const RELEASED_FILE = "released.json";
|
|
7
7
|
export interface PanelsService {
|
|
8
|
-
list(workspace: string | null): PanelEntry[];
|
|
8
|
+
list(workspace: string | null, target?: BoardTarget): PanelEntry[];
|
|
9
|
+
boards(workspace: string | null): ScopeBoards;
|
|
9
10
|
isReleased(id: string): boolean;
|
|
10
11
|
release(id: string): void;
|
|
11
12
|
accept(id: string): void;
|
|
12
13
|
subscribe(listener: () => void): () => void;
|
|
13
14
|
isEnabled(id: string, workspace: string | null): boolean;
|
|
14
|
-
show(id: string, workspace: string | null): PanelEntry[];
|
|
15
|
-
hide(id: string, workspace: string | null): PanelEntry[];
|
|
16
|
-
move(id: string, index: number, workspace: string | null): PanelEntry[];
|
|
17
|
-
|
|
15
|
+
show(id: string, workspace: string | null, target?: BoardTarget): PanelEntry[];
|
|
16
|
+
hide(id: string, workspace: string | null, target?: BoardTarget): PanelEntry[];
|
|
17
|
+
move(id: string, index: number, workspace: string | null, target?: BoardTarget): PanelEntry[];
|
|
18
|
+
reset(workspace: string | null, target?: BoardTarget): PanelEntry[];
|
|
18
19
|
}
|
|
19
20
|
export declare function createPanelsService(options: {
|
|
20
21
|
manifests: () => readonly UnitManifest[];
|
|
21
22
|
store: WorkspaceStore;
|
|
23
|
+
owned?: (() => readonly string[]) | undefined;
|
|
22
24
|
logger?: {
|
|
23
25
|
warn?(message: string): void;
|
|
24
26
|
} | undefined;
|