@dsh-workbench/core 0.2.0 → 0.2.2
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 +1429 -607
- package/dist/client/client.body.js +1429 -607
- package/dist/client/index.js +1430 -608
- package/dist/host/index.js +712 -158
- package/dist/types/app/client.d.ts +168 -81
- package/dist/types/app/layouts/__tests__/async-feedback.test.d.ts +1 -0
- package/dist/types/app/layouts/market/use-add-module.d.ts +1 -0
- package/dist/types/app/layouts/rightbar/MarketView.d.ts +3 -1
- package/dist/types/app/layouts/rightbar/{PanelPluginRows.d.ts → PanelGroupRows.d.ts} +3 -2
- package/dist/types/app/layouts/rightbar/PanelRowControls.d.ts +0 -1
- 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-state-rules.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-write.test.d.ts +1 -0
- package/dist/types/app/layouts/rightbar/board-selection.d.ts +9 -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-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 -48
- package/dist/types/app/layouts/rightbar/market-row-types.d.ts +4 -2
- package/dist/types/app/layouts/rightbar/market-rows.d.ts +9 -22
- package/dist/types/app/layouts/rightbar/market-section-icon.d.ts +1 -1
- package/dist/types/app/layouts/rightbar/market-shared-rows.d.ts +21 -0
- package/dist/types/app/layouts/rightbar/panel-dismiss.d.ts +2 -0
- package/dist/types/app/layouts/rightbar/panel-mock.d.ts +1 -1
- 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/sidebar/__tests__/session-row-ui.test.d.ts +1 -0
- package/dist/types/app/units/registry.d.ts +4 -1
- 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__/market-tools-harness.d.ts +42 -0
- package/dist/types/modules/panels/__tests__/market-workbench-update.test.d.ts +1 -0
- package/dist/types/modules/panels/model/config.d.ts +4 -3
- package/dist/types/modules/panels/model/diy-report.d.ts +63 -0
- 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/bundle-routes.d.ts +1 -0
- package/dist/types/shared/api/host/installed-module.d.ts +2 -0
- package/dist/types/shared/api/host/mount-units.d.ts +1 -0
- package/dist/types/shared/api/host/release.d.ts +6 -0
- package/dist/types/shared/api/host/unit-registry.d.ts +6 -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 +11 -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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -23,6 +23,7 @@ export interface AddModuleState {
|
|
|
23
23
|
readonly preview: AddModulePreview | null;
|
|
24
24
|
readonly outcome: AddModuleOutcome | null;
|
|
25
25
|
readonly failure: string | null;
|
|
26
|
+
readonly removing: boolean;
|
|
26
27
|
readonly builds: readonly string[];
|
|
27
28
|
setSpec(value: string): void;
|
|
28
29
|
setChoice(choice: RegistryChoice): void;
|
|
@@ -10,9 +10,11 @@ import type { WorkbenchVersion } from '../../../shared/api/bundle-install';
|
|
|
10
10
|
export interface MarketViewProps {
|
|
11
11
|
readonly t: Translate;
|
|
12
12
|
readonly manifests: readonly UnitManifest[];
|
|
13
|
+
readonly installable?: ReadonlySet<string> | null | undefined;
|
|
13
14
|
readonly capabilities: CapabilityMap | null;
|
|
14
15
|
readonly freshness: MarketFreshness;
|
|
15
16
|
readonly onChanged: () => void;
|
|
17
|
+
readonly onPending?: ((pending: boolean) => void) | undefined;
|
|
16
18
|
readonly updates?: ModuleUpdateMap | undefined;
|
|
17
19
|
readonly installed?: readonly InstalledWorkbenchModule[] | undefined;
|
|
18
20
|
readonly installedRead?: boolean | undefined;
|
|
@@ -23,4 +25,4 @@ export interface MarketViewProps {
|
|
|
23
25
|
readonly defaults?: readonly string[] | undefined;
|
|
24
26
|
readonly changed?: Readonly<Record<string, number>> | undefined;
|
|
25
27
|
}
|
|
26
|
-
export declare function MarketView({ t, manifests, capabilities, freshness, onChanged, updates, installed, installedRead, workbench, plugins, settling, mock, defaults, changed, }: MarketViewProps): JSX.Element;
|
|
28
|
+
export declare function MarketView({ t, manifests, installable, capabilities, freshness, onChanged, onPending, updates, installed, installedRead, workbench, plugins, settling, mock, defaults, changed, }: MarketViewProps): JSX.Element;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { Translate } from '@dsh-workbench/shared';
|
|
2
2
|
import type { PanelRow } from './board-selection';
|
|
3
|
-
export interface
|
|
3
|
+
export interface PanelGroupRowsProps {
|
|
4
4
|
readonly t: Translate;
|
|
5
5
|
readonly rows: readonly PanelRow[];
|
|
6
|
+
readonly titleKey: string;
|
|
6
7
|
readonly busy: boolean;
|
|
7
8
|
readonly onWrite: (body: Record<string, unknown>) => void;
|
|
8
9
|
}
|
|
9
|
-
export declare function
|
|
10
|
+
export declare function PanelGroupRows({ t, rows, titleKey, busy, onWrite }: PanelGroupRowsProps): JSX.Element | null;
|
|
@@ -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 {};
|
|
@@ -11,12 +11,21 @@ export interface PanelRow {
|
|
|
11
11
|
readonly titleKey?: string;
|
|
12
12
|
readonly title?: string;
|
|
13
13
|
readonly plugin: boolean;
|
|
14
|
+
readonly hasCard?: boolean;
|
|
14
15
|
readonly badgeKey?: string;
|
|
15
16
|
readonly shown: boolean;
|
|
16
17
|
readonly source: 'default' | 'user';
|
|
17
18
|
}
|
|
18
19
|
export declare function available(capability: CapabilityMap[string] | undefined): boolean;
|
|
19
20
|
export declare function selectPanelUnits<T extends SelectableUnit>(units: readonly T[], capabilities: CapabilityMap | null): T[];
|
|
21
|
+
export declare function panelDropTarget(rows: readonly {
|
|
22
|
+
readonly shown: boolean;
|
|
23
|
+
readonly hasCard?: boolean;
|
|
24
|
+
}[], index: number | null): number | null;
|
|
25
|
+
export declare function rowAtPoint(boxes: readonly {
|
|
26
|
+
readonly top: number;
|
|
27
|
+
readonly bottom: number;
|
|
28
|
+
}[], y: number): number | null;
|
|
20
29
|
export declare function panelBadgeKey(capability: CapabilityMap[string] | undefined): string | undefined;
|
|
21
30
|
export declare function selectPanelRows(units: readonly PanelUnit[], plugins: readonly PanelPluginUnit[], capabilities: CapabilityMap | null): PanelRow[];
|
|
22
31
|
export declare function selectBoardModules(units: readonly SelectableUnit[] | null, byId: (id: string) => BoardModule | undefined, capabilities: CapabilityMap | null): BoardModule[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { DshSidebarRight } from '@dsh-workbench/shared';
|
|
2
|
+
export interface DshBorrowHost {
|
|
3
|
+
official(): DshSidebarRight | undefined;
|
|
4
|
+
yieldColumn(): void;
|
|
5
|
+
reclaimColumn(): void;
|
|
6
|
+
}
|
|
7
|
+
export interface DshBorrow {
|
|
8
|
+
open(): boolean;
|
|
9
|
+
use(call?: () => void): void;
|
|
10
|
+
toggle(): void;
|
|
11
|
+
back(): void;
|
|
12
|
+
start(): void;
|
|
13
|
+
dispose(): void;
|
|
14
|
+
}
|
|
15
|
+
export declare function createDshBorrow(host: DshBorrowHost): DshBorrow;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const DSH_SEAT_ATTRIBUTE = "data-sidebar-right-session";
|
|
2
|
+
export interface DshSeatHost {
|
|
3
|
+
querySelector(selector: string): unknown;
|
|
4
|
+
}
|
|
5
|
+
export declare function dshSeatOnScreen(host: DshSeatHost | undefined): boolean;
|
|
6
|
+
export declare const DSH_SURFACE_POLL_MS = 60;
|
|
7
|
+
export interface DshSurfaceWatch {
|
|
8
|
+
arm(): void;
|
|
9
|
+
disarm(): void;
|
|
10
|
+
}
|
|
11
|
+
export declare function createDshSurfaceWatch(read: () => boolean, onReady: () => void, intervalMs: number): DshSurfaceWatch;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { UnitManifest } from '@dsh-workbench/shared';
|
|
2
|
+
import type { CapabilityMap } from '../../../shared/hooks/use-capabilities';
|
|
3
|
+
import type { MarketMock } from './market-mock-types';
|
|
4
|
+
export declare function installedMocks(input: {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly found: UnitManifest;
|
|
7
|
+
readonly mine: UnitManifest;
|
|
8
|
+
readonly probe: (unit: string, status: CapabilityMap[string]['status'], extra?: Partial<CapabilityMap[string]>) => CapabilityMap;
|
|
9
|
+
}): readonly MarketMock[];
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { InstalledWorkbenchModule } from './market-rows';
|
|
2
|
+
import type { InstalledPlugin } from '../../../shared/api/installed-plugins';
|
|
3
|
+
import type { UnitManifest } from '@dsh-workbench/shared';
|
|
4
|
+
import type { MarketRowAction, ModuleUpdateMap } from './market-rows';
|
|
5
|
+
import type { CapabilityMap } from '../../../shared/hooks/use-capabilities';
|
|
6
|
+
import type { MarketState } from './market-rows';
|
|
7
|
+
import type { WorkbenchVersion } from '../../../shared/api/bundle-install';
|
|
8
|
+
export interface MarketMockExpect {
|
|
9
|
+
readonly rows: number;
|
|
10
|
+
readonly state?: MarketState;
|
|
11
|
+
readonly actions?: readonly MarketRowAction[];
|
|
12
|
+
readonly titleChars?: number;
|
|
13
|
+
readonly shared?: number;
|
|
14
|
+
readonly installed?: number;
|
|
15
|
+
readonly installedState?: MarketState;
|
|
16
|
+
readonly installedActions?: readonly MarketRowAction[];
|
|
17
|
+
readonly installedNote?: boolean;
|
|
18
|
+
readonly installedHint?: string;
|
|
19
|
+
readonly sharedActions?: readonly MarketRowAction[];
|
|
20
|
+
readonly plugins?: number;
|
|
21
|
+
readonly pluginActions?: readonly MarketRowAction[];
|
|
22
|
+
readonly pluginNote?: boolean;
|
|
23
|
+
readonly pluginNoteKey?: 'panels.market.pluginBroken';
|
|
24
|
+
readonly pluginState?: MarketState;
|
|
25
|
+
readonly notice?: boolean;
|
|
26
|
+
readonly local?: boolean;
|
|
27
|
+
readonly noteKey?: 'panels.market.needCommands';
|
|
28
|
+
readonly version?: {
|
|
29
|
+
readonly installed?: string;
|
|
30
|
+
readonly latest?: string;
|
|
31
|
+
};
|
|
32
|
+
readonly workbenchState?: MarketState;
|
|
33
|
+
readonly workbenchActions?: readonly MarketRowAction[];
|
|
34
|
+
readonly workbenchNoteKey?: 'panels.market.workbenchLocal';
|
|
35
|
+
}
|
|
36
|
+
export interface MarketMock {
|
|
37
|
+
readonly id: string;
|
|
38
|
+
readonly label: string;
|
|
39
|
+
readonly manifests: readonly UnitManifest[];
|
|
40
|
+
readonly capabilities: CapabilityMap | null;
|
|
41
|
+
readonly pending?: {
|
|
42
|
+
readonly id: string;
|
|
43
|
+
readonly action: MarketRowAction;
|
|
44
|
+
};
|
|
45
|
+
readonly updates?: ModuleUpdateMap;
|
|
46
|
+
readonly installed?: readonly InstalledWorkbenchModule[];
|
|
47
|
+
readonly workbench?: WorkbenchVersion;
|
|
48
|
+
readonly installedRead?: boolean;
|
|
49
|
+
readonly plugins?: readonly InstalledPlugin[];
|
|
50
|
+
readonly loaded?: boolean;
|
|
51
|
+
readonly confirming?: string;
|
|
52
|
+
readonly failure?: {
|
|
53
|
+
readonly id: string;
|
|
54
|
+
readonly message: string;
|
|
55
|
+
};
|
|
56
|
+
readonly notice?: string;
|
|
57
|
+
readonly expect: MarketMockExpect;
|
|
58
|
+
}
|
|
@@ -1,50 +1,4 @@
|
|
|
1
|
-
import type { InstalledWorkbenchModule } from './market-rows';
|
|
2
|
-
import type { InstalledPlugin } from '../../../shared/api/installed-plugins';
|
|
3
1
|
import type { UnitManifest } from '@dsh-workbench/shared';
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
import type { MarketState } from './market-rows';
|
|
7
|
-
import type { WorkbenchVersion } from '../../../shared/api/bundle-install';
|
|
8
|
-
export interface MarketMockExpect {
|
|
9
|
-
readonly rows: number;
|
|
10
|
-
readonly state?: MarketState;
|
|
11
|
-
readonly actions?: readonly MarketRowAction[];
|
|
12
|
-
readonly titleChars?: number;
|
|
13
|
-
readonly shared?: number;
|
|
14
|
-
readonly installed?: number;
|
|
15
|
-
readonly installedActions?: readonly MarketRowAction[];
|
|
16
|
-
readonly installedNote?: boolean;
|
|
17
|
-
readonly sharedActions?: readonly MarketRowAction[];
|
|
18
|
-
readonly plugins?: number;
|
|
19
|
-
readonly pluginActions?: readonly MarketRowAction[];
|
|
20
|
-
readonly pluginNote?: boolean;
|
|
21
|
-
readonly pluginNoteKey?: 'panels.market.pluginBroken';
|
|
22
|
-
readonly notice?: boolean;
|
|
23
|
-
readonly workbenchState?: MarketState;
|
|
24
|
-
readonly workbenchActions?: readonly MarketRowAction[];
|
|
25
|
-
readonly workbenchNoteKey?: 'panels.market.workbenchLocal';
|
|
26
|
-
}
|
|
27
|
-
export interface MarketMock {
|
|
28
|
-
readonly id: string;
|
|
29
|
-
readonly label: string;
|
|
30
|
-
readonly manifests: readonly UnitManifest[];
|
|
31
|
-
readonly capabilities: CapabilityMap | null;
|
|
32
|
-
readonly pending?: {
|
|
33
|
-
readonly id: string;
|
|
34
|
-
readonly action: MarketRowAction;
|
|
35
|
-
};
|
|
36
|
-
readonly updates?: ModuleUpdateMap;
|
|
37
|
-
readonly installed?: readonly InstalledWorkbenchModule[];
|
|
38
|
-
readonly workbench?: WorkbenchVersion;
|
|
39
|
-
readonly installedRead?: boolean;
|
|
40
|
-
readonly plugins?: readonly InstalledPlugin[];
|
|
41
|
-
readonly loaded?: boolean;
|
|
42
|
-
readonly confirming?: string;
|
|
43
|
-
readonly failure?: {
|
|
44
|
-
readonly id: string;
|
|
45
|
-
readonly message: string;
|
|
46
|
-
};
|
|
47
|
-
readonly notice?: string;
|
|
48
|
-
readonly expect: MarketMockExpect;
|
|
49
|
-
}
|
|
2
|
+
import type { MarketMock } from './market-mock-types';
|
|
3
|
+
export type { MarketMock, MarketMockExpect } from './market-mock-types';
|
|
50
4
|
export declare function buildMarketMocks(roster: readonly UnitManifest[]): readonly MarketMock[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export type MarketRowAction = 'install' | 'update' | 'update-bundle' | 'remove-bundle' | 'uninstall' | 'update-dependency' | 'update-plugin' | 'uninstall-plugin' | 'update-workbench';
|
|
2
|
+
export type MarketState = 'checking' | 'installed' | 'inactive' | 'unusable' | 'broken' | 'outdated' | 'missing' | 'unchecked' | 'unknown';
|
|
2
3
|
export interface MarketNote {
|
|
3
|
-
readonly key: 'panels.market.needEnv' | 'panels.market.noSource' | 'panels.market.badSource' | 'panels.market.moduleRefused' | 'panels.market.moduleRestartHint' | 'panels.market.pluginAlsoKnownAs' | 'panels.market.pluginBroken' | 'panels.market.workbenchLocal';
|
|
4
|
+
readonly key: 'panels.market.needEnv' | 'panels.market.noSource' | 'panels.market.badSource' | 'panels.market.needCommands' | 'panels.market.moduleRefused' | 'panels.market.moduleRestartHint' | 'panels.market.pluginAlsoKnownAs' | 'panels.market.pluginBroken' | 'panels.market.workbenchLocal';
|
|
4
5
|
readonly params: Readonly<Record<string, string>>;
|
|
5
6
|
readonly tone?: 'plain' | 'alert';
|
|
6
7
|
}
|
|
@@ -8,6 +9,7 @@ export type MarketHintKey = 'panels.market.moduleRestartHint';
|
|
|
8
9
|
export interface ModuleUpdate {
|
|
9
10
|
readonly installed: string;
|
|
10
11
|
readonly latest?: string;
|
|
12
|
+
readonly local?: boolean;
|
|
11
13
|
}
|
|
12
14
|
export interface MarketRow {
|
|
13
15
|
readonly id: string;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { ModuleVersion, WorkbenchVersion } from '../../../shared/api/bundle-install';
|
|
2
2
|
import type { Translate, UnitManifest } from '@dsh-workbench/shared';
|
|
3
|
-
import type { MarketRow, MarketState, ModuleUpdate } from './market-row-types';
|
|
4
|
-
|
|
3
|
+
import type { MarketRow, MarketRowAction, MarketState, ModuleUpdate } from './market-row-types';
|
|
4
|
+
import { type SharedRow } from './market-shared-rows';
|
|
5
5
|
import type { CapabilityMap } from '../../../shared/hooks/use-capabilities';
|
|
6
|
-
export type { MarketHintKey, MarketNote, MarketRow, MarketState, ModuleUpdate, } from './market-row-types';
|
|
6
|
+
export type { MarketHintKey, MarketNote, MarketRow, MarketRowAction, MarketState, ModuleUpdate, } from './market-row-types';
|
|
7
|
+
export type { SharedRow, SharedState } from './market-shared-rows';
|
|
8
|
+
export { SHARED_DOT, SHARED_STATE_KEY, sharedActions, sharedRows } from './market-shared-rows';
|
|
7
9
|
export declare const MARKET_STATE_KEY: Readonly<Record<MarketState, string>>;
|
|
8
|
-
export declare const MARKET_DOT: Readonly<Record<MarketState, 'ongoing' | 'done' | 'warning' | 'idle'>>;
|
|
10
|
+
export declare const MARKET_DOT: Readonly<Record<MarketState, 'ongoing' | 'done' | 'warning' | 'idle' | 'error'>>;
|
|
9
11
|
export type ModuleUpdateMap = Readonly<Record<string, ModuleUpdate>>;
|
|
10
12
|
export declare function marketRowTitle(row: MarketRow, t: Translate): string;
|
|
11
13
|
export interface InstalledWorkbenchModule {
|
|
@@ -19,12 +21,15 @@ export interface InstalledWorkbenchModule {
|
|
|
19
21
|
}
|
|
20
22
|
export declare function withClientRefusals(modules: readonly InstalledWorkbenchModule[], refusals: readonly {
|
|
21
23
|
readonly unit: string;
|
|
24
|
+
readonly kind?: string | undefined;
|
|
22
25
|
readonly reasons: readonly string[];
|
|
23
26
|
}[]): readonly InstalledWorkbenchModule[];
|
|
24
27
|
export declare function refusalReasons(host: readonly string[] | undefined, client: readonly string[] | undefined): readonly string[];
|
|
25
28
|
export declare function mergeTitles(known: ReadonlyMap<string, string>, manifests: readonly UnitManifest[]): ReadonlyMap<string, string>;
|
|
26
29
|
export declare function installedRows(modules: readonly InstalledWorkbenchModule[], manifests: readonly UnitManifest[], listed: ReadonlySet<string>, known?: ReadonlyMap<string, string> | undefined, defaults?: ReadonlySet<string>, changed?: Readonly<Record<string, number>>): MarketRow[];
|
|
30
|
+
export declare function marketSwitchLocked(row: MarketRow): boolean;
|
|
27
31
|
export declare function marketActions(row: MarketRow): MarketRowAction[];
|
|
32
|
+
export declare function marketCatalog(manifests: readonly UnitManifest[], installable: ReadonlySet<string> | null | undefined): readonly UnitManifest[];
|
|
28
33
|
export declare function liveManifests(manifests: readonly UnitManifest[], capabilities: CapabilityMap | null, installed: ReadonlySet<string> | null): readonly UnitManifest[];
|
|
29
34
|
export declare function marketHasUpdates(rows: readonly MarketRow[], shared?: readonly SharedRow[]): boolean;
|
|
30
35
|
export declare function marketUpdatesOf(modules: readonly ModuleVersion[] | null): ModuleUpdateMap;
|
|
@@ -36,21 +41,3 @@ export interface MarketSection {
|
|
|
36
41
|
}
|
|
37
42
|
export declare function marketSections(rows: readonly MarketRow[]): MarketSection[];
|
|
38
43
|
export declare function marketRows(manifests: readonly UnitManifest[], capabilities: CapabilityMap | null, updates?: ModuleUpdateMap, defaults?: ReadonlySet<string>, changed?: Readonly<Record<string, number>>): MarketRow[];
|
|
39
|
-
export type SharedState = 'checking' | 'installed' | 'outdated' | 'unsatisfied' | 'missing' | 'unchecked';
|
|
40
|
-
export declare const SHARED_STATE_KEY: Readonly<Record<SharedState, string>>;
|
|
41
|
-
export declare const SHARED_DOT: Readonly<Record<SharedState, 'ongoing' | 'done' | 'warning' | 'idle'>>;
|
|
42
|
-
export interface SharedRow {
|
|
43
|
-
readonly id: string;
|
|
44
|
-
readonly kind: 'plugin' | 'lib';
|
|
45
|
-
readonly label: string;
|
|
46
|
-
readonly usedByKeys: readonly string[];
|
|
47
|
-
readonly state: SharedState;
|
|
48
|
-
readonly canUpdate: boolean;
|
|
49
|
-
readonly version?: {
|
|
50
|
-
readonly installed?: string;
|
|
51
|
-
readonly latest?: string;
|
|
52
|
-
};
|
|
53
|
-
readonly detail?: string;
|
|
54
|
-
}
|
|
55
|
-
export declare function sharedActions(row: SharedRow): MarketRowAction[];
|
|
56
|
-
export declare function sharedRows(manifests: readonly UnitManifest[], capabilities: CapabilityMap | null): SharedRow[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type MarketSectionKind = 'installed' | 'pending' | 'plugins' | '
|
|
1
|
+
export type MarketSectionKind = 'installed' | 'pending' | 'plugins' | 'shared';
|
|
2
2
|
export declare function marketSectionIcon(kind: MarketSectionKind): import("react").FunctionComponentElement<import("@deepseek-ai/dsh-client-ui-primitives").IconProps> | import("react").FunctionComponentElement<import("@dsh-workbench/shared").IconProps>;
|
|
3
3
|
export type MarketSectionIcon = ReturnType<typeof marketSectionIcon>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { UnitManifest } from '@dsh-workbench/shared';
|
|
2
|
+
import type { CapabilityMap } from '../../../shared/hooks/use-capabilities';
|
|
3
|
+
import type { MarketRowAction } from './market-row-types';
|
|
4
|
+
export type SharedState = 'checking' | 'installed' | 'outdated' | 'unsatisfied' | 'missing' | 'unchecked';
|
|
5
|
+
export declare const SHARED_STATE_KEY: Readonly<Record<SharedState, string>>;
|
|
6
|
+
export declare const SHARED_DOT: Readonly<Record<SharedState, 'ongoing' | 'done' | 'warning' | 'idle'>>;
|
|
7
|
+
export interface SharedRow {
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly kind: 'plugin' | 'lib';
|
|
10
|
+
readonly label: string;
|
|
11
|
+
readonly usedByKeys: readonly string[];
|
|
12
|
+
readonly state: SharedState;
|
|
13
|
+
readonly canUpdate: boolean;
|
|
14
|
+
readonly version?: {
|
|
15
|
+
readonly installed?: string;
|
|
16
|
+
readonly latest?: string;
|
|
17
|
+
};
|
|
18
|
+
readonly detail?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function sharedActions(row: SharedRow): MarketRowAction[];
|
|
21
|
+
export declare function sharedRows(manifests: readonly UnitManifest[], capabilities: CapabilityMap | null): SharedRow[];
|
|
@@ -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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,14 +3,17 @@ 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;
|
|
@@ -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,42 @@
|
|
|
1
|
+
import type { UnitCapability } from '../../../shared/api/host/probe-units';
|
|
2
|
+
import type { BundleManager } from '../../../shared/api/host/bundle-manager';
|
|
3
|
+
import type { InstalledModule, ProfileModule, ProfilePackage } from '../../../shared/api/host/installed-module';
|
|
4
|
+
import type { PluginSource, UnitManifest } from '@dsh-workbench/shared';
|
|
5
|
+
import { type PluginLedger } from '../model/plugin-ledger';
|
|
6
|
+
export declare function unit(id: string, plugin: string, source?: PluginSource): UnitManifest;
|
|
7
|
+
export declare function libUnit(id: string, libName: string): UnitManifest;
|
|
8
|
+
export declare function cleanupRoots(): void;
|
|
9
|
+
export declare function ledgerWith(entries: readonly {
|
|
10
|
+
pkg: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
registry?: string;
|
|
13
|
+
}[]): PluginLedger;
|
|
14
|
+
export declare function harness(options: {
|
|
15
|
+
manifests: UnitManifest[];
|
|
16
|
+
statuses?: Readonly<Record<string, UnitCapability['status']>>;
|
|
17
|
+
withShell?: boolean;
|
|
18
|
+
bundles?: BundleManager;
|
|
19
|
+
installed?: (pkg: string) => InstalledModule;
|
|
20
|
+
modules?: () => readonly ProfileModule[];
|
|
21
|
+
workbench?: (pkg: string) => ProfilePackage | undefined;
|
|
22
|
+
ledger?: PluginLedger;
|
|
23
|
+
references?: {
|
|
24
|
+
readonly trustworthy: boolean;
|
|
25
|
+
};
|
|
26
|
+
npmLatest?: string;
|
|
27
|
+
npmMissing?: readonly string[];
|
|
28
|
+
}): {
|
|
29
|
+
registered: {
|
|
30
|
+
name: string;
|
|
31
|
+
execute: (args: unknown) => Promise<unknown>;
|
|
32
|
+
}[];
|
|
33
|
+
fake: {
|
|
34
|
+
shell: import("@dsh-workbench/shared").DshShell;
|
|
35
|
+
calls: import("@dsh-workbench/shared/testing").ShellCall[];
|
|
36
|
+
peak: () => number;
|
|
37
|
+
commands: () => string[];
|
|
38
|
+
};
|
|
39
|
+
disposers: (() => void)[];
|
|
40
|
+
};
|
|
41
|
+
export declare function fakeBundles(over?: Partial<BundleManager>): BundleManager;
|
|
42
|
+
export declare function call(h: ReturnType<typeof harness>, args: unknown): Promise<Record<string, unknown>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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 {
|
|
@@ -29,7 +30,7 @@ export interface PanelEntry {
|
|
|
29
30
|
}
|
|
30
31
|
export declare function parseBoard(raw: unknown): PanelBoard;
|
|
31
32
|
export declare function parseReleased(raw: unknown): string[];
|
|
32
|
-
export declare function resolvePanels(manifests: readonly UnitManifest[], boards: ScopeBoards): PanelEntry[];
|
|
33
|
+
export declare function resolvePanels(manifests: readonly UnitManifest[], boards: ScopeBoards, owned?: ReadonlySet<string>): PanelEntry[];
|
|
33
34
|
export interface PanelPluginRef {
|
|
34
35
|
readonly pkg: string;
|
|
35
36
|
readonly title: string;
|
|
@@ -49,7 +50,7 @@ export declare function pluginPanelId(pkg: string): string;
|
|
|
49
50
|
export declare function resolvePluginPanels(plugins: readonly PanelPluginRef[], boards: ScopeBoards): PanelPluginEntry[];
|
|
50
51
|
export declare function withoutReleased(released: PanelList, id: string): string[];
|
|
51
52
|
export declare function withReleased(released: PanelList, id: string): string[];
|
|
52
|
-
export declare function withShown(board: PanelBoard, id: string): PanelBoard;
|
|
53
|
+
export declare function withShown(board: PanelBoard, id: string, visible?: PanelList): PanelBoard;
|
|
53
54
|
export declare function withHidden(board: PanelBoard, id: string): PanelBoard;
|
|
54
55
|
export declare function withoutPanel(board: PanelBoard, id: string): PanelBoard;
|
|
55
|
-
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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,5 +2,6 @@ import type { DshHostContext, DshShell } from '@dsh-workbench/shared';
|
|
|
2
2
|
import { type RouteHandler } from '@dsh-workbench/shared/host';
|
|
3
3
|
export declare function bundleRegistriesHandler(ctx: DshHostContext): RouteHandler;
|
|
4
4
|
export declare function resetRefusalLog(): void;
|
|
5
|
+
export declare function resetHoldLog(): void;
|
|
5
6
|
export declare function moduleVersionsHandler(ctx: DshHostContext, shell: DshShell | undefined): RouteHandler;
|
|
6
7
|
export declare function bundleInspectHandler(ctx: DshHostContext): RouteHandler;
|
|
@@ -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,6 +25,7 @@ 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;
|