@dsh-workbench/core 0.1.0

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 (169) hide show
  1. package/README.md +55 -0
  2. package/bin/dsh-workbench +200 -0
  3. package/bin/opencli-isolated +61 -0
  4. package/client.js +5334 -0
  5. package/cordis.patch.yml +42 -0
  6. package/dist/client/client.body.js +5323 -0
  7. package/dist/client/index.js +5324 -0
  8. package/dist/host/index.js +5420 -0
  9. package/dist/types/app/client.d.ts +1476 -0
  10. package/dist/types/app/host.d.ts +4 -0
  11. package/dist/types/app/layouts/__tests__/panel-hint.test.d.ts +1 -0
  12. package/dist/types/app/layouts/__tests__/project-selection.test.d.ts +1 -0
  13. package/dist/types/app/layouts/env-gate/__tests__/force-plan.test.d.ts +1 -0
  14. package/dist/types/app/layouts/env-gate/__tests__/gate-hidden.test.d.ts +1 -0
  15. package/dist/types/app/layouts/env-gate/__tests__/gate-mocks.test.d.ts +1 -0
  16. package/dist/types/app/layouts/env-gate/boot-gate.d.ts +16 -0
  17. package/dist/types/app/layouts/env-gate/gate-dom.d.ts +4 -0
  18. package/dist/types/app/layouts/env-gate/gate-mock.d.ts +18 -0
  19. package/dist/types/app/layouts/env-gate/gate-text.d.ts +13 -0
  20. package/dist/types/app/layouts/market/panel.d.ts +4 -0
  21. package/dist/types/app/layouts/panel-hint.d.ts +9 -0
  22. package/dist/types/app/layouts/project-selection.d.ts +3 -0
  23. package/dist/types/app/layouts/rightbar/BoardEmpty.d.ts +6 -0
  24. package/dist/types/app/layouts/rightbar/BoardMockStrip.d.ts +5 -0
  25. package/dist/types/app/layouts/rightbar/Breadcrumbs.d.ts +11 -0
  26. package/dist/types/app/layouts/rightbar/ExpandButton.d.ts +9 -0
  27. package/dist/types/app/layouts/rightbar/MarketFreshLines.d.ts +5 -0
  28. package/dist/types/app/layouts/rightbar/MarketView.d.ts +14 -0
  29. package/dist/types/app/layouts/rightbar/ModulesPage.d.ts +15 -0
  30. package/dist/types/app/layouts/rightbar/PanelModules.d.ts +14 -0
  31. package/dist/types/app/layouts/rightbar/Rightbar.d.ts +24 -0
  32. package/dist/types/app/layouts/rightbar/__tests__/board-mock.test.d.ts +1 -0
  33. package/dist/types/app/layouts/rightbar/__tests__/board-plan.test.d.ts +1 -0
  34. package/dist/types/app/layouts/rightbar/__tests__/board-selection.test.d.ts +1 -0
  35. package/dist/types/app/layouts/rightbar/__tests__/breadcrumbs.test.d.ts +1 -0
  36. package/dist/types/app/layouts/rightbar/__tests__/market-freshness.test.d.ts +1 -0
  37. package/dist/types/app/layouts/rightbar/__tests__/market-mock.test.d.ts +1 -0
  38. package/dist/types/app/layouts/rightbar/__tests__/market-rows-libs.test.d.ts +1 -0
  39. package/dist/types/app/layouts/rightbar/__tests__/market-rows.test.d.ts +1 -0
  40. package/dist/types/app/layouts/rightbar/__tests__/market-shared.test.d.ts +1 -0
  41. package/dist/types/app/layouts/rightbar/__tests__/panel-mock.test.d.ts +1 -0
  42. package/dist/types/app/layouts/rightbar/__tests__/suite-world.test.d.ts +1 -0
  43. package/dist/types/app/layouts/rightbar/__tests__/use-panels.test.d.ts +1 -0
  44. package/dist/types/app/layouts/rightbar/board-mock.d.ts +22 -0
  45. package/dist/types/app/layouts/rightbar/board-plan.d.ts +25 -0
  46. package/dist/types/app/layouts/rightbar/board-selection.d.ts +15 -0
  47. package/dist/types/app/layouts/rightbar/market-freshness.d.ts +13 -0
  48. package/dist/types/app/layouts/rightbar/market-mock.d.ts +29 -0
  49. package/dist/types/app/layouts/rightbar/market-rows.d.ts +45 -0
  50. package/dist/types/app/layouts/rightbar/panel-mock.d.ts +26 -0
  51. package/dist/types/app/layouts/rightbar/registry.d.ts +11 -0
  52. package/dist/types/app/layouts/rightbar/registry.test.d.ts +1 -0
  53. package/dist/types/app/layouts/rightbar/store.d.ts +23 -0
  54. package/dist/types/app/layouts/rightbar/store.test.d.ts +1 -0
  55. package/dist/types/app/layouts/rightbar/suite-world.d.ts +14 -0
  56. package/dist/types/app/layouts/rightbar/use-panels.d.ts +15 -0
  57. package/dist/types/app/layouts/sidebar/PanelNav.d.ts +13 -0
  58. package/dist/types/app/layouts/sidebar/ProjectSwitcher.d.ts +10 -0
  59. package/dist/types/app/layouts/sidebar/SessionList.d.ts +13 -0
  60. package/dist/types/app/layouts/sidebar/Sidebar.d.ts +25 -0
  61. package/dist/types/app/layouts/sidebar/WorkspaceSection.d.ts +7 -0
  62. package/dist/types/app/layouts/sidebar/__tests__/session-pick.test.d.ts +1 -0
  63. package/dist/types/app/layouts/sidebar/session-pick.d.ts +20 -0
  64. package/dist/types/app/units/host.d.ts +4 -0
  65. package/dist/types/app/units/index.d.ts +4 -0
  66. package/dist/types/app/units/registry.d.ts +12 -0
  67. package/dist/types/modules/panels/__tests__/config.test.d.ts +1 -0
  68. package/dist/types/modules/panels/__tests__/face.test.d.ts +1 -0
  69. package/dist/types/modules/panels/__tests__/market-dependency.test.d.ts +1 -0
  70. package/dist/types/modules/panels/__tests__/market-tools.test.d.ts +1 -0
  71. package/dist/types/modules/panels/__tests__/market.test.d.ts +1 -0
  72. package/dist/types/modules/panels/__tests__/prefs.test.d.ts +1 -0
  73. package/dist/types/modules/panels/__tests__/routes.test.d.ts +1 -0
  74. package/dist/types/modules/panels/__tests__/service.test.d.ts +1 -0
  75. package/dist/types/modules/panels/__tests__/tools.test.d.ts +1 -0
  76. package/dist/types/modules/panels/index.d.ts +2 -0
  77. package/dist/types/modules/panels/model/config.d.ts +18 -0
  78. package/dist/types/modules/panels/model/handoff.d.ts +8 -0
  79. package/dist/types/modules/panels/model/handoff.test.d.ts +1 -0
  80. package/dist/types/modules/panels/model/market-dependency.d.ts +41 -0
  81. package/dist/types/modules/panels/model/market-dispatch.d.ts +14 -0
  82. package/dist/types/modules/panels/model/market-tools.d.ts +3 -0
  83. package/dist/types/modules/panels/model/market.d.ts +49 -0
  84. package/dist/types/modules/panels/model/prefs.d.ts +13 -0
  85. package/dist/types/modules/panels/model/routes.d.ts +4 -0
  86. package/dist/types/modules/panels/model/routes.test.d.ts +1 -0
  87. package/dist/types/modules/panels/model/service.d.ts +25 -0
  88. package/dist/types/modules/panels/model/tools.d.ts +4 -0
  89. package/dist/types/modules/panels/unit.d.ts +4 -0
  90. package/dist/types/modules/sessions/index.d.ts +1 -0
  91. package/dist/types/modules/sessions/model/session-node.d.ts +25 -0
  92. package/dist/types/modules/sessions/model/session-node.test.d.ts +1 -0
  93. package/dist/types/shared/__tests__/i18n-keys.test.d.ts +1 -0
  94. package/dist/types/shared/api/__tests__/context-ref.test.d.ts +1 -0
  95. package/dist/types/shared/api/context-chips.d.ts +10 -0
  96. package/dist/types/shared/api/host/__tests__/capability-force.test.d.ts +1 -0
  97. package/dist/types/shared/api/host/__tests__/cli-error.test.d.ts +1 -0
  98. package/dist/types/shared/api/host/__tests__/context-inject.test.d.ts +1 -0
  99. package/dist/types/shared/api/host/__tests__/data-root.test.d.ts +1 -0
  100. package/dist/types/shared/api/host/__tests__/events.test.d.ts +1 -0
  101. package/dist/types/shared/api/host/__tests__/fact-writes.test.d.ts +1 -0
  102. package/dist/types/shared/api/host/__tests__/facts.test.d.ts +1 -0
  103. package/dist/types/shared/api/host/__tests__/long-task.test.d.ts +1 -0
  104. package/dist/types/shared/api/host/__tests__/plugin-source.test.d.ts +1 -0
  105. package/dist/types/shared/api/host/__tests__/preflight-fixtures.d.ts +19 -0
  106. package/dist/types/shared/api/host/__tests__/preflight-warm.test.d.ts +1 -0
  107. package/dist/types/shared/api/host/__tests__/preflight.test.d.ts +1 -0
  108. package/dist/types/shared/api/host/__tests__/probe-cache.test.d.ts +1 -0
  109. package/dist/types/shared/api/host/__tests__/probe-libs.test.d.ts +1 -0
  110. package/dist/types/shared/api/host/__tests__/probe-units-cache.test.d.ts +1 -0
  111. package/dist/types/shared/api/host/__tests__/probe-units-npm-source.test.d.ts +1 -0
  112. package/dist/types/shared/api/host/__tests__/probe-units-release.test.d.ts +1 -0
  113. package/dist/types/shared/api/host/__tests__/probe-units.test.d.ts +1 -0
  114. package/dist/types/shared/api/host/__tests__/probe-verdict.test.d.ts +1 -0
  115. package/dist/types/shared/api/host/__tests__/provision-dependency.test.d.ts +1 -0
  116. package/dist/types/shared/api/host/__tests__/release.test.d.ts +1 -0
  117. package/dist/types/shared/api/host/__tests__/tool-approval.test.d.ts +1 -0
  118. package/dist/types/shared/api/host/__tests__/tool-kit.test.d.ts +1 -0
  119. package/dist/types/shared/api/host/__tests__/tool-scope.test.d.ts +1 -0
  120. package/dist/types/shared/api/host/__tests__/tool-surface.test.d.ts +1 -0
  121. package/dist/types/shared/api/host/__tests__/unit-face.test.d.ts +1 -0
  122. package/dist/types/shared/api/host/__tests__/unit-readiness.test.d.ts +1 -0
  123. package/dist/types/shared/api/host/__tests__/unit-registry.test.d.ts +1 -0
  124. package/dist/types/shared/api/host/__tests__/value-handoff.test.d.ts +1 -0
  125. package/dist/types/shared/api/host/__tests__/version-range.test.d.ts +1 -0
  126. package/dist/types/shared/api/host/__tests__/workspace-store.test.d.ts +1 -0
  127. package/dist/types/shared/api/host/__tests__/write-result.test.d.ts +1 -0
  128. package/dist/types/shared/api/host/context-inject.d.ts +24 -0
  129. package/dist/types/shared/api/host/events.d.ts +9 -0
  130. package/dist/types/shared/api/host/git.test.d.ts +1 -0
  131. package/dist/types/shared/api/host/http.test.d.ts +1 -0
  132. package/dist/types/shared/api/host/mount-units.d.ts +52 -0
  133. package/dist/types/shared/api/host/opencli.test.d.ts +1 -0
  134. package/dist/types/shared/api/host/preflight.d.ts +58 -0
  135. package/dist/types/shared/api/host/probe-cache.d.ts +6 -0
  136. package/dist/types/shared/api/host/probe-libs.d.ts +11 -0
  137. package/dist/types/shared/api/host/probe-units.d.ts +17 -0
  138. package/dist/types/shared/api/host/probe-verdict.d.ts +7 -0
  139. package/dist/types/shared/api/host/release.d.ts +18 -0
  140. package/dist/types/shared/api/host/shell.test.d.ts +1 -0
  141. package/dist/types/shared/api/host/tool-scope.d.ts +32 -0
  142. package/dist/types/shared/api/host/unit-readiness.d.ts +7 -0
  143. package/dist/types/shared/api/host/unit-registry.d.ts +9 -0
  144. package/dist/types/shared/api/host/version-range.d.ts +2 -0
  145. package/dist/types/shared/components/BlockerState.d.ts +11 -0
  146. package/dist/types/shared/hooks/__tests__/mock-mode.test.d.ts +1 -0
  147. package/dist/types/shared/hooks/__tests__/use-api-resource.test.d.ts +1 -0
  148. package/dist/types/shared/hooks/__tests__/use-capabilities.test.d.ts +1 -0
  149. package/dist/types/shared/hooks/__tests__/use-visible-busy.test.d.ts +1 -0
  150. package/dist/types/shared/hooks/fact-transports.d.ts +2 -0
  151. package/dist/types/shared/hooks/mock-mode.d.ts +1 -0
  152. package/dist/types/shared/hooks/use-api-resource.d.ts +18 -0
  153. package/dist/types/shared/hooks/use-blocker-actions.d.ts +11 -0
  154. package/dist/types/shared/hooks/use-capabilities.d.ts +25 -0
  155. package/dist/types/shared/hooks/use-capability-gate.d.ts +20 -0
  156. package/dist/types/shared/hooks/use-card-summary.d.ts +8 -0
  157. package/dist/types/shared/hooks/use-facts.d.ts +2 -0
  158. package/dist/types/shared/hooks/use-fixture-pick.d.ts +20 -0
  159. package/dist/types/shared/hooks/use-host-write.d.ts +17 -0
  160. package/dist/types/shared/hooks/use-long-task.d.ts +14 -0
  161. package/dist/types/shared/hooks/use-unit-board.d.ts +32 -0
  162. package/dist/types/shared/hooks/use-visible-busy.d.ts +8 -0
  163. package/docs/HANDOFF.md +207 -0
  164. package/docs/OPERATIONS.md +109 -0
  165. package/icon.svg +29 -0
  166. package/package.json +97 -0
  167. package/profile/isolation.patch.yml +35 -0
  168. package/profile/sandbox.patch.yml +26 -0
  169. package/scripts/seed-profile.sh +199 -0
