@hydranium/cli 1.0.0-next.4 → 1.0.0-next.400

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 (340) hide show
  1. package/README.md +102 -204
  2. package/bin/hydranium-cli.js +13 -0
  3. package/heap-analysis/heap/core/load.mjs +2 -2
  4. package/heap-analysis/heap/langium/langium.classifier.mjs +22 -11
  5. package/lib/cli-version.js.map +1 -1
  6. package/lib/cli.js +7 -2
  7. package/lib/cli.js.map +1 -1
  8. package/lib/commands/analyze-heap-args.d.ts.map +1 -1
  9. package/lib/commands/analyze-heap-args.js +1 -2
  10. package/lib/commands/analyze-heap-args.js.map +1 -1
  11. package/lib/commands/analyze-heap.d.ts +3 -0
  12. package/lib/commands/analyze-heap.d.ts.map +1 -1
  13. package/lib/commands/analyze-heap.js +2 -1
  14. package/lib/commands/analyze-heap.js.map +1 -1
  15. package/lib/commands/ast-ground-truth-args.d.ts +3 -2
  16. package/lib/commands/ast-ground-truth-args.d.ts.map +1 -1
  17. package/lib/commands/ast-ground-truth-args.js +11 -9
  18. package/lib/commands/ast-ground-truth-args.js.map +1 -1
  19. package/lib/commands/ast-ground-truth-driver.js +4 -2
  20. package/lib/commands/ast-ground-truth-driver.js.map +1 -1
  21. package/lib/commands/ast-ground-truth.js +1 -1
  22. package/lib/commands/ast-ground-truth.js.map +1 -1
  23. package/lib/commands/client-session.d.ts +17 -0
  24. package/lib/commands/client-session.d.ts.map +1 -0
  25. package/lib/commands/client-session.js +27 -0
  26. package/lib/commands/client-session.js.map +1 -0
  27. package/lib/commands/create-args.d.ts +17 -0
  28. package/lib/commands/create-args.d.ts.map +1 -0
  29. package/lib/commands/create-args.js +53 -0
  30. package/lib/commands/create-args.js.map +1 -0
  31. package/lib/commands/create.d.ts +38 -0
  32. package/lib/commands/create.d.ts.map +1 -0
  33. package/lib/commands/create.js +43 -0
  34. package/lib/commands/create.js.map +1 -0
  35. package/lib/commands/delete-args.d.ts +17 -0
  36. package/lib/commands/delete-args.d.ts.map +1 -0
  37. package/lib/commands/delete-args.js +49 -0
  38. package/lib/commands/delete-args.js.map +1 -0
  39. package/lib/commands/delete.d.ts +30 -0
  40. package/lib/commands/delete.d.ts.map +1 -0
  41. package/lib/commands/delete.js +32 -0
  42. package/lib/commands/delete.js.map +1 -0
  43. package/lib/commands/generate-ast-builder.d.ts +49 -0
  44. package/lib/commands/generate-ast-builder.d.ts.map +1 -0
  45. package/lib/commands/generate-ast-builder.js +191 -0
  46. package/lib/commands/generate-ast-builder.js.map +1 -0
  47. package/lib/commands/generate-languages.d.ts +35 -0
  48. package/lib/commands/generate-languages.d.ts.map +1 -0
  49. package/lib/commands/generate-languages.js +105 -0
  50. package/lib/commands/generate-languages.js.map +1 -0
  51. package/lib/commands/generate-transfer-builder.d.ts +33 -0
  52. package/lib/commands/generate-transfer-builder.d.ts.map +1 -0
  53. package/lib/commands/generate-transfer-builder.js +86 -0
  54. package/lib/commands/generate-transfer-builder.js.map +1 -0
  55. package/lib/commands/generate-transfer-model-args.d.ts.map +1 -1
  56. package/lib/commands/generate-transfer-model-args.js +30 -5
  57. package/lib/commands/generate-transfer-model-args.js.map +1 -1
  58. package/lib/commands/generate-transfer-model-config.d.ts.map +1 -1
  59. package/lib/commands/generate-transfer-model-config.js +10 -3
  60. package/lib/commands/generate-transfer-model-config.js.map +1 -1
  61. package/lib/commands/generate-transfer-model.d.ts +49 -9
  62. package/lib/commands/generate-transfer-model.d.ts.map +1 -1
  63. package/lib/commands/generate-transfer-model.js +235 -70
  64. package/lib/commands/generate-transfer-model.js.map +1 -1
  65. package/lib/commands/generated-module-path.d.ts +16 -0
  66. package/lib/commands/generated-module-path.d.ts.map +1 -0
  67. package/lib/commands/generated-module-path.js +21 -0
  68. package/lib/commands/generated-module-path.js.map +1 -0
  69. package/lib/commands/harness-args.d.ts +44 -42
  70. package/lib/commands/harness-args.d.ts.map +1 -1
  71. package/lib/commands/harness-args.js +109 -27
  72. package/lib/commands/harness-args.js.map +1 -1
  73. package/lib/commands/headless-harness.d.ts +37 -20
  74. package/lib/commands/headless-harness.d.ts.map +1 -1
  75. package/lib/commands/headless-harness.js +71 -19
  76. package/lib/commands/headless-harness.js.map +1 -1
  77. package/lib/commands/init-args.d.ts +2 -0
  78. package/lib/commands/init-args.d.ts.map +1 -1
  79. package/lib/commands/init-args.js +74 -31
  80. package/lib/commands/init-args.js.map +1 -1
  81. package/lib/commands/init-hosts.d.ts +24 -0
  82. package/lib/commands/init-hosts.d.ts.map +1 -0
  83. package/lib/commands/init-hosts.js +37 -0
  84. package/lib/commands/init-hosts.js.map +1 -0
  85. package/lib/commands/init-prompt.d.ts +3 -3
  86. package/lib/commands/init-prompt.d.ts.map +1 -1
  87. package/lib/commands/init-prompt.js +4 -5
  88. package/lib/commands/init-prompt.js.map +1 -1
  89. package/lib/commands/init-templates.d.ts +20 -14
  90. package/lib/commands/init-templates.d.ts.map +1 -1
  91. package/lib/commands/init-templates.js +3015 -750
  92. package/lib/commands/init-templates.js.map +1 -1
  93. package/lib/commands/init-wizard.d.ts +3 -0
  94. package/lib/commands/init-wizard.d.ts.map +1 -1
  95. package/lib/commands/init-wizard.js +46 -31
  96. package/lib/commands/init-wizard.js.map +1 -1
  97. package/lib/commands/init-workspace.d.ts +13 -11
  98. package/lib/commands/init-workspace.d.ts.map +1 -1
  99. package/lib/commands/init-workspace.js +21 -7
  100. package/lib/commands/init-workspace.js.map +1 -1
  101. package/lib/commands/init.d.ts +58 -22
  102. package/lib/commands/init.d.ts.map +1 -1
  103. package/lib/commands/init.js +203 -48
  104. package/lib/commands/init.js.map +1 -1
  105. package/lib/commands/kebab.d.ts +15 -0
  106. package/lib/commands/kebab.d.ts.map +1 -0
  107. package/lib/commands/kebab.js +17 -0
  108. package/lib/commands/kebab.js.map +1 -0
  109. package/lib/commands/lint-grammar-args.d.ts +3 -2
  110. package/lib/commands/lint-grammar-args.d.ts.map +1 -1
  111. package/lib/commands/lint-grammar-args.js +13 -10
  112. package/lib/commands/lint-grammar-args.js.map +1 -1
  113. package/lib/commands/lint-grammar-driver.js +2 -1
  114. package/lib/commands/lint-grammar-driver.js.map +1 -1
  115. package/lib/commands/lint-grammar-report.js.map +1 -1
  116. package/lib/commands/lint-grammar.js +1 -1
  117. package/lib/commands/lint-grammar.js.map +1 -1
  118. package/lib/commands/measure-memory-args.d.ts +3 -2
  119. package/lib/commands/measure-memory-args.d.ts.map +1 -1
  120. package/lib/commands/measure-memory-args.js +22 -11
  121. package/lib/commands/measure-memory-args.js.map +1 -1
  122. package/lib/commands/measure-memory-driver.js +5 -3
  123. package/lib/commands/measure-memory-driver.js.map +1 -1
  124. package/lib/commands/measure-memory.js +1 -1
  125. package/lib/commands/measure-memory.js.map +1 -1
  126. package/lib/commands/model-docs-args.d.ts +4 -3
  127. package/lib/commands/model-docs-args.d.ts.map +1 -1
  128. package/lib/commands/model-docs-args.js +12 -10
  129. package/lib/commands/model-docs-args.js.map +1 -1
  130. package/lib/commands/model-docs-driver.js +2 -1
  131. package/lib/commands/model-docs-driver.js.map +1 -1
  132. package/lib/commands/model-docs.js +1 -1
  133. package/lib/commands/model-docs.js.map +1 -1
  134. package/lib/commands/projects-args.d.ts.map +1 -1
  135. package/lib/commands/projects-args.js +5 -5
  136. package/lib/commands/projects-args.js.map +1 -1
  137. package/lib/commands/projects.d.ts +3 -4
  138. package/lib/commands/projects.d.ts.map +1 -1
  139. package/lib/commands/projects.js +2 -2
  140. package/lib/commands/projects.js.map +1 -1
  141. package/lib/commands/query-args.d.ts.map +1 -1
  142. package/lib/commands/query-args.js +6 -5
  143. package/lib/commands/query-args.js.map +1 -1
  144. package/lib/commands/query.d.ts +6 -5
  145. package/lib/commands/query.d.ts.map +1 -1
  146. package/lib/commands/query.js +5 -4
  147. package/lib/commands/query.js.map +1 -1
  148. package/lib/commands/reflect-args.d.ts +3 -2
  149. package/lib/commands/reflect-args.d.ts.map +1 -1
  150. package/lib/commands/reflect-args.js +13 -10
  151. package/lib/commands/reflect-args.js.map +1 -1
  152. package/lib/commands/reflect-driver.js +2 -1
  153. package/lib/commands/reflect-driver.js.map +1 -1
  154. package/lib/commands/reflect-report.js.map +1 -1
  155. package/lib/commands/reflect.js +1 -1
  156. package/lib/commands/reflect.js.map +1 -1
  157. package/lib/commands/save-args.d.ts.map +1 -1
  158. package/lib/commands/save-args.js +7 -4
  159. package/lib/commands/save-args.js.map +1 -1
  160. package/lib/commands/save.d.ts +8 -4
  161. package/lib/commands/save.d.ts.map +1 -1
  162. package/lib/commands/save.js +12 -23
  163. package/lib/commands/save.js.map +1 -1
  164. package/lib/commands/validate-args.d.ts +3 -2
  165. package/lib/commands/validate-args.d.ts.map +1 -1
  166. package/lib/commands/validate-args.js +13 -10
  167. package/lib/commands/validate-args.js.map +1 -1
  168. package/lib/commands/validate-driver.js +2 -1
  169. package/lib/commands/validate-driver.js.map +1 -1
  170. package/lib/commands/validate-report.js.map +1 -1
  171. package/lib/commands/validate.js +1 -1
  172. package/lib/commands/validate.js.map +1 -1
  173. package/lib/commands/watch-args.d.ts.map +1 -1
  174. package/lib/commands/watch-args.js +6 -4
  175. package/lib/commands/watch-args.js.map +1 -1
  176. package/lib/commands/watch.d.ts +3 -4
  177. package/lib/commands/watch.d.ts.map +1 -1
  178. package/lib/commands/watch.js +20 -2
  179. package/lib/commands/watch.js.map +1 -1
  180. package/lib/driver-heap.d.ts +52 -0
  181. package/lib/driver-heap.d.ts.map +1 -0
  182. package/lib/driver-heap.js +51 -0
  183. package/lib/driver-heap.js.map +1 -0
  184. package/lib/index.d.ts +3 -0
  185. package/lib/index.d.ts.map +1 -1
  186. package/lib/index.js +3 -0
  187. package/lib/index.js.map +1 -1
  188. package/lib/log-level.d.ts +21 -11
  189. package/lib/log-level.d.ts.map +1 -1
  190. package/lib/log-level.js +25 -14
  191. package/lib/log-level.js.map +1 -1
  192. package/lib/spawn-data-server.d.ts +9 -4
  193. package/lib/spawn-data-server.d.ts.map +1 -1
  194. package/lib/spawn-data-server.js +5 -4
  195. package/lib/spawn-data-server.js.map +1 -1
  196. package/lib/stderr-connection-logger.d.ts +12 -0
  197. package/lib/stderr-connection-logger.d.ts.map +1 -0
  198. package/lib/stderr-connection-logger.js +16 -0
  199. package/lib/stderr-connection-logger.js.map +1 -0
  200. package/lib/testing/echo-server.js +9 -1
  201. package/lib/testing/echo-server.js.map +1 -1
  202. package/package.json +90 -38
  203. package/src/cli.ts +7 -2
  204. package/src/commands/analyze-heap-args.ts +1 -2
  205. package/src/commands/analyze-heap.ts +4 -1
  206. package/src/commands/ast-ground-truth-args.ts +15 -12
  207. package/src/commands/ast-ground-truth-driver.ts +4 -2
  208. package/src/commands/ast-ground-truth.ts +1 -1
  209. package/src/commands/client-session.ts +33 -0
  210. package/src/commands/create-args.ts +68 -0
  211. package/src/commands/create.ts +83 -0
  212. package/src/commands/delete-args.ts +64 -0
  213. package/src/commands/delete.ts +61 -0
  214. package/src/commands/generate-ast-builder.ts +236 -0
  215. package/src/commands/generate-languages.ts +132 -0
  216. package/src/commands/generate-transfer-builder.ts +101 -0
  217. package/src/commands/generate-transfer-model-args.ts +30 -5
  218. package/src/commands/generate-transfer-model-config.ts +10 -3
  219. package/src/commands/generate-transfer-model.ts +316 -68
  220. package/src/commands/generated-module-path.ts +22 -0
  221. package/src/commands/harness-args.ts +99 -31
  222. package/src/commands/headless-harness.ts +89 -28
  223. package/src/commands/init-args.ts +76 -31
  224. package/src/commands/init-hosts.ts +51 -0
  225. package/src/commands/init-prompt.ts +5 -6
  226. package/src/commands/init-templates.ts +3183 -760
  227. package/src/commands/init-wizard.ts +55 -31
  228. package/src/commands/init-workspace.ts +31 -16
  229. package/src/commands/init.ts +261 -63
  230. package/src/commands/kebab.ts +17 -0
  231. package/src/commands/lint-grammar-args.ts +17 -13
  232. package/src/commands/lint-grammar-driver.ts +2 -1
  233. package/src/commands/lint-grammar.ts +1 -1
  234. package/src/commands/measure-memory-args.ts +27 -14
  235. package/src/commands/measure-memory-driver.ts +5 -3
  236. package/src/commands/measure-memory.ts +1 -1
  237. package/src/commands/model-docs-args.ts +16 -13
  238. package/src/commands/model-docs-driver.ts +2 -1
  239. package/src/commands/model-docs.ts +1 -1
  240. package/src/commands/projects-args.ts +5 -4
  241. package/src/commands/projects.ts +4 -6
  242. package/src/commands/query-args.ts +6 -4
  243. package/src/commands/query.ts +9 -9
  244. package/src/commands/reflect-args.ts +17 -13
  245. package/src/commands/reflect-driver.ts +2 -1
  246. package/src/commands/reflect.ts +1 -1
  247. package/src/commands/save-args.ts +7 -3
  248. package/src/commands/save.ts +24 -27
  249. package/src/commands/validate-args.ts +17 -13
  250. package/src/commands/validate-driver.ts +2 -1
  251. package/src/commands/validate.ts +1 -1
  252. package/src/commands/watch-args.ts +6 -3
  253. package/src/commands/watch.ts +28 -7
  254. package/src/driver-heap.ts +65 -0
  255. package/src/index.ts +3 -0
  256. package/src/log-level.ts +42 -14
  257. package/src/spawn-data-server.ts +17 -5
  258. package/src/stderr-connection-logger.ts +18 -0
  259. package/src/testing/echo-server.ts +11 -2
  260. package/templates/client/gitignore +3 -0
  261. package/templates/client/src/__GRAMMAR_ID__-diagram-module.ts +82 -0
  262. package/templates/editorconfig +15 -0
  263. package/templates/gitignore +1 -0
  264. package/templates/host-browser/esbuild.mjs +82 -0
  265. package/templates/host-browser/gitignore +4 -0
  266. package/templates/host-browser/hydranium-mark.svg +40 -0
  267. package/templates/host-browser/index.html +287 -0
  268. package/templates/host-browser/playwright.config.mts +24 -0
  269. package/templates/host-browser/src/data-status.ts +15 -0
  270. package/templates/host-browser/src/diagram-save.ts +60 -0
  271. package/templates/host-browser/src/diagram.ts +121 -0
  272. package/templates/host-browser/src/editor.ts +102 -0
  273. package/templates/host-browser/src/log.ts +14 -0
  274. package/templates/host-browser/src/monaco-editor-core-worker.d.ts +7 -0
  275. package/templates/host-browser/src/monaco-editor-worker.ts +10 -0
  276. package/templates/host-browser/src/posix-path-shim.ts +23 -0
  277. package/templates/host-browser/src/shown-file.ts +61 -0
  278. package/templates/host-browser/src/workspace.ts +5 -0
  279. package/templates/host-browser/tsconfig.e2e.json +16 -0
  280. package/templates/host-browser/tsconfig.page.json +16 -0
  281. package/templates/host-browser/tsconfig.worker.json +16 -0
  282. package/templates/host-theia-browser/esbuild.mjs +24 -0
  283. package/templates/host-theia-browser/gitignore +9 -0
  284. package/templates/host-theia-browser/playwright.config.mts +42 -0
  285. package/templates/host-theia-browser/start.mjs +50 -0
  286. package/templates/host-theia-browser/tsconfig.e2e.json +16 -0
  287. package/templates/host-theia-electron/esbuild.mjs +27 -0
  288. package/templates/host-theia-electron/gitignore +8 -0
  289. package/templates/host-theia-electron/playwright.config.mts +12 -0
  290. package/templates/host-theia-electron/start.mjs +47 -0
  291. package/templates/host-theia-electron/tsconfig.e2e.json +16 -0
  292. package/templates/host-vscode/esbuild.mjs +38 -0
  293. package/templates/host-vscode/gitignore +7 -0
  294. package/templates/host-vscode/playwright.config.mts +14 -0
  295. package/templates/host-vscode/src/__GRAMMAR_ID__-diagram-editor.ts +19 -0
  296. package/templates/host-vscode/src/show-model-command.ts +24 -0
  297. package/templates/host-vscode/src/webview/__GRAMMAR_ID__-diagram.ts +18 -0
  298. package/templates/host-vscode/src/webview/diagram.css +40 -0
  299. package/templates/host-vscode/start.mjs +22 -0
  300. package/templates/host-vscode/test/install-vscode.mts +21 -0
  301. package/templates/host-vscode/test/vscode-version.mts +10 -0
  302. package/templates/host-vscode/tsconfig.e2e.json +17 -0
  303. package/templates/host-vscode/tsconfig.json +19 -0
  304. package/templates/host-vscode/tsconfig.webview.json +17 -0
  305. package/templates/oxlintrc.json +4 -0
  306. package/templates/protocol/gitignore +3 -0
  307. package/templates/protocol/src/__GRAMMAR_ID__-diagram-types.ts +47 -0
  308. package/templates/server/gitignore +6 -0
  309. package/templates/server/src/glsp/__GRAMMAR_ID__/create-node-operation-handler.ts +62 -0
  310. package/templates/server/src/glsp/__GRAMMAR_ID__/delete-operation-handler.ts +63 -0
  311. package/templates/server/src/glsp/__GRAMMAR_ID__/gmodel-factory.ts +144 -0
  312. package/templates/server/src/glsp/__GRAMMAR_ID__/state.ts +18 -0
  313. package/templates/server/src/glsp/__GRAMMAR_ID__/storage.ts +16 -0
  314. package/templates/server/src/glsp/__GRAMMAR_ID__/submission-handler.ts +24 -0
  315. package/templates/server/src/grammar/common.langium +12 -0
  316. package/templates/server/src/language-server/__GRAMMAR_ID__-serializer.ts +53 -0
  317. package/templates/server/src/language-server/__GRAMMAR_ID__-validation.ts +30 -0
  318. package/templates/server/src/language-server/ast.ts +23 -0
  319. package/templates/server/src/node/services.ts +16 -0
  320. package/templates/server/test/__GRAMMAR_ID__-diagram.test.ts +403 -0
  321. package/templates/server/test/tsconfig.json +4 -0
  322. package/templates/server/tsconfig.test.json +10 -0
  323. package/templates/server/vitest.config.ts +14 -0
  324. package/templates/theia/gitignore +3 -0
  325. package/templates/theia/src/browser/__GRAMMAR_ID__-diagram-frontend-module.ts +65 -0
  326. package/templates/theia/src/browser/__PROJECT_ID__-connection-preload-module.ts +15 -0
  327. package/templates/theia/src/browser/__PROJECT_ID__-data-connection.ts +15 -0
  328. package/templates/theia/src/browser/__PROJECT_ID__-data-port.ts +11 -0
  329. package/templates/theia/src/browser/__PROJECT_ID__-glsp-client-contribution.ts +13 -0
  330. package/templates/theia/src/browser/__PROJECT_ID__-show-model-command.ts +51 -0
  331. package/templates/theia/src/common/__PROJECT_ID__-glsp-contribution.ts +3 -0
  332. package/templates/theia/src/node/__PROJECT_ID__-connection-backend-module.ts +12 -0
  333. package/templates/theia/src/node/__PROJECT_ID__-data-backend-module.ts +15 -0
  334. package/templates/theia/src/node/__PROJECT_ID__-glsp-backend-module.ts +16 -0
  335. package/templates/theia/style/diagram.css +20 -0
  336. package/templates/theia/tsconfig.json +24 -0
  337. package/templates/vscode-servers/gitignore +4 -0
  338. package/templates/vscode-servers/tsconfig.json +19 -0
  339. package/templates/workspace/nodes.__EXTENSION__ +5 -0
  340. package/templates/workspace/references.__EXTENSION__ +2 -0
