@dsh-workbench/core 0.3.10 → 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 (234) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +148 -105
  3. package/bin/dsh-workbench +132 -31
  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 +8192 -4904
  10. package/cordis.patch.yml +62 -37
  11. package/dist/client/client.body.js +8192 -4904
  12. package/dist/client/index.js +7186 -3898
  13. package/dist/host/index.js +7277 -6956
  14. package/dist/types/app/client.d.ts +3 -1
  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 +6 -2
  38. package/dist/types/app/layouts/rightbar/MarketView.d.ts +6 -3
  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-act.d.ts +6 -3
  42. package/dist/types/app/layouts/rightbar/market-busy.d.ts +0 -22
  43. package/dist/types/app/layouts/rightbar/market-change.d.ts +1 -1
  44. package/dist/types/app/layouts/rightbar/market-hint.d.ts +1 -7
  45. package/dist/types/app/layouts/rightbar/market-plugin-rows.d.ts +0 -7
  46. package/dist/types/app/layouts/rightbar/market-row-icon.d.ts +1 -1
  47. package/dist/types/app/layouts/rightbar/market-row-types.d.ts +2 -2
  48. package/dist/types/app/layouts/rightbar/market-rows.d.ts +1 -1
  49. package/dist/types/app/layouts/rightbar/market-section-icon.d.ts +1 -1
  50. package/dist/types/app/layouts/rightbar/market-settle-hold.d.ts +2 -0
  51. package/dist/types/app/layouts/rightbar/market-settle.d.ts +17 -0
  52. package/dist/types/app/layouts/rightbar/market-shared-rows.d.ts +1 -1
  53. package/dist/types/app/layouts/rightbar/market-update-verdict.d.ts +31 -0
  54. package/dist/types/app/layouts/rightbar/market-view-text.d.ts +8 -1
  55. package/dist/types/app/layouts/rightbar/market-workbench-row.d.ts +1 -1
  56. package/dist/types/app/layouts/rightbar/store.d.ts +2 -0
  57. package/dist/types/app/layouts/sidebar/LongTaskDot.d.ts +6 -0
  58. package/dist/types/app/layouts/sidebar/LongTaskHover.d.ts +6 -0
  59. package/dist/types/app/layouts/sidebar/edition-boot.d.ts +6 -0
  60. package/dist/types/app/layouts/sidebar/edition.d.ts +5 -0
  61. package/dist/types/app/layouts/sidebar/use-attention.d.ts +0 -4
  62. package/dist/types/app/layouts/sidebar/workshop-preset.d.ts +2 -0
  63. package/dist/types/app/layouts/workbench-settings/AdapterSetItem.d.ts +5 -0
  64. package/dist/types/app/layouts/workbench-settings/ConfigSyncItem.d.ts +5 -0
  65. package/dist/types/app/layouts/workbench-settings/ConfigSyncRows.d.ts +11 -0
  66. package/dist/types/app/layouts/workbench-settings/NewWorkbenchItem.d.ts +5 -0
  67. package/dist/types/app/layouts/workbench-settings/SettingsItem.d.ts +8 -0
  68. package/dist/types/app/layouts/workbench-settings/SidebarEditionItem.d.ts +5 -0
  69. package/dist/types/app/layouts/workbench-settings/WorkbenchSettingsSection.d.ts +5 -0
  70. package/dist/types/app/units/manifests.d.ts +1 -1
  71. package/dist/types/{app/units → kernel/client}/registry.d.ts +1 -1
  72. package/dist/types/kernel/contract/bundle-install.d.ts +2 -0
  73. package/dist/types/kernel/contract/config-sync.d.ts +2 -0
  74. package/dist/types/kernel/contract/diy.d.ts +1 -0
  75. package/dist/types/kernel/contract/dsh-plugins.d.ts +2 -0
  76. package/dist/types/kernel/contract/index.d.ts +4 -0
  77. package/dist/types/kernel/contract/long-tasks.d.ts +2 -0
  78. package/dist/types/kernel/contract/market-index.d.ts +2 -0
  79. package/dist/types/kernel/contract/platform.d.ts +1 -0
  80. package/dist/types/kernel/contract/preflight-wake.d.ts +2 -0
  81. package/dist/types/kernel/contract/profile-create.d.ts +2 -0
  82. package/dist/types/kernel/contract/sidebar-edition.d.ts +2 -0
  83. package/dist/types/kernel/contract/unit-manifests.d.ts +2 -0
  84. package/dist/types/{shared/api → kernel}/host/mount-units.d.ts +2 -1
  85. package/dist/types/modules/panels/client.d.ts +1 -1
  86. package/dist/types/modules/panels/model/approval.d.ts +4 -8
  87. package/dist/types/modules/panels/model/diy-browser-tools.d.ts +1 -1
  88. package/dist/types/modules/panels/model/diy-changelog.d.ts +2 -0
  89. package/dist/types/modules/panels/model/diy-context.d.ts +20 -18
  90. package/dist/types/modules/panels/model/diy-page.d.ts +4 -2
  91. package/dist/types/modules/panels/model/diy-record-open.d.ts +0 -15
  92. package/dist/types/modules/panels/model/diy-record-text.d.ts +0 -2
  93. package/dist/types/modules/panels/model/diy-record.d.ts +1 -31
  94. package/dist/types/modules/panels/model/diy-report.d.ts +6 -7
  95. package/dist/types/modules/panels/model/diy-tools.d.ts +1 -0
  96. package/dist/types/modules/panels/model/long-task-tools.d.ts +0 -11
  97. package/dist/types/modules/panels/model/market-dependency-update.d.ts +15 -0
  98. package/dist/types/modules/panels/model/market-dependency.d.ts +15 -10
  99. package/dist/types/modules/panels/model/market-discover-routes.d.ts +3 -0
  100. package/dist/types/modules/panels/model/market-discover.d.ts +33 -0
  101. package/dist/types/modules/panels/model/market-dispatch.d.ts +4 -3
  102. package/dist/types/modules/panels/model/market-env.d.ts +2 -3
  103. package/dist/types/modules/panels/model/market-registry.d.ts +3 -3
  104. package/dist/types/modules/panels/model/market-restart.d.ts +1 -1
  105. package/dist/types/modules/panels/model/market-route.d.ts +5 -3
  106. package/dist/types/modules/panels/model/market-sources-act.d.ts +9 -0
  107. package/dist/types/modules/panels/model/market-types.d.ts +7 -13
  108. package/dist/types/modules/panels/model/market-update-bundle.d.ts +19 -0
  109. package/dist/types/modules/panels/model/market-verify.d.ts +15 -0
  110. package/dist/types/modules/panels/model/market-workbench-update.d.ts +3 -2
  111. package/dist/types/modules/panels/model/market.d.ts +6 -5
  112. package/dist/types/modules/panels/model/plugin-actions.d.ts +2 -1
  113. package/dist/types/modules/panels/model/plugin-section.d.ts +3 -1
  114. package/dist/types/modules/panels/model/publish-preview-routes.d.ts +2 -0
  115. package/dist/types/modules/panels/unit.d.ts +8 -5
  116. package/dist/types/modules/sessions/model/attention.d.ts +0 -11
  117. package/dist/types/modules/sessions/model/session-node.d.ts +0 -10
  118. package/dist/types/shared/api/diy.d.ts +6 -4
  119. package/dist/types/shared/api/host/approval-call.d.ts +0 -9
  120. package/dist/types/shared/api/host/approval-gate.d.ts +26 -0
  121. package/dist/types/shared/api/host/bundle-routes.d.ts +2 -1
  122. package/dist/types/shared/api/host/diy-artifacts.d.ts +3 -0
  123. package/dist/types/shared/api/host/diy-changelog.d.ts +13 -0
  124. package/dist/types/shared/api/host/diy-components.d.ts +2 -3
  125. package/dist/types/shared/api/host/diy-modules.d.ts +25 -0
  126. package/dist/types/shared/api/host/diy-publish-preview.d.ts +4 -0
  127. package/dist/types/shared/api/host/diy-recon-fs.d.ts +2 -2
  128. package/dist/types/shared/api/host/diy-tokens.d.ts +8 -0
  129. package/dist/types/shared/api/host/host-routes.d.ts +10 -0
  130. package/dist/types/shared/api/host/long-task-notice.d.ts +0 -20
  131. package/dist/types/shared/api/host/long-tasks.d.ts +1 -8
  132. package/dist/types/shared/api/host/market-doc.d.ts +21 -0
  133. package/dist/types/shared/api/host/market-index-fetch.d.ts +37 -0
  134. package/dist/types/shared/api/host/market-source-init.d.ts +22 -0
  135. package/dist/types/shared/api/host/market-sources-store.d.ts +15 -0
  136. package/dist/types/shared/api/host/permission-mode.d.ts +4 -0
  137. package/dist/types/shared/api/host/post-channels.d.ts +1 -1
  138. package/dist/types/shared/api/host/sidebar-edition.d.ts +14 -0
  139. package/dist/types/shared/api/host/unit-roster-facts.d.ts +1 -1
  140. package/dist/types/shared/api/host/workspace-root.d.ts +6 -0
  141. package/dist/types/shared/api/platform/client.d.ts +10 -0
  142. package/dist/types/shared/api/unit-board.d.ts +4 -0
  143. package/dist/types/shared/api/write-outcome.d.ts +3 -0
  144. package/dist/types/shared/components/IconModules.d.ts +2 -0
  145. package/dist/types/shared/components/PanelFoot.d.ts +0 -9
  146. package/dist/types/shared/components/blocker-action.d.ts +3 -0
  147. package/dist/types/shared/dev-surface/index.d.ts +5 -0
  148. package/dist/types/shared/dev-surface/types.d.ts +79 -0
  149. package/dist/types/shared/hooks/bundle-queries.d.ts +1 -13
  150. package/dist/types/shared/hooks/fact-transport.d.ts +4 -0
  151. package/dist/types/shared/hooks/fact-transports.d.ts +0 -4
  152. package/dist/types/shared/hooks/market-queries.d.ts +11 -0
  153. package/dist/types/shared/hooks/panel-state-report.d.ts +0 -12
  154. package/dist/types/shared/hooks/sidebar-edition.d.ts +2 -0
  155. package/dist/types/shared/hooks/use-blocker-actions.d.ts +0 -8
  156. package/dist/types/shared/hooks/use-capabilities.d.ts +1 -55
  157. package/dist/types/shared/hooks/use-capability-gate.d.ts +1 -2
  158. package/dist/types/shared/hooks/use-diy-debug.d.ts +0 -13
  159. package/dist/types/shared/hooks/use-diy-record.d.ts +0 -13
  160. package/dist/types/shared/hooks/use-host-write.d.ts +1 -1
  161. package/dist/types/shared/hooks/use-shell-long-tasks.d.ts +1 -7
  162. package/dist/types/shared/hooks/use-unit-board.d.ts +1 -1
  163. package/icon.svg +17 -28
  164. package/package.json +33 -13
  165. package/preset/diy.patch.yml +3 -3
  166. package/profile/isolation.patch.yml +18 -7
  167. package/profile/sandbox.patch.yml +2 -2
  168. package/scripts/clone-profile.mjs +268 -0
  169. package/scripts/create-workbench.mjs +166 -0
  170. package/scripts/seed-profile.sh +22 -10
  171. package/scripts/seed-workshop.sh +17 -19
  172. package/skills/workbench-module-diy/BUILD.md +57 -133
  173. package/skills/workbench-module-diy/COPY.md +89 -0
  174. package/skills/workbench-module-diy/DATASOURCE.md +173 -116
  175. package/skills/workbench-module-diy/DESIGN.md +76 -109
  176. package/skills/workbench-module-diy/FAMILY.md +48 -52
  177. package/skills/workbench-module-diy/KIT.md +78 -133
  178. package/skills/workbench-module-diy/LINKAGE.md +66 -105
  179. package/skills/workbench-module-diy/PANEL.md +81 -171
  180. package/skills/workbench-module-diy/REVIEW.md +67 -81
  181. package/skills/workbench-module-diy/SKILL.md +66 -96
  182. package/skills/workbench-module-diy/STEPS.md +66 -69
  183. package/skills/workbench-module-diy/TOOLS.md +134 -103
  184. package/skills/workbench-module-diy/WIRING.md +64 -84
  185. package/skills/workbench-module-diy/WRITES.md +115 -142
  186. package/dist/types/app/layouts/config-sync/ConfigSyncSection.d.ts +0 -5
  187. package/dist/types/shared/api/bundle-install.d.ts +0 -123
  188. package/dist/types/shared/api/config-sync.d.ts +0 -35
  189. package/dist/types/shared/api/dsh-plugins.d.ts +0 -11
  190. package/dist/types/shared/api/host/bundle-manager.d.ts +0 -11
  191. package/dist/types/shared/api/host/config-sync.d.ts +0 -46
  192. package/dist/types/shared/api/host/diy-preset-health.d.ts +0 -35
  193. package/dist/types/shared/api/host/diy-workshop.d.ts +0 -23
  194. package/dist/types/shared/api/host/dsh-plugins.d.ts +0 -5
  195. package/dist/types/shared/api/host/installed-module.d.ts +0 -54
  196. package/dist/types/shared/api/host/installed-module.test.d.ts +0 -1
  197. package/dist/types/shared/api/host/opencli-command.d.ts +0 -10
  198. package/dist/types/shared/api/host/opencli-command.test.d.ts +0 -1
  199. package/dist/types/shared/api/host/opencli.test.d.ts +0 -1
  200. package/dist/types/shared/api/host/package-content.d.ts +0 -6
  201. package/dist/types/shared/api/host/package-content.test.d.ts +0 -1
  202. package/dist/types/shared/api/host/package-kind.d.ts +0 -21
  203. package/dist/types/shared/api/host/package-kind.test.d.ts +0 -1
  204. package/dist/types/shared/api/host/package-route.d.ts +0 -23
  205. package/dist/types/shared/api/host/package-route.test.d.ts +0 -1
  206. package/dist/types/shared/api/host/plugin-catalog.d.ts +0 -65
  207. package/dist/types/shared/api/host/plugin-login-hint.d.ts +0 -2
  208. package/dist/types/shared/api/host/plugin-tools.d.ts +0 -14
  209. package/dist/types/shared/api/host/plugin-units.d.ts +0 -48
  210. package/dist/types/shared/api/host/preflight-route.d.ts +0 -15
  211. package/dist/types/shared/api/host/preflight.d.ts +0 -75
  212. package/dist/types/shared/api/host/probe-cache.d.ts +0 -6
  213. package/dist/types/shared/api/host/probe-libs.d.ts +0 -11
  214. package/dist/types/shared/api/host/probe-units.d.ts +0 -17
  215. package/dist/types/shared/api/host/probe-verdict.d.ts +0 -7
  216. package/dist/types/shared/api/host/profile-registries.d.ts +0 -21
  217. package/dist/types/shared/api/host/registry-declaration.d.ts +0 -23
  218. package/dist/types/shared/api/host/release.d.ts +0 -24
  219. package/dist/types/shared/api/host/runtime-seed.d.ts +0 -38
  220. package/dist/types/shared/api/host/self-update.d.ts +0 -45
  221. package/dist/types/shared/api/host/version-range.d.ts +0 -2
  222. package/dist/types/shared/api/host/workshop-root.d.ts +0 -16
  223. package/dist/types/shared/api/long-tasks.d.ts +0 -19
  224. package/dist/types/shared/api/unit-manifests.d.ts +0 -6
  225. package/docs/HANDOFF.md +0 -333
  226. package/docs/OPERATIONS.md +0 -229
  227. package/skills/workbench-module-diy/TOOLING.md +0 -55
  228. /package/dist/types/{app/layouts/rightbar/registry.d.ts → kernel/client/board-registry.d.ts} +0 -0
  229. /package/dist/types/{app/layouts/rightbar/registry.test.d.ts → kernel/contract/contracts.test.d.ts} +0 -0
  230. /package/dist/types/{shared/api/host/bundle-manager.test.d.ts → kernel/contract/index.test.d.ts} +0 -0
  231. /package/dist/types/{shared/api → kernel}/host/unit-readiness.d.ts +0 -0
  232. /package/dist/types/{shared/api → kernel}/host/unit-registry.d.ts +0 -0
  233. /package/dist/types/shared/{api/host/diy-workshop.test.d.ts → components/blocker-action.test.d.ts} +0 -0
  234. /package/dist/types/shared/{api/host/dsh-plugins.test.d.ts → dev-surface/install.d.ts} +0 -0