@@ -0,0 +1,4 @@
1
+ import type { UnitClientFace } from '@dsh-workbench/shared';
2
+ export declare function assembleClientUnits(registry: {
3
+ register(face: UnitClientFace): () => void;
4
+ }): void;
@@ -0,0 +1,12 @@
1
+ import type { UnitManifest } from '@dsh-workbench/shared';
2
+ import type { UnitClientFace } from '@dsh-workbench/shared';
3
+ import { type BoardRegistry } from '../layouts/rightbar/registry';
4
+ export interface ClientUnitRegistry {
5
+ register(face: UnitClientFace): () => void;
6
+ all(): readonly UnitClientFace[];
7
+ manifests(): readonly UnitManifest[];
8
+ readonly board: BoardRegistry;
9
+ subscribe(listener: () => void): () => void;
10
+ version(): number;
11
+ }
12
+ export declare function createClientUnitRegistry(): ClientUnitRegistry;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { UnitHostFace } from '@dsh-workbench/shared/host';
2
+ export declare const panelsHost: UnitHostFace;
@@ -0,0 +1,18 @@
1
+ import type { UnitManifest } from '@dsh-workbench/shared';
2
+ export type ShownPanels = readonly string[];
3
+ export interface PanelEntry {
4
+ readonly id: string;
5
+ readonly titleKey: string;
6
+ readonly order: number;
7
+ readonly shown: boolean;
8
+ readonly source: 'default' | 'user';
9
+ readonly hasCard: boolean;
10
+ }
11
+ export declare function parseShown(raw: unknown): string[];
12
+ export declare function parseReleased(raw: unknown): string[];
13
+ export declare function resolvePanels(manifests: readonly UnitManifest[], panels: ShownPanels | null): PanelEntry[];
14
+ export declare function withoutReleased(released: ShownPanels, id: string): string[];
15
+ export declare function withReleased(released: ShownPanels, id: string): string[];
16
+ export declare function withShown(panels: ShownPanels, id: string): string[];
17
+ export declare function withHidden(panels: ShownPanels, id: string): string[];
18
+ export declare function withMoved(panels: ShownPanels, id: string, index: number): string[];
@@ -0,0 +1,8 @@
1
+ import type { UnitCall } from '@dsh-workbench/shared/host';
2
+ import type { HandoffEntry } from '@dsh-workbench/shared/host';
3
+ import type { UnitManifest } from '@dsh-workbench/shared';
4
+ export declare const PANELS_FACT = "panels";
5
+ export declare function panelsHandoffEntry(target?: {
6
+ readonly path?: string | undefined;
7
+ }): HandoffEntry | undefined;
8
+ export declare function panelsFactsOf(call: UnitCall, manifests: readonly UnitManifest[]): readonly string[] | undefined;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,41 @@
1
+ import type { UnitCapability } from '../../../shared/api/host/probe-units';
2
+ import { type ProvisionRequest } from '@dsh-workbench/shared/host';
3
+ import type { UnitManifest } from '@dsh-workbench/shared';
4
+ import { type PluginSourceCommand, type PluginSourceProblem } from '@dsh-workbench/shared/host';
5
+ export type DependencyKind = 'plugin' | 'lib';
6
+ export interface SharedDependency {
7
+ readonly id: string;
8
+ readonly kind: DependencyKind;
9
+ readonly name: string;
10
+ readonly status: 'ok' | 'outdated' | 'unsatisfied' | 'missing' | 'unchecked';
11
+ readonly installed?: string;
12
+ readonly latest?: string;
13
+ readonly purpose?: string;
14
+ readonly usedBy: readonly string[];
15
+ }
16
+ export interface DependencyTarget {
17
+ readonly id: string;
18
+ readonly kind: DependencyKind;
19
+ readonly name: string;
20
+ readonly declarers: readonly UnitManifest[];
21
+ readonly users: readonly UnitManifest[];
22
+ }
23
+ export declare function dependencyId(kind: DependencyKind, name: string): string;
24
+ export declare function parseDependencyId(id: string): {
25
+ readonly kind: DependencyKind;
26
+ readonly name: string;
27
+ } | undefined;
28
+ export declare function findDependency(manifests: readonly UnitManifest[], id: string, isReleased?: ((unit: string) => boolean) | undefined): DependencyTarget | undefined;
29
+ export declare function affectedUnitsOf(manifests: readonly UnitManifest[], request: ProvisionRequest): readonly string[];
30
+ export declare function sharedDependencies(options: {
31
+ readonly manifests: readonly UnitManifest[];
32
+ readonly capabilities: ReadonlyMap<string, UnitCapability>;
33
+ readonly isReleased?: ((unit: string) => boolean) | undefined;
34
+ }): SharedDependency[];
35
+ export type DependencyPlan = readonly PluginSourceCommand[] | undefined;
36
+ export declare function dependencyCommandPlan(options: {
37
+ readonly target: DependencyTarget;
38
+ readonly capability: UnitCapability | undefined;
39
+ readonly command: string;
40
+ }): DependencyPlan;
41
+ export declare function sourceProblemText(problem: PluginSourceProblem, env: string | undefined): string;
@@ -0,0 +1,14 @@
1
+ import type { ProvisionRequest } from '@dsh-workbench/shared/host';
2
+ import type { MarketEntry, MarketService } from './market';
3
+ import type { SharedDependency } from './market-dependency';
4
+ export type ProvisionResult = {
5
+ readonly ok: true;
6
+ readonly action: 'install' | 'update' | 'uninstall';
7
+ readonly module: MarketEntry;
8
+ readonly keptFor?: readonly string[];
9
+ } | {
10
+ readonly ok: true;
11
+ readonly action: 'update-dependency';
12
+ readonly shared: readonly SharedDependency[];
13
+ };
14
+ export declare function dispatchMarket(market: MarketService, request: ProvisionRequest): Promise<ProvisionResult>;
@@ -0,0 +1,3 @@
1
+ import type { DshHostContext } from '@dsh-workbench/shared';
2
+ import type { MarketService } from './market';
3
+ export declare function registerMarketTools(ctx: DshHostContext, market: MarketService): Array<() => void>;
@@ -0,0 +1,49 @@
1
+ import type { DshShell } from '@dsh-workbench/shared';
2
+ import type { PluginSource, UnitManifest } from '@dsh-workbench/shared';
3
+ import type { UnitCapability } from '../../../shared/api/host/probe-units';
4
+ import type { ProvisionAction } from '@dsh-workbench/shared/host';
5
+ import type { UnitMountDeps } from '@dsh-workbench/shared/host';
6
+ import { type SharedDependency } from './market-dependency';
7
+ export type { SharedDependency } from './market-dependency';
8
+ export type MarketAction = ProvisionAction;
9
+ export interface MarketEntry {
10
+ readonly unit: string;
11
+ readonly titleKey: string;
12
+ readonly plugins: readonly {
13
+ readonly name: string;
14
+ readonly source?: PluginSource;
15
+ }[];
16
+ readonly libs: readonly {
17
+ readonly name: string;
18
+ readonly version?: string | undefined;
19
+ readonly purpose: string;
20
+ }[];
21
+ readonly capability: UnitCapability;
22
+ }
23
+ export interface UninstallResult {
24
+ readonly entry: MarketEntry;
25
+ readonly keptFor: readonly string[];
26
+ }
27
+ export interface MarketService {
28
+ list(): Promise<{
29
+ readonly modules: MarketEntry[];
30
+ readonly shared: readonly SharedDependency[];
31
+ }>;
32
+ install(unit: string): Promise<MarketEntry>;
33
+ update(unit: string): Promise<MarketEntry>;
34
+ uninstall(unit: string): Promise<UninstallResult>;
35
+ updateDependency(id: string): Promise<readonly SharedDependency[]>;
36
+ }
37
+ export declare function createMarketService(options: {
38
+ manifests: readonly UnitManifest[];
39
+ probe?: UnitMountDeps['probe'];
40
+ shell?: DshShell | undefined;
41
+ command?: string | undefined;
42
+ onInstalled?: (unit: string) => void;
43
+ onUninstalled?: (unit: string) => void;
44
+ isReleased?: (unit: string) => boolean;
45
+ logger?: {
46
+ info?(message: string): void;
47
+ warn?(message: string): void;
48
+ } | undefined;
49
+ }): MarketService;
@@ -0,0 +1,13 @@
1
+ import type { PanelsService } from './service';
2
+ export declare const PANELS_PREF_RESOURCE = "panels";
3
+ export interface PanelsPrefAction {
4
+ readonly action: 'show' | 'hide' | 'enable' | 'disable' | 'move' | 'reset';
5
+ readonly id?: string;
6
+ readonly index?: number;
7
+ readonly path?: string;
8
+ }
9
+ export declare function parsePanelsPrefAction(payload: unknown): PanelsPrefAction;
10
+ export declare function applyPanelsPref(panels: PanelsService, payload: unknown): {
11
+ ok: true;
12
+ units: unknown;
13
+ };
@@ -0,0 +1,4 @@
1
+ import { type RouteTable } from '@dsh-workbench/shared/host';
2
+ import type { ValueHandoff } from '@dsh-workbench/shared/host';
3
+ import type { PanelsService } from './service';
4
+ export declare function panelRoutes(panels: PanelsService, values?: ValueHandoff): RouteTable;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,25 @@
1
+ import type { WorkspaceStore } from '@dsh-workbench/shared/host';
2
+ import type { UnitManifest } from '@dsh-workbench/shared';
3
+ import { type PanelEntry } from './config';
4
+ export declare const PANELS_MODULE_ID = "panels";
5
+ export declare const PANELS_FILE = "config.json";
6
+ export declare const RELEASED_FILE = "released.json";
7
+ export interface PanelsService {
8
+ list(workspace: string | null): PanelEntry[];
9
+ isReleased(id: string): boolean;
10
+ release(id: string): void;
11
+ accept(id: string): void;
12
+ subscribe(listener: () => void): () => void;
13
+ isEnabled(id: string, workspace: string | null): boolean;
14
+ show(id: string, workspace: string | null): PanelEntry[];
15
+ hide(id: string, workspace: string | null): PanelEntry[];
16
+ move(id: string, index: number, workspace: string | null): PanelEntry[];
17
+ resetWorkspace(workspace: string | null): PanelEntry[];
18
+ }
19
+ export declare function createPanelsService(options: {
20
+ manifests: () => readonly UnitManifest[];
21
+ store: WorkspaceStore;
22
+ logger?: {
23
+ warn?(message: string): void;
24
+ } | undefined;
25
+ }): PanelsService;
@@ -0,0 +1,4 @@
1
+ import type { DshHostContext } from '@dsh-workbench/shared';
2
+ import type { ValueHandoff } from '@dsh-workbench/shared/host';
3
+ import type { PanelsService } from './service';
4
+ export declare function registerPanelTools(ctx: DshHostContext, panels: PanelsService, values?: ValueHandoff): Array<() => void>;
@@ -0,0 +1,4 @@
1
+ import type { UnitManifest } from '@dsh-workbench/shared';
2
+ export declare const PANELS_TOOL = "workbench_panels";
3
+ export declare const MODULES_TOOL = "workbench_modules";
4
+ export declare const panelsUnit: UnitManifest;
@@ -0,0 +1 @@
1
+ export { currentSessionId, sessionNode, orderSessionRows, sessionRows, workspaceOfSession, sessionStatuses, visiblePendingKind, type SessionNode, type SessionStatusDot, } from './model/session-node';
@@ -0,0 +1,25 @@
1
+ import type { SessionStatusSnapshot, SessionSummary, SessionsSnapshot, Translate } from '@dsh-workbench/shared';
2
+ export interface SessionNode {
3
+ readonly id: string;
4
+ readonly title: string;
5
+ readonly blank: boolean;
6
+ readonly running: boolean;
7
+ readonly runningSubagentCount: number;
8
+ readonly completed: boolean;
9
+ readonly pinned: boolean;
10
+ readonly updatedAt: number;
11
+ readonly pendingInteraction: string | undefined;
12
+ }
13
+ export interface SessionStatusDot {
14
+ readonly state: 'ongoing' | 'warning' | 'done' | 'idle';
15
+ readonly label: string;
16
+ }
17
+ export declare function visiblePendingKind(kind: string | undefined): string | undefined;
18
+ export declare function sessionNode(summary: SessionSummary, statusById: SessionStatusSnapshot, list: SessionsSnapshot, pinnedIds: ReadonlySet<string>, archivedIds: ReadonlySet<string>): SessionNode;
19
+ export declare function sessionStatuses(node: SessionNode, t: Translate): SessionStatusDot[];
20
+ export declare function currentSessionId(list: SessionsSnapshot, panelActive: boolean): string | undefined;
21
+ export declare function orderSessionRows(rows: readonly SessionSummary[], pinnedIds: ReadonlySet<string>, archivedIds: ReadonlySet<string>): SessionSummary[];
22
+ export declare function workspaceOfSession<T extends {
23
+ readonly sessionIds: readonly string[];
24
+ }>(workspaces: readonly T[], sessionId: string | undefined): T | null;
25
+ export declare function sessionRows(workspaceSessionIds: readonly string[], list: SessionsSnapshot, archivedIds: ReadonlySet<string>, current?: string | undefined): SessionSummary[];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { DshClientContext } from '@dsh-workbench/shared';
2
+ import { type ContextRef } from '@dsh-workbench/shared';
3
+ export declare const CONTEXT_SOURCE = "workbench";
4
+ export type ChipResult = 'inserted' | 'unavailable';
5
+ export interface ContextChipsDeps {
6
+ currentSessionId(): string | undefined;
7
+ }
8
+ export declare function installContextChips(ctx: DshClientContext, deps: ContextChipsDeps): void;
9
+ export declare function addContextChip(ref: ContextRef, label: string): ChipResult;
10
+ export declare function serializeChipRef(encoded: string): string;
@@ -0,0 +1,19 @@
1
+ import { createFakeShell } from '@dsh-workbench/shared/host';
2
+ export declare const GOOD_BRIDGE_REPORT: string;
3
+ export declare const ALL_OK: {
4
+ stdout: string;
5
+ }[];
6
+ export declare const STALE_DAEMON_BRIDGE: string;
7
+ export declare const BROKEN_BRIDGE: string;
8
+ export declare function build(replies: Parameters<typeof createFakeShell>[0], install?: () => Promise<{
9
+ ok: boolean;
10
+ detail: string;
11
+ }>, warmReads?: () => readonly (readonly string[])[]): {
12
+ fake: {
13
+ shell: import("@dsh-workbench/shared").DshShell;
14
+ calls: import("@dsh-workbench/shared/host").ShellCall[];
15
+ peak: () => number;
16
+ commands: () => string[];
17
+ };
18
+ preflight: import("../preflight").Preflight;
19
+ };
@@ -0,0 +1,24 @@
1
+ import { type ContextRef } from '@dsh-workbench/shared';
2
+ import type { ContextRenderer } from '@dsh-workbench/shared/host';
3
+ export declare const CONTEXT_SOURCE_KIND = "workbench";
4
+ export interface ScannableMessage {
5
+ readonly source?: {
6
+ readonly kind?: string;
7
+ };
8
+ readonly content?: readonly {
9
+ readonly type?: string;
10
+ readonly text?: string;
11
+ }[];
12
+ }
13
+ export type { ContextRenderer };
14
+ export declare function collectContextRefs(messages: readonly ScannableMessage[]): ContextRef[];
15
+ export declare function buildContextMessage(text: string, summary: string): unknown;
16
+ export interface ContextInjector {
17
+ inject(messages: readonly ScannableMessage[], agent: unknown): Promise<unknown | undefined>;
18
+ }
19
+ export declare function createContextInjector(options: {
20
+ renderers: ReadonlyMap<string, ContextRenderer>;
21
+ logger?: {
22
+ warn?(message: string): void;
23
+ } | undefined;
24
+ }): ContextInjector;
@@ -0,0 +1,9 @@
1
+ import type { DshHostContext, DshRequest, DshResponse } from '@dsh-workbench/shared';
2
+ import type { FactLog } from '@dsh-workbench/shared/host';
3
+ export interface FactStream {
4
+ handler(req: DshRequest, res: DshResponse): void;
5
+ closeAll(): void;
6
+ size(): number;
7
+ }
8
+ export declare function createFactStream(log: FactLog): FactStream;
9
+ export declare function registerFactStream(ctx: DshHostContext, log: FactLog): () => void;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,52 @@
1
+ import type { DshHostContext } from '@dsh-workbench/shared';
2
+ import type { UnitManifest } from '@dsh-workbench/shared';
3
+ import { type RouteTable } from '@dsh-workbench/shared/host';
4
+ import type { ContextRenderer, UnitHostFace, UnitMountDeps, UnitMountResult, UnitCall } from '@dsh-workbench/shared/host';
5
+ import { type UnitReadiness } from './unit-readiness';
6
+ export interface MountedUnit {
7
+ readonly face: UnitHostFace;
8
+ readonly result: UnitMountResult;
9
+ readonly readiness: UnitReadiness;
10
+ }
11
+ export interface UnitsPlan {
12
+ readonly mounted: readonly MountedUnit[];
13
+ readonly routes: RouteTable;
14
+ readonly gate: UnitMountResult['gate'];
15
+ readonly prefs: ReadonlyArray<{
16
+ readonly resource: string;
17
+ readonly unit: string;
18
+ handle(payload: unknown): unknown;
19
+ }>;
20
+ readonly actions: ReadonlyArray<{
21
+ readonly resource: string;
22
+ readonly unit: string;
23
+ handle(payload: unknown): unknown;
24
+ }>;
25
+ readonly provision: UnitMountResult['provision'];
26
+ readonly contextRenderers: ReadonlyMap<string, ContextRenderer>;
27
+ readonly owners: ReadonlyMap<string, string>;
28
+ readonly routesOfUnit: ReadonlyMap<string, readonly string[]>;
29
+ readonly factsOf: ReadonlyMap<string, (call: UnitCall) => readonly string[] | undefined>;
30
+ readonly skipped: ReadonlyArray<{
31
+ readonly id: string;
32
+ readonly missing: readonly string[];
33
+ }>;
34
+ readonly warmReads: () => readonly (readonly string[])[];
35
+ readonly disposeLongTasks: () => void;
36
+ }
37
+ export declare function mountUnits(faces: readonly UnitHostFace[], deps: {
38
+ ctx: DshHostContext;
39
+ logger?: {
40
+ info?(m: string): void;
41
+ warn?(m: string): void;
42
+ } | undefined;
43
+ manifests: () => readonly UnitManifest[];
44
+ opencliCommand?: string;
45
+ probe?: UnitMountDeps['probe'];
46
+ store?: UnitMountDeps['store'];
47
+ values?: UnitMountDeps['values'];
48
+ longTasks?: {
49
+ readonly scope: string;
50
+ readonly bump: (facts: readonly string[]) => void;
51
+ } | undefined;
52
+ }): UnitsPlan;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,58 @@
1
+ import type { DshShell } from '@dsh-workbench/shared';
2
+ export type PreflightStepId = 'opencli' | 'bridge' | 'warm';
3
+ export type PreflightStepStatus = 'pending' | 'running' | 'ok' | 'warn' | 'failed';
4
+ export interface PreflightStep {
5
+ readonly id: PreflightStepId;
6
+ readonly status: PreflightStepStatus;
7
+ readonly detail?: string;
8
+ readonly action?: string;
9
+ readonly command?: string;
10
+ }
11
+ export type PreflightFailure = 'permission' | 'network' | 'missing' | 'unknown';
12
+ export declare function classifyFailure(text: string): PreflightFailure;
13
+ export type PreflightGuidance = 'install' | 'path' | 'shell';
14
+ export type PreflightBridgeIssue = 'daemon' | 'extension' | 'profile' | 'stale' | 'unknown';
15
+ export declare function readBridgeReport(stdout: string): {
16
+ readonly ok: boolean;
17
+ readonly issues: readonly PreflightBridgeIssue[];
18
+ readonly detail: string;
19
+ };
20
+ export interface PreflightSnapshot {
21
+ readonly phase: 'idle' | 'checking' | 'installing' | 'ready' | 'failed';
22
+ readonly steps: readonly PreflightStep[];
23
+ readonly at: number;
24
+ readonly error?: string;
25
+ readonly failure?: PreflightFailure;
26
+ readonly guidance?: PreflightGuidance;
27
+ readonly bridgeIssues?: readonly PreflightBridgeIssue[];
28
+ }
29
+ export interface Preflight {
30
+ run(options?: {
31
+ force?: boolean;
32
+ }): Promise<PreflightSnapshot>;
33
+ snapshot(): PreflightSnapshot;
34
+ }
35
+ export declare const OPENCLI_INSTALL_COMMAND: string;
36
+ export interface BridgeVerdict {
37
+ readonly ok: boolean;
38
+ readonly detail: string;
39
+ readonly issues: readonly PreflightBridgeIssue[];
40
+ readonly command?: string | undefined;
41
+ }
42
+ export declare function canWarm(bridge: {
43
+ ok: boolean;
44
+ issues: readonly PreflightBridgeIssue[];
45
+ }): boolean;
46
+ export declare function createPreflight(options: {
47
+ shell: DshShell;
48
+ command?: string;
49
+ installCommand?: string;
50
+ logger?: {
51
+ warn?(message: string): void;
52
+ } | undefined;
53
+ install?: (() => Promise<{
54
+ ok: boolean;
55
+ detail: string;
56
+ }>) | undefined;
57
+ warmReads?: (() => readonly (readonly string[])[]) | undefined;
58
+ }): Preflight;
@@ -0,0 +1,6 @@
1
+ export interface TimedMemo<T> {
2
+ get(key: string, now?: number): T | undefined;
3
+ set(key: string, value: T, now?: number): void;
4
+ clear(): void;
5
+ }
6
+ export declare function createTimedMemo<T>(ttlMs: number): TimedMemo<T>;
@@ -0,0 +1,11 @@
1
+ import type { DshShell } from '@dsh-workbench/shared';
2
+ export type { UnitCapability, UnitCommands, UnitLibState, UnitPluginState } from '@dsh-workbench/shared/host';
3
+ import type { UnitLibState } from '@dsh-workbench/shared/host';
4
+ import type { UnitLibNeed } from '@dsh-workbench/shared';
5
+ export declare function installedLibVersion(name: string): string | undefined;
6
+ export declare function probeLibs(options: {
7
+ readonly needs: readonly UnitLibNeed[];
8
+ readonly shell: DshShell;
9
+ readonly force: boolean;
10
+ }): Promise<ReadonlyMap<string, UnitLibState>>;
11
+ export declare function resetLibCache(): void;