@dsh-workbench/core 0.3.11 → 1.0.0-beta.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 (224) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +148 -117
  3. package/bin/dsh-workbench +130 -29
  4. package/bin/dsh-workbench.cmd +5 -0
  5. package/bin/opencli-isolated +3 -2
  6. package/bin/opencli-isolated.mjs +44 -0
  7. package/bin/opencli-node-mode.cjs +1 -0
  8. package/bin/seed-workshop-windows.mjs +307 -0
  9. package/client.js +6572 -3959
  10. package/cordis.patch.yml +3 -3
  11. package/dist/client/client.body.js +6572 -3959
  12. package/dist/client/index.js +6417 -3804
  13. package/dist/host/index.js +5704 -5945
  14. package/dist/types/app/client.d.ts +1 -0
  15. package/dist/types/app/host.d.ts +2 -1
  16. package/dist/types/app/layouts/approval-detail.d.ts +3 -0
  17. package/dist/types/app/layouts/env-gate/boot-gate.d.ts +1 -12
  18. package/dist/types/app/layouts/env-gate/gate-text.d.ts +2 -1
  19. package/dist/types/app/layouts/market/DiscoverPanel.d.ts +8 -0
  20. package/dist/types/app/layouts/market/add-module-text.d.ts +1 -1
  21. package/dist/types/app/layouts/market/discover-categories.d.ts +8 -0
  22. package/dist/types/app/layouts/market/discover-confirm.d.ts +14 -0
  23. package/dist/types/app/layouts/market/discover-detail.d.ts +12 -0
  24. package/dist/types/app/layouts/market/discover-dialogs.d.ts +7 -0
  25. package/dist/types/app/layouts/market/discover-doc.d.ts +18 -0
  26. package/dist/types/app/layouts/market/discover-init-dialog.d.ts +10 -0
  27. package/dist/types/app/layouts/market/discover-rows.d.ts +24 -0
  28. package/dist/types/app/layouts/market/discover-sources-dialog.d.ts +16 -0
  29. package/dist/types/app/layouts/market/discover-states.d.ts +22 -0
  30. package/dist/types/app/layouts/market/discover-toolbar.d.ts +23 -0
  31. package/dist/types/app/layouts/market/discover-versions.d.ts +9 -0
  32. package/dist/types/app/layouts/market/discover-view.d.ts +38 -0
  33. package/dist/types/app/layouts/market/market-header.d.ts +13 -0
  34. package/dist/types/app/layouts/market/panel.d.ts +1 -1
  35. package/dist/types/app/layouts/market/use-add-module.d.ts +1 -1
  36. package/dist/types/app/layouts/market/use-discover.d.ts +72 -0
  37. package/dist/types/app/layouts/market/use-module-versions.d.ts +1 -8
  38. package/dist/types/app/layouts/rightbar/MarketView.d.ts +1 -1
  39. package/dist/types/app/layouts/rightbar/Rightbar.d.ts +1 -1
  40. package/dist/types/app/layouts/rightbar/board-shape.d.ts +1 -14
  41. package/dist/types/app/layouts/rightbar/market-busy.d.ts +0 -22
  42. package/dist/types/app/layouts/rightbar/market-change.d.ts +1 -1
  43. package/dist/types/app/layouts/rightbar/market-hint.d.ts +1 -7
  44. package/dist/types/app/layouts/rightbar/market-plugin-rows.d.ts +0 -7
  45. package/dist/types/app/layouts/rightbar/market-row-icon.d.ts +1 -1
  46. package/dist/types/app/layouts/rightbar/market-row-types.d.ts +2 -2
  47. package/dist/types/app/layouts/rightbar/market-rows.d.ts +1 -1
  48. package/dist/types/app/layouts/rightbar/market-section-icon.d.ts +1 -1
  49. package/dist/types/app/layouts/rightbar/market-settle-hold.d.ts +1 -1
  50. package/dist/types/app/layouts/rightbar/market-settle.d.ts +4 -7
  51. package/dist/types/app/layouts/rightbar/market-shared-rows.d.ts +1 -1
  52. package/dist/types/app/layouts/rightbar/market-update-verdict.d.ts +1 -11
  53. package/dist/types/app/layouts/rightbar/market-view-text.d.ts +5 -1
  54. package/dist/types/app/layouts/rightbar/market-workbench-row.d.ts +1 -1
  55. package/dist/types/app/layouts/rightbar/store.d.ts +0 -12
  56. package/dist/types/app/layouts/sidebar/LongTaskDot.d.ts +0 -6
  57. package/dist/types/app/layouts/sidebar/LongTaskHover.d.ts +0 -6
  58. package/dist/types/app/layouts/sidebar/edition-boot.d.ts +1 -19
  59. package/dist/types/app/layouts/sidebar/edition.d.ts +1 -18
  60. package/dist/types/app/layouts/sidebar/use-attention.d.ts +0 -4
  61. package/dist/types/app/layouts/sidebar/workshop-preset.d.ts +2 -0
  62. package/dist/types/app/layouts/workbench-settings/AdapterSetItem.d.ts +5 -0
  63. package/dist/types/app/layouts/workbench-settings/ConfigSyncRows.d.ts +11 -0
  64. package/dist/types/app/layouts/workbench-settings/NewWorkbenchItem.d.ts +5 -0
  65. package/dist/types/app/layouts/workbench-settings/SettingsItem.d.ts +0 -9
  66. package/dist/types/app/layouts/workbench-settings/SidebarEditionItem.d.ts +0 -6
  67. package/dist/types/app/layouts/workbench-settings/WorkbenchSettingsSection.d.ts +0 -6
  68. package/dist/types/app/units/manifests.d.ts +1 -1
  69. package/dist/types/{app/units → kernel/client}/registry.d.ts +1 -1
  70. package/dist/types/kernel/contract/bundle-install.d.ts +2 -0
  71. package/dist/types/kernel/contract/config-sync.d.ts +2 -0
  72. package/dist/types/kernel/contract/diy.d.ts +1 -0
  73. package/dist/types/kernel/contract/dsh-plugins.d.ts +2 -0
  74. package/dist/types/kernel/contract/index.d.ts +4 -0
  75. package/dist/types/kernel/contract/long-tasks.d.ts +2 -0
  76. package/dist/types/kernel/contract/market-index.d.ts +2 -0
  77. package/dist/types/kernel/contract/platform.d.ts +1 -0
  78. package/dist/types/kernel/contract/preflight-wake.d.ts +2 -0
  79. package/dist/types/kernel/contract/profile-create.d.ts +2 -0
  80. package/dist/types/kernel/contract/sidebar-edition.d.ts +2 -0
  81. package/dist/types/kernel/contract/unit-manifests.d.ts +2 -0
  82. package/dist/types/{shared/api → kernel}/host/mount-units.d.ts +2 -1
  83. package/dist/types/modules/panels/client.d.ts +1 -1
  84. package/dist/types/modules/panels/model/approval.d.ts +3 -15
  85. package/dist/types/modules/panels/model/diy-changelog.d.ts +2 -0
  86. package/dist/types/modules/panels/model/diy-context.d.ts +1 -16
  87. package/dist/types/modules/panels/model/diy-page.d.ts +1 -0
  88. package/dist/types/modules/panels/model/diy-record-open.d.ts +0 -15
  89. package/dist/types/modules/panels/model/diy-record-text.d.ts +0 -2
  90. package/dist/types/modules/panels/model/diy-record.d.ts +0 -30
  91. package/dist/types/modules/panels/model/diy-tools.d.ts +1 -0
  92. package/dist/types/modules/panels/model/long-task-tools.d.ts +0 -11
  93. package/dist/types/modules/panels/model/market-dependency-update.d.ts +1 -7
  94. package/dist/types/modules/panels/model/market-dependency.d.ts +15 -10
  95. package/dist/types/modules/panels/model/market-discover-routes.d.ts +3 -0
  96. package/dist/types/modules/panels/model/market-discover.d.ts +33 -0
  97. package/dist/types/modules/panels/model/market-dispatch.d.ts +3 -3
  98. package/dist/types/modules/panels/model/market-env.d.ts +2 -3
  99. package/dist/types/modules/panels/model/market-registry.d.ts +3 -3
  100. package/dist/types/modules/panels/model/market-restart.d.ts +1 -1
  101. package/dist/types/modules/panels/model/market-route.d.ts +5 -3
  102. package/dist/types/modules/panels/model/market-sources-act.d.ts +9 -0
  103. package/dist/types/modules/panels/model/market-types.d.ts +6 -13
  104. package/dist/types/modules/panels/model/market-update-bundle.d.ts +3 -9
  105. package/dist/types/modules/panels/model/market-verify.d.ts +3 -19
  106. package/dist/types/modules/panels/model/market-workbench-update.d.ts +3 -2
  107. package/dist/types/modules/panels/model/market.d.ts +6 -5
  108. package/dist/types/modules/panels/model/plugin-actions.d.ts +2 -1
  109. package/dist/types/modules/panels/model/plugin-section.d.ts +3 -1
  110. package/dist/types/modules/panels/model/publish-preview-routes.d.ts +2 -0
  111. package/dist/types/modules/panels/unit.d.ts +7 -3
  112. package/dist/types/modules/sessions/model/attention.d.ts +0 -11
  113. package/dist/types/modules/sessions/model/session-node.d.ts +0 -10
  114. package/dist/types/shared/api/diy.d.ts +6 -4
  115. package/dist/types/shared/api/host/approval-call.d.ts +0 -9
  116. package/dist/types/shared/api/host/approval-gate.d.ts +0 -13
  117. package/dist/types/shared/api/host/bundle-routes.d.ts +1 -1
  118. package/dist/types/shared/api/host/diy-artifacts.d.ts +0 -11
  119. package/dist/types/shared/api/host/diy-changelog.d.ts +13 -0
  120. package/dist/types/shared/api/host/diy-components.d.ts +2 -3
  121. package/dist/types/shared/api/host/diy-modules.d.ts +0 -16
  122. package/dist/types/shared/api/host/diy-publish-preview.d.ts +4 -0
  123. package/dist/types/shared/api/host/diy-recon-fs.d.ts +2 -2
  124. package/dist/types/shared/api/host/diy-tokens.d.ts +8 -0
  125. package/dist/types/shared/api/host/host-routes.d.ts +3 -6
  126. package/dist/types/shared/api/host/long-task-notice.d.ts +0 -20
  127. package/dist/types/shared/api/host/long-tasks.d.ts +1 -8
  128. package/dist/types/shared/api/host/market-doc.d.ts +21 -0
  129. package/dist/types/shared/api/host/market-index-fetch.d.ts +37 -0
  130. package/dist/types/shared/api/host/market-source-init.d.ts +22 -0
  131. package/dist/types/shared/api/host/market-sources-store.d.ts +15 -0
  132. package/dist/types/shared/api/host/permission-mode.d.ts +0 -5
  133. package/dist/types/shared/api/host/post-channels.d.ts +1 -1
  134. package/dist/types/shared/api/host/sidebar-edition.d.ts +1 -33
  135. package/dist/types/shared/api/host/unit-roster-facts.d.ts +1 -1
  136. package/dist/types/shared/api/host/workspace-root.d.ts +0 -7
  137. package/dist/types/shared/api/platform/client.d.ts +10 -0
  138. package/dist/types/shared/api/unit-board.d.ts +0 -16
  139. package/dist/types/shared/api/write-outcome.d.ts +0 -12
  140. package/dist/types/shared/components/IconModules.d.ts +0 -6
  141. package/dist/types/shared/components/PanelFoot.d.ts +0 -9
  142. package/dist/types/shared/components/blocker-action.d.ts +0 -13
  143. package/dist/types/shared/dev-surface/index.d.ts +5 -0
  144. package/dist/types/shared/dev-surface/types.d.ts +79 -0
  145. package/dist/types/shared/hooks/bundle-queries.d.ts +1 -13
  146. package/dist/types/shared/hooks/fact-transport.d.ts +4 -0
  147. package/dist/types/shared/hooks/fact-transports.d.ts +0 -4
  148. package/dist/types/shared/hooks/market-queries.d.ts +11 -0
  149. package/dist/types/shared/hooks/panel-state-report.d.ts +0 -12
  150. package/dist/types/shared/hooks/sidebar-edition.d.ts +1 -6
  151. package/dist/types/shared/hooks/use-blocker-actions.d.ts +0 -8
  152. package/dist/types/shared/hooks/use-capabilities.d.ts +0 -59
  153. package/dist/types/shared/hooks/use-diy-debug.d.ts +0 -13
  154. package/dist/types/shared/hooks/use-diy-record.d.ts +0 -13
  155. package/dist/types/shared/hooks/use-shell-long-tasks.d.ts +1 -7
  156. package/icon.svg +17 -28
  157. package/package.json +33 -13
  158. package/preset/diy.patch.yml +1 -1
  159. package/profile/isolation.patch.yml +8 -8
  160. package/profile/sandbox.patch.yml +2 -2
  161. package/scripts/clone-profile.mjs +268 -0
  162. package/scripts/create-workbench.mjs +166 -0
  163. package/scripts/seed-profile.sh +22 -10
  164. package/scripts/seed-workshop.sh +17 -19
  165. package/skills/workbench-module-diy/BUILD.md +4 -11
  166. package/skills/workbench-module-diy/COPY.md +1 -1
  167. package/skills/workbench-module-diy/DATASOURCE.md +107 -22
  168. package/skills/workbench-module-diy/DESIGN.md +2 -1
  169. package/skills/workbench-module-diy/FAMILY.md +48 -68
  170. package/skills/workbench-module-diy/KIT.md +2 -1
  171. package/skills/workbench-module-diy/LINKAGE.md +1 -1
  172. package/skills/workbench-module-diy/PANEL.md +5 -3
  173. package/skills/workbench-module-diy/REVIEW.md +7 -7
  174. package/skills/workbench-module-diy/SKILL.md +20 -11
  175. package/skills/workbench-module-diy/STEPS.md +1 -1
  176. package/skills/workbench-module-diy/TOOLS.md +33 -9
  177. package/skills/workbench-module-diy/WIRING.md +18 -6
  178. package/skills/workbench-module-diy/WRITES.md +30 -4
  179. package/dist/types/shared/api/bundle-install.d.ts +0 -136
  180. package/dist/types/shared/api/config-sync.d.ts +0 -35
  181. package/dist/types/shared/api/dsh-plugins.d.ts +0 -11
  182. package/dist/types/shared/api/host/bundle-manager.d.ts +0 -11
  183. package/dist/types/shared/api/host/config-sync.d.ts +0 -46
  184. package/dist/types/shared/api/host/diy-preset-health.d.ts +0 -35
  185. package/dist/types/shared/api/host/dsh-plugins.d.ts +0 -5
  186. package/dist/types/shared/api/host/installed-module.d.ts +0 -54
  187. package/dist/types/shared/api/host/installed-module.test.d.ts +0 -1
  188. package/dist/types/shared/api/host/opencli-command.d.ts +0 -10
  189. package/dist/types/shared/api/host/opencli-command.test.d.ts +0 -1
  190. package/dist/types/shared/api/host/opencli.test.d.ts +0 -1
  191. package/dist/types/shared/api/host/package-content.d.ts +0 -6
  192. package/dist/types/shared/api/host/package-content.test.d.ts +0 -1
  193. package/dist/types/shared/api/host/package-kind.d.ts +0 -21
  194. package/dist/types/shared/api/host/package-kind.test.d.ts +0 -1
  195. package/dist/types/shared/api/host/package-route.d.ts +0 -23
  196. package/dist/types/shared/api/host/package-route.test.d.ts +0 -1
  197. package/dist/types/shared/api/host/plugin-catalog.d.ts +0 -65
  198. package/dist/types/shared/api/host/plugin-login-hint.d.ts +0 -2
  199. package/dist/types/shared/api/host/plugin-tools.d.ts +0 -14
  200. package/dist/types/shared/api/host/plugin-units.d.ts +0 -48
  201. package/dist/types/shared/api/host/preflight-route.d.ts +0 -15
  202. package/dist/types/shared/api/host/preflight.d.ts +0 -75
  203. package/dist/types/shared/api/host/probe-cache.d.ts +0 -6
  204. package/dist/types/shared/api/host/probe-libs.d.ts +0 -11
  205. package/dist/types/shared/api/host/probe-units.d.ts +0 -17
  206. package/dist/types/shared/api/host/probe-verdict.d.ts +0 -7
  207. package/dist/types/shared/api/host/profile-registries.d.ts +0 -21
  208. package/dist/types/shared/api/host/registry-declaration.d.ts +0 -23
  209. package/dist/types/shared/api/host/release.d.ts +0 -24
  210. package/dist/types/shared/api/host/runtime-seed.d.ts +0 -40
  211. package/dist/types/shared/api/host/self-update.d.ts +0 -52
  212. package/dist/types/shared/api/host/version-range.d.ts +0 -2
  213. package/dist/types/shared/api/long-tasks.d.ts +0 -19
  214. package/dist/types/shared/api/sidebar-edition.d.ts +0 -14
  215. package/dist/types/shared/api/unit-manifests.d.ts +0 -6
  216. package/docs/HANDOFF.md +0 -333
  217. package/docs/OPERATIONS.md +0 -240
  218. package/skills/workbench-module-diy/TOOLING.md +0 -38
  219. /package/dist/types/{app/layouts/rightbar/registry.d.ts → kernel/client/board-registry.d.ts} +0 -0
  220. /package/dist/types/{app/layouts/rightbar/registry.test.d.ts → kernel/contract/contracts.test.d.ts} +0 -0
  221. /package/dist/types/{shared/api/host/bundle-manager.test.d.ts → kernel/contract/index.test.d.ts} +0 -0
  222. /package/dist/types/{shared/api → kernel}/host/unit-readiness.d.ts +0 -0
  223. /package/dist/types/{shared/api → kernel}/host/unit-registry.d.ts +0 -0
  224. /package/dist/types/shared/{api/host/dsh-plugins.test.d.ts → dev-surface/install.d.ts} +0 -0