@@ -7,7 +7,8 @@
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
9
  import type * as HydraniumCoreNode from '@hydranium/core/node';
10
- import type { LogThreshold } from '@hydranium/protocol';
10
+ import { type HeapReading } from '../driver-heap.js';
11
+ import { type LogOptions } from '../log-level.js';
11
12
  /** The flag every report-producing subcommand names its destination file with. */
12
13
  export declare const OUT_FILE_FLAG = "--out-file";
13
14
  /** The `@hydranium/core/node` module surface the drivers use (type only). */
@@ -30,13 +31,15 @@ export interface HeadlessContext {
30
31
  * its `createServices` thunk AND the `@hydranium/core/node` harness, both
31
32
  * resolved from the HEAD's location rather than the CLI's.
32
33
  *
33
- * The module is an ESM file (typically a compiled `lib/*.js`) exporting a
34
- * ZERO-ARG `createServices(): { shared }`. `hydranium-cli` is language-agnostic
34
+ * The module is an ESM file exporting a ZERO-ARG `createServices(): { shared }`:
35
+ * a compiled `lib/*.js`, or the TypeScript source when the child was started
36
+ * with a loader through {@link IMPORT_FLAG}. `hydranium-cli` is language-agnostic
35
37
  * and cannot statically import a head's `create<Lang>Services`, so the dynamic
36
38
  * import is the seam that keeps the binary head-neutral. Resolving the harness
37
- * from the head's graph (via `createRequire` rooted at the head module) means the
38
- * CLI itself needs no `@hydranium/core` dependency — the head always has it — and
39
- * guarantees the harness runs against the SAME core copy as `createServices`.
39
+ * from the head's graph (via `createRequire` rooted at the head module) rather
40
+ * than from the CLI's guarantees it runs against the SAME core copy as
41
+ * `createServices`, which a second copy of the module would break even where
42
+ * both resolve.
40
43
  *
41
44
  * Throws a clear error when the path names no file, and when the export is
42
45
  * missing or not a function.
@@ -66,31 +69,45 @@ export declare function emitReport(report: string, outFile: string | undefined):
66
69
  export declare function spawnNodeChild(execArgs: string[], env?: Record<string, string>): Promise<number>;
67
70
  /** How a subcommand parent reaches its driver child; the seam `__spawnForTest` replaces. */
68
71
  export type SpawnDriverChild = (execArgs: string[], env?: Record<string, string>) => Promise<number>;
69
- /** What every `--services` subcommand carries for the child it spawns, on top of its own options. */
70
- export interface DriverSpawnOptions {
71
- /**
72
- * Log threshold for the head the driver boots. Absent leaves the child's
73
- * inherited environment alone, so an ambient `HYDRANIUM_LOG_LEVEL` still wins
74
- * where a caller set one.
75
- */
76
- readonly logLevel?: LogThreshold;
72
+ /**
73
+ * What every `--services` subcommand carries for the child it spawns, on top of
74
+ * its own options. The log options apply to the head the driver boots; an
75
+ * absent one leaves the child's inherited environment alone, so an ambient
76
+ * variable still wins where a caller set one.
77
+ */
78
+ export interface DriverSpawnOptions extends LogOptions {
79
+ /** Specifiers the driver child registers with Node's `--import`, in order, before it imports the head. */
80
+ readonly imports?: readonly string[];
77
81
  /** Test-only: capture the node argv and env instead of spawning the real child. */
78
82
  readonly __spawnForTest?: SpawnDriverChild;
83
+ /**
84
+ * Test-only: decide the heap ceiling from a stated cgroup reading rather
85
+ * than the machine's. Without it an argv assertion means one thing on a
86
+ * workstation and nothing at all under a memory limit, so a suite that
87
+ * asserts the ceiling is present passes vacuously in a container.
88
+ */
89
+ readonly __heapReadingForTest?: HeapReading;
79
90
  }
80
91
  /**
81
92
  * Parent-side: run a subcommand's driver child and propagate its exit code, so a
82
93
  * shell or CI step sees the gate.
83
94
  *
84
- * **The log threshold travels in the child's ENVIRONMENT, not its argv.** The
85
- * head's logger reads `HYDRANIUM_LOG_LEVEL` while `createServices` constructs it,
86
- * which is inside the driver's dynamic import — a flag the driver parsed would
87
- * arrive after the only moment it can be read. Setting it here rather than
88
- * exporting it also leaves the CLI's own output alone, unlike an ambient
89
- * `HYDRANIUM_LOG_LEVEL=…` the parent would carry too.
95
+ * **The log options travel in the child's ENVIRONMENT, not its argv.** The
96
+ * head's logger reads its `HYDRANIUM_LOG_*` variables while `createServices`
97
+ * constructs it, which is inside the driver's dynamic import — a flag the driver
98
+ * parsed would arrive after the only moment it can be read. Setting them here
99
+ * rather than exporting them also leaves the CLI's own output alone, unlike
100
+ * ambient variables the parent would carry too.
90
101
  *
91
102
  * A head that binds a logger of its own decides for itself whether the flag means
92
103
  * anything, which is the intended seam: the CLI is language-agnostic and cannot
93
104
  * reach past `createServices`.
105
+ *
106
+ * **The heap ceiling is prepended HERE rather than passed by each subcommand.**
107
+ * Every caller wants the same answer to the same question, and the answer is not
108
+ * a constant — see {@link driverHeapArgs}. A literal at the call site is a place
109
+ * the container case can be missed, and the caller that misses it takes the whole
110
+ * cgroup down with it rather than failing on its own.
94
111
  */
95
112
  export declare function runDriverChild(execArgs: string[], options: DriverSpawnOptions): Promise<void>;
96
113
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"headless-harness.d.ts","sourceRoot":"","sources":["../../src/commands/headless-harness.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,KAAK,KAAK,iBAAiB,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AASxD,kFAAkF;AAClF,eAAO,MAAM,aAAa,eAAe,CAAC;AAE1C,6EAA6E;AAC7E,KAAK,cAAc,GAAG,OAAO,iBAAiB,CAAC;AAE/C;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,iBAAiB,CAAC,yBAAyB,CAAC,gBAAgB,CAAC,CAAC;AAE5F,qFAAqF;AACrF,MAAM,WAAW,eAAe;IAC7B,gEAAgE;IAChE,cAAc,EAAE,eAAe,CAAC;IAChC,yEAAyE;IACzE,QAAQ,EAAE,cAAc,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,mBAAmB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CA4B1F;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAS5E;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,C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AAG,OAAO,CAAC,eAAe,CAAC,CAiC1F;AA4BD;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAU5E;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAShG;AAED,4FAA4F;AAC5F,MAAM,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAErG;;;;;GAKG;AACH,MAAM,WAAW,kBAAmB,SAAQ,UAAU;IACnD,0GAA0G;IAC1G,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,mFAAmF;IACnF,QAAQ,CAAC,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAC3C;;;;;OAKG;IACH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,WAAW,CAAC;CAC9C;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAOnG"}
@@ -11,8 +11,9 @@ import { statSync, writeFileSync } from 'node:fs';
11
11
  import { createRequire } from 'node:module';
12
12
  import * as path from 'node:path';
13
13
  import { pathToFileURL } from 'node:url';
14
- import { logLevelEnv } from '../log-level.js';
15
- import { SERVICES_FLAG } from './harness-args.js';
14
+ import { driverHeapArgs } from '../driver-heap.js';
15
+ import { logEnv } from '../log-level.js';
16
+ import { IMPORT_FLAG, SERVICES_FLAG } from './harness-args.js';
16
17
  /** The flag every report-producing subcommand names its destination file with. */
17
18
  export const OUT_FILE_FLAG = '--out-file';
18
19
  /**
@@ -20,13 +21,15 @@ export const OUT_FILE_FLAG = '--out-file';
20
21
  * its `createServices` thunk AND the `@hydranium/core/node` harness, both
21
22
  * resolved from the HEAD's location rather than the CLI's.
22
23
  *
23
- * The module is an ESM file (typically a compiled `lib/*.js`) exporting a
24
- * ZERO-ARG `createServices(): { shared }`. `hydranium-cli` is language-agnostic
24
+ * The module is an ESM file exporting a ZERO-ARG `createServices(): { shared }`:
25
+ * a compiled `lib/*.js`, or the TypeScript source when the child was started
26
+ * with a loader through {@link IMPORT_FLAG}. `hydranium-cli` is language-agnostic
25
27
  * and cannot statically import a head's `create<Lang>Services`, so the dynamic
26
28
  * import is the seam that keeps the binary head-neutral. Resolving the harness
27
- * from the head's graph (via `createRequire` rooted at the head module) means the
28
- * CLI itself needs no `@hydranium/core` dependency — the head always has it — and
29
- * guarantees the harness runs against the SAME core copy as `createServices`.
29
+ * from the head's graph (via `createRequire` rooted at the head module) rather
30
+ * than from the CLI's guarantees it runs against the SAME core copy as
31
+ * `createServices`, which a second copy of the module would break even where
32
+ * both resolve.
30
33
  *
31
34
  * Throws a clear error when the path names no file, and when the export is
32
35
  * missing or not a function.
@@ -40,11 +43,17 @@ export async function loadHeadlessContext(servicesModule) {
40
43
  const stats = statSync(modulePath, { throwIfNoEntry: false });
41
44
  if (stats === undefined || !stats.isFile()) {
42
45
  throw new Error(`${SERVICES_FLAG} must name an existing ESM file; '${servicesModule}' resolved to ${modulePath}, ` +
43
- `which is not one. Pass the head's COMPILED entry, e.g. \`${SERVICES_FLAG} ./lib/services.js\` — ` +
44
- 'not the TypeScript source and not a package name.');
46
+ "which is not one. Pass the path of the server package's built `lib/node/services.js` from where you run this — " +
47
+ 'not a package name.');
45
48
  }
46
49
  const moduleUrl = pathToFileURL(modulePath).href;
47
- const imported = (await import(moduleUrl));
50
+ let imported;
51
+ try {
52
+ imported = (await import(moduleUrl));
53
+ }
54
+ catch (err) {
55
+ throw withLoaderHint(err, modulePath);
56
+ }
48
57
  const createServices = imported.createServices;
49
58
  if (typeof createServices !== 'function') {
50
59
  throw new Error(`Services module '${servicesModule}' must export a zero-arg 'createServices(): { shared }' ` +
@@ -56,6 +65,30 @@ export async function loadHeadlessContext(servicesModule) {
56
65
  const coreNode = (await import(pathToFileURL(coreNodePath).href));
57
66
  return { createServices: createServices, coreNode };
58
67
  }
68
+ /** The codes Node fails a TypeScript entry with when no loader handled it, depending on its version. */
69
+ const UNLOADED_TYPESCRIPT_CODES = new Set([
70
+ 'ERR_UNKNOWN_FILE_EXTENSION',
71
+ 'ERR_MODULE_NOT_FOUND',
72
+ 'ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX'
73
+ ]);
74
+ /**
75
+ * Append a loader hint to a TypeScript entry's import failure, unless the child
76
+ * was started with {@link IMPORT_FLAG}, where the hint would only repeat the
77
+ * caller's own command. Appended rather than substituted: a loader set through
78
+ * `NODE_OPTIONS` does not show in `execArgv`, and under it the failure can be a
79
+ * missing module that only Node's own message names.
80
+ */
81
+ function withLoaderHint(err, modulePath) {
82
+ if (!(err instanceof Error) || !/\.[cm]?ts$/.test(modulePath) || !('code' in err) || typeof err.code !== 'string') {
83
+ return err;
84
+ }
85
+ if (!UNLOADED_TYPESCRIPT_CODES.has(err.code) || process.execArgv.some(arg => arg.startsWith(IMPORT_FLAG))) {
86
+ return err;
87
+ }
88
+ return new Error(`${err.message}\nA TypeScript head needs a loader registered with \`${IMPORT_FLAG}\`, e.g. \`${IMPORT_FLAG} tsx\`.`, {
89
+ cause: err
90
+ });
91
+ }
59
92
  /**
60
93
  * Child-side: deliver a finished report — to `outFile` when one was named, else
61
94
  * to stdout.
@@ -73,8 +106,9 @@ export function emitReport(report, outFile) {
73
106
  }
74
107
  writeFileSync(outFile, report.endsWith('\n') ? report : `${report}\n`);
75
108
  // Progress on stderr, so a caller that also captures stdout gets a clean
76
- // stream rather than a note where the report used to be.
77
- console.error(`Wrote ${outFile}`);
109
+ // stream rather than a note where the report used to be. Not `console.error`,
110
+ // which a configured log file records as an error line.
111
+ process.stderr.write(`Wrote ${outFile}\n`);
78
112
  }
79
113
  /**
80
114
  * Parent-side: spawn `node <execArgs...>` inheriting stdio and resolve with the
@@ -100,22 +134,40 @@ export function spawnNodeChild(execArgs, env) {
100
134
  * Parent-side: run a subcommand's driver child and propagate its exit code, so a
101
135
  * shell or CI step sees the gate.
102
136
  *
103
- * **The log threshold travels in the child's ENVIRONMENT, not its argv.** The
104
- * head's logger reads `HYDRANIUM_LOG_LEVEL` while `createServices` constructs it,
105
- * which is inside the driver's dynamic import — a flag the driver parsed would
106
- * arrive after the only moment it can be read. Setting it here rather than
107
- * exporting it also leaves the CLI's own output alone, unlike an ambient
108
- * `HYDRANIUM_LOG_LEVEL=…` the parent would carry too.
137
+ * **The log options travel in the child's ENVIRONMENT, not its argv.** The
138
+ * head's logger reads its `HYDRANIUM_LOG_*` variables while `createServices`
139
+ * constructs it, which is inside the driver's dynamic import — a flag the driver
140
+ * parsed would arrive after the only moment it can be read. Setting them here
141
+ * rather than exporting them also leaves the CLI's own output alone, unlike
142
+ * ambient variables the parent would carry too.
109
143
  *
110
144
  * A head that binds a logger of its own decides for itself whether the flag means
111
145
  * anything, which is the intended seam: the CLI is language-agnostic and cannot
112
146
  * reach past `createServices`.
147
+ *
148
+ * **The heap ceiling is prepended HERE rather than passed by each subcommand.**
149
+ * Every caller wants the same answer to the same question, and the answer is not
150
+ * a constant — see {@link driverHeapArgs}. A literal at the call site is a place
151
+ * the container case can be missed, and the caller that misses it takes the whole
152
+ * cgroup down with it rather than failing on its own.
113
153
  */
114
154
  export async function runDriverChild(execArgs, options) {
115
155
  const spawnChild = options.__spawnForTest ?? spawnNodeChild;
116
- const code = await spawnChild(execArgs, options.logLevel === undefined ? undefined : logLevelEnv(options.logLevel));
156
+ const importArgs = (options.imports ?? []).map(specifier => `${IMPORT_FLAG}=${loaderSpecifier(specifier)}`);
157
+ const code = await spawnChild([...driverHeapArgs(options.__heapReadingForTest), ...importArgs, ...execArgs], logEnv(options));
117
158
  if (code) {
118
159
  process.exitCode = code;
119
160
  }
120
161
  }
162
+ /**
163
+ * A path, absolute or `./`/`../` relative with either separator, becomes a file
164
+ * URL resolved against the caller's directory. Node reads `--import` as a URL or
165
+ * package specifier, so it would take a Windows `C:\…` for the URL scheme `c:`
166
+ * and a `.\…` for a package name. Any other specifier passes through as Node
167
+ * reads it.
168
+ */
169
+ function loaderSpecifier(specifier) {
170
+ const isPath = path.isAbsolute(specifier) || /^\.\.?[\\/]/.test(specifier);
171
+ return isPath ? pathToFileURL(path.resolve(specifier)).href : specifier;
172
+ }
121
173
  //# sourceMappingURL=headless-harness.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"headless-harness.js","sourceRoot":"","sources":["../../src/commands/headless-harness.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAIlF,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,kFAAkF;AAClF,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAC;AAoB1C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,cAAsB;IAC7D,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IAChD,yDAAyD;IACzD,0EAA0E;IAC1E,6EAA6E;IAC7E,0DAA0D;IAC1D,MAAM,KAAK,GAAG,QAAQ,CAAC,UAAU,EAAE,EAAE,cAAc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oBG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,QAAkB,EAAE,OAA2B;IACjF,MAAM,UAAU,GAAG,OAAO,CAAC,cAAc,IAAI,cAAc,CAAC;IAC5D,MAAM,UAAU,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,GAAG,WAAW,IAAI,eAAe,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAC5G,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,CAAC,GAAG,cAAc,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE,GAAG,UAAU,EAAE,GAAG,QAAQ,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9H,IAAI,IAAI,EAAE,CAAC;QACR,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAC3B,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,SAAS,eAAe,CAAC,SAAiB;IACvC,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC3E,OAAO,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3E,CAAC"}
@@ -26,6 +26,7 @@
26
26
  */
27
27
  import { type UsageError } from './harness-args.js';
28
28
  import { type InitHead } from './init.js';
29
+ import type { InitHost } from './init-hosts.js';
29
30
  /** One grammar as the command line collected it, before any derivation. */
30
31
  export interface ParsedInitGrammar {
31
32
  name: string;
@@ -39,6 +40,7 @@ export interface ParsedInitArgs {
39
40
  name?: string;
40
41
  force: boolean;
41
42
  heads?: InitHead[];
43
+ hosts?: InitHost[];
42
44
  monorepo: boolean;
43
45
  scope?: string;
44
46
  public: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"init-args.d.ts","sourceRoot":"","sources":["../../src/commands/init-args.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAA2D,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC7G,OAAO,EAA0B,KAAK,QAAQ,EAAE,MAAM,WAAW,CAAC;AAKlE,2EAA2E;AAC3E,MAAM,WAAW,iBAAiB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,sGAAsG;AACtG,MAAM,WAAW,cAAc;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAChC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,EAAE,SAAS,MAAM,EAWvC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAAmF,CAAC;AAElI;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,UAA0B,GAAG,cAAc,CAiFjG;AAED;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,EAAE,SAAS,MAAM,EA6DtC,CAAC;AAEF,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA4BlE"}
1
+ {"version":3,"file":"init-args.d.ts","sourceRoot":"","sources":["../../src/commands/init-args.ts"],"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6 +39,7 @@ import { createNodeWorkspaceProbe, detectWorkspace } from './init-workspace.js';
39
39
  export const INIT_FLAGS = [
40
40
  '--name',
41
41
  '--heads',
42
+ '--hosts',
42
43
  '--force',
43
44
  '--monorepo',
44
45
  '--scope',
@@ -52,7 +53,15 @@ export const INIT_FLAGS = [
52
53
  * The subset that takes a value, so `--help` in a value position reads as data.
53
54
  * The rest are presence-only.
54
55
  */
55
- export const INIT_VALUE_FLAGS = ['--name', '--heads', '--scope', '--grammar', '--extensions', '--language-id'];
56
+ export const INIT_VALUE_FLAGS = [
57
+ '--name',
58
+ '--heads',
59
+ '--hosts',
60
+ '--scope',
61
+ '--grammar',
62
+ '--extensions',
63
+ '--language-id'
64
+ ];
56
65
  /**
57
66
  * Parse `init`'s flags without deciding whether the result is complete.
58
67
  *
@@ -69,6 +78,7 @@ export function parseInitArgs(args, onError = exitWithUsage) {
69
78
  let name;
70
79
  let force = false;
71
80
  let heads;
81
+ let hosts;
72
82
  let monorepo = false;
73
83
  let scope;
74
84
  let isPublic = false;
@@ -112,11 +122,14 @@ export function parseInitArgs(args, onError = exitWithUsage) {
112
122
  scoped().diagram = true;
113
123
  break;
114
124
  case '--heads': {
115
- // Validated in `resolveInitComposition`, which owns the rule that
116
- // `lsp` is mandatory; the cast only gets the strings that far.
125
+ // Validated in `resolveInitComposition`; the cast only gets the
126
+ // strings that far.
117
127
  heads = next().split(',');
118
128
  break;
119
129
  }
130
+ case '--hosts':
131
+ hosts = next().split(',');
132
+ break;
120
133
  case '--force':
121
134
  force = true;
122
135
  break;
@@ -147,7 +160,7 @@ export function parseInitArgs(args, onError = exitWithUsage) {
147
160
  }
148
161
  }
149
162
  }
150
- return { targetDir, name, force, heads, monorepo, scope, public: isPublic, grammars };
163
+ return { targetDir, name, force, heads, hosts, monorepo, scope, public: isPublic, grammars };
151
164
  }
152
165
  /**
153
166
  * The `init --help` text, as data.
@@ -157,46 +170,71 @@ export function parseInitArgs(args, onError = exitWithUsage) {
157
170
  * authoritative, and a flag missing from it is a capability nobody finds.
158
171
  */
159
172
  export const INIT_HELP = [
160
- 'Usage: hydranium-cli init <target-dir> --name <Name> [--heads <list>] [--force]',
161
- ' [--monorepo] [--scope <@scope>] [--public]',
173
+ 'Usage: hydranium-cli init <target-dir> --name <Name> [--heads <list>]',
174
+ ' [--hosts <list>] [--force] [--monorepo]',
175
+ ' [--scope <@scope>] [--public]',
162
176
  ' ( --grammar <Name> [--extensions <list>]',
163
177
  ' [--language-id <id>] [--diagram] )...',
164
178
  '',
165
- 'Scaffold a new Hydranium language project end-to-end: a starter grammar per',
166
- '--grammar, the `create<Name>Services` DI wiring, an LSP + data-server launch,',
167
- 'langium-config, package.json, and build scripts. Does NOT run `npm install` or',
168
- '`langium generate` — those are printed as next steps. Refuses a non-empty',
169
- 'directory without --force.',
179
+ 'Scaffold a new Hydranium language project end-to-end: its packages and a',
180
+ 'starter workspace, each in its own directory. server/ holds a starter grammar',
181
+ 'per --grammar, the `create<Name>Services` DI wiring, a launch of every head',
182
+ 'and build scripts; protocol/ holds what the server and its clients both',
183
+ 'import; client/, with a diagram, holds its host-neutral client side;',
184
+ 'host-<name>/ holds each --hosts application, vscode-servers/ the server',
185
+ 'launch of the VS Code and Theia ones, and theia/ the Theia extension;',
186
+ 'workspace/ holds two starter model files per grammar. A standalone project',
187
+ 'also gets a root manifest naming the packages as npm workspaces.',
188
+ 'Does NOT run `npm install` or `langium generate` — those are printed as next',
189
+ 'steps. Refuses a non-empty directory without --force.',
170
190
  '',
171
191
  'Run it with no --name on a terminal to be prompted instead. The wizard echoes',
172
192
  'the command it composed before running it, so every answer is reproducible as',
173
193
  'flags. Without a terminal a missing --name stays an error, so CI never hangs.',
174
194
  '',
175
195
  'Project options (position-free):',
176
- ' <target-dir> Directory to scaffold into (required).',
196
+ ' <target-dir> The project directory to scaffold into (required).',
177
197
  ' --name <Name> PascalCase PROJECT name; drives the services and the',
178
198
  ' Langium projectName, i.e. the shared generated symbols',
179
199
  ' (<Name>AstReflection, <Name>GeneratedSharedModule) (required).',
180
- ' --heads <list> Comma-separated protocol heads: lsp, data, glsp.',
181
- ' `lsp` is mandatory — it owns the workspace, the build',
182
- ' pipeline and the shared tier the others read through.',
183
- ' The emitted dependencies, main.ts and module bindings',
184
- ' all follow this set. Default: lsp,data.',
200
+ ' --heads <list> Comma-separated protocol heads: lsp, data, glsp, any',
201
+ ' non-empty set. Without lsp, main.ts serves the socket',
202
+ ' heads from a workspace path it is given and prints',
203
+ ' their ports. The emitted dependencies, main.ts and',
204
+ ' module bindings all follow this set. Default: lsp,data.',
205
+ ' --hosts <list> Comma-separated host applications to emit around the',
206
+ ' heads: browser, a page running every head in a web',
207
+ ' worker, which needs lsp or glsp; without lsp it has',
208
+ ' no editor and saves through the diagram. vscode, a',
209
+ ' VS Code extension and the servers-only extension it',
210
+ ' starts the server through, which needs lsp.',
211
+ ' theia-browser, a Theia browser application, its',
212
+ ' Theia extension and the servers-only extension it',
213
+ ' sideloads, which needs lsp. theia-electron, the',
214
+ ' same in a Theia Electron application. Without',
215
+ ' --hosts, the server with its Node entry points, and',
216
+ ' with glsp the client/ package a host mounts.',
185
217
  ' --force Scaffold into a non-empty directory anyway.',
186
- ' --monorepo Scaffold a member of the surrounding npm workspace:',
187
- ' tsconfig extends the root config that actually carries',
188
- ' compilerOptions, .gitignore is left to the root, and the',
189
- ' scripts address the package by --prefix. Errors when no',
190
- ' ancestor declares `workspaces`. Never writes outside the',
191
- ' target — the root `workspaces` entry is printed, not added.',
192
- ' --scope <@scope> npm scope for the package name, e.g. @acme. Not inferred:',
218
+ ' --monorepo Scaffold the packages as members of the surrounding npm',
219
+ ' workspace, with no root of their own: each tsconfig',
220
+ ' extends the root config that actually carries',
221
+ ' compilerOptions, and the scripts address the server by',
222
+ ' --prefix. Errors when no ancestor declares `workspaces`.',
223
+ ' Never writes outside the target — the root `workspaces`',
224
+ ' entries and dependency pins are printed, not added.',
225
+ ' --scope <@scope> npm scope for the package names, e.g. @acme. Not inferred:',
193
226
  ' a root manifest is usually named for the repo, not the',
194
227
  ' scope. The wizard offers the siblings’ scope as a default.',
195
- ' --public Omit "private": true, so the package can be published.',
196
- ' The scaffold emits it by default, because the manifest',
197
- ' it also emits declares license "UNLICENSED": a package',
198
- ' granting no rights on a public registry contradicts',
199
- ' itself. Pass this once the project has picked a licence.',
228
+ ' The VS Code extensions stay unscoped, since vsce',
229
+ ' refuses a scoped extension name.',
230
+ ' --public Omit "private": true from the server, protocol,',
231
+ ' client and Theia extension packages, so they can be',
232
+ ' published together; a host package stays private.',
233
+ ' The scaffold emits it by default, because the',
234
+ ' manifests also declare license "UNLICENSED": a',
235
+ ' package granting no rights on a public registry',
236
+ ' contradicts itself. Pass this once the project has',
237
+ ' picked a licence.',
200
238
  '',
201
239
  'Grammar options — each applies to the PRECEDING --grammar:',
202
240
  ' --grammar <Name> PascalCase GRAMMAR name; drives the `grammar X` declaration',
@@ -210,8 +248,12 @@ export const INIT_HELP = [
210
248
  ' (default: <project-id>-<grammar-id>).',
211
249
  ' --diagram Scaffold a GLSP diagram for that grammar. Requires',
212
250
  ' `glsp` in --heads. Derived when there is exactly one',
213
- ' grammar; required when there are several, because a',
214
- ' diagram type binds exactly one grammar.',
251
+ ' grammar; required when there are several, because the',
252
+ ' scaffolded diagram is typed over one grammar’s model.',
253
+ '',
254
+ 'Example — one grammar, three heads, in a browser page:',
255
+ ' hydranium-cli init ./bookstore --name Bookstore --heads lsp,data,glsp \\',
256
+ ' --hosts browser',
215
257
  '',
216
258
  'Example — three grammars, one with a differing extension, three heads:',
217
259
  ' hydranium-cli init ./order-flow --name OrderFlow --heads lsp,data,glsp \\',
@@ -241,6 +283,7 @@ export async function runInitCommand(args) {
241
283
  name: assertRequired(parsed.name, '--name', 'init'),
242
284
  grammars: parsed.grammars,
243
285
  heads: parsed.heads,
286
+ hosts: parsed.hosts,
244
287
  force: parsed.force,
245
288
  monorepo: parsed.monorepo,
246
289
  scope: parsed.scope,
@@ -1 +1 @@
1
- {"version":3,"file":"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,SAAS,CAAC,EAAE,CAAC,eAAe,CAAC,SAAS,EAAE,wBAAwB,EAAE,CAAC,EAAE;YAC3G,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,UAAU,EAAE,aAAa;SAC3B,CAAC,CAAC;QACH,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,CAAC;QACL,SAAS,EAAE,cAAc,CAAC,MAAM,CAAC,SAAS,EAAE,cAAc,EAAE,MAAM,CAAC;QACnE,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC;QACnD,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,MAAM,EAAE,MAAM,CAAC,MAAM;KACvB,CAAC,CAAC;AACN,CAAC"}
@@ -0,0 +1,24 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the MIT License which is available in the project root.
6
+ *
7
+ * SPDX-License-Identifier: MIT
8
+ ********************************************************************************/
9
+ /**
10
+ * The host applications `init` can emit around the server: each holds the
11
+ * clients of the heads it runs, in a sibling package of its own.
12
+ */
13
+ import type { InitHead } from './init.js';
14
+ /** The hosts a scaffold can emit, in the order a workspace lists them. */
15
+ export declare const INIT_HOSTS: readonly ['browser', 'vscode', 'theia-browser', 'theia-electron'];
16
+ /** One host application — see {@link INIT_HOSTS}. */
17
+ export type InitHost = (typeof INIT_HOSTS)[number];
18
+ /** True for a string naming one of {@link INIT_HOSTS}. */
19
+ export declare function isInitHost(value: string): value is InitHost;
20
+ /** True for a host that is a Theia application, which runs the Theia extension. */
21
+ export declare function isTheiaHost(host: InitHost): boolean;
22
+ /** The heads {@link host} needs at least one of in the composition. */
23
+ export declare function editingHeads(host: InitHost): readonly InitHead[];
24
+ //# sourceMappingURL=init-hosts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init-hosts.d.ts","sourceRoot":"","sources":["../../src/commands/init-hosts.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1C,0EAA0E;AAC1E,eAAO,MAAM,UAAU,YAAI,SAAS,EAAE,QAAQ,EAAE,eAAe,EAAE,gBAAgB,CAAU,CAAC;AAE5F,qDAAqD;AACrD,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAiBnD,0DAA0D;AAC1D,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,QAAQ,CAE3D;AAED,mFAAmF;AACnF,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAEnD;AAED,uEAAuE;AACvE,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,QAAQ,EAAE,CAEhE"}
@@ -0,0 +1,37 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the MIT License which is available in the project root.
6
+ *
7
+ * SPDX-License-Identifier: MIT
8
+ ********************************************************************************/
9
+ /** The hosts a scaffold can emit, in the order a workspace lists them. */
10
+ export const INIT_HOSTS = ['browser', 'vscode', 'theia-browser', 'theia-electron'];
11
+ /**
12
+ * The heads a host needs at least one of: those whose client edits and saves
13
+ * the files. The browser page has no filesystem of its own, so it saves through
14
+ * the LSP head's editor or the GLSP head's diagram. VS Code and Theia own the
15
+ * files and reach the server through a language client, so they need the LSP
16
+ * head. Every other head is optional, and a head the host does not know is left
17
+ * unused.
18
+ */
19
+ const EDITING_HEADS = {
20
+ browser: ['lsp', 'glsp'],
21
+ vscode: ['lsp'],
22
+ 'theia-browser': ['lsp'],
23
+ 'theia-electron': ['lsp']
24
+ };
25
+ /** True for a string naming one of {@link INIT_HOSTS}. */
26
+ export function isInitHost(value) {
27
+ return INIT_HOSTS.includes(value);
28
+ }
29
+ /** True for a host that is a Theia application, which runs the Theia extension. */
30
+ export function isTheiaHost(host) {
31
+ return host === 'theia-browser' || host === 'theia-electron';
32
+ }
33
+ /** The heads {@link host} needs at least one of in the composition. */
34
+ export function editingHeads(host) {
35
+ return EDITING_HEADS[host];
36
+ }
37
+ //# sourceMappingURL=init-hosts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init-hosts.js","sourceRoot":"","sources":["../../src/commands/init-hosts.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AASlF,0EAA0E;AAC1E,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,eAAe,EAAE,gBAAgB,CAAU,CAAC;AAK5F;;;;;;;GAOG;AACH,MAAM,aAAa,GAA0C;IAC1D,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,CAAC,KAAK,CAAC;IACf,eAAe,EAAE,CAAC,KAAK,CAAC;IACxB,gBAAgB,EAAE,CAAC,KAAK,CAAC;CAC3B,CAAC;AAEF,0DAA0D;AAC1D,MAAM,UAAU,UAAU,CAAC,KAAa;IACrC,OAAQ,UAAgC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC5D,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,WAAW,CAAC,IAAc;IACvC,OAAO,IAAI,KAAK,eAAe,IAAI,IAAI,KAAK,gBAAgB,CAAC;AAChE,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,YAAY,CAAC,IAAc;IACxC,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC"}
@@ -39,7 +39,7 @@ export interface PromptPort {
39
39
  readonly choices: ReadonlyArray<PromptChoice<Value>>;
40
40
  readonly initialValue?: Value;
41
41
  }) => Promise<Value>;
42
- /** Ask for any number of several choices, including none. */
42
+ /** Ask for at least one of several choices. */
43
43
  readonly multiselect: <Value extends string>(options: {
44
44
  readonly message: string;
45
45
  readonly choices: ReadonlyArray<PromptChoice<Value>>;
@@ -53,8 +53,8 @@ export interface PromptPort {
53
53
  /** Close the session with a closing line. */
54
54
  readonly outro: (message: string) => void;
55
55
  }
56
- /** The optional heads, as a checkbox list. `lsp` is not offered — see `askHeads`. */
57
- export declare const OPTIONAL_HEAD_CHOICES: ReadonlyArray<PromptChoice<Exclude<InitHead, 'lsp'>>>;
56
+ /** The heads, as a checkbox list. */
57
+ export declare const HEAD_CHOICES: ReadonlyArray<PromptChoice<InitHead>>;
58
58
  /**
59
59
  * The real prompt, backed by `@clack/prompts`.
60
60
  *
@@ -1 +1 @@
1
- {"version":3,"file":"init-prompt.d.ts","sourceRoot":"","sources":["../../src/commands/init-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAqBlF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1C,wFAAwF;AACxF,MAAM,WAAW,YAAY,CAAC,KAAK,SAAS,MAAM;IAC/C,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,2EAA2E;IAC3E,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,mGAAmG;AACnG,MAAM,WAAW,iBAAiB;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG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