@hydranium/cli 1.0.0-next.10

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 (267) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +240 -0
  3. package/heap-analysis/analyze-heap.mjs +798 -0
  4. package/heap-analysis/heap/core/aggregate.mjs +152 -0
  5. package/heap-analysis/heap/core/bucket-label.mjs +23 -0
  6. package/heap-analysis/heap/core/cutpoints.mjs +51 -0
  7. package/heap-analysis/heap/core/diff.mjs +56 -0
  8. package/heap-analysis/heap/core/format.mjs +47 -0
  9. package/heap-analysis/heap/core/holders.mjs +80 -0
  10. package/heap-analysis/heap/core/load.mjs +46 -0
  11. package/heap-analysis/heap/core/report.mjs +68 -0
  12. package/heap-analysis/heap/core/strings.mjs +80 -0
  13. package/heap-analysis/heap/langium/concepts.mjs +230 -0
  14. package/heap-analysis/heap/langium/glsp.classifier.mjs +80 -0
  15. package/heap-analysis/heap/langium/langium.classifier.mjs +203 -0
  16. package/heap-analysis/heap/renderer/renderer.mjs +122 -0
  17. package/lib/cli-version.d.ts +21 -0
  18. package/lib/cli-version.d.ts.map +1 -0
  19. package/lib/cli-version.js +30 -0
  20. package/lib/cli-version.js.map +1 -0
  21. package/lib/cli.d.ts +11 -0
  22. package/lib/cli.d.ts.map +1 -0
  23. package/lib/cli.js +135 -0
  24. package/lib/cli.js.map +1 -0
  25. package/lib/commands/analyze-heap-args.d.ts +46 -0
  26. package/lib/commands/analyze-heap-args.d.ts.map +1 -0
  27. package/lib/commands/analyze-heap-args.js +174 -0
  28. package/lib/commands/analyze-heap-args.js.map +1 -0
  29. package/lib/commands/analyze-heap.d.ts +37 -0
  30. package/lib/commands/analyze-heap.d.ts.map +1 -0
  31. package/lib/commands/analyze-heap.js +63 -0
  32. package/lib/commands/analyze-heap.js.map +1 -0
  33. package/lib/commands/ast-ground-truth-args.d.ts +23 -0
  34. package/lib/commands/ast-ground-truth-args.d.ts.map +1 -0
  35. package/lib/commands/ast-ground-truth-args.js +47 -0
  36. package/lib/commands/ast-ground-truth-args.js.map +1 -0
  37. package/lib/commands/ast-ground-truth-driver.d.ts +10 -0
  38. package/lib/commands/ast-ground-truth-driver.d.ts.map +1 -0
  39. package/lib/commands/ast-ground-truth-driver.js +72 -0
  40. package/lib/commands/ast-ground-truth-driver.js.map +1 -0
  41. package/lib/commands/ast-ground-truth.d.ts +31 -0
  42. package/lib/commands/ast-ground-truth.d.ts.map +1 -0
  43. package/lib/commands/ast-ground-truth.js +36 -0
  44. package/lib/commands/ast-ground-truth.js.map +1 -0
  45. package/lib/commands/generate-transfer-model-args.d.ts +38 -0
  46. package/lib/commands/generate-transfer-model-args.d.ts.map +1 -0
  47. package/lib/commands/generate-transfer-model-args.js +183 -0
  48. package/lib/commands/generate-transfer-model-args.js.map +1 -0
  49. package/lib/commands/generate-transfer-model-config.d.ts +32 -0
  50. package/lib/commands/generate-transfer-model-config.d.ts.map +1 -0
  51. package/lib/commands/generate-transfer-model-config.js +122 -0
  52. package/lib/commands/generate-transfer-model-config.js.map +1 -0
  53. package/lib/commands/generate-transfer-model.d.ts +110 -0
  54. package/lib/commands/generate-transfer-model.d.ts.map +1 -0
  55. package/lib/commands/generate-transfer-model.js +587 -0
  56. package/lib/commands/generate-transfer-model.js.map +1 -0
  57. package/lib/commands/harness-args.d.ts +198 -0
  58. package/lib/commands/harness-args.d.ts.map +1 -0
  59. package/lib/commands/harness-args.js +339 -0
  60. package/lib/commands/harness-args.js.map +1 -0
  61. package/lib/commands/headless-harness.d.ts +97 -0
  62. package/lib/commands/headless-harness.d.ts.map +1 -0
  63. package/lib/commands/headless-harness.js +121 -0
  64. package/lib/commands/headless-harness.js.map +1 -0
  65. package/lib/commands/init-args.d.ts +81 -0
  66. package/lib/commands/init-args.d.ts.map +1 -0
  67. package/lib/commands/init-args.js +250 -0
  68. package/lib/commands/init-args.js.map +1 -0
  69. package/lib/commands/init-prompt.d.ts +66 -0
  70. package/lib/commands/init-prompt.d.ts.map +1 -0
  71. package/lib/commands/init-prompt.js +71 -0
  72. package/lib/commands/init-prompt.js.map +1 -0
  73. package/lib/commands/init-templates.d.ts +42 -0
  74. package/lib/commands/init-templates.d.ts.map +1 -0
  75. package/lib/commands/init-templates.js +1902 -0
  76. package/lib/commands/init-templates.js.map +1 -0
  77. package/lib/commands/init-wizard.d.ts +65 -0
  78. package/lib/commands/init-wizard.d.ts.map +1 -0
  79. package/lib/commands/init-wizard.js +302 -0
  80. package/lib/commands/init-wizard.js.map +1 -0
  81. package/lib/commands/init-workspace.d.ts +168 -0
  82. package/lib/commands/init-workspace.d.ts.map +1 -0
  83. package/lib/commands/init-workspace.js +372 -0
  84. package/lib/commands/init-workspace.js.map +1 -0
  85. package/lib/commands/init.d.ts +273 -0
  86. package/lib/commands/init.d.ts.map +1 -0
  87. package/lib/commands/init.js +303 -0
  88. package/lib/commands/init.js.map +1 -0
  89. package/lib/commands/lint-grammar-args.d.ts +23 -0
  90. package/lib/commands/lint-grammar-args.d.ts.map +1 -0
  91. package/lib/commands/lint-grammar-args.js +63 -0
  92. package/lib/commands/lint-grammar-args.js.map +1 -0
  93. package/lib/commands/lint-grammar-driver.d.ts +10 -0
  94. package/lib/commands/lint-grammar-driver.d.ts.map +1 -0
  95. package/lib/commands/lint-grammar-driver.js +72 -0
  96. package/lib/commands/lint-grammar-driver.js.map +1 -0
  97. package/lib/commands/lint-grammar-report.d.ts +24 -0
  98. package/lib/commands/lint-grammar-report.d.ts.map +1 -0
  99. package/lib/commands/lint-grammar-report.js +65 -0
  100. package/lib/commands/lint-grammar-report.js.map +1 -0
  101. package/lib/commands/lint-grammar.d.ts +33 -0
  102. package/lib/commands/lint-grammar.d.ts.map +1 -0
  103. package/lib/commands/lint-grammar.js +42 -0
  104. package/lib/commands/lint-grammar.js.map +1 -0
  105. package/lib/commands/measure-memory-args.d.ts +23 -0
  106. package/lib/commands/measure-memory-args.d.ts.map +1 -0
  107. package/lib/commands/measure-memory-args.js +106 -0
  108. package/lib/commands/measure-memory-args.js.map +1 -0
  109. package/lib/commands/measure-memory-driver.d.ts +10 -0
  110. package/lib/commands/measure-memory-driver.d.ts.map +1 -0
  111. package/lib/commands/measure-memory-driver.js +110 -0
  112. package/lib/commands/measure-memory-driver.js.map +1 -0
  113. package/lib/commands/measure-memory.d.ts +68 -0
  114. package/lib/commands/measure-memory.d.ts.map +1 -0
  115. package/lib/commands/measure-memory.js +100 -0
  116. package/lib/commands/measure-memory.js.map +1 -0
  117. package/lib/commands/model-docs-args.d.ts +23 -0
  118. package/lib/commands/model-docs-args.d.ts.map +1 -0
  119. package/lib/commands/model-docs-args.js +53 -0
  120. package/lib/commands/model-docs-args.js.map +1 -0
  121. package/lib/commands/model-docs-driver.d.ts +10 -0
  122. package/lib/commands/model-docs-driver.d.ts.map +1 -0
  123. package/lib/commands/model-docs-driver.js +61 -0
  124. package/lib/commands/model-docs-driver.js.map +1 -0
  125. package/lib/commands/model-docs-report.d.ts +18 -0
  126. package/lib/commands/model-docs-report.d.ts.map +1 -0
  127. package/lib/commands/model-docs-report.js +123 -0
  128. package/lib/commands/model-docs-report.js.map +1 -0
  129. package/lib/commands/model-docs.d.ts +30 -0
  130. package/lib/commands/model-docs.d.ts.map +1 -0
  131. package/lib/commands/model-docs.js +37 -0
  132. package/lib/commands/model-docs.js.map +1 -0
  133. package/lib/commands/projects-args.d.ts +25 -0
  134. package/lib/commands/projects-args.d.ts.map +1 -0
  135. package/lib/commands/projects-args.js +49 -0
  136. package/lib/commands/projects-args.js.map +1 -0
  137. package/lib/commands/projects.d.ts +45 -0
  138. package/lib/commands/projects.d.ts.map +1 -0
  139. package/lib/commands/projects.js +39 -0
  140. package/lib/commands/projects.js.map +1 -0
  141. package/lib/commands/query-args.d.ts +25 -0
  142. package/lib/commands/query-args.d.ts.map +1 -0
  143. package/lib/commands/query-args.js +46 -0
  144. package/lib/commands/query-args.js.map +1 -0
  145. package/lib/commands/query.d.ts +32 -0
  146. package/lib/commands/query.d.ts.map +1 -0
  147. package/lib/commands/query.js +29 -0
  148. package/lib/commands/query.js.map +1 -0
  149. package/lib/commands/reflect-args.d.ts +23 -0
  150. package/lib/commands/reflect-args.d.ts.map +1 -0
  151. package/lib/commands/reflect-args.js +59 -0
  152. package/lib/commands/reflect-args.js.map +1 -0
  153. package/lib/commands/reflect-driver.d.ts +10 -0
  154. package/lib/commands/reflect-driver.d.ts.map +1 -0
  155. package/lib/commands/reflect-driver.js +66 -0
  156. package/lib/commands/reflect-driver.js.map +1 -0
  157. package/lib/commands/reflect-report.d.ts +20 -0
  158. package/lib/commands/reflect-report.d.ts.map +1 -0
  159. package/lib/commands/reflect-report.js +127 -0
  160. package/lib/commands/reflect-report.js.map +1 -0
  161. package/lib/commands/reflect.d.ts +30 -0
  162. package/lib/commands/reflect.d.ts.map +1 -0
  163. package/lib/commands/reflect.js +38 -0
  164. package/lib/commands/reflect.js.map +1 -0
  165. package/lib/commands/save-args.d.ts +26 -0
  166. package/lib/commands/save-args.d.ts.map +1 -0
  167. package/lib/commands/save-args.js +59 -0
  168. package/lib/commands/save-args.js.map +1 -0
  169. package/lib/commands/save.d.ts +38 -0
  170. package/lib/commands/save.d.ts.map +1 -0
  171. package/lib/commands/save.js +48 -0
  172. package/lib/commands/save.js.map +1 -0
  173. package/lib/commands/validate-args.d.ts +23 -0
  174. package/lib/commands/validate-args.d.ts.map +1 -0
  175. package/lib/commands/validate-args.js +60 -0
  176. package/lib/commands/validate-args.js.map +1 -0
  177. package/lib/commands/validate-driver.d.ts +10 -0
  178. package/lib/commands/validate-driver.d.ts.map +1 -0
  179. package/lib/commands/validate-driver.js +72 -0
  180. package/lib/commands/validate-driver.js.map +1 -0
  181. package/lib/commands/validate-report.d.ts +30 -0
  182. package/lib/commands/validate-report.d.ts.map +1 -0
  183. package/lib/commands/validate-report.js +87 -0
  184. package/lib/commands/validate-report.js.map +1 -0
  185. package/lib/commands/validate.d.ts +34 -0
  186. package/lib/commands/validate.d.ts.map +1 -0
  187. package/lib/commands/validate.js +41 -0
  188. package/lib/commands/validate.js.map +1 -0
  189. package/lib/commands/watch-args.d.ts +26 -0
  190. package/lib/commands/watch-args.d.ts.map +1 -0
  191. package/lib/commands/watch-args.js +59 -0
  192. package/lib/commands/watch-args.js.map +1 -0
  193. package/lib/commands/watch.d.ts +75 -0
  194. package/lib/commands/watch.d.ts.map +1 -0
  195. package/lib/commands/watch.js +112 -0
  196. package/lib/commands/watch.js.map +1 -0
  197. package/lib/index.d.ts +16 -0
  198. package/lib/index.d.ts.map +1 -0
  199. package/lib/index.js +16 -0
  200. package/lib/index.js.map +1 -0
  201. package/lib/log-level.d.ts +39 -0
  202. package/lib/log-level.d.ts.map +1 -0
  203. package/lib/log-level.js +47 -0
  204. package/lib/log-level.js.map +1 -0
  205. package/lib/package-name.d.ts +33 -0
  206. package/lib/package-name.d.ts.map +1 -0
  207. package/lib/package-name.js +37 -0
  208. package/lib/package-name.js.map +1 -0
  209. package/lib/spawn-data-server.d.ts +102 -0
  210. package/lib/spawn-data-server.d.ts.map +1 -0
  211. package/lib/spawn-data-server.js +154 -0
  212. package/lib/spawn-data-server.js.map +1 -0
  213. package/lib/testing/echo-server.d.ts +11 -0
  214. package/lib/testing/echo-server.d.ts.map +1 -0
  215. package/lib/testing/echo-server.js +79 -0
  216. package/lib/testing/echo-server.js.map +1 -0
  217. package/package.json +105 -0
  218. package/src/cli-version.ts +32 -0
  219. package/src/cli.ts +139 -0
  220. package/src/commands/analyze-heap-args.ts +184 -0
  221. package/src/commands/analyze-heap.ts +76 -0
  222. package/src/commands/ast-ground-truth-args.ts +63 -0
  223. package/src/commands/ast-ground-truth-driver.ts +81 -0
  224. package/src/commands/ast-ground-truth.ts +49 -0
  225. package/src/commands/generate-transfer-model-args.ts +203 -0
  226. package/src/commands/generate-transfer-model-config.ts +128 -0
  227. package/src/commands/generate-transfer-model.ts +716 -0
  228. package/src/commands/harness-args.ts +429 -0
  229. package/src/commands/headless-harness.ts +165 -0
  230. package/src/commands/init-args.ts +273 -0
  231. package/src/commands/init-prompt.ts +149 -0
  232. package/src/commands/init-templates.ts +2037 -0
  233. package/src/commands/init-wizard.ts +378 -0
  234. package/src/commands/init-workspace.ts +442 -0
  235. package/src/commands/init.ts +554 -0
  236. package/src/commands/lint-grammar-args.ts +79 -0
  237. package/src/commands/lint-grammar-driver.ts +83 -0
  238. package/src/commands/lint-grammar-report.ts +74 -0
  239. package/src/commands/lint-grammar.ts +57 -0
  240. package/src/commands/measure-memory-args.ts +123 -0
  241. package/src/commands/measure-memory-driver.ts +128 -0
  242. package/src/commands/measure-memory.ts +143 -0
  243. package/src/commands/model-docs-args.ts +69 -0
  244. package/src/commands/model-docs-driver.ts +68 -0
  245. package/src/commands/model-docs-report.ts +133 -0
  246. package/src/commands/model-docs.ts +48 -0
  247. package/src/commands/projects-args.ts +62 -0
  248. package/src/commands/projects.ts +76 -0
  249. package/src/commands/query-args.ts +61 -0
  250. package/src/commands/query.ts +58 -0
  251. package/src/commands/reflect-args.ts +75 -0
  252. package/src/commands/reflect-driver.ts +76 -0
  253. package/src/commands/reflect-report.ts +138 -0
  254. package/src/commands/reflect.ts +51 -0
  255. package/src/commands/save-args.ts +74 -0
  256. package/src/commands/save.ts +84 -0
  257. package/src/commands/validate-args.ts +76 -0
  258. package/src/commands/validate-driver.ts +84 -0
  259. package/src/commands/validate-report.ts +95 -0
  260. package/src/commands/validate.ts +58 -0
  261. package/src/commands/watch-args.ts +74 -0
  262. package/src/commands/watch.ts +185 -0
  263. package/src/index.ts +16 -0
  264. package/src/log-level.ts +49 -0
  265. package/src/package-name.ts +39 -0
  266. package/src/spawn-data-server.ts +247 -0
  267. package/src/testing/echo-server.ts +93 -0