@@ -1,23 +0,0 @@
1
- import type { DshShell } from '@dsh-workbench/shared';
2
- import { type ResolvedPluginSource } from '@dsh-workbench/shared/host';
3
- export type PackageRouteKind = 'opencli-plugin' | 'dsh-bundle' | 'neither';
4
- export interface PackageRoute {
5
- readonly kind: PackageRouteKind;
6
- readonly pkg?: string;
7
- readonly pluginName?: string;
8
- }
9
- export declare const LOCAL_PLUGIN_ENV = "DSH_WB_OPENCLI_PLUGIN_PATH";
10
- export declare const PLUGIN_REGISTRY_ENV = "DSH_WB_OPENCLI_PLUGIN_REGISTRY";
11
- export declare function packageRouteOf(options: {
12
- readonly spec: string;
13
- readonly shell?: DshShell | undefined;
14
- readonly registry?: string | undefined;
15
- readonly force?: boolean;
16
- }): Promise<PackageRoute | undefined>;
17
- export declare function resetPackageRouteCache(): void;
18
- export declare function pluginInstallPlan(options: {
19
- readonly spec: string;
20
- readonly command: string;
21
- readonly registry?: string | undefined;
22
- readonly pluginName?: string | undefined;
23
- }): ResolvedPluginSource;
@@ -1 +0,0 @@
1
- export {};
@@ -1,65 +0,0 @@
1
- import type { DshShell } from '@dsh-workbench/shared';
2
- export interface PluginCommandArg {
3
- readonly name: string;
4
- readonly type: string;
5
- readonly required: boolean;
6
- readonly positional: boolean;
7
- readonly valueRequired: boolean;
8
- readonly choices: readonly string[];
9
- readonly defaultValue?: unknown;
10
- readonly help: string;
11
- }
12
- export interface PluginCommand {
13
- readonly plugin: string;
14
- readonly name: string;
15
- readonly description: string;
16
- readonly access: string;
17
- readonly browser: boolean;
18
- readonly siteSession: string;
19
- readonly domain?: string;
20
- readonly args: readonly PluginCommandArg[];
21
- }
22
- export interface PluginCommandSet {
23
- readonly plugin: string;
24
- readonly version: string;
25
- readonly commands: readonly PluginCommand[];
26
- }
27
- export interface PluginRow {
28
- readonly name: string;
29
- readonly version: string;
30
- readonly commands: readonly string[];
31
- }
32
- export interface CommandRow {
33
- readonly site: string;
34
- readonly name: string;
35
- readonly description: string;
36
- readonly access: string;
37
- readonly browser: boolean;
38
- readonly siteSession: string;
39
- readonly domain?: string;
40
- readonly args: readonly PluginCommandArg[];
41
- }
42
- export interface PluginCatalogSnapshot {
43
- readonly ok: boolean;
44
- readonly at: number;
45
- readonly sets: readonly PluginCommandSet[];
46
- readonly problems: readonly string[];
47
- }
48
- export interface PluginCatalog {
49
- refresh(options?: {
50
- readonly force?: boolean;
51
- }): Promise<PluginCatalogSnapshot>;
52
- snapshot(): PluginCatalogSnapshot;
53
- }
54
- export interface PluginCatalogOptions {
55
- readonly shell?: DshShell | undefined;
56
- readonly command: string;
57
- readonly timeoutMs?: number;
58
- }
59
- export declare function parsePluginRows(stdout: string): PluginRow[] | undefined;
60
- export declare function parseCommandRows(stdout: string): CommandRow[] | undefined;
61
- export declare function attributeCommands(plugins: readonly PluginRow[], rows: readonly CommandRow[]): {
62
- readonly sets: PluginCommandSet[];
63
- readonly problems: string[];
64
- };
65
- export declare function createPluginCatalog(options: PluginCatalogOptions): PluginCatalog;
@@ -1,2 +0,0 @@
1
- export declare function loginUrlOfDomain(domain: string | undefined): string | undefined;
2
- export declare function pluginLoginHint(error: unknown, domain: string | undefined): string;
@@ -1,14 +0,0 @@
1
- import type { ApprovalDetail, ApprovalPolicy, OpencliSession } from '@dsh-workbench/shared/host';
2
- import type { PluginCommand } from './plugin-catalog';
3
- export declare const RUN_CODE_TOOL = "run_code";
4
- export declare const PLUGIN_PROMPT_BUDGET = 4000;
5
- export declare function pluginToolName(plugin: string, command: string): string;
6
- export declare function pluginPromptChars(command: PluginCommand): number;
7
- export declare function pluginToolParameters(command: PluginCommand): Record<string, unknown>;
8
- export declare function pluginToolDescription(command: PluginCommand): string;
9
- export declare function pluginToolWrites(command: PluginCommand): boolean;
10
- export declare function pluginToolSession(command: PluginCommand): OpencliSession;
11
- export declare function pluginToolArgv(command: PluginCommand, raw: unknown): string[];
12
- export declare function pluginKeyArgs(command: PluginCommand, raw: unknown): string;
13
- export declare function pluginApprovalQuestion(command: PluginCommand, raw: unknown): ApprovalDetail;
14
- export declare function pluginApprovalFor(command: PluginCommand): ApprovalPolicy;
@@ -1,48 +0,0 @@
1
- import type { Opencli } from '@dsh-workbench/shared/host';
2
- import type { PluginCatalog } from './plugin-catalog';
3
- import type { UnitRegistry } from './unit-registry';
4
- export interface PluginRowRef {
5
- readonly id: string;
6
- readonly pkg: string;
7
- readonly name?: string | undefined;
8
- }
9
- export interface PluginRowsSource {
10
- listPlugins(workspace: string | null): readonly PluginRowRef[];
11
- subscribe?(listener: () => void): () => void;
12
- }
13
- export interface PluginUnitRow {
14
- readonly plugin: string;
15
- readonly pkg: string;
16
- readonly version: string;
17
- readonly commands: number;
18
- readonly synthesized: number;
19
- readonly chars: number;
20
- readonly tools: readonly string[];
21
- }
22
- export interface PluginUnitReport {
23
- readonly ok: boolean;
24
- readonly at: number;
25
- readonly plugins: readonly PluginUnitRow[];
26
- readonly problems: readonly string[];
27
- }
28
- export interface PluginUnits {
29
- refresh(options?: {
30
- readonly force?: boolean;
31
- }): Promise<PluginUnitReport>;
32
- touch(): void;
33
- report(): PluginUnitReport;
34
- dispose(): void;
35
- }
36
- export interface PluginUnitsOptions {
37
- readonly registry: UnitRegistry;
38
- readonly catalog: PluginCatalog;
39
- readonly rows: () => readonly PluginRowRef[];
40
- readonly declared: (plugin: string) => ReadonlySet<string>;
41
- readonly opencliFor: (plugin: string) => Opencli;
42
- readonly toolNames?: () => ReadonlySet<string>;
43
- readonly logger?: {
44
- info?(message: string): void;
45
- warn?(message: string): void;
46
- } | undefined;
47
- }
48
- export declare function createPluginUnits(options: PluginUnitsOptions): PluginUnits;
@@ -1,15 +0,0 @@
1
- import type { DshHostContext, DshShell } from '@dsh-workbench/shared';
2
- import type { RouteTable } from '@dsh-workbench/shared/host';
3
- /**
4
- * 把启动体检接上 `preflight` 那条路由。
5
- * @param input - 路由表、宿主上下文、执行缝,以及 opencli 命令 / 装它用的命令(可选)与各套件声明的预热读命令。
6
- * @returns 无(路由挂在 `input.routes.preflight` 上)。
7
- */
8
- export declare function registerPreflight(input: {
9
- routes: RouteTable;
10
- ctx: DshHostContext;
11
- shell: DshShell;
12
- opencliCommand: string;
13
- installCommand?: string | undefined;
14
- warmReads: () => readonly (readonly string[])[];
15
- }): void;
@@ -1,75 +0,0 @@
1
- import type { DshShell } from '@dsh-workbench/shared';
2
- import type { DiyPresetVerdict } from './diy-preset-health';
3
- export type PreflightStepId = 'opencli' | 'bridge' | 'diy' | 'warm';
4
- export type PreflightStepStatus = 'pending' | 'running' | 'ok' | 'warn' | 'failed';
5
- export interface PreflightStep {
6
- readonly id: PreflightStepId;
7
- readonly status: PreflightStepStatus;
8
- readonly detail?: string;
9
- readonly action?: string;
10
- readonly command?: string;
11
- }
12
- export type PreflightFailure = 'permission' | 'network' | 'missing' | 'unknown';
13
- export declare function classifyFailure(text: string): PreflightFailure;
14
- export type PreflightGuidance = 'install' | 'path' | 'shell';
15
- export type PreflightBridgeIssue = 'daemon' | 'extension' | 'profile' | 'stale' | 'unknown';
16
- export declare function readBridgeReport(stdout: string): {
17
- readonly ok: boolean;
18
- readonly issues: readonly PreflightBridgeIssue[];
19
- readonly detail: string;
20
- };
21
- /**
22
- * DIY 模式挂不起来时随快照送出去的那三件:挂不起来的行、dsh 给的原文、修法(升级 dsh)。
23
- */
24
- export interface PreflightDiyGap {
25
- readonly rows: readonly string[];
26
- readonly detail: string;
27
- readonly command: string;
28
- }
29
- export interface PreflightSnapshot {
30
- readonly phase: 'idle' | 'checking' | 'installing' | 'ready' | 'failed';
31
- readonly steps: readonly PreflightStep[];
32
- readonly at: number;
33
- readonly error?: string;
34
- readonly failure?: PreflightFailure;
35
- readonly guidance?: PreflightGuidance;
36
- readonly bridgeIssues?: readonly PreflightBridgeIssue[];
37
- readonly diyGap?: PreflightDiyGap;
38
- }
39
- /**
40
- * 环境体检:`run()` 跑一次并回快照,`snapshot()` 看眼下这一拍。`run` 的取舍是:
41
- * 已经有在跑的那一轮就跟它(不再排第二轮);上一次跑出 `ready` 且不到 `PREFLIGHT_FRESH_MS`
42
- * 也直接回那一份 —— 于是两页同时打开只体检一轮、第二页还不用等。`hard` 不看新鲜度、一律重来,
43
- * 留给用户按的那颗「重试」;上一次是失败/没跑完的也一律重来。
44
- */
45
- export interface Preflight {
46
- run(options?: {
47
- hard?: boolean;
48
- }): Promise<PreflightSnapshot>;
49
- snapshot(): PreflightSnapshot;
50
- }
51
- export declare const OPENCLI_INSTALL_COMMAND: string;
52
- export interface BridgeVerdict {
53
- readonly ok: boolean;
54
- readonly detail: string;
55
- readonly issues: readonly PreflightBridgeIssue[];
56
- readonly command?: string | undefined;
57
- }
58
- export declare function canWarm(bridge: {
59
- ok: boolean;
60
- issues: readonly PreflightBridgeIssue[];
61
- }): boolean;
62
- export declare function createPreflight(options: {
63
- shell: DshShell;
64
- command?: string;
65
- installCommand?: string;
66
- logger?: {
67
- warn?(message: string): void;
68
- } | undefined;
69
- install?: (() => Promise<{
70
- ok: boolean;
71
- detail: string;
72
- }>) | undefined;
73
- warmReads?: (() => readonly (readonly string[])[]) | undefined;
74
- probeDiy?: (() => Promise<DiyPresetVerdict | undefined>) | undefined;
75
- }): Preflight;
@@ -1,6 +0,0 @@
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>;
@@ -1,11 +0,0 @@
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/host';
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;
@@ -1,17 +0,0 @@
1
- import type { DshShell } from '@dsh-workbench/shared';
2
- import type { UnitCapability, UnitCommands } from "@dsh-workbench/shared/host";
3
- export type { UnitCapability, UnitCommands, UnitLibState, UnitPluginState } from "@dsh-workbench/shared/host";
4
- export declare function parsePluginList(stdout: string): unknown[] | undefined;
5
- export declare function probeUnitCommands(options: {
6
- shell: DshShell;
7
- command?: string;
8
- unit: UnitCommands;
9
- force?: boolean;
10
- }): Promise<UnitCapability>;
11
- export declare function probeUnits(options: {
12
- shell: DshShell;
13
- command?: string;
14
- units: readonly UnitCommands[];
15
- force?: boolean;
16
- }): Promise<UnitCapability[]>;
17
- export declare const resetProbeCache: () => void;
@@ -1,7 +0,0 @@
1
- import type { PluginRelease, UnitPluginNeed } from '@dsh-workbench/shared';
2
- import type { UnitCapability, UnitCommands, UnitLibState } from "./probe-libs";
3
- export declare function evaluateUnit(list: readonly unknown[] | undefined, unit: UnitCommands, failure: string | undefined, command?: string, releases?: ReadonlyMap<string, PluginRelease>, libs?: readonly UnitLibState[]): UnitCapability;
4
- export declare function gapsText(gaps: readonly string[]): string;
5
- export declare function pluginUpdateCommand(plugin: string | undefined): string | undefined;
6
- export declare function pluginInstallCommand(plugin: string | undefined): string;
7
- export declare function upgradeLine(need: UnitPluginNeed, command: string, latest: string): string | undefined;
@@ -1,21 +0,0 @@
1
- import type { BundleChange } from '../bundle-install.js';
2
- export interface RegistryEntry {
3
- readonly scope: string;
4
- readonly registry: string;
5
- }
6
- export interface RegistryNotebook {
7
- sources(): readonly RegistryEntry[];
8
- remember(entries: readonly RegistryEntry[]): readonly string[];
9
- }
10
- export declare const REGISTRY_MARKER = "# dsh-workbench \u5199\u7684\uFF1A\u8FD9\u4E00\u884C\u7684\u5305\u53EA\u5728\u8FD9\u4E2A\u6E90\u4E0A\uFF08dsh \u5378\u8F7D\u6CA1\u6709\u6E90\u53C2\u6570\uFF0Cpnpm \u5F97\u95EE\u5F97\u5230\uFF09";
11
- export declare function scopeOf(pkg: string): string | null;
12
- export declare function normalizeRegistry(url: string): string;
13
- export declare function sameRegistry(a: string | null | undefined, b: string | null | undefined): boolean;
14
- export declare function sourcesFromLockfile(text: string): readonly RegistryEntry[];
15
- export interface RegistryConfigMerge {
16
- readonly text: string;
17
- readonly added: readonly string[];
18
- }
19
- export declare function mergeRegistryConfig(text: string, entries: readonly RegistryEntry[]): RegistryConfigMerge;
20
- export declare function registryFailure(change: BundleChange): boolean;
21
- export declare function createRegistryNotebook(dir: string | null): RegistryNotebook;
@@ -1,23 +0,0 @@
1
- import type { DshShell } from '@dsh-workbench/shared';
2
- export declare function localDirOf(spec: string): string | undefined;
3
- export declare function packageManifestOf(dir: string): Readonly<Record<string, unknown>> | undefined;
4
- export declare function dshRecordOf(dir: string): unknown | undefined;
5
- export declare function packageNameOf(dir: string): string | undefined;
6
- export declare function pathDeclarationOf(spec: string): unknown | undefined;
7
- export interface RegistryDshLookup {
8
- readonly readable: boolean;
9
- readonly raw: unknown;
10
- }
11
- export declare function registryDshOf(options: {
12
- shell: DshShell;
13
- name: string;
14
- registry?: string | undefined;
15
- force?: boolean;
16
- }): Promise<RegistryDshLookup>;
17
- export declare function registryDeclarationOf(options: {
18
- shell: DshShell;
19
- name: string;
20
- registry: string;
21
- force?: boolean;
22
- }): Promise<unknown | undefined>;
23
- export declare function declarationRefusalOf(name: string, raw: unknown): readonly string[];
@@ -1,24 +0,0 @@
1
- import type { DshShell } from '@dsh-workbench/shared';
2
- import type { PluginRelease } from '@dsh-workbench/shared';
3
- export declare function parseLedgerVersion(stdout: string, name: string): string | undefined;
4
- export declare function compareVersions(a: string, b: string): number | undefined;
5
- export declare function isNewerVersion(latest: string, installed: string): boolean;
6
- export declare function latestVersion(options: {
7
- shell: DshShell;
8
- name: string;
9
- registry: string;
10
- force?: boolean;
11
- }): Promise<string | undefined>;
12
- export declare function missingReleaseParts(options: {
13
- shell: DshShell;
14
- registry: string;
15
- version: string;
16
- force?: boolean;
17
- }): Promise<readonly string[]>;
18
- export declare function probeRelease(options: {
19
- shell: DshShell;
20
- package: string;
21
- registry?: string | undefined;
22
- force?: boolean;
23
- }): Promise<PluginRelease | undefined>;
24
- export declare function resetReleaseCache(): void;
@@ -1,40 +0,0 @@
1
- import { spawn } from 'node:child_process';
2
- import type { DshHostContext } from '@dsh-workbench/shared';
3
- export type SeedLog = (message: string) => void;
4
- export interface RuntimeSeedPaths {
5
- readonly root: string;
6
- readonly entryDir: string;
7
- readonly opencliRoot: string;
8
- readonly opencliBinDir: string;
9
- readonly opencliBin: string;
10
- readonly opencliHome: string;
11
- readonly workshop: string;
12
- readonly workshopPackages: string;
13
- readonly workshopManifest: string;
14
- }
15
- export interface RuntimeSeedOptions {
16
- readonly root: string;
17
- readonly home: string;
18
- readonly packageRoot: string;
19
- readonly log?: SeedLog;
20
- }
21
- export declare function runtimeSeedPaths(root: string): RuntimeSeedPaths;
22
- export declare function runtimeSeedRootOf(ctx: DshHostContext): string | null;
23
- export declare function coversWritableRoot(workspaceRoot: string, root: string): boolean;
24
- export declare function warnUnwritableRoot(ctx: DshHostContext): void;
25
- export declare function packageRootOf(moduleUrl: string): string;
26
- export declare function isInstalledCopy(packageRoot: string): boolean;
27
- export declare function opencliWrapperScript(packageRoot: string, home: string): string;
28
- export interface SeedCommand {
29
- readonly file: string;
30
- readonly args: readonly string[];
31
- readonly env: Readonly<Record<string, string>>;
32
- readonly log: string;
33
- }
34
- export declare function workshopSeedPlan(packageRoot: string, home: string, root: string): {
35
- readonly entry: SeedCommand;
36
- readonly full: SeedCommand;
37
- };
38
- export declare function runDetached(command: SeedCommand, onError: SeedLog, spawnImpl?: typeof spawn): void;
39
- export declare function prependPath(entryDir: string, env?: NodeJS.ProcessEnv): boolean;
40
- export declare function seedRuntimeFiles(options: RuntimeSeedOptions): readonly string[];
@@ -1,52 +0,0 @@
1
- import { spawn } from 'node:child_process';
2
- import { type SeedCommand } from './runtime-seed';
3
- import { SELF_UPDATE_STATES, type SelfUpdateState, type WorkbenchSelfUpdate } from '../bundle-install.js';
4
- export { SELF_UPDATE_STATES, type SelfUpdateState };
5
- export interface SelfUpdatePaths {
6
- readonly dir: string;
7
- readonly script: string;
8
- readonly marker: string;
9
- readonly log: string;
10
- }
11
- export interface SelfUpdateRequest {
12
- readonly dshHome: string;
13
- readonly profile: string;
14
- readonly pkg: string;
15
- readonly from: string;
16
- readonly to: string;
17
- readonly pinned: boolean;
18
- }
19
- export interface SelfUpdateMarker extends SelfUpdateRequest {
20
- readonly state: SelfUpdateState;
21
- readonly version: string;
22
- readonly at: string;
23
- }
24
- export interface SelfUpdatePlan {
25
- readonly paths: SelfUpdatePaths;
26
- readonly script: string;
27
- readonly marker: SelfUpdateMarker;
28
- readonly command: SeedCommand;
29
- }
30
- export interface SelfUpdateStart {
31
- readonly started: boolean;
32
- readonly paths: SelfUpdatePaths;
33
- readonly forward: string;
34
- }
35
- export declare function runningVersionOf(moduleUrl: string): string | undefined;
36
- export declare function selfUpdatePaths(dshHome: string): SelfUpdatePaths;
37
- export declare function recoveryCommand(input: {
38
- readonly profile: string;
39
- readonly pkg: string;
40
- readonly version: string;
41
- }): string;
42
- export declare function selfUpdateMarker(request: SelfUpdateRequest, state: SelfUpdateState, version: string, at: string): SelfUpdateMarker;
43
- export declare function selfUpdateScript(request: SelfUpdateRequest, paths: SelfUpdatePaths): string;
44
- export declare function planSelfUpdate(request: SelfUpdateRequest, now?: Date): SelfUpdatePlan;
45
- export declare function startSelfUpdate(request: SelfUpdateRequest, onError: (message: string) => void, spawnImpl?: typeof spawn): SelfUpdateStart;
46
- /**
47
- * 读外面那个自更新进程留下的现场(marker + 日志尾):状态是 `running` / `ok` / `rolled-back` / `failed`,
48
- * `tail` 是日志最后几行(最多 800 字);没跑过、marker 坏了或状态不认识都给 `undefined`。
49
- * @param home DSH_HOME(自更新的现场在 `<home>/workbench` 下)。
50
- * @param profile 只认这个 profile 的现场(同一份 home 下几个 profile 共用一个目录);不传就不过滤。
51
- */
52
- export declare function readSelfUpdateView(home: string, profile?: string): WorkbenchSelfUpdate | undefined;
@@ -1,2 +0,0 @@
1
- export type VersionVerdict = 'satisfied' | 'unsatisfied' | 'malformed';
2
- export declare function checkVersionRange(contract: string | undefined, version: string): VersionVerdict;
@@ -1,19 +0,0 @@
1
- import type { LongTaskStatus } from '@dsh-workbench/shared';
2
- /**
3
- * 外壳自己的长任务读口:一次把**全进程还在跑的**长任务交出来(不分单元、不分工作区)——
4
- * 左栏拿它点会话行与项目下拉里那颗 loading 点。
5
- */
6
- export declare const LONG_TASKS_ROUTE = "long-tasks";
7
- /** 一条还在跑的长任务:左栏只要这几格,模块自己那份投影不参与。 */
8
- export interface ShellLongTaskRow {
9
- readonly unit: string;
10
- readonly id: string;
11
- readonly workspace: string;
12
- readonly target: string;
13
- readonly status: LongTaskStatus;
14
- readonly session?: string | undefined;
15
- }
16
- /** 外壳长任务读口的载荷。 */
17
- export interface ShellLongTasksPayload {
18
- readonly runs: readonly ShellLongTaskRow[];
19
- }
@@ -1,14 +0,0 @@
1
- export declare const SIDEBAR_EDITION_ROUTE = "sidebar-edition";
2
- export declare const SIDEBAR_EDITION_RESOURCE = "sidebarEdition";
3
- export type SidebarEdition = 'official' | 'custom';
4
- export interface SidebarEditionSnapshot {
5
- readonly edition: SidebarEdition;
6
- }
7
- export interface SidebarEditionApplied {
8
- readonly ok: true;
9
- readonly edition: SidebarEdition;
10
- readonly reloadRequired: boolean;
11
- }
12
- export interface SidebarEditionRequest {
13
- readonly edition: SidebarEdition;
14
- }
@@ -1,6 +0,0 @@
1
- import type { UnitManifest } from '@dsh-workbench/shared';
2
- export declare const UNIT_MANIFESTS_ROUTE = "unit-manifests";
3
- export interface UnitManifestsPayload {
4
- readonly manifests: readonly UnitManifest[];
5
- readonly installable: readonly string[];
6
- }