@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.
Files changed (95) hide show
  1. package/client.js +2241 -955
  2. package/dist/client/client.body.js +2241 -955
  3. package/dist/client/index.js +2242 -956
  4. package/dist/host/index.js +1840 -332
  5. package/dist/types/app/client.d.ts +225 -81
  6. package/dist/types/app/layouts/__tests__/async-feedback.test.d.ts +1 -0
  7. package/dist/types/app/layouts/market/__tests__/add-module-stages.test.d.ts +1 -0
  8. package/dist/types/app/layouts/market/add-module-text.d.ts +16 -1
  9. package/dist/types/app/layouts/market/use-add-module.d.ts +3 -8
  10. package/dist/types/app/layouts/market/use-module-versions.d.ts +2 -1
  11. package/dist/types/app/layouts/rightbar/MarketView.d.ts +7 -1
  12. package/dist/types/app/layouts/rightbar/ModulesPage.d.ts +4 -2
  13. package/dist/types/app/layouts/rightbar/PanelGroupRows.d.ts +10 -0
  14. package/dist/types/app/layouts/rightbar/PanelModules.d.ts +2 -2
  15. package/dist/types/app/layouts/rightbar/PanelRowControls.d.ts +13 -0
  16. package/dist/types/app/layouts/rightbar/__tests__/market-catalog.test.d.ts +1 -0
  17. package/dist/types/app/layouts/rightbar/__tests__/market-dots.test.d.ts +1 -0
  18. package/dist/types/app/layouts/rightbar/__tests__/market-row-icon.test.d.ts +1 -0
  19. package/dist/types/app/layouts/rightbar/__tests__/market-section-icon.test.d.ts +1 -0
  20. package/dist/types/app/layouts/rightbar/__tests__/market-state-rules.test.d.ts +1 -0
  21. package/dist/types/app/layouts/rightbar/__tests__/market-workbench.test.d.ts +1 -0
  22. package/dist/types/app/layouts/rightbar/__tests__/panel-dismiss.test.d.ts +1 -0
  23. package/dist/types/app/layouts/rightbar/__tests__/panel-drag-target.test.d.ts +1 -0
  24. package/dist/types/app/layouts/rightbar/__tests__/panel-plugin-rows.test.d.ts +1 -0
  25. package/dist/types/app/layouts/rightbar/__tests__/panel-scope-ui.test.d.ts +1 -0
  26. package/dist/types/app/layouts/rightbar/__tests__/panel-write.test.d.ts +1 -0
  27. package/dist/types/app/layouts/rightbar/board-selection.d.ts +20 -0
  28. package/dist/types/app/layouts/rightbar/dsh-borrow.d.ts +15 -0
  29. package/dist/types/app/layouts/rightbar/dsh-borrow.test.d.ts +1 -0
  30. package/dist/types/app/layouts/rightbar/dsh-surface.d.ts +11 -0
  31. package/dist/types/app/layouts/rightbar/dsh-surface.test.d.ts +1 -0
  32. package/dist/types/app/layouts/rightbar/market-act.d.ts +21 -0
  33. package/dist/types/app/layouts/rightbar/market-installed-mock.d.ts +9 -0
  34. package/dist/types/app/layouts/rightbar/market-mock-types.d.ts +58 -0
  35. package/dist/types/app/layouts/rightbar/market-mock.d.ts +2 -43
  36. package/dist/types/app/layouts/rightbar/market-plugin-rows.d.ts +3 -1
  37. package/dist/types/app/layouts/rightbar/market-row-icon.d.ts +7 -0
  38. package/dist/types/app/layouts/rightbar/market-row-types.d.ts +37 -0
  39. package/dist/types/app/layouts/rightbar/market-rows.d.ts +13 -53
  40. package/dist/types/app/layouts/rightbar/market-section-icon.d.ts +3 -0
  41. package/dist/types/app/layouts/rightbar/market-section.d.ts +18 -0
  42. package/dist/types/app/layouts/rightbar/market-shared-rows.d.ts +21 -0
  43. package/dist/types/app/layouts/rightbar/market-view-text.d.ts +7 -1
  44. package/dist/types/app/layouts/rightbar/market-workbench-row.d.ts +5 -0
  45. package/dist/types/app/layouts/rightbar/panel-dismiss.d.ts +2 -0
  46. package/dist/types/app/layouts/rightbar/panel-mock.d.ts +3 -2
  47. package/dist/types/app/layouts/rightbar/panel-write.d.ts +15 -0
  48. package/dist/types/app/layouts/rightbar/use-drag-listeners.d.ts +6 -0
  49. package/dist/types/app/layouts/rightbar/use-panels.d.ts +15 -1
  50. package/dist/types/app/layouts/sidebar/__tests__/session-row-ui.test.d.ts +1 -0
  51. package/dist/types/app/units/registry.d.ts +5 -2
  52. package/dist/types/modules/panels/__tests__/diy-harness.d.ts +19 -0
  53. package/dist/types/modules/panels/__tests__/diy-report.test.d.ts +1 -0
  54. package/dist/types/modules/panels/__tests__/diy-tools-health.test.d.ts +1 -0
  55. package/dist/types/modules/panels/__tests__/diy-tools-panel.test.d.ts +1 -0
  56. package/dist/types/modules/panels/__tests__/plugin-panel-market-parity.test.d.ts +1 -0
  57. package/dist/types/modules/panels/__tests__/plugin-panel.test.d.ts +1 -0
  58. package/dist/types/modules/panels/__tests__/plugin-tool-units.test.d.ts +1 -0
  59. package/dist/types/modules/panels/__tests__/scope-machine.test.d.ts +1 -0
  60. package/dist/types/modules/panels/__tests__/scope-support.d.ts +51 -0
  61. package/dist/types/modules/panels/model/config.d.ts +23 -3
  62. package/dist/types/modules/panels/model/diy-report.d.ts +63 -0
  63. package/dist/types/modules/panels/model/market-dispatch.d.ts +4 -0
  64. package/dist/types/modules/panels/model/market-registry.d.ts +12 -0
  65. package/dist/types/modules/panels/model/market-registry.test.d.ts +1 -0
  66. package/dist/types/modules/panels/model/market-types.d.ts +1 -0
  67. package/dist/types/modules/panels/model/market.d.ts +3 -2
  68. package/dist/types/modules/panels/model/plugin-panel.d.ts +3 -0
  69. package/dist/types/modules/panels/model/prefs.d.ts +3 -1
  70. package/dist/types/modules/panels/model/service.d.ts +5 -1
  71. package/dist/types/shared/api/bundle-install.d.ts +15 -1
  72. package/dist/types/shared/api/host/__tests__/approval-note-injection.test.d.ts +1 -0
  73. package/dist/types/shared/api/host/__tests__/panel-state-route.test.d.ts +1 -0
  74. package/dist/types/shared/api/host/__tests__/plugin-catalog.test.d.ts +1 -0
  75. package/dist/types/shared/api/host/__tests__/plugin-login-hint.test.d.ts +1 -0
  76. package/dist/types/shared/api/host/__tests__/plugin-tools.test.d.ts +1 -0
  77. package/dist/types/shared/api/host/bundle-inspect-kind.test.d.ts +1 -0
  78. package/dist/types/shared/api/host/bundle-routes-self.test.d.ts +1 -0
  79. package/dist/types/shared/api/host/installed-module.d.ts +12 -0
  80. package/dist/types/shared/api/host/mount-units.d.ts +1 -0
  81. package/dist/types/shared/api/host/plugin-catalog.d.ts +60 -0
  82. package/dist/types/shared/api/host/plugin-login-hint.d.ts +2 -0
  83. package/dist/types/shared/api/host/plugin-tools.d.ts +10 -0
  84. package/dist/types/shared/api/host/plugin-units.d.ts +47 -0
  85. package/dist/types/shared/api/host/unit-registry.d.ts +9 -0
  86. package/dist/types/shared/api/unit-manifests.d.ts +1 -0
  87. package/dist/types/shared/components/PanelFoot.d.ts +1 -1
  88. package/dist/types/shared/hooks/panel-state-report.d.ts +13 -0
  89. package/dist/types/shared/hooks/panel-state-report.test.d.ts +1 -0
  90. package/docs/HANDOFF.md +7 -0
  91. package/package.json +2 -2
  92. package/preset/diy.patch.yml +5 -26
  93. package/skills/workbench-module-diy/REVIEW.md +22 -0
  94. package/skills/workbench-module-diy/SKILL.md +3 -1
  95. package/skills/workbench-module-diy/TOOLING.md +2 -0
