@dsh-workbench/core 0.1.18 → 0.2.1
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 +2241 -955
- package/dist/client/client.body.js +2241 -955
- package/dist/client/index.js +2242 -956
- package/dist/host/index.js +1840 -332
- package/dist/types/app/client.d.ts +225 -81
- package/dist/types/app/layouts/__tests__/async-feedback.test.d.ts +1 -0
- 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 +3 -8
- package/dist/types/app/layouts/market/use-module-versions.d.ts +2 -1
- package/dist/types/app/layouts/rightbar/MarketView.d.ts +7 -1
- package/dist/types/app/layouts/rightbar/ModulesPage.d.ts +4 -2
- package/dist/types/app/layouts/rightbar/PanelGroupRows.d.ts +10 -0
- package/dist/types/app/layouts/rightbar/PanelModules.d.ts +2 -2
- package/dist/types/app/layouts/rightbar/PanelRowControls.d.ts +13 -0
- package/dist/types/app/layouts/rightbar/__tests__/market-catalog.test.d.ts +1 -0
- package/dist/types/app/layouts/rightbar/__tests__/market-dots.test.d.ts +1 -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-state-rules.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-dismiss.test.d.ts +1 -0
- package/dist/types/app/layouts/rightbar/__tests__/panel-drag-target.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/__tests__/panel-write.test.d.ts +1 -0
- package/dist/types/app/layouts/rightbar/board-selection.d.ts +20 -0
- package/dist/types/app/layouts/rightbar/dsh-borrow.d.ts +15 -0
- package/dist/types/app/layouts/rightbar/dsh-borrow.test.d.ts +1 -0
- package/dist/types/app/layouts/rightbar/dsh-surface.d.ts +11 -0
- package/dist/types/app/layouts/rightbar/dsh-surface.test.d.ts +1 -0
- package/dist/types/app/layouts/rightbar/market-act.d.ts +21 -0
- package/dist/types/app/layouts/rightbar/market-installed-mock.d.ts +9 -0
- package/dist/types/app/layouts/rightbar/market-mock-types.d.ts +58 -0
- package/dist/types/app/layouts/rightbar/market-mock.d.ts +2 -43
- 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 +37 -0
- package/dist/types/app/layouts/rightbar/market-rows.d.ts +13 -53
- 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-shared-rows.d.ts +21 -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-dismiss.d.ts +2 -0
- package/dist/types/app/layouts/rightbar/panel-mock.d.ts +3 -2
- package/dist/types/app/layouts/rightbar/panel-write.d.ts +15 -0
- package/dist/types/app/layouts/rightbar/use-drag-listeners.d.ts +6 -0
- package/dist/types/app/layouts/rightbar/use-panels.d.ts +15 -1
- package/dist/types/app/layouts/sidebar/__tests__/session-row-ui.test.d.ts +1 -0
- package/dist/types/app/units/registry.d.ts +5 -2
- package/dist/types/modules/panels/__tests__/diy-harness.d.ts +19 -0
- package/dist/types/modules/panels/__tests__/diy-report.test.d.ts +1 -0
- package/dist/types/modules/panels/__tests__/diy-tools-health.test.d.ts +1 -0
- package/dist/types/modules/panels/__tests__/diy-tools-panel.test.d.ts +1 -0
- 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 +23 -3
- package/dist/types/modules/panels/model/diy-report.d.ts +63 -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__/approval-note-injection.test.d.ts +1 -0
- package/dist/types/shared/api/host/__tests__/panel-state-route.test.d.ts +1 -0
- 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 +12 -0
- package/dist/types/shared/api/host/mount-units.d.ts +1 -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 +9 -0
- package/dist/types/shared/api/unit-manifests.d.ts +1 -0
- package/dist/types/shared/components/PanelFoot.d.ts +1 -1
- package/dist/types/shared/hooks/panel-state-report.d.ts +13 -0
- package/dist/types/shared/hooks/panel-state-report.test.d.ts +1 -0
- package/docs/HANDOFF.md +7 -0
- package/package.json +2 -2
- package/preset/diy.patch.yml +5 -26
- package/skills/workbench-module-diy/REVIEW.md +22 -0
- package/skills/workbench-module-diy/SKILL.md +3 -1
- package/skills/workbench-module-diy/TOOLING.md +2 -0
|
@@ -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,12 +10,13 @@ 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;
|
|
16
17
|
readonly drag?: {
|
|
17
18
|
readonly from: number;
|
|
18
|
-
readonly over: number;
|
|
19
|
+
readonly over: number | null;
|
|
19
20
|
readonly at?: {
|
|
20
21
|
readonly x: number;
|
|
21
22
|
readonly y: number;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const PANEL_SETTLE_MS = 4000;
|
|
2
|
+
export interface BoardSignRow {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly shown: boolean;
|
|
5
|
+
readonly source: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function panelBoardSignature(units: readonly BoardSignRow[], plugins: readonly BoardSignRow[], own: boolean): string;
|
|
8
|
+
export declare function machineBoardSignature(defaults: readonly string[], changed: Readonly<Record<string, number>>): string;
|
|
9
|
+
export declare function nextPending(pending: string | null, signature: string): string | null;
|
|
10
|
+
export interface BoardSettle {
|
|
11
|
+
readonly pending: boolean;
|
|
12
|
+
begin(): void;
|
|
13
|
+
clear(): void;
|
|
14
|
+
}
|
|
15
|
+
export declare function useBoardSettle(signature: string): BoardSettle;
|
|
@@ -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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,19 +3,22 @@ import type { BoardModule, UnitClientFace } from '@dsh-workbench/shared';
|
|
|
3
3
|
import { type BoardRegistry } from '../layouts/rightbar/registry';
|
|
4
4
|
export interface ClientUnitRefusal {
|
|
5
5
|
readonly unit: string;
|
|
6
|
+
readonly kind: ClientRefusalKind;
|
|
6
7
|
readonly reasons: readonly string[];
|
|
7
8
|
}
|
|
9
|
+
export type ClientRefusalKind = 'no-manifest' | 'withdrawn' | 'old-shape';
|
|
8
10
|
export interface ClientUnitRegistry {
|
|
9
11
|
register(face: UnitClientFace): () => void;
|
|
10
12
|
all(): readonly UnitClientFace[];
|
|
11
13
|
manifests(): readonly UnitManifest[];
|
|
14
|
+
installable(): ReadonlySet<string> | null;
|
|
12
15
|
refusals(): readonly ClientUnitRefusal[];
|
|
13
|
-
setManifests(manifests: readonly UnitManifest[]): void;
|
|
16
|
+
setManifests(manifests: readonly UnitManifest[], installable?: readonly string[]): void;
|
|
14
17
|
readonly board: BoardRegistry;
|
|
15
18
|
subscribe(listener: () => void): () => void;
|
|
16
19
|
version(): number;
|
|
17
20
|
}
|
|
18
|
-
export declare function toBoardModule(face: UnitClientFace, manifest: UnitManifest): BoardModule;
|
|
21
|
+
export declare function toBoardModule(face: UnitClientFace, manifest: UnitManifest): BoardModule | undefined;
|
|
19
22
|
export declare function createClientUnitRegistry(options?: {
|
|
20
23
|
readonly onUnknownUnit?: (unit: string) => void;
|
|
21
24
|
}): ClientUnitRegistry;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { UnitManifest } from '@dsh-workbench/shared';
|
|
2
|
+
import { type PanelStateStore } from '@dsh-workbench/shared/host';
|
|
2
3
|
import type { BundleInstallOutcome } from '../model/market';
|
|
3
4
|
import { panelsUnit } from '../unit';
|
|
4
5
|
export type Application = 'applied' | 'restart-required' | 'overridden' | 'cancelled' | 'failed';
|
|
@@ -38,6 +39,13 @@ export declare function createDiyRig(): {
|
|
|
38
39
|
outcome?: BundleInstallOutcome;
|
|
39
40
|
withTools?: boolean;
|
|
40
41
|
probe?: readonly ProbeStep[];
|
|
42
|
+
mounted?: readonly string[];
|
|
43
|
+
refused?: readonly {
|
|
44
|
+
unit: string;
|
|
45
|
+
reasons: readonly string[];
|
|
46
|
+
}[];
|
|
47
|
+
failures?: Readonly<Record<string, string>>;
|
|
48
|
+
panelState?: PanelStateStore;
|
|
41
49
|
}) => {
|
|
42
50
|
specs: string[];
|
|
43
51
|
registered: {
|
|
@@ -45,6 +53,17 @@ export declare function createDiyRig(): {
|
|
|
45
53
|
execute: (args: unknown, exec?: unknown) => Promise<unknown>;
|
|
46
54
|
}[];
|
|
47
55
|
panels: import("../model/service").PanelsService;
|
|
56
|
+
panelState: PanelStateStore;
|
|
57
|
+
registry: {
|
|
58
|
+
all: () => {
|
|
59
|
+
unit: string;
|
|
60
|
+
}[];
|
|
61
|
+
refusals: () => readonly {
|
|
62
|
+
unit: string;
|
|
63
|
+
reasons: readonly string[];
|
|
64
|
+
}[];
|
|
65
|
+
failureOf: (unit: string) => string | undefined;
|
|
66
|
+
};
|
|
48
67
|
disposers: (() => void)[];
|
|
49
68
|
commands: string[];
|
|
50
69
|
};
|
|
@@ -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,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 {};
|
|
@@ -3,6 +3,7 @@ export type PanelList = readonly string[];
|
|
|
3
3
|
export interface PanelBoard {
|
|
4
4
|
readonly shown: PanelList;
|
|
5
5
|
readonly hidden: PanelList;
|
|
6
|
+
readonly order?: PanelList | undefined;
|
|
6
7
|
}
|
|
7
8
|
export declare const EMPTY_BOARD: PanelBoard;
|
|
8
9
|
export interface ScopeBoards {
|
|
@@ -16,6 +17,8 @@ export interface ScopeQuery {
|
|
|
16
17
|
readonly id: string;
|
|
17
18
|
readonly boards: ScopeBoards;
|
|
18
19
|
}
|
|
20
|
+
export declare function overrideOf(board: PanelBoard | null, id: string): boolean | undefined;
|
|
21
|
+
export declare function defaultOf(board: PanelBoard | null, id: string): boolean;
|
|
19
22
|
export declare function resolveScope(query: ScopeQuery): boolean;
|
|
20
23
|
export interface PanelEntry {
|
|
21
24
|
readonly id: string;
|
|
@@ -27,10 +30,27 @@ export interface PanelEntry {
|
|
|
27
30
|
}
|
|
28
31
|
export declare function parseBoard(raw: unknown): PanelBoard;
|
|
29
32
|
export declare function parseReleased(raw: unknown): string[];
|
|
30
|
-
export declare function resolvePanels(manifests: readonly UnitManifest[], boards: ScopeBoards): PanelEntry[];
|
|
33
|
+
export declare function resolvePanels(manifests: readonly UnitManifest[], boards: ScopeBoards, owned?: ReadonlySet<string>): PanelEntry[];
|
|
34
|
+
export interface PanelPluginRef {
|
|
35
|
+
readonly pkg: string;
|
|
36
|
+
readonly title: string;
|
|
37
|
+
readonly name?: string | undefined;
|
|
38
|
+
}
|
|
39
|
+
export interface PanelPluginEntry {
|
|
40
|
+
readonly id: string;
|
|
41
|
+
readonly pkg: string;
|
|
42
|
+
readonly title: string;
|
|
43
|
+
readonly name?: string | undefined;
|
|
44
|
+
readonly order: number;
|
|
45
|
+
readonly shown: boolean;
|
|
46
|
+
readonly source: 'default' | 'user';
|
|
47
|
+
}
|
|
48
|
+
export declare const PLUGIN_PANEL_PREFIX = "plugin:";
|
|
49
|
+
export declare function pluginPanelId(pkg: string): string;
|
|
50
|
+
export declare function resolvePluginPanels(plugins: readonly PanelPluginRef[], boards: ScopeBoards): PanelPluginEntry[];
|
|
31
51
|
export declare function withoutReleased(released: PanelList, id: string): string[];
|
|
32
52
|
export declare function withReleased(released: PanelList, id: string): string[];
|
|
33
|
-
export declare function withShown(board: PanelBoard, id: string): PanelBoard;
|
|
53
|
+
export declare function withShown(board: PanelBoard, id: string, visible?: PanelList): PanelBoard;
|
|
34
54
|
export declare function withHidden(board: PanelBoard, id: string): PanelBoard;
|
|
35
55
|
export declare function withoutPanel(board: PanelBoard, id: string): PanelBoard;
|
|
36
|
-
export declare function withMoved(board: PanelBoard, id: string, index: number): PanelBoard;
|
|
56
|
+
export declare function withMoved(board: PanelBoard, id: string, index: number, visible: PanelList): PanelBoard;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { PanelUnitReport } from '@dsh-workbench/shared';
|
|
2
|
+
import type { WorkshopModule } from '../../../shared/api/host/diy-workshop';
|
|
3
|
+
export interface SuiteHealth {
|
|
4
|
+
readonly state: 'ok' | 'failed' | 'absent';
|
|
5
|
+
readonly reason?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface RegistryLike {
|
|
8
|
+
all(): readonly {
|
|
9
|
+
readonly unit: string;
|
|
10
|
+
}[];
|
|
11
|
+
refusals(): readonly {
|
|
12
|
+
readonly unit: string;
|
|
13
|
+
readonly reasons: readonly string[];
|
|
14
|
+
}[];
|
|
15
|
+
failureOf(unit: string): string | undefined;
|
|
16
|
+
}
|
|
17
|
+
export declare function healthOf(options: {
|
|
18
|
+
readonly registry: RegistryLike | undefined;
|
|
19
|
+
readonly unit: string;
|
|
20
|
+
readonly installed: boolean;
|
|
21
|
+
}): SuiteHealth;
|
|
22
|
+
export declare function ageText(at: number, now: number): string;
|
|
23
|
+
export declare function stampOf(at: number): string;
|
|
24
|
+
export declare function readText(read: PanelUnitReport['cards'][number], now: number): string;
|
|
25
|
+
export declare function renderPanel(options: {
|
|
26
|
+
readonly packagesDir: string;
|
|
27
|
+
readonly workspace: string | null;
|
|
28
|
+
readonly rows: readonly {
|
|
29
|
+
readonly unit: string;
|
|
30
|
+
readonly name: string;
|
|
31
|
+
readonly health: SuiteHealth;
|
|
32
|
+
readonly report?: PanelUnitReport;
|
|
33
|
+
}[];
|
|
34
|
+
readonly board: readonly string[];
|
|
35
|
+
readonly at: number;
|
|
36
|
+
readonly now: number;
|
|
37
|
+
}): string;
|
|
38
|
+
export interface ModuleStatus {
|
|
39
|
+
readonly unit: string;
|
|
40
|
+
readonly name: string;
|
|
41
|
+
readonly dir: string;
|
|
42
|
+
readonly installed: boolean;
|
|
43
|
+
readonly known: boolean;
|
|
44
|
+
readonly open: boolean;
|
|
45
|
+
readonly artifacts: readonly {
|
|
46
|
+
readonly path: string;
|
|
47
|
+
readonly at: string | null;
|
|
48
|
+
}[];
|
|
49
|
+
readonly stale: boolean;
|
|
50
|
+
readonly health: SuiteHealth;
|
|
51
|
+
readonly next: string;
|
|
52
|
+
}
|
|
53
|
+
export declare function statusOf(options: {
|
|
54
|
+
readonly dir: string;
|
|
55
|
+
readonly unit: string;
|
|
56
|
+
readonly name: string;
|
|
57
|
+
readonly installed: boolean;
|
|
58
|
+
readonly known: boolean;
|
|
59
|
+
readonly open: boolean;
|
|
60
|
+
readonly health: SuiteHealth;
|
|
61
|
+
}): ModuleStatus;
|
|
62
|
+
export declare function renderStatus(packagesDir: string, lines: readonly ModuleStatus[]): string;
|
|
63
|
+
export declare function renderList(packagesDir: string, modules: readonly WorkshopModule[]): string;
|
|
@@ -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;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import type { BoardTarget } from './config';
|
|
1
2
|
import type { PanelsService } from './service';
|
|
2
3
|
export declare const PANELS_PREF_RESOURCE = "panels";
|
|
3
4
|
export interface PanelsPrefAction {
|
|
4
|
-
readonly action: 'show' | 'hide' | '
|
|
5
|
+
readonly action: 'show' | 'hide' | 'move' | 'reset' | 'follow';
|
|
5
6
|
readonly id?: string;
|
|
6
7
|
readonly index?: number;
|
|
7
8
|
readonly path?: string;
|
|
9
|
+
readonly scope?: BoardTarget;
|
|
8
10
|
}
|
|
9
11
|
export declare function parsePanelsPrefAction(payload: unknown): PanelsPrefAction;
|
|
10
12
|
export declare function applyPanelsPref(panels: PanelsService, payload: unknown): {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { WorkspaceStore } from '@dsh-workbench/shared/host';
|
|
2
2
|
import type { UnitManifest } from '@dsh-workbench/shared';
|
|
3
|
-
import { type BoardTarget, type PanelEntry, type ScopeBoards } from './config';
|
|
3
|
+
import { type BoardTarget, type PanelEntry, type PanelPluginEntry, type PanelPluginRef, 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
8
|
list(workspace: string | null, target?: BoardTarget): PanelEntry[];
|
|
9
|
+
listPlugins(workspace: string | null, target?: BoardTarget): PanelPluginEntry[];
|
|
9
10
|
boards(workspace: string | null): ScopeBoards;
|
|
10
11
|
isReleased(id: string): boolean;
|
|
11
12
|
release(id: string): void;
|
|
@@ -16,11 +17,14 @@ export interface PanelsService {
|
|
|
16
17
|
hide(id: string, workspace: string | null, target?: BoardTarget): PanelEntry[];
|
|
17
18
|
move(id: string, index: number, workspace: string | null, target?: BoardTarget): PanelEntry[];
|
|
18
19
|
reset(workspace: string | null, target?: BoardTarget): PanelEntry[];
|
|
20
|
+
follow(workspace: string | null, id?: string): PanelEntry[];
|
|
21
|
+
changedBy(): ReadonlyMap<string, number>;
|
|
19
22
|
}
|
|
20
23
|
export declare function createPanelsService(options: {
|
|
21
24
|
manifests: () => readonly UnitManifest[];
|
|
22
25
|
store: WorkspaceStore;
|
|
23
26
|
owned?: (() => readonly string[]) | undefined;
|
|
27
|
+
plugins?: (() => readonly PanelPluginRef[]) | undefined;
|
|
24
28
|
logger?: {
|
|
25
29
|
warn?(message: string): void;
|
|
26
30
|
} | undefined;
|
|
@@ -26,7 +26,14 @@ export interface BundleInspectionRefused {
|
|
|
26
26
|
readonly reason: string;
|
|
27
27
|
readonly registries?: readonly BundleRegistry[];
|
|
28
28
|
}
|
|
29
|
-
export
|
|
29
|
+
export interface BundleInspectionPlugin {
|
|
30
|
+
readonly status: 'plugin';
|
|
31
|
+
readonly pkg: string;
|
|
32
|
+
readonly registry: BundleRegistry;
|
|
33
|
+
readonly pluginName?: string;
|
|
34
|
+
readonly version?: string;
|
|
35
|
+
}
|
|
36
|
+
export type BundleInspection = BundleInspectionAccepted | BundleInspectionRefused | BundleInspectionPlugin;
|
|
30
37
|
export interface BundleRegistriesPayload {
|
|
31
38
|
readonly available: boolean;
|
|
32
39
|
readonly registries: BundleRegistries | null;
|
|
@@ -100,6 +107,13 @@ export interface ModuleVersion {
|
|
|
100
107
|
readonly local?: boolean;
|
|
101
108
|
readonly refused?: readonly string[];
|
|
102
109
|
}
|
|
110
|
+
export interface WorkbenchVersion {
|
|
111
|
+
readonly pkg: string;
|
|
112
|
+
readonly installed: string;
|
|
113
|
+
readonly latest?: string;
|
|
114
|
+
readonly local?: boolean;
|
|
115
|
+
}
|
|
103
116
|
export interface ModuleVersionsPayload {
|
|
104
117
|
readonly modules: readonly ModuleVersion[];
|
|
118
|
+
readonly workbench?: WorkbenchVersion;
|
|
105
119
|
}
|
|
@@ -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,4 +1,5 @@
|
|
|
1
1
|
import type { DshHostContext } from '@dsh-workbench/shared';
|
|
2
|
+
import type { UnitDeclarationSource } from './unit-registry';
|
|
2
3
|
export type InstalledModule = {
|
|
3
4
|
readonly kind: 'module';
|
|
4
5
|
readonly pkg: string;
|
|
@@ -24,10 +25,21 @@ export interface ProfileModule {
|
|
|
24
25
|
}
|
|
25
26
|
export declare function profileManifestOf(profileDir: string | null): Readonly<Record<string, unknown>> | undefined;
|
|
26
27
|
export declare function profileModules(profileDir: string | null): readonly ProfileModule[];
|
|
28
|
+
export declare function createDeclarationLookup(profileDir: string | null): (unit: string) => UnitDeclarationSource | undefined;
|
|
27
29
|
export declare function moduleDeclarationOf(profileDir: string | null, pkg: string): unknown;
|
|
28
30
|
export interface DeclarationGap {
|
|
29
31
|
readonly pkg: string;
|
|
30
32
|
readonly problems: readonly string[];
|
|
31
33
|
}
|
|
32
34
|
export declare function declarationGaps(profileDir: string | null): readonly DeclarationGap[] | undefined;
|
|
35
|
+
export declare function declaredPluginCommands(profileDir: string | null): ReadonlyMap<string, ReadonlySet<string>>;
|
|
33
36
|
export declare function readInstalledModule(profileDir: string | null, pkg: string): InstalledModule;
|
|
37
|
+
export declare function isLocalDependencySpec(spec: string): boolean;
|
|
38
|
+
export interface ProfilePackage {
|
|
39
|
+
readonly pkg: string;
|
|
40
|
+
readonly version: string;
|
|
41
|
+
readonly registry?: string;
|
|
42
|
+
readonly local?: boolean;
|
|
43
|
+
}
|
|
44
|
+
export declare function readProfilePackage(profileDir: string | null, pkg: string): ProfilePackage | undefined;
|
|
45
|
+
export declare function packageVersionAt(packageRoot: string): string | undefined;
|
|
@@ -49,6 +49,7 @@ export declare function mountUnits(units: readonly HostUnit[], deps: {
|
|
|
49
49
|
} | undefined;
|
|
50
50
|
manifests: () => readonly UnitManifest[];
|
|
51
51
|
ownedUnits?: () => readonly string[];
|
|
52
|
+
installable?: () => readonly string[];
|
|
52
53
|
opencliCommand?: string;
|
|
53
54
|
probe?: UnitMountDeps['probe'];
|
|
54
55
|
store?: UnitMountDeps['store'];
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { DshShell } from '@dsh-workbench/shared';
|
|
2
|
+
export interface PluginCommandArg {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly type: string;
|
|
5
|
+
readonly required: boolean;
|
|
6
|
+
readonly positional: boolean;
|
|
7
|
+
readonly valueRequired: boolean;
|
|
8
|
+
readonly choices: readonly string[];
|
|
9
|
+
readonly defaultValue?: unknown;
|
|
10
|
+
readonly help: string;
|
|
11
|
+
}
|
|
12
|
+
export interface PluginCommand {
|
|
13
|
+
readonly plugin: string;
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly description: string;
|
|
16
|
+
readonly access: string;
|
|
17
|
+
readonly domain?: string;
|
|
18
|
+
readonly args: readonly PluginCommandArg[];
|
|
19
|
+
}
|
|
20
|
+
export interface PluginCommandSet {
|
|
21
|
+
readonly plugin: string;
|
|
22
|
+
readonly version: string;
|
|
23
|
+
readonly commands: readonly PluginCommand[];
|
|
24
|
+
}
|
|
25
|
+
export interface PluginRow {
|
|
26
|
+
readonly name: string;
|
|
27
|
+
readonly version: string;
|
|
28
|
+
readonly commands: readonly string[];
|
|
29
|
+
}
|
|
30
|
+
export interface CommandRow {
|
|
31
|
+
readonly site: string;
|
|
32
|
+
readonly name: string;
|
|
33
|
+
readonly description: string;
|
|
34
|
+
readonly access: string;
|
|
35
|
+
readonly args: readonly PluginCommandArg[];
|
|
36
|
+
}
|
|
37
|
+
export interface PluginCatalogSnapshot {
|
|
38
|
+
readonly ok: boolean;
|
|
39
|
+
readonly at: number;
|
|
40
|
+
readonly sets: readonly PluginCommandSet[];
|
|
41
|
+
readonly problems: readonly string[];
|
|
42
|
+
}
|
|
43
|
+
export interface PluginCatalog {
|
|
44
|
+
refresh(options?: {
|
|
45
|
+
readonly force?: boolean;
|
|
46
|
+
}): Promise<PluginCatalogSnapshot>;
|
|
47
|
+
snapshot(): PluginCatalogSnapshot;
|
|
48
|
+
}
|
|
49
|
+
export interface PluginCatalogOptions {
|
|
50
|
+
readonly shell?: DshShell | undefined;
|
|
51
|
+
readonly command: string;
|
|
52
|
+
readonly timeoutMs?: number;
|
|
53
|
+
}
|
|
54
|
+
export declare function parsePluginRows(stdout: string): PluginRow[] | undefined;
|
|
55
|
+
export declare function parseCommandRows(stdout: string): CommandRow[] | undefined;
|
|
56
|
+
export declare function attributeCommands(plugins: readonly PluginRow[], rows: readonly CommandRow[]): {
|
|
57
|
+
readonly sets: PluginCommandSet[];
|
|
58
|
+
readonly problems: string[];
|
|
59
|
+
};
|
|
60
|
+
export declare function createPluginCatalog(options: PluginCatalogOptions): PluginCatalog;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ApprovalDetail, ApprovalPolicy } from '@dsh-workbench/shared/host';
|
|
2
|
+
import type { PluginCommand } from './plugin-catalog';
|
|
3
|
+
export declare function pluginToolName(plugin: string, command: string): string;
|
|
4
|
+
export declare function pluginToolParameters(command: PluginCommand): Record<string, unknown>;
|
|
5
|
+
export declare function pluginToolDescription(command: PluginCommand): string;
|
|
6
|
+
export declare function pluginToolWrites(command: PluginCommand): boolean;
|
|
7
|
+
export declare function pluginToolArgv(command: PluginCommand, raw: unknown): string[];
|
|
8
|
+
export declare function pluginKeyArgs(command: PluginCommand, raw: unknown): string;
|
|
9
|
+
export declare function pluginApprovalQuestion(command: PluginCommand, raw: unknown): ApprovalDetail;
|
|
10
|
+
export declare function pluginApprovalFor(command: PluginCommand): ApprovalPolicy;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Opencli } from '@dsh-workbench/shared/host';
|
|
2
|
+
import type { PluginCatalog } from './plugin-catalog';
|
|
3
|
+
import type { UnitRegistry } from './unit-registry';
|
|
4
|
+
export interface PluginRowRef {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly pkg: string;
|
|
7
|
+
readonly name?: string | undefined;
|
|
8
|
+
}
|
|
9
|
+
export interface PluginRowsSource {
|
|
10
|
+
listPlugins(workspace: string | null): readonly PluginRowRef[];
|
|
11
|
+
subscribe?(listener: () => void): () => void;
|
|
12
|
+
}
|
|
13
|
+
export interface PluginUnitRow {
|
|
14
|
+
readonly plugin: string;
|
|
15
|
+
readonly pkg: string;
|
|
16
|
+
readonly version: string;
|
|
17
|
+
readonly commands: number;
|
|
18
|
+
readonly synthesized: number;
|
|
19
|
+
readonly tools: readonly string[];
|
|
20
|
+
}
|
|
21
|
+
export interface PluginUnitReport {
|
|
22
|
+
readonly ok: boolean;
|
|
23
|
+
readonly at: number;
|
|
24
|
+
readonly plugins: readonly PluginUnitRow[];
|
|
25
|
+
readonly problems: readonly string[];
|
|
26
|
+
}
|
|
27
|
+
export interface PluginUnits {
|
|
28
|
+
refresh(options?: {
|
|
29
|
+
readonly force?: boolean;
|
|
30
|
+
}): Promise<PluginUnitReport>;
|
|
31
|
+
touch(): void;
|
|
32
|
+
report(): PluginUnitReport;
|
|
33
|
+
dispose(): void;
|
|
34
|
+
}
|
|
35
|
+
export interface PluginUnitsOptions {
|
|
36
|
+
readonly registry: UnitRegistry;
|
|
37
|
+
readonly catalog: PluginCatalog;
|
|
38
|
+
readonly rows: () => readonly PluginRowRef[];
|
|
39
|
+
readonly declared: (plugin: string) => ReadonlySet<string>;
|
|
40
|
+
readonly opencliFor: (plugin: string) => Opencli;
|
|
41
|
+
readonly toolNames?: () => ReadonlySet<string>;
|
|
42
|
+
readonly logger?: {
|
|
43
|
+
info?(message: string): void;
|
|
44
|
+
warn?(message: string): void;
|
|
45
|
+
} | undefined;
|
|
46
|
+
}
|
|
47
|
+
export declare function createPluginUnits(options: PluginUnitsOptions): PluginUnits;
|