@@ -1,54 +0,0 @@
1
- import type { DshHostContext } from '@dsh-workbench/shared';
2
- import type { UnitDeclarationSource } from './unit-registry';
3
- export type InstalledModule = {
4
- readonly kind: 'module';
5
- readonly pkg: string;
6
- readonly unit: string;
7
- readonly version: string;
8
- readonly registry?: string;
9
- readonly local?: boolean;
10
- } | {
11
- readonly kind: 'not-module';
12
- readonly pkg: string;
13
- } | {
14
- readonly kind: 'unknown';
15
- readonly pkg: string;
16
- };
17
- export declare function isPackageName(value: string): boolean;
18
- export declare function profileDirOf(ctx: DshHostContext): string | null;
19
- export interface ProfileModule {
20
- readonly pkg: string;
21
- readonly unit: string;
22
- readonly version: string;
23
- readonly registry?: string;
24
- readonly local?: boolean;
25
- }
26
- export declare function profileManifestOf(profileDir: string | null): Readonly<Record<string, unknown>> | undefined;
27
- export declare function profileModules(profileDir: string | null): readonly ProfileModule[];
28
- export declare function createDeclarationLookup(profileDir: string | null): (unit: string) => UnitDeclarationSource | undefined;
29
- export declare function moduleDeclarationOf(profileDir: string | null, pkg: string): unknown;
30
- export interface DeclarationGap {
31
- readonly pkg: string;
32
- readonly problems: readonly string[];
33
- }
34
- export declare function declarationGaps(profileDir: string | null): readonly DeclarationGap[] | undefined;
35
- export declare function declaredPluginCommands(profileDir: string | null): ReadonlyMap<string, ReadonlySet<string>>;
36
- export declare function readInstalledModule(profileDir: string | null, pkg: string): InstalledModule;
37
- /**
38
- * 这份依赖是不是"从一个**打好的包**装的"(`file:/tmp/dsh-workbench-core-0.3.8.tgz`、
39
- * `./x-0.3.8.tgz`)。它跟 `link:` / 目录装的**不是**一回事:那是工作树(改了立刻生效,
40
- * 也不可能跟源上比出个新旧),而 tgz 是打包产物 —— 包名与版本就是源上那一套,能比、
41
- * 也该让人更新。混在一起会把"从文件装的发布产物"说成"本仓正在开发的那一份",
42
- * 顺带把版本比对与更新一起关掉。
43
- */
44
- export declare function isPackedArtifactSpec(spec: string): boolean;
45
- /** 这份依赖是不是"本仓那份"(`link:` / 目录 / 相对或绝对路径)—— 只有工作树才算。 */
46
- export declare function isLocalDependencySpec(spec: string): boolean;
47
- export interface ProfilePackage {
48
- readonly pkg: string;
49
- readonly version: string;
50
- readonly registry?: string;
51
- readonly local?: boolean;
52
- }
53
- export declare function readProfilePackage(profileDir: string | null, pkg: string): ProfilePackage | undefined;
54
- export declare function packageVersionAt(packageRoot: string): string | undefined;
@@ -1 +0,0 @@
1
- export {};
@@ -1,10 +0,0 @@
1
- import type { DshHostContext } from '@dsh-workbench/shared';
2
- export type OpencliSource = 'env' | 'isolated' | 'path';
3
- export interface OpencliResolution {
4
- readonly command: string;
5
- readonly source: OpencliSource;
6
- readonly isolated: string | null;
7
- }
8
- export declare const OPENCLI_PATH_FALLBACK = "opencli";
9
- export declare function isolatedOpencliPathOf(ctx: DshHostContext): string | null;
10
- export declare function opencliCommandOf(ctx: DshHostContext): OpencliResolution;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- import type { DshShell } from '@dsh-workbench/shared';
2
- export declare function withPackageDir<T>(options: {
3
- readonly shell?: DshShell | undefined;
4
- readonly spec: string;
5
- readonly registry?: string | undefined;
6
- }, visit: (dir: string) => T): Promise<T | undefined>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,21 +0,0 @@
1
- export type PackageKind = 'opencli-plugin' | 'dsh-bundle' | 'both' | 'neither';
2
- export interface PackageVerdict {
3
- readonly kind: PackageKind;
4
- readonly pkg?: string;
5
- readonly pluginName?: string;
6
- }
7
- export interface NpmRef {
8
- readonly name: string;
9
- readonly version?: string;
10
- }
11
- export declare const OPENCLI_MANIFEST_FILE = "opencli-plugin.json";
12
- export declare function splitNpmSpec(spec: string): NpmRef | undefined;
13
- export declare function isCommandFile(name: string): boolean;
14
- export declare function pluginManifestOf(dir: string): Readonly<Record<string, unknown>> | undefined;
15
- export declare function hasCommandFile(dir: string): boolean;
16
- export declare function pluginAt(dir: string): {
17
- readonly name?: string;
18
- } | undefined;
19
- export declare function dshMarkersOf(raw: unknown): boolean;
20
- export declare function verdictOf(dir: string): PackageVerdict | undefined;
21
- export declare function refusalReason(): string;
@@ -1 +0,0 @@
1
- export {};
@@ -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,38 +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 packageRootOf(moduleUrl: string): string;
24
- export declare function isInstalledCopy(packageRoot: string): boolean;
25
- export declare function opencliWrapperScript(packageRoot: string, home: string): string;
26
- export interface SeedCommand {
27
- readonly file: string;
28
- readonly args: readonly string[];
29
- readonly env: Readonly<Record<string, string>>;
30
- readonly log: string;
31
- }
32
- export declare function workshopSeedPlan(packageRoot: string, home: string, root: string): {
33
- readonly entry: SeedCommand;
34
- readonly full: SeedCommand;
35
- };
36
- export declare function runDetached(command: SeedCommand, onError: SeedLog, spawnImpl?: typeof spawn): void;
37
- export declare function prependPath(entryDir: string, env?: NodeJS.ProcessEnv): boolean;
38
- export declare function seedRuntimeFiles(options: RuntimeSeedOptions): readonly string[];
@@ -1,45 +0,0 @@
1
- import { spawn } from 'node:child_process';
2
- import { type SeedCommand } from './runtime-seed';
3
- export declare const SELF_UPDATE_STATES: readonly ["running", "ok", "rolled-back", "failed"];
4
- export type SelfUpdateState = (typeof SELF_UPDATE_STATES)[number];
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;
@@ -1,2 +0,0 @@
1
- export type VersionVerdict = 'satisfied' | 'unsatisfied' | 'malformed';
2
- export declare function checkVersionRange(contract: string | undefined, version: string): VersionVerdict;
@@ -1,16 +0,0 @@
1
- import type { DshHostContext } from '@dsh-workbench/shared';
2
- export interface WorkshopRoot {
3
- readonly root: string;
4
- readonly packagesDir: string;
5
- readonly title: string;
6
- }
7
- /**
8
- * 工坊**自己的家**(`$DSH_HOME/workbench/diy`)—— 宿主启动时就是按它把工坊登记成工作区的。
9
- * DIY 会话的工坊根取这一份,**不随会话 cwd 漂**:cwd 一离开工坊(用户把自己的项目设成工作区),
10
- * 从 cwd 往上找会撞上任意一个"带 `packages/` 的仓库",于是模块列表、`shots/` 落点、装机名单全跟着变样。
11
- * 这一档拿不到(没有 `dshHomePath` 服务)时才退回 cwd 那套。
12
- * @param ctx - 宿主上下文(要从里面取 `dshHomePath`)。
13
- * @returns 工坊的家;取不到给 `null`。
14
- */
15
- export declare function workshopHomeOf(ctx: DshHostContext): WorkshopRoot | null;
16
- export declare function workshopRootOf(ctx: DshHostContext, workspace: string | null): Promise<WorkshopRoot | null>;
@@ -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,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
- }