@@ -1,6 +1,21 @@
1
1
  import type { Translate } from '@dsh-workbench/shared';
2
- import type { BundleChange, BundleInspectProblem, BundleRegistries } from '../../../shared/api/bundle-install';
2
+ import type { BundleChange, BundleInspectProblem, BundleInspectionAccepted, BundleInspectionPlugin, BundleRegistries } from '../../../shared/api/bundle-install';
3
3
  export type AddModulePhase = 'idle' | 'inspecting' | 'preview' | 'installing' | 'result';
4
+ export interface AddModulePreview {
5
+ readonly kind: 'module' | 'plugin';
6
+ readonly name: string;
7
+ readonly version: string;
8
+ readonly description: string;
9
+ readonly registry: string;
10
+ readonly pluginName?: string;
11
+ }
12
+ export declare function previewOf(inspection: BundleInspectionAccepted | BundleInspectionPlugin, fallback: string): AddModulePreview;
13
+ export type AddModuleResultKind = 'plugin' | 'failed' | 'cancelled' | 'restart' | 'took-effect' | 'quiet';
14
+ export declare function resultKindOf(input: {
15
+ readonly change: Pick<BundleChange, 'application'>;
16
+ readonly supplyState: string;
17
+ readonly plugin: boolean;
18
+ }): AddModuleResultKind;
4
19
  export type RegistryKind = 'default' | 'url' | 'custom';