@@ -0,0 +1,30 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 CrossBreeze, 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
+ import { readFileSync } from 'node:fs';
10
+ /** This package's own manifest, reachable at the same relative path from `src/` and `lib/`. */
11
+ const CLI_MANIFEST = new URL('../package.json', import.meta.url);
12
+ /**
13
+ * The version of the running binary.
14
+ *
15
+ * Read from the manifest rather than emitted as a constant at build time: a
16
+ * generated constant is a second copy of a number the manifest already carries,
17
+ * and nothing goes red while the two disagree.
18
+ *
19
+ * Throws rather than reporting `unknown`: every caller turns the number into a
20
+ * claim someone else acts on — a pinned dependency range, a version in a bug
21
+ * report — where a placeholder is worse than a failure.
22
+ */
23
+ export function readCliVersion() {
24
+ const manifest = JSON.parse(readFileSync(CLI_MANIFEST, 'utf-8'));
25
+ if (typeof manifest.version !== 'string' || manifest.version === '') {
26
+ throw new Error('hydranium-cli cannot read its own version from its package manifest.');
27
+ }
28
+ return manifest.version;
29
+ }
30
+ //# sourceMappingURL=cli-version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-version.js","sourceRoot":"","sources":["../src/cli-version.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,+FAA+F;AAC/F,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEjE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,cAAc;IAC3B,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAA0B,CAAC;IAC1F,IAAI,OAAO,QAAQ,CAAC,OAAO,KAAK,QAAQ,IAAI,QAAQ,CAAC,OAAO,KAAK,EAAE,EAAE,CAAC;QACnE,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAC;IAC3F,CAAC;IACD,OAAO,QAAQ,CAAC,OAAO,CAAC;AAC3B,CAAC"}
package/lib/cli.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ /********************************************************************************
3
+ * Copyright (c) 2026 CrossBreeze, EclipseSource and others.
4
+ *
5
+ * This program and the accompanying materials are made available under the
6
+ * terms of the MIT License which is available in the project root.
7
+ *
8
+ * SPDX-License-Identifier: MIT
9
+ ********************************************************************************/
10
+ export {};
11
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;kFAOkF"}
package/lib/cli.js ADDED
@@ -0,0 +1,135 @@
1
+ #!/usr/bin/env node
2
+ /********************************************************************************
3
+ * Copyright (c) 2026 CrossBreeze, EclipseSource and others.
4
+ *
5
+ * This program and the accompanying materials are made available under the
6
+ * terms of the MIT License which is available in the project root.
7
+ *
8
+ * SPDX-License-Identifier: MIT
9
+ ********************************************************************************/
10
+ import { Command } from 'commander';
11
+ import { readCliVersion } from './cli-version.js';
12
+ import { runAnalyzeHeapCommand } from './commands/analyze-heap-args.js';
13
+ import { runAstGroundTruthCommand } from './commands/ast-ground-truth-args.js';
14
+ import { runGenerateTransferModelCommand } from './commands/generate-transfer-model-args.js';
15
+ import { runInitCommand } from './commands/init-args.js';
16
+ import { InitWizardCancelled } from './commands/init-prompt.js';
17
+ import { runLintGrammarCommand } from './commands/lint-grammar-args.js';
18
+ import { runMeasureMemoryCommand } from './commands/measure-memory-args.js';
19
+ import { runModelDocsCommand } from './commands/model-docs-args.js';
20
+ import { runProjectsCommand } from './commands/projects-args.js';
21
+ import { runQueryCommand } from './commands/query-args.js';
22
+ import { runReflectCommand } from './commands/reflect-args.js';
23
+ import { runSaveCommand } from './commands/save-args.js';
24
+ import { runValidateCommand } from './commands/validate-args.js';
25
+ import { runWatchCommand } from './commands/watch-args.js';
26
+ /**
27
+ * The subcommand table, as name → handler over that command's own argv tail.
28
+ *
29
+ * Each handler owns its own flag parsing, in a sibling `<name>-args` module that
30
+ * also holds the command's flag list and its help text as data. `commander`
31
+ * provides the dispatch, the command list and the top-level help, but NOT the
32
+ * option parsing: it would generate the per-command help from declared options,
33
+ * at the price of its own error vocabulary replacing the messages scripts match
34
+ * on. `init` could not follow it there in any case — its grammar-scoped flags
35
+ * (`--extensions` applies to the PRECEDING `--grammar`) depend on the relative
36
+ * order of two DIFFERENT option names, which no declarative option model
37
+ * expresses.
38
+ */
39
+ const COMMANDS = {
40
+ 'analyze-heap': { summary: 'Analyze a V8 heap snapshot (needs optional @memlab/heap-analysis).', run: runAnalyzeHeapCommand },
41
+ 'ast-ground-truth': {
42
+ summary: "Tally a workspace's live-model $types (analyze-heap --validate input).",
43
+ run: runAstGroundTruthCommand
44
+ },
45
+ 'generate-transfer-model': {
46
+ summary: 'Generate a transfer-model TypeScript file from a Langium AST.',
47
+ run: runGenerateTransferModelCommand
48
+ },
49
+ init: { summary: 'Scaffold a new Hydranium language project (grammar + server head).', run: runInitCommand },
50
+ 'lint-grammar': { summary: 'Check a grammar against framework conventions (CI gate).', run: runLintGrammarCommand },
51
+ 'measure-memory': { summary: 'Measure model-store memory for a workspace (needs @hydranium/core).', run: runMeasureMemoryCommand },
52
+ 'model-docs': { summary: 'Generate a navigable Markdown model reference for adopter docs.', run: runModelDocsCommand },
53
+ projects: { summary: 'List projects exposed by a data-server subprocess.', run: runProjectsCommand },
54
+ query: { summary: 'Print the data-server document envelope for a URI.', run: runQueryCommand },
55
+ reflect: { summary: "Dump a head's grammar/AST reflection (types, terminals, refs).", run: runReflectCommand },
56
+ save: { summary: 'Update + persist a document via a data-server subprocess.', run: runSaveCommand },
57
+ validate: { summary: 'Validate a workspace headlessly; non-zero exit on errors (CI gate).', run: runValidateCommand },
58
+ watch: { summary: 'Subscribe to data-server document updates; print events as NDJSON.', run: runWatchCommand }
59
+ };
60
+ /**
61
+ * The `commander` program.
62
+ *
63
+ * `.usage()` and the help formatter are pinned to the shape scripts already
64
+ * read — `Usage: hydranium-cli <command> [options]` with a two-space-indented
65
+ * command list — because a CI step that greps the usage line is a contract, not
66
+ * cosmetics. Each subcommand passes its raw tail through to its own handler
67
+ * (`.allowUnknownOption()` plus a variadic operand), so commander owns dispatch
68
+ * and discovery while the handlers keep the exact flag semantics they had.
69
+ */
70
+ function buildProgram() {
71
+ const program = new Command();
72
+ program
73
+ .name('hydranium-cli')
74
+ .usage('<command> [options]')
75
+ .addHelpText('after', '\nRun `hydranium-cli <command> --help` for command-specific options.')
76
+ .helpOption('-h, --help', 'Show this help.')
77
+ // Declared so the top-level help lists it; the dispatch below answers it,
78
+ // because commander would otherwise never see the token — an argv whose
79
+ // first word is not a known subcommand is rejected before `parseAsync`.
80
+ .version(readCliVersion(), '-V, --version', 'Show the version.')
81
+ // No `help <command>` alias: the surface stays exactly the COMMANDS
82
+ // table, and `<command> --help` already covers what it would offer.
83
+ .helpCommand(false)
84
+ .configureHelp({ subcommandTerm: command => command.name() });
85
+ for (const [name, { summary, run }] of Object.entries(COMMANDS)) {
86
+ program
87
+ .command(name)
88
+ .summary(summary)
89
+ .description(summary)
90
+ .allowUnknownOption()
91
+ .allowExcessArguments()
92
+ .helpOption(false)
93
+ .argument('[args...]')
94
+ .action(async (args) => {
95
+ await run(args);
96
+ });
97
+ }
98
+ return program;
99
+ }
100
+ async function main(argv) {
101
+ const [command] = argv;
102
+ // Handled ahead of commander so the three shapes a script can depend on keep
103
+ // their exact contract: a bare invocation prints usage on STDOUT and exits 1,
104
+ // `--help` prints the same on stdout and exits 0, and an unknown command
105
+ // names itself on STDERR with the usage still on stdout.
106
+ const program = buildProgram();
107
+ if (!command || command === '--help' || command === '-h') {
108
+ program.outputHelp();
109
+ process.exit(command ? 0 : 1);
110
+ }
111
+ // Ahead of the unknown-command branch, which claims every first token the
112
+ // COMMANDS table does not name and would report the flag as a misspelt
113
+ // subcommand on stderr with a non-zero exit.
114
+ if (command === '--version' || command === '-V') {
115
+ console.log(readCliVersion());
116
+ process.exit(0);
117
+ }
118
+ if (!Object.hasOwn(COMMANDS, command)) {
119
+ console.error(`Unknown command: ${command}`);
120
+ program.outputHelp();
121
+ process.exit(1);
122
+ }
123
+ await program.parseAsync(argv, { from: 'user' });
124
+ }
125
+ main(process.argv.slice(2)).catch(err => {
126
+ // Ctrl-C out of the wizard is a choice, not a failure: clack has already
127
+ // drawn its cancel line, so printing a stack trace over it would report the
128
+ // user's own decision back to them as an error.
129
+ if (err instanceof InitWizardCancelled) {
130
+ process.exit(130);
131
+ }
132
+ console.error(err instanceof Error ? err.message : String(err));
133
+ process.exit(1);
134
+ });
135
+ //# sourceMappingURL=cli.js.map
package/lib/cli.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,+BAA+B,EAAE,MAAM,4CAA4C,CAAC;AAC7F,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,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,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACjC,CAAC;IACD,0EAA0E;IAC1E,uEAAuE;IACvE,6CAA6C;IAC7C,IAAI,OAAO,KAAK,WAAW,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QAC/C,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC,CAAC;QAC9B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC;QACrC,OAAO,CAAC,KAAK,CAAC,oBAAoB,OAAO,EAAE,CAAC,CAAC;QAC7C,OAAO,CAAC,UAAU,EAAE,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC;IACD,MAAM,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;AACpD,CAAC;AAED,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;IACrC,yEAAyE;IACzE,4EAA4E;IAC5E,gDAAgD;IAChD,IAAI,GAAG,YAAY,mBAAmB,EAAE,CAAC;QACtC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,CAAC,KAAK,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAChE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,46 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 CrossBreeze, 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
+ import { type AnalyzeHeapDeps } from './analyze-heap.js';
10
+ import { type UsageError } from './harness-args.js';
11
+ /**
12
+ * Every flag `analyze-heap` accepts, derived from the three sets the parser
13
+ * scans so the list cannot claim a flag the parser would reject. `--help` is
14
+ * absent because it selects the help block rather than describing a run.
15
+ */
16
+ export declare const ANALYZE_HEAP_FLAGS: readonly string[];
17
+ /** The subset whose value is mandatory, so `--help` in a value position reads as data. */
18
+ export declare const ANALYZE_HEAP_VALUE_FLAGS: readonly string[];
19
+ /**
20
+ * The `--help` text, as data, held to {@link ANALYZE_HEAP_FLAGS} by a test.
21
+ *
22
+ * The analyzer is a standalone ESM asset spawned as a child, so this is the only
23
+ * copy: a second one beside its argv reads is what let its flags and its help
24
+ * drift apart with nothing able to see it.
25
+ */
26
+ export declare const ANALYZE_HEAP_HELP: readonly string[];
27
+ /** What {@link parseAnalyzeHeapArgs} recovered from an argv. */
28
+ export interface AnalyzeHeapArgs {
29
+ /** `true` when the argv selects the JSON-vs-JSON diff, which reads no snapshot. */
30
+ readonly diff: boolean;
31
+ /** The `.heapsnapshot` to read; absent only on the {@link diff} path. */
32
+ readonly snapshot?: string;
33
+ }
34
+ /**
35
+ * Validate the argv the analyzer will be handed.
36
+ *
37
+ * The values themselves stay the analyzer's to read — it is a standalone ESM
38
+ * asset spawned as a child, and duplicating its numeric coercions here would be
39
+ * a second place for them to drift. What this pass adds is the rejection every
40
+ * sibling subcommand performs: an unrecognised token left inert makes a typo'd
41
+ * `--treshold 0` apply the default silently, so the caller believes a threshold
42
+ * is in force.
43
+ */
44
+ export declare function parseAnalyzeHeapArgs(args: string[], onError?: UsageError): AnalyzeHeapArgs;
45
+ export declare function runAnalyzeHeapCommand(args: string[], deps?: AnalyzeHeapDeps): Promise<void>;
46
+ //# sourceMappingURL=analyze-heap-args.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyze-heap-args.d.ts","sourceRoot":"","sources":["../../src/commands/analyze-heap-args.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAA6B,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpF,OAAO,EAA2C,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAoB7F;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAA6D,CAAC;AAE9G,0FAA0F;AAC1F,eAAO,MAAM,wBAAwB,EAAE,SAAS,MAAM,EAAgB,CAAC;AAEvE;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,MAAM,EA8D9C,CAAC;AAEF,gEAAgE;AAChE,MAAM,WAAW,eAAe;IAC7B,mFAAmF;IACnF,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,yEAAyE;IACzE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,UAA0B,GAAG,eAAe,CAqCzG;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,GAAE,eAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAe/F"}
@@ -0,0 +1,174 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 CrossBreeze, 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
+ import { DIFF_FLAG, runAnalyzeHeap } from './analyze-heap.js';
10
+ import { exitWithUsage, helpRequested, printHelp } from './harness-args.js';
11
+ import { OUT_FILE_FLAG } from './headless-harness.js';
12
+ /**
13
+ * Flags whose value is mandatory. `--diff` is here for
14
+ * {@link helpRequested}'s benefit — it takes TWO values, which the parser below
15
+ * handles as its own case.
16
+ */
17
+ const VALUE_FLAGS = [DIFF_FLAG, OUT_FILE_FLAG, '--validate', '--json', '--threshold', '--classifier'];
18
+ /**
19
+ * Flags whose value may be omitted: each names a top-N the analyzer defaults
20
+ * when the token is bare, so a following token is a value only when it is not
21
+ * itself a flag.
22
+ */
23
+ const OPTIONAL_VALUE_FLAGS = ['--breakdown-depth', '--top-concepts', '--strings', '--cutpoints', '--docs', '--holders'];
24
+ /** Presence-only flags. */
25
+ const BOOL_FLAGS = ['--cutpoints-all', '--renderer'];
26
+ /**
27
+ * Every flag `analyze-heap` accepts, derived from the three sets the parser
28
+ * scans so the list cannot claim a flag the parser would reject. `--help` is
29
+ * absent because it selects the help block rather than describing a run.
30
+ */
31
+ export const ANALYZE_HEAP_FLAGS = [...VALUE_FLAGS, ...OPTIONAL_VALUE_FLAGS, ...BOOL_FLAGS];
32
+ /** The subset whose value is mandatory, so `--help` in a value position reads as data. */
33
+ export const ANALYZE_HEAP_VALUE_FLAGS = VALUE_FLAGS;
34
+ /**
35
+ * The `--help` text, as data, held to {@link ANALYZE_HEAP_FLAGS} by a test.
36
+ *
37
+ * The analyzer is a standalone ESM asset spawned as a child, so this is the only
38
+ * copy: a second one beside its argv reads is what let its flags and its help
39
+ * drift apart with nothing able to see it.
40
+ */
41
+ export const ANALYZE_HEAP_HELP = [
42
+ 'Usage: hydranium-cli analyze-heap <snapshot> [options]',
43
+ ' hydranium-cli analyze-heap --diff <baseline.json> <current.json> [--threshold <pct>]',
44
+ '',
45
+ 'Langium-aware V8 heap-snapshot analyzer (memlab-based). A default run (just',
46
+ '<snapshot>) prints a Markdown report to stdout: concept table, a hierarchical',
47
+ 'breakdown (each concept group drilled into its colon-delimited sub-levels, e.g.',
48
+ 'AST node -> $type, GModel -> kind -> subtype), the duplicate-string / cut-point /',
49
+ 'per-document drill-downs, and sample retainer paths. Loading is the only real',
50
+ 'cost, so the drill-downs run by default; tune or disable them with the flags',
51
+ 'below. The Markdown reads fine as text, saves as a .md file (--out-file), and',
52
+ 'is ideal input for the memory-analysis skill.',
53
+ '',
54
+ 'Reading a snapshot needs the optional @memlab/core + @memlab/heap-analysis peer',
55
+ 'dependencies (`npm install @memlab/core @memlab/heap-analysis`); --diff and',
56
+ '--help need neither.',
57
+ '',
58
+ 'Options:',
59
+ ' <snapshot> the .heapsnapshot to read; omit only with --diff (required).',
60
+ ' --out-file <file.md> also write the Markdown report to a file',
61
+ ' --breakdown-depth [N] max DISPLAY depth of the hierarchical breakdown',
62
+ ' (default: full depth). Aggregation is always',
63
+ ' depth-agnostic; a cap only hides deeper rows — their',
64
+ ' bytes still roll up into the deepest shown row.',
65
+ ' --top-concepts [N] how many of the biggest anchor concepts get a',
66
+ ' retainer-path sample and are the default --holders',
67
+ ' targets (default 6)',
68
+ ' --strings [N] duplicate plain strings, top N (default 20; 0 = off)',
69
+ ' --cutpoints [N] lightweight sole owners, top N (default 10; 0 = off)',
70
+ ' --cutpoints-all include Node/V8/server runtime owners (default: model only)',
71
+ ' --docs [N] heaviest documents, top N (default 15; 0 = off).',
72
+ ' Langium/server-only — skipped in --renderer mode (a',
73
+ ' renderer heap has no documents).',
74
+ ' --holders [a,b,c] who holds each concept: dominator + referrer tallies,',
75
+ ' comma-separated, one heap pass (e.g. CST,Range,Map);',
76
+ ' no value = the top model concepts',
77
+ " --validate <gt.json> validate the snapshot's $type classification against",
78
+ ' the live model (ground truth from the',
79
+ ' hydranium-cli ast-ground-truth subcommand); flags',
80
+ ' drift and computed/derived types',
81
+ ' --json <file> write the analysis as JSON (baseline artifact for --diff)',
82
+ ' --diff <base> <cur> diff two analysis JSONs; prints deltas + verdict,',
83
+ ' exits non-zero on regression (no snapshot needed)',
84
+ ' --threshold <pct> regression threshold for --diff, % growth of total',
85
+ ' shallow (default 5)',
86
+ ' --renderer analyze a BROWSER/renderer heap (the browser-heap',
87
+ ' artefact, from CDP) instead of a Langium server heap:',
88
+ ' buckets by DOM vocabulary (Detached DOM / DOM node /',
89
+ ' Event listener) and the retainer paths to each detached',
90
+ ' concept ARE the listener-retainer analysis. Skips the',
91
+ ' Langium/GLSP classifiers + --validate (no ground truth).',
92
+ ' --classifier <file> ESM module default-exporting a ConceptClassifier',
93
+ ' (classify(node) -> a colon-delimited label path, +',
94
+ ' optional anchorConcepts/grammarTypes/isAnchor) to label',
95
+ " a head's own concepts; repeatable. Tried BEFORE the",
96
+ ' built-in Langium + GLSP defaults (return undefined to',
97
+ ' defer), so a more specific classifier overrides a',
98
+ ' default. Order = precedence.',
99
+ ' -h, --help show this help',
100
+ '',
101
+ 'Notes: snapshot is the language-server process only (no other processes, native',
102
+ 'memory, or browser heap).'
103
+ ];
104
+ /**
105
+ * Validate the argv the analyzer will be handed.
106
+ *
107
+ * The values themselves stay the analyzer's to read — it is a standalone ESM
108
+ * asset spawned as a child, and duplicating its numeric coercions here would be
109
+ * a second place for them to drift. What this pass adds is the rejection every
110
+ * sibling subcommand performs: an unrecognised token left inert makes a typo'd
111
+ * `--treshold 0` apply the default silently, so the caller believes a threshold
112
+ * is in force.
113
+ */
114
+ export function parseAnalyzeHeapArgs(args, onError = exitWithUsage) {
115
+ const mandatoryValue = new Set(VALUE_FLAGS);
116
+ const optionalValue = new Set(OPTIONAL_VALUE_FLAGS);
117
+ const presenceOnly = new Set(BOOL_FLAGS);
118
+ let diff = false;
119
+ let snapshot;
120
+ for (let index = 0; index < args.length; index += 1) {
121
+ const flag = args[index];
122
+ if (flag === DIFF_FLAG) {
123
+ diff = true;
124
+ if (args[index + 1] === undefined || args[index + 2] === undefined) {
125
+ onError(`Missing value for ${DIFF_FLAG}`);
126
+ }
127
+ index += 2;
128
+ }
129
+ else if (mandatoryValue.has(flag)) {
130
+ if (args[index + 1] === undefined) {
131
+ onError(`Missing value for ${flag}`);
132
+ }
133
+ index += 1;
134
+ }
135
+ else if (optionalValue.has(flag)) {
136
+ if (args[index + 1] !== undefined && !args[index + 1].startsWith('-')) {
137
+ index += 1;
138
+ }
139
+ }
140
+ else if (presenceOnly.has(flag)) {
141
+ // Nothing to claim; the analyzer reads its presence.
142
+ }
143
+ else if (flag.startsWith('-')) {
144
+ onError(`Unknown option: ${flag} (hydranium-cli analyze-heap --help)`);
145
+ }
146
+ else if (snapshot === undefined) {
147
+ snapshot = flag;
148
+ }
149
+ else {
150
+ onError(`Unexpected argument: ${flag} (hydranium-cli analyze-heap --help)`);
151
+ }
152
+ }
153
+ if (!diff && snapshot === undefined) {
154
+ onError('Missing required option: <snapshot> (hydranium-cli analyze-heap --help)');
155
+ }
156
+ return { diff, snapshot };
157
+ }
158
+ export function runAnalyzeHeapCommand(args, deps = {}) {
159
+ if (args.length === 0) {
160
+ // Usage on stdout and a non-zero exit, matching the parent binary's bare
161
+ // invocation: a CI step that forgot its snapshot argument must fail rather
162
+ // than read a help page as a completed analysis.
163
+ printHelp(ANALYZE_HEAP_HELP);
164
+ process.exitCode = 1;
165
+ return Promise.resolve();
166
+ }
167
+ if (helpRequested(args, ANALYZE_HEAP_VALUE_FLAGS)) {
168
+ printHelp(ANALYZE_HEAP_HELP);
169
+ return Promise.resolve();
170
+ }
171
+ parseAnalyzeHeapArgs(args);
172
+ return runAnalyzeHeap(args, deps);
173
+ }
174
+ //# sourceMappingURL=analyze-heap-args.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyze-heap-args.js","sourceRoot":"","sources":["../../src/commands/analyze-heap-args.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,SAAS,EAAE,cAAc,EAAwB,MAAM,mBAAmB,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAmB,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;;;GAIG;AACH,MAAM,WAAW,GAAG,CAAC,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,CAAU,CAAC;AAE/G;;;;GAIG;AACH,MAAM,oBAAoB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,IAAI,EAAE,IAAI,CAAC,CAAC;AACrC,CAAC"}
@@ -0,0 +1,37 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 CrossBreeze, 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
+ * Selects the JSON-vs-JSON comparison, which reads two analysis artifacts and
11
+ * needs neither a snapshot nor memlab. Declared here rather than in the args
12
+ * module so the guard below and the flag list read the same constant.
13
+ */
14
+ export declare const DIFF_FLAG = "--diff";
15
+ /** Test-only injection seam for {@link runAnalyzeHeap}, mirroring the sibling harness commands. */
16
+ export interface AnalyzeHeapDeps {
17
+ /** Capture the node argv instead of spawning the real analyzer child. */
18
+ readonly __spawnForTest?: (execArgs: string[]) => Promise<number>;
19
+ /** Override the memlab-availability check. */
20
+ readonly __memlabInstalledForTest?: () => boolean;
21
+ }
22
+ /**
23
+ * Run the heap-snapshot analyzer. Memlab is an OPTIONAL PEER dependency and a
24
+ * heavy one — it drags in a browser download — so an install of this package
25
+ * pulls in nothing, and a caller that wants heap analysis opts in with the
26
+ * install line the guard below prints. This subcommand loads it only when
27
+ * invoked, by spawning the bundled analyzer in a child process with the large
28
+ * heap memlab needs. All arguments are forwarded verbatim — the analyzer owns
29
+ * how it reads them.
30
+ *
31
+ * The guard is skipped for {@link DIFF_FLAG}, which the analyzer short-circuits
32
+ * before any memlab import: refusing it would demand ~86 MB of dependency for a
33
+ * run that reads two JSON files. Help is intercepted earlier still, by the args
34
+ * module, so it never reaches this function.
35
+ */
36
+ export declare function runAnalyzeHeap(args: string[], deps?: AnalyzeHeapDeps): Promise<void>;
37
+ //# sourceMappingURL=analyze-heap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyze-heap.d.ts","sourceRoot":"","sources":["../../src/commands/analyze-heap.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAuBlF;;;;GAIG;AACH,eAAO,MAAM,SAAS,WAAW,CAAC;AAElC,mGAAmG;AACnG,MAAM,WAAW,eAAe;IAC7B,yEAAyE;IACzE,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAClE,8CAA8C;IAC9C,QAAQ,CAAC,wBAAwB,CAAC,EAAE,MAAM,OAAO,CAAC;CACpD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,GAAE,eAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgB9F"}
@@ -0,0 +1,63 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 CrossBreeze, 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
+ import { fileURLToPath } from 'node:url';
10
+ import { spawnNodeChild } from './headless-harness.js';
11
+ /**
12
+ * Absolute path to the bundled memlab-based analyzer (a standalone ESM script
13
+ * shipped under the package's `heap-analysis/` assets, not the compiled `lib/`).
14
+ * From `lib/commands/analyze-heap.js` that is `../../heap-analysis/analyze-heap.mjs`.
15
+ */
16
+ const ANALYZER = fileURLToPath(new URL('../../heap-analysis/analyze-heap.mjs', import.meta.url));
17
+ /** `true` when the optional `@memlab/heap-analysis` dependency is installed and resolvable. */
18
+ function memlabInstalled() {
19
+ const resolve = import.meta.resolve;
20
+ try {
21
+ resolve?.('@memlab/heap-analysis');
22
+ return resolve !== undefined;
23
+ }
24
+ catch {
25
+ return false;
26
+ }
27
+ }
28
+ /**
29
+ * Selects the JSON-vs-JSON comparison, which reads two analysis artifacts and
30
+ * needs neither a snapshot nor memlab. Declared here rather than in the args
31
+ * module so the guard below and the flag list read the same constant.
32
+ */
33
+ export const DIFF_FLAG = '--diff';
34
+ /**
35
+ * Run the heap-snapshot analyzer. Memlab is an OPTIONAL PEER dependency and a
36
+ * heavy one — it drags in a browser download — so an install of this package
37
+ * pulls in nothing, and a caller that wants heap analysis opts in with the
38
+ * install line the guard below prints. This subcommand loads it only when
39
+ * invoked, by spawning the bundled analyzer in a child process with the large
40
+ * heap memlab needs. All arguments are forwarded verbatim — the analyzer owns
41
+ * how it reads them.
42
+ *
43
+ * The guard is skipped for {@link DIFF_FLAG}, which the analyzer short-circuits
44
+ * before any memlab import: refusing it would demand ~86 MB of dependency for a
45
+ * run that reads two JSON files. Help is intercepted earlier still, by the args
46
+ * module, so it never reaches this function.
47
+ */
48
+ export async function runAnalyzeHeap(args, deps = {}) {
49
+ const isMemlabInstalled = deps.__memlabInstalledForTest ?? memlabInstalled;
50
+ if (!args.includes(DIFF_FLAG) && !isMemlabInstalled()) {
51
+ console.error('analyze-heap needs the optional @memlab/heap-analysis dependency (heavy: ~86 MB).\n' +
52
+ 'It is an optional peer dependency, so it is not installed by default; add it with:\n' +
53
+ ' npm install @memlab/core @memlab/heap-analysis');
54
+ process.exitCode = 1;
55
+ return;
56
+ }
57
+ const spawnChild = deps.__spawnForTest ?? spawnNodeChild;
58
+ const code = await spawnChild(['--max-old-space-size=8192', ANALYZER, ...args]);
59
+ if (code) {
60
+ process.exitCode = code;
61
+ }
62
+ }
63
+ //# sourceMappingURL=analyze-heap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyze-heap.js","sourceRoot":"","sources":["../../src/commands/analyze-heap.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,QAAQ,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,sCAAsC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAEjG,+FAA+F;AAC/F,SAAS,eAAe;IACrB,MAAM,OAAO,GAAI,MAAM,CAAC,IAAoD,CAAC,OAAO,CAAC;IACrF,IAAI,CAAC;QACF,OAAO,EAAE,CAAC,uBAAuB,CAAC,CAAC;QACnC,OAAO,OAAO,KAAK,SAAS,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACN,OAAO,KAAK,CAAC;IAChB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC;AAUlC;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,IAAc,EAAE,OAAwB,EAAE;IAC5E,MAAM,iBAAiB,GAAG,IAAI,CAAC,wBAAwB,IAAI,eAAe,CAAC;IAC3E,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE,CAAC;QACrD,OAAO,CAAC,KAAK,CACV,qFAAqF;YAClF,sFAAsF;YACtF,kDAAkD,CACvD,CAAC;QACF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACrB,OAAO;IACV,CAAC;IACD,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,IAAI,cAAc,CAAC;IACzD,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,CAAC,2BAA2B,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;IAChF,IAAI,IAAI,EAAE,CAAC;QACR,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAC3B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,23 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 CrossBreeze, 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
+ import { type AstGroundTruthCommandOptions } from './ast-ground-truth.js';
10
+ import { type UsageError } from './harness-args.js';
11
+ /**
12
+ * Every flag `ast-ground-truth` accepts, derived from the sets the parser is
13
+ * handed so the list cannot claim a flag the parser would reject. `--services`
14
+ * is consumed by the shared harness parser itself, so it is in neither set.
15
+ */
16
+ export declare const AST_GROUND_TRUTH_FLAGS: readonly string[];
17
+ /** The subset that takes a value, so `--help` in a value position reads as data. */
18
+ export declare const AST_GROUND_TRUTH_VALUE_FLAGS: readonly string[];
19
+ /** The `--help` text, as data, held to {@link AST_GROUND_TRUTH_FLAGS} by a test. */
20
+ export declare const AST_GROUND_TRUTH_HELP: readonly string[];
21
+ export declare function parseAstGroundTruthArgs(args: string[], onError?: UsageError): AstGroundTruthCommandOptions;
22
+ export declare function runAstGroundTruthCommand(args: string[]): Promise<void>;
23
+ //# sourceMappingURL=ast-ground-truth-args.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ast-ground-truth-args.d.ts","sourceRoot":"","sources":["../../src/commands/ast-ground-truth-args.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAqB,KAAK,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAC7F,OAAO,EASJ,KAAK,UAAU,EACjB,MAAM,mBAAmB,CAAC;AAK3B;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,SAAS,MAAM,EAAoC,CAAC;AAEzF,oFAAoF;AACpF,eAAO,MAAM,4BAA4B,EAAE,SAAS,MAAM,EAA2B,CAAC;AAEtF,oFAAoF;AACpF,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,EAalD,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,UAA0B,GAAG,4BAA4B,CAGzH;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAMtE"}
@@ -0,0 +1,47 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 CrossBreeze, 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
+ import { runAstGroundTruth } from './ast-ground-truth.js';
10
+ import { exitWithUsage, helpRequested, LOG_LEVEL_FLAG, logLevelHelpLine, logLevelOption, parseHarnessArgs, printHelp, SERVICES_FLAG } from './harness-args.js';
11
+ import { OUT_FILE_FLAG } from './headless-harness.js';
12
+ const VALUE_FLAGS = [OUT_FILE_FLAG, LOG_LEVEL_FLAG];
13
+ /**
14
+ * Every flag `ast-ground-truth` accepts, derived from the sets the parser is
15
+ * handed so the list cannot claim a flag the parser would reject. `--services`
16
+ * is consumed by the shared harness parser itself, so it is in neither set.
17
+ */
18
+ export const AST_GROUND_TRUTH_FLAGS = [SERVICES_FLAG, ...VALUE_FLAGS];
19
+ /** The subset that takes a value, so `--help` in a value position reads as data. */
20
+ export const AST_GROUND_TRUTH_VALUE_FLAGS = AST_GROUND_TRUTH_FLAGS;
21
+ /** The `--help` text, as data, held to {@link AST_GROUND_TRUTH_FLAGS} by a test. */
22
+ export const AST_GROUND_TRUTH_HELP = [
23
+ 'Usage: hydranium-cli ast-ground-truth --services <module> <workspace> [--out-file <file>] [--log-level <lvl>]',
24
+ '',
25
+ "Tally a workspace's live-model AST nodes by `$type` — the ground truth that",
26
+ '`analyze-heap --validate <gt.json>` checks a heap snapshot against. `<module>`',
27
+ 'exports a zero-arg `createServices(): { shared }` thunk. Emits the',
28
+ '`{ documents, totalAstNodes, byType }` JSON on stdout (or `--out-file`).',
29
+ '',
30
+ 'Options:',
31
+ ' --services <module> ESM module exporting `createServices(): { shared }` (required).',
32
+ ' <workspace> Workspace root (path or file URI) to build (required).',
33
+ ' --out-file <file> Write the JSON to this file instead of stdout.',
34
+ logLevelHelpLine(22)
35
+ ];
36
+ export function parseAstGroundTruthArgs(args, onError = exitWithUsage) {
37
+ const { servicesModule, workspace, options } = parseHarnessArgs(args, 'ast-ground-truth', VALUE_FLAGS, [], { onError });
38
+ return { servicesModule, workspace, outFile: options[OUT_FILE_FLAG], logLevel: logLevelOption(options[LOG_LEVEL_FLAG]) };
39
+ }
40
+ export function runAstGroundTruthCommand(args) {
41
+ if (helpRequested(args, AST_GROUND_TRUTH_VALUE_FLAGS)) {
42
+ printHelp(AST_GROUND_TRUTH_HELP);
43
+ return Promise.resolve();
44
+ }
45
+ return runAstGroundTruth(parseAstGroundTruthArgs(args));
46
+ }
47
+ //# sourceMappingURL=ast-ground-truth-args.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ast-ground-truth-args.js","sourceRoot":"","sources":["../../src/commands/ast-ground-truth-args.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,iBAAiB,EAAqC,MAAM,uBAAuB,CAAC;AAC7F,OAAO,EACJ,aAAa,EACb,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,aAAa,EAEf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,MAAM,WAAW,GAAG,CAAC,aAAa,EAAE,cAAc,CAAU,CAAC;AAE7D;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAsB,CAAC,aAAa,EAAE,GAAG,WAAW,CAAC,CAAC;AAEzF,oFAAoF;AACpF,MAAM,CAAC,MAAM,4BAA4B,GAAsB,sBAAsB,CAAC;AAEtF,oFAAoF;AACpF,MAAM,CAAC,MAAM,qBAAqB,GAAsB;IACrD,+GAA+G;IAC/G,EAAE;IACF,6EAA6E;IAC7E,gFAAgF;IAChF,oEAAoE;IACpE,0EAA0E;IAC1E,EAAE;IACF,UAAU;IACV,yFAAyF;IACzF,gFAAgF;IAChF,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,UAAU,uBAAuB,CAAC,IAAc,EAAE,UAAsB,aAAa;IACxF,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,gBAAgB,CAAC,IAAI,EAAE,kBAAkB,EAAE,WAAW,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IACxH,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,cAAc,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC;AAC5H,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,IAAc;IACpD,IAAI,aAAa,CAAC,IAAI,EAAE,4BAA4B,CAAC,EAAE,CAAC;QACrD,SAAS,CAAC,qBAAqB,CAAC,CAAC;QACjC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC5B,CAAC;IACD,OAAO,iBAAiB,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC;AAC3D,CAAC"}
@@ -0,0 +1,10 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 CrossBreeze, 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
+ export {};
10
+ //# sourceMappingURL=ast-ground-truth-driver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ast-ground-truth-driver.d.ts","sourceRoot":"","sources":["../../src/commands/ast-ground-truth-driver.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF"}