5
20
  export interface RegistryChoice {
6
21
  readonly kind: RegistryKind;
@@ -1,12 +1,6 @@
1
1
  import type { BundleChange, BundleInspectProblem, BundleInstalledPlugin, BundleModulePayload, BundleSupplyPayload } from '../../../shared/api/bundle-install';
2
- import { type AddModulePhase, type RegistryChoice, type RegistryOption } from './add-module-text';
3
- export type { AddModulePhase } from './add-module-text';
4
- export interface AddModulePreview {
5
- readonly name: string;
6
- readonly version: string;
7
- readonly description: string;
8
- readonly registry: string;
9
- }
2
+ import { type AddModulePhase, type AddModulePreview, type RegistryChoice, type RegistryOption } from './add-module-text';
3
+ export type { AddModulePhase, AddModulePreview } from './add-module-text';
10
4
  export interface AddModuleOutcome {
11
5
  readonly change: BundleChange;
12
6
  readonly module: BundleModulePayload;
@@ -29,6 +23,7 @@ export interface AddModuleState {
29
23
  readonly preview: AddModulePreview | null;
30
24
  readonly outcome: AddModuleOutcome | null;
31
25
  readonly failure: string | null;
26
+ readonly removing: boolean;
32
27
  readonly builds: readonly string[];
33
28
  setSpec(value: string): void;
34
29
  setChoice(choice: RegistryChoice): void;
@@ -1,8 +1,9 @@
1
- import type { ModuleVersion } from '../../../shared/api/bundle-install';
1
+ import type { ModuleVersion, WorkbenchVersion } from '../../../shared/api/bundle-install';
2
2
  import type { InstalledPlugin } from '../../../shared/api/installed-plugins';
3
3
  export interface ModuleVersionsState {
4
4
  readonly modules: readonly ModuleVersion[] | null;
5
5
  readonly plugins: readonly InstalledPlugin[] | null;
6
+ readonly workbench: WorkbenchVersion | null;
6
7
  readonly read: boolean;
7
8
  readonly checkedAt: number | null;
8
9
  }
@@ -6,17 +6,23 @@ import type { InstalledPlugin } from '../../../shared/api/installed-plugins';
6
6
  import { type InstalledWorkbenchModule } from './market-rows';
7
7
  import type { MarketMock } from './market-mock';
8
8
  import type { ModuleUpdateMap } from './market-rows';
9
+ import type { WorkbenchVersion } from '../../../shared/api/bundle-install';
9
10
  export interface MarketViewProps {
10
11
  readonly t: Translate;
11
12
  readonly manifests: readonly UnitManifest[];
13
+ readonly installable?: ReadonlySet<string> | null | undefined;
12
14
  readonly capabilities: CapabilityMap | null;
13
15
  readonly freshness: MarketFreshness;
14
16
  readonly onChanged: () => void;
17
+ readonly onPending?: ((pending: boolean) => void) | undefined;
15
18
  readonly updates?: ModuleUpdateMap | undefined;
16
19
  readonly installed?: readonly InstalledWorkbenchModule[] | undefined;
17
20
  readonly installedRead?: boolean | undefined;
21
+ readonly workbench?: WorkbenchVersion | null | undefined;
18
22
  readonly plugins?: readonly InstalledPlugin[] | null | undefined;
19
23
  readonly settling?: ReadonlySet<string> | undefined;
20
24
  readonly mock?: MarketMock | undefined;
25
+ readonly defaults?: readonly string[] | undefined;
26
+ readonly changed?: Readonly<Record<string, number>> | undefined;
21
27
  }
22
- export declare function MarketView({ t, manifests, capabilities, freshness, onChanged, updates, installed, installedRead, plugins, settling, mock, }: 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,15 +1,17 @@
1
1
  import type { Translate } from '@dsh-workbench/shared';
2
2
  import type { CapabilityMap } from '../../../shared/hooks/use-capabilities';
3
3
  import type { PanelMock } from './panel-mock';
4
- import type { PanelUnit } from './use-panels';
4
+ import type { PanelPluginUnit, PanelUnit } from './use-panels';
5
5
  export interface ModulesPageProps {
6
6
  readonly t: Translate;
7
7
  readonly units: readonly PanelUnit[];
8
+ readonly plugins?: readonly PanelPluginUnit[];
8
9
  readonly workspace: string | null;
9
10
  readonly capabilities: CapabilityMap | null;
10
11
  readonly loading?: boolean;
11
12
  readonly onOpenMarket: () => void;
12
13
  readonly mocked?: boolean;
13
14
  readonly mock?: PanelMock | undefined;
15
+ readonly own?: boolean;
14
16
  }
15
- export declare function ModulesPage({ t, units, workspace, capabilities, loading, onOpenMarket, mocked, mock, }: ModulesPageProps): JSX.Element;
17
+ export declare function ModulesPage({ t, units, plugins, workspace, capabilities, loading, onOpenMarket, mocked, mock, own, }: ModulesPageProps): JSX.Element;
@@ -0,0 +1,10 @@
1
+ import type { Translate } from '@dsh-workbench/shared';
2
+ import type { PanelRow } from './board-selection';
3
+ export interface PanelGroupRowsProps {
4
+ readonly t: Translate;
5
+ readonly rows: readonly PanelRow[];
6
+ readonly titleKey: string;
7
+ readonly busy: boolean;
8
+ readonly onWrite: (body: Record<string, unknown>) => void;
9
+ }
10
+ export declare function PanelGroupRows({ t, rows, titleKey, busy, onWrite }: PanelGroupRowsProps): JSX.Element | null;
@@ -1,11 +1,11 @@
1
1
  import type { Translate } from '@dsh-workbench/shared';
2
2
  import type { UnitManifest } from '@dsh-workbench/shared';
3
- import type { PanelUnit } from './use-panels';
3
+ import type { PanelBoardView } from './use-panels';
4
4
  export interface PanelModulesProps {
5
5
  readonly t: Translate;
6
6
  readonly open: boolean;
7
7
  readonly onOpenChange: (open: boolean) => void;
8
- readonly enabledUnits: readonly PanelUnit[] | null;
8
+ readonly enabledUnits: PanelBoardView | null;
9
9
  readonly workspace: string | null;
10
10
  readonly refreshToken: number;
11
11
  readonly manifests: readonly UnitManifest[];
@@ -0,0 +1,13 @@
1
+ import type { Translate } from '@dsh-workbench/shared';
2
+ export interface PanelRowUnit {
3
+ readonly id: string;
4
+ readonly shown: boolean;
5
+ }
6
+ export interface PanelRowControlsProps {
7
+ readonly t: Translate;
8
+ readonly unit: PanelRowUnit;
9
+ readonly label: string;
10
+ readonly busy: boolean;
11
+ readonly onWrite: (body: Record<string, unknown>) => void;
12
+ }
13
+ export declare function PanelRowControls({ t, unit, label, busy, onWrite }: PanelRowControlsProps): JSX.Element;
@@ -1,13 +1,33 @@
1
1
  import type { ModuleSummary } from '@dsh-workbench/shared';
2
2
  import type { BoardModule } from '@dsh-workbench/shared';
3
3
  import type { CapabilityMap } from '../../../shared/hooks/use-capabilities';
4
+ import type { PanelPluginUnit, PanelUnit } from './use-panels';
4
5
  export interface SelectableUnit {
5
6
  readonly id: string;
6
7
  readonly shown: boolean;
7
8
  }
9
+ export interface PanelRow {
10
+ readonly id: string;
11
+ readonly titleKey?: string;
12
+ readonly title?: string;
13
+ readonly plugin: boolean;
14
+ readonly hasCard?: boolean;
15
+ readonly badgeKey?: string;
16
+ readonly shown: boolean;
17
+ readonly source: 'default' | 'user';
18
+ }
8
19
  export declare function available(capability: CapabilityMap[string] | undefined): boolean;
9
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;
10
29
  export declare function panelBadgeKey(capability: CapabilityMap[string] | undefined): string | undefined;
30
+ export declare function selectPanelRows(units: readonly PanelUnit[], plugins: readonly PanelPluginUnit[], capabilities: CapabilityMap | null): PanelRow[];
11
31
  export declare function selectBoardModules(units: readonly SelectableUnit[] | null, byId: (id: string) => BoardModule | undefined, capabilities: CapabilityMap | null): BoardModule[];
12
32
  export declare function aggregateSummaries(summaries: readonly ModuleSummary[]): {
13
33
  readonly refreshing: boolean;
@@ -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,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,21 @@
1
+ import type { Translate, WriteOutcome } from '@dsh-workbench/shared';
2
+ import type { MarketRow } from './market-row-types';
3
+ import { type MarketRowAction } from './market-rows';
4
+ import type { Pending } from './market-view-text';
5
+ export interface MarketActSeats {
6
+ readonly setPending: (next: Pending | null) => void;
7
+ readonly setConfirming: (next: string | null) => void;
8
+ readonly setFailed: (next: {
9
+ readonly id: string;
10
+ readonly message: string;
11
+ } | null) => void;
12
+ readonly setNotice: (next: string | null) => void;
13
+ }
14
+ export declare function marketActOf(options: {
15
+ readonly t: Translate;
16
+ readonly mocked: boolean;
17
+ readonly rowOf: (id: string) => MarketRow | undefined;
18
+ readonly seats: MarketActSeats;
19
+ readonly send: (body: Record<string, unknown>) => Promise<WriteOutcome<unknown>>;
20
+ readonly onChanged: () => void;
21
+ }): (id: string, action: MarketRowAction) => Promise<void>;
@@ -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,45 +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 { MarketRowAction, ModuleUpdateMap } from './market-rows';
5
- import type { CapabilityMap } from '../../../shared/hooks/use-capabilities';
6
- import type { MarketState } from './market-rows';
7
- export interface MarketMockExpect {
8
- readonly rows: number;
9
- readonly state?: MarketState;
10
- readonly actions?: readonly MarketRowAction[];
11
- readonly titleChars?: number;
12
- readonly shared?: number;
13
- readonly installed?: number;
14
- readonly installedActions?: readonly MarketRowAction[];
15
- readonly installedNote?: boolean;
16
- readonly sharedActions?: readonly MarketRowAction[];
17
- readonly plugins?: number;
18
- readonly pluginActions?: readonly MarketRowAction[];
19
- readonly pluginNote?: boolean;
20
- readonly pluginNoteKey?: 'panels.market.pluginAlsoKnownAs' | 'panels.market.pluginBroken';
21
- readonly notice?: boolean;
22
- }
23
- export interface MarketMock {
24
- readonly id: string;
25
- readonly label: string;
26
- readonly manifests: readonly UnitManifest[];
27
- readonly capabilities: CapabilityMap | null;
28
- readonly pending?: {
29
- readonly id: string;
30
- readonly action: MarketRowAction;
31
- };
32
- readonly updates?: ModuleUpdateMap;
33
- readonly installed?: readonly InstalledWorkbenchModule[];
34
- readonly installedRead?: boolean;
35
- readonly plugins?: readonly InstalledPlugin[];
36
- readonly loaded?: boolean;
37
- readonly confirming?: string;
38
- readonly failure?: {
39
- readonly id: string;
40
- readonly message: string;
41
- };
42
- readonly notice?: string;
43
- readonly expect: MarketMockExpect;
44
- }
2
+ import type { MarketMock } from './market-mock-types';
3
+ export type { MarketMock, MarketMockExpect } from './market-mock-types';
45
4
  export declare function buildMarketMocks(roster: readonly UnitManifest[]): readonly MarketMock[];
@@ -1,8 +1,10 @@
1
1
  import type { InstalledPlugin } from '../../../shared/api/installed-plugins';
2
+ import type { Translate } from '@dsh-workbench/shared';
2
3
  import type { MarketRow } from './market-rows';
3
4
  export interface InstalledPluginKept {
4
5
  readonly key: 'panels.market.pluginKeptInUse' | 'panels.market.pluginKeptUnsure' | 'panels.market.pluginKeptHeld' | 'panels.market.pluginKeptUnnamed';
5
6
  readonly names?: readonly string[];
6
7
  }
7
8
  export declare function installedPluginKept(value: unknown): InstalledPluginKept | undefined;
8
- export declare function installedPluginRows(plugins: readonly InstalledPlugin[]): MarketRow[];
9
+ export declare function installedPluginNotice(value: unknown, t: Translate): string | null;
10
+ export declare function installedPluginRows(plugins: readonly InstalledPlugin[], defaults?: ReadonlySet<string>, changed?: Readonly<Record<string, number>>): MarketRow[];
@@ -0,0 +1,7 @@
1
+ import type { MarketRow } from './market-row-types';
2
+ import type { SharedRow } from './market-rows';
3
+ export type PackageKind = 'module' | 'plugin' | 'lib' | 'workbench';
4
+ export declare function packageIcon(kind: PackageKind): import("react").FunctionComponentElement<import("@deepseek-ai/dsh-client-ui-primitives").IconProps> | import("react").FunctionComponentElement<import("@dsh-workbench/shared").IconProps>;
5
+ export declare function marketRowKind(row: MarketRow): PackageKind;
6
+ export declare function sharedRowKind(row: SharedRow): PackageKind;
7
+ export type PackageIcon = ReturnType<typeof packageIcon>;
@@ -0,0 +1,37 @@
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';
3
+ export interface MarketNote {
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';
5
+ readonly params: Readonly<Record<string, string>>;
6
+ readonly tone?: 'plain' | 'alert';
7
+ }
8
+ export type MarketHintKey = 'panels.market.moduleRestartHint';
9
+ export interface ModuleUpdate {
10
+ readonly installed: string;
11
+ readonly latest?: string;
12
+ readonly local?: boolean;
13
+ }
14
+ export interface MarketRow {
15
+ readonly id: string;
16
+ readonly titleKey: string;
17
+ readonly label?: string;
18
+ readonly state: MarketState;
19
+ readonly canInstall: boolean;
20
+ readonly canUpdate: boolean;
21
+ readonly canUninstall: boolean;
22
+ readonly plugin?: boolean;
23
+ readonly workbench?: boolean;
24
+ readonly note?: MarketNote;
25
+ readonly hint?: MarketHintKey;
26
+ readonly version?: {
27
+ readonly installed?: string;
28
+ readonly latest?: string;
29
+ };
30
+ readonly moduleUpdate?: ModuleUpdate;
31
+ readonly pkg?: string;
32
+ readonly local?: boolean;
33
+ readonly versionLabel?: string;
34
+ readonly defaultShown?: boolean;
35
+ readonly defaultChanged?: number;
36
+ readonly broken?: boolean;
37
+ }
@@ -1,40 +1,14 @@
1
- import type { ModuleVersion } from '../../../shared/api/bundle-install';
1
+ import type { ModuleVersion, WorkbenchVersion } from '../../../shared/api/bundle-install';
2
2
  import type { Translate, UnitManifest } from '@dsh-workbench/shared';
3
- export type MarketRowAction = 'install' | 'update' | 'update-bundle' | 'remove-bundle' | 'uninstall' | 'update-dependency' | 'update-plugin' | 'uninstall-plugin';
3
+ import type { MarketRow, MarketRowAction, MarketState, ModuleUpdate } from './market-row-types';
4
+ import { type SharedRow } from './market-shared-rows';
4
5
  import type { CapabilityMap } from '../../../shared/hooks/use-capabilities';
5
- export type MarketState = 'checking' | 'installed' | 'outdated' | 'missing' | 'unchecked' | 'unknown';
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';
6
9
  export declare const MARKET_STATE_KEY: Readonly<Record<MarketState, string>>;
7
- export declare const MARKET_DOT: Readonly<Record<MarketState, 'ongoing' | 'done' | 'warning' | 'idle'>>;
8
- export interface MarketNote {
9
- readonly key: 'panels.market.needEnv' | 'panels.market.noSource' | 'panels.market.badSource' | 'panels.market.moduleRefused' | 'panels.market.moduleRestartHint' | 'panels.market.pluginAlsoKnownAs' | 'panels.market.pluginBroken';
10
- readonly params: Readonly<Record<string, string>>;
11
- }
12
- export type MarketHintKey = 'panels.market.moduleRestartHint';
13
- export interface ModuleUpdate {
14
- readonly installed: string;
15
- readonly latest?: string;
16
- }
10
+ export declare const MARKET_DOT: Readonly<Record<MarketState, 'ongoing' | 'done' | 'warning' | 'idle' | 'error'>>;
17
11
  export type ModuleUpdateMap = Readonly<Record<string, ModuleUpdate>>;
18
- export interface MarketRow {
19
- readonly id: string;
20
- readonly titleKey: string;
21
- readonly label?: string;
22
- readonly state: MarketState;
23
- readonly canInstall: boolean;
24
- readonly canUpdate: boolean;
25
- readonly canUninstall: boolean;
26
- readonly plugin?: boolean;
27
- readonly note?: MarketNote;
28
- readonly hint?: MarketHintKey;
29
- readonly version?: {
30
- readonly installed?: string;
31
- readonly latest?: string;
32
- };
33
- readonly moduleUpdate?: ModuleUpdate;
34
- readonly pkg?: string;
35
- readonly local?: boolean;
36
- readonly broken?: boolean;
37
- }
38
12
  export declare function marketRowTitle(row: MarketRow, t: Translate): string;
39
13
  export interface InstalledWorkbenchModule {
40
14
  readonly unit: string;
@@ -47,37 +21,23 @@ export interface InstalledWorkbenchModule {
47
21
  }
48
22
  export declare function withClientRefusals(modules: readonly InstalledWorkbenchModule[], refusals: readonly {
49
23
  readonly unit: string;
24
+ readonly kind?: string | undefined;
50
25
  readonly reasons: readonly string[];
51
26
  }[]): readonly InstalledWorkbenchModule[];
52
27
  export declare function refusalReasons(host: readonly string[] | undefined, client: readonly string[] | undefined): readonly string[];
53
28
  export declare function mergeTitles(known: ReadonlyMap<string, string>, manifests: readonly UnitManifest[]): ReadonlyMap<string, string>;
54
- export declare function installedRows(modules: readonly InstalledWorkbenchModule[], manifests: readonly UnitManifest[], listed: ReadonlySet<string>, known?: ReadonlyMap<string, string> | undefined): MarketRow[];
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;
55
31
  export declare function marketActions(row: MarketRow): MarketRowAction[];
32
+ export declare function marketCatalog(manifests: readonly UnitManifest[], installable: ReadonlySet<string> | null | undefined): readonly UnitManifest[];
56
33
  export declare function liveManifests(manifests: readonly UnitManifest[], capabilities: CapabilityMap | null, installed: ReadonlySet<string> | null): readonly UnitManifest[];
57
34
  export declare function marketHasUpdates(rows: readonly MarketRow[], shared?: readonly SharedRow[]): boolean;
58
35
  export declare function marketUpdatesOf(modules: readonly ModuleVersion[] | null): ModuleUpdateMap;
59
- export declare function marketHintVisible(manifests: readonly UnitManifest[], capabilities: CapabilityMap | null, modules: readonly ModuleVersion[] | null): boolean;
36
+ export declare function marketHintVisible(manifests: readonly UnitManifest[], capabilities: CapabilityMap | null, modules: readonly ModuleVersion[] | null, workbench?: WorkbenchVersion | null | undefined): boolean;
60
37
  export interface MarketSection {
61
38
  readonly id: 'installed' | 'not-installed';
62
39
  readonly titleKey: string;
63
40
  readonly rows: readonly MarketRow[];
64
41
  }
65
42
  export declare function marketSections(rows: readonly MarketRow[]): MarketSection[];
66
- export declare function marketRows(manifests: readonly UnitManifest[], capabilities: CapabilityMap | null, updates?: ModuleUpdateMap): MarketRow[];
67
- export type SharedState = 'checking' | 'installed' | 'outdated' | 'unsatisfied' | 'missing' | 'unchecked';
68
- export declare const SHARED_STATE_KEY: Readonly<Record<SharedState, string>>;
69
- export declare const SHARED_DOT: Readonly<Record<SharedState, 'ongoing' | 'done' | 'warning' | 'idle'>>;
70
- export interface SharedRow {
71
- readonly id: string;
72
- readonly label: string;
73
- readonly usedByKeys: readonly string[];
74
- readonly state: SharedState;
75
- readonly canUpdate: boolean;
76
- readonly version?: {
77
- readonly installed?: string;
78
- readonly latest?: string;
79
- };
80
- readonly detail?: string;
81
- }
82
- export declare function sharedActions(row: SharedRow): MarketRowAction[];
83
- export declare function sharedRows(manifests: readonly UnitManifest[], capabilities: CapabilityMap | null): SharedRow[];
43
+ export declare function marketRows(manifests: readonly UnitManifest[], capabilities: CapabilityMap | null, updates?: ModuleUpdateMap, defaults?: ReadonlySet<string>, changed?: Readonly<Record<string, number>>): MarketRow[];
@@ -0,0 +1,3 @@
1
+ export type MarketSectionKind = 'installed' | 'pending' | 'plugins' | 'shared';
2
+ export declare function marketSectionIcon(kind: MarketSectionKind): import("react").FunctionComponentElement<import("@deepseek-ai/dsh-client-ui-primitives").IconProps> | import("react").FunctionComponentElement<import("@dsh-workbench/shared").IconProps>;
3
+ export type MarketSectionIcon = ReturnType<typeof marketSectionIcon>;
@@ -0,0 +1,18 @@
1
+ import type { Translate } from '@dsh-workbench/shared';
2
+ import type { MarketRow } from './market-row-types';
3
+ import { type MarketRowAction } from './market-rows';
4
+ import type { MarketSectionIcon } from './market-section-icon';
5
+ import { type Pending } from './market-view-text';
6
+ export declare function MarketSection({ t, titleKey, icon, rows, pending, failureOf, act, confirmActions, onConfirming, onDefault, boardBusy, }: {
7
+ readonly t: Translate;
8
+ readonly titleKey?: string;
9
+ readonly icon?: MarketSectionIcon;
10
+ readonly rows: readonly MarketRow[];
11
+ readonly pending: Pending | null;
12
+ readonly failureOf: (id: string) => string | null;
13
+ readonly act: (id: string, action: MarketRowAction) => Promise<void>;
14
+ readonly onDefault?: ((id: string, next: boolean) => void) | undefined;
15
+ readonly boardBusy?: boolean | undefined;
16
+ readonly confirmActions: readonly MarketRowAction[];
17
+ readonly onConfirming: (id: string | null) => void;
18
+ }): JSX.Element | null;
@@ -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[];
@@ -1,4 +1,4 @@
1
- import type { MarketRowAction } from './market-rows';
1
+ import type { MarketRow, MarketRowAction } from './market-rows';
2
2
  export declare const PROGRESS_KEY: Readonly<Record<MarketRowAction, string>>;
3
3
  export declare const ACTION_LABEL_KEY: Readonly<Record<MarketRowAction, string>>;
4
4
  export interface Pending {
@@ -8,3 +8,9 @@ export interface Pending {
8
8
  readonly pkg?: string | undefined;
9
9
  readonly version?: string | undefined;
10
10
  }
11
+ export declare function pendingRowOf(input: {
12
+ readonly pending: Pending | null;
13
+ readonly removing: string | null;
14
+ readonly rows: readonly MarketRow[];
15
+ readonly titles: ReadonlyMap<string, string>;
16
+ }): MarketRow | undefined;
@@ -0,0 +1,5 @@
1
+ import type { WorkbenchVersion } from '../../../shared/api/bundle-install';
2
+ import type { MarketRow } from './market-row-types';
3
+ export declare const WORKBENCH_ROW_ID = "workbench:self";
4
+ export declare const WORKBENCH_TITLE_KEY = "panels.market.workbenchName";
5
+ export declare function workbenchRow(version: WorkbenchVersion | null | undefined): MarketRow | undefined;
@@ -0,0 +1,2 @@
1
+ export declare function hasOpenModal(scope: ParentNode): boolean;
2
+ export declare function dismissPanelByPointer(next: boolean, scope: ParentNode, onOpenChange: (open: boolean) => void): void;