@hydranium/cli 1.0.0-next.27 → 1.0.0-next.270

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 (196) hide show
  1. package/README.md +73 -204
  2. package/bin/hydranium-cli.js +13 -0
  3. package/lib/cli-version.js.map +1 -1
  4. package/lib/cli.js +2 -1
  5. package/lib/cli.js.map +1 -1
  6. package/lib/commands/analyze-heap-args.js.map +1 -1
  7. package/lib/commands/analyze-heap.d.ts +3 -0
  8. package/lib/commands/analyze-heap.d.ts.map +1 -1
  9. package/lib/commands/analyze-heap.js +2 -1
  10. package/lib/commands/analyze-heap.js.map +1 -1
  11. package/lib/commands/ast-ground-truth-args.d.ts +3 -2
  12. package/lib/commands/ast-ground-truth-args.d.ts.map +1 -1
  13. package/lib/commands/ast-ground-truth-args.js +11 -9
  14. package/lib/commands/ast-ground-truth-args.js.map +1 -1
  15. package/lib/commands/ast-ground-truth-driver.js +2 -1
  16. package/lib/commands/ast-ground-truth-driver.js.map +1 -1
  17. package/lib/commands/ast-ground-truth.js +1 -1
  18. package/lib/commands/ast-ground-truth.js.map +1 -1
  19. package/lib/commands/generate-ast-builder.d.ts +49 -0
  20. package/lib/commands/generate-ast-builder.d.ts.map +1 -0
  21. package/lib/commands/generate-ast-builder.js +200 -0
  22. package/lib/commands/generate-ast-builder.js.map +1 -0
  23. package/lib/commands/generate-transfer-model-args.d.ts.map +1 -1
  24. package/lib/commands/generate-transfer-model-args.js +11 -1
  25. package/lib/commands/generate-transfer-model-args.js.map +1 -1
  26. package/lib/commands/generate-transfer-model-config.d.ts.map +1 -1
  27. package/lib/commands/generate-transfer-model-config.js +6 -3
  28. package/lib/commands/generate-transfer-model-config.js.map +1 -1
  29. package/lib/commands/generate-transfer-model.d.ts +9 -0
  30. package/lib/commands/generate-transfer-model.d.ts.map +1 -1
  31. package/lib/commands/generate-transfer-model.js +18 -4
  32. package/lib/commands/generate-transfer-model.js.map +1 -1
  33. package/lib/commands/harness-args.d.ts +37 -42
  34. package/lib/commands/harness-args.d.ts.map +1 -1
  35. package/lib/commands/harness-args.js +91 -27
  36. package/lib/commands/harness-args.js.map +1 -1
  37. package/lib/commands/headless-harness.d.ts +37 -20
  38. package/lib/commands/headless-harness.d.ts.map +1 -1
  39. package/lib/commands/headless-harness.js +68 -17
  40. package/lib/commands/headless-harness.js.map +1 -1
  41. package/lib/commands/init-args.js +6 -6
  42. package/lib/commands/init-args.js.map +1 -1
  43. package/lib/commands/init-prompt.d.ts.map +1 -1
  44. package/lib/commands/init-templates.d.ts +8 -10
  45. package/lib/commands/init-templates.d.ts.map +1 -1
  46. package/lib/commands/init-templates.js +260 -152
  47. package/lib/commands/init-templates.js.map +1 -1
  48. package/lib/commands/init-wizard.js +4 -4
  49. package/lib/commands/init-wizard.js.map +1 -1
  50. package/lib/commands/init-workspace.d.ts +13 -3
  51. package/lib/commands/init-workspace.d.ts.map +1 -1
  52. package/lib/commands/init-workspace.js +21 -6
  53. package/lib/commands/init-workspace.js.map +1 -1
  54. package/lib/commands/init.d.ts +16 -10
  55. package/lib/commands/init.d.ts.map +1 -1
  56. package/lib/commands/init.js +17 -15
  57. package/lib/commands/init.js.map +1 -1
  58. package/lib/commands/lint-grammar-args.d.ts +3 -2
  59. package/lib/commands/lint-grammar-args.d.ts.map +1 -1
  60. package/lib/commands/lint-grammar-args.js +13 -10
  61. package/lib/commands/lint-grammar-args.js.map +1 -1
  62. package/lib/commands/lint-grammar-driver.js +2 -1
  63. package/lib/commands/lint-grammar-driver.js.map +1 -1
  64. package/lib/commands/lint-grammar-report.js.map +1 -1
  65. package/lib/commands/lint-grammar.js +1 -1
  66. package/lib/commands/lint-grammar.js.map +1 -1
  67. package/lib/commands/measure-memory-args.d.ts +3 -2
  68. package/lib/commands/measure-memory-args.d.ts.map +1 -1
  69. package/lib/commands/measure-memory-args.js +22 -11
  70. package/lib/commands/measure-memory-args.js.map +1 -1
  71. package/lib/commands/measure-memory-driver.js +5 -3
  72. package/lib/commands/measure-memory-driver.js.map +1 -1
  73. package/lib/commands/measure-memory.js +1 -1
  74. package/lib/commands/measure-memory.js.map +1 -1
  75. package/lib/commands/model-docs-args.d.ts +4 -3
  76. package/lib/commands/model-docs-args.d.ts.map +1 -1
  77. package/lib/commands/model-docs-args.js +12 -10
  78. package/lib/commands/model-docs-args.js.map +1 -1
  79. package/lib/commands/model-docs-driver.js +2 -1
  80. package/lib/commands/model-docs-driver.js.map +1 -1
  81. package/lib/commands/model-docs.js +1 -1
  82. package/lib/commands/model-docs.js.map +1 -1
  83. package/lib/commands/projects-args.d.ts.map +1 -1
  84. package/lib/commands/projects-args.js +5 -5
  85. package/lib/commands/projects-args.js.map +1 -1
  86. package/lib/commands/projects.d.ts +3 -4
  87. package/lib/commands/projects.d.ts.map +1 -1
  88. package/lib/commands/projects.js +2 -2
  89. package/lib/commands/projects.js.map +1 -1
  90. package/lib/commands/query-args.d.ts.map +1 -1
  91. package/lib/commands/query-args.js +5 -5
  92. package/lib/commands/query-args.js.map +1 -1
  93. package/lib/commands/query.d.ts +3 -4
  94. package/lib/commands/query.d.ts.map +1 -1
  95. package/lib/commands/query.js +2 -2
  96. package/lib/commands/query.js.map +1 -1
  97. package/lib/commands/reflect-args.d.ts +3 -2
  98. package/lib/commands/reflect-args.d.ts.map +1 -1
  99. package/lib/commands/reflect-args.js +13 -10
  100. package/lib/commands/reflect-args.js.map +1 -1
  101. package/lib/commands/reflect-driver.js +2 -1
  102. package/lib/commands/reflect-driver.js.map +1 -1
  103. package/lib/commands/reflect-report.js.map +1 -1
  104. package/lib/commands/reflect.js +1 -1
  105. package/lib/commands/reflect.js.map +1 -1
  106. package/lib/commands/save-args.d.ts.map +1 -1
  107. package/lib/commands/save-args.js +6 -4
  108. package/lib/commands/save-args.js.map +1 -1
  109. package/lib/commands/save.d.ts +8 -4
  110. package/lib/commands/save.d.ts.map +1 -1
  111. package/lib/commands/save.js +31 -6
  112. package/lib/commands/save.js.map +1 -1
  113. package/lib/commands/validate-args.d.ts +3 -2
  114. package/lib/commands/validate-args.d.ts.map +1 -1
  115. package/lib/commands/validate-args.js +13 -10
  116. package/lib/commands/validate-args.js.map +1 -1
  117. package/lib/commands/validate-driver.js +2 -1
  118. package/lib/commands/validate-driver.js.map +1 -1
  119. package/lib/commands/validate-report.js.map +1 -1
  120. package/lib/commands/validate.js +1 -1
  121. package/lib/commands/validate.js.map +1 -1
  122. package/lib/commands/watch-args.d.ts.map +1 -1
  123. package/lib/commands/watch-args.js +6 -4
  124. package/lib/commands/watch-args.js.map +1 -1
  125. package/lib/commands/watch.d.ts +3 -4
  126. package/lib/commands/watch.d.ts.map +1 -1
  127. package/lib/commands/watch.js +20 -2
  128. package/lib/commands/watch.js.map +1 -1
  129. package/lib/driver-heap.d.ts +52 -0
  130. package/lib/driver-heap.d.ts.map +1 -0
  131. package/lib/driver-heap.js +51 -0
  132. package/lib/driver-heap.js.map +1 -0
  133. package/lib/index.d.ts +1 -0
  134. package/lib/index.d.ts.map +1 -1
  135. package/lib/index.js +1 -0
  136. package/lib/index.js.map +1 -1
  137. package/lib/log-level.d.ts +21 -11
  138. package/lib/log-level.d.ts.map +1 -1
  139. package/lib/log-level.js +25 -14
  140. package/lib/log-level.js.map +1 -1
  141. package/lib/spawn-data-server.d.ts +6 -1
  142. package/lib/spawn-data-server.d.ts.map +1 -1
  143. package/lib/spawn-data-server.js +2 -1
  144. package/lib/spawn-data-server.js.map +1 -1
  145. package/lib/stderr-connection-logger.d.ts +12 -0
  146. package/lib/stderr-connection-logger.d.ts.map +1 -0
  147. package/lib/stderr-connection-logger.js +16 -0
  148. package/lib/stderr-connection-logger.js.map +1 -0
  149. package/lib/testing/echo-server.js +9 -1
  150. package/lib/testing/echo-server.js.map +1 -1
  151. package/package.json +50 -39
  152. package/src/cli.ts +2 -1
  153. package/src/commands/analyze-heap.ts +4 -1
  154. package/src/commands/ast-ground-truth-args.ts +15 -12
  155. package/src/commands/ast-ground-truth-driver.ts +2 -1
  156. package/src/commands/ast-ground-truth.ts +1 -1
  157. package/src/commands/generate-ast-builder.ts +246 -0
  158. package/src/commands/generate-transfer-model-args.ts +11 -1
  159. package/src/commands/generate-transfer-model-config.ts +6 -3
  160. package/src/commands/generate-transfer-model.ts +27 -4
  161. package/src/commands/harness-args.ts +76 -31
  162. package/src/commands/headless-harness.ts +86 -26
  163. package/src/commands/init-args.ts +6 -6
  164. package/src/commands/init-templates.ts +270 -154
  165. package/src/commands/init-wizard.ts +4 -4
  166. package/src/commands/init-workspace.ts +31 -7
  167. package/src/commands/init.ts +36 -26
  168. package/src/commands/lint-grammar-args.ts +17 -13
  169. package/src/commands/lint-grammar-driver.ts +2 -1
  170. package/src/commands/lint-grammar.ts +1 -1
  171. package/src/commands/measure-memory-args.ts +27 -14
  172. package/src/commands/measure-memory-driver.ts +5 -3
  173. package/src/commands/measure-memory.ts +1 -1
  174. package/src/commands/model-docs-args.ts +16 -13
  175. package/src/commands/model-docs-driver.ts +2 -1
  176. package/src/commands/model-docs.ts +1 -1
  177. package/src/commands/projects-args.ts +5 -4
  178. package/src/commands/projects.ts +4 -6
  179. package/src/commands/query-args.ts +5 -4
  180. package/src/commands/query.ts +4 -6
  181. package/src/commands/reflect-args.ts +17 -13
  182. package/src/commands/reflect-driver.ts +2 -1
  183. package/src/commands/reflect.ts +1 -1
  184. package/src/commands/save-args.ts +6 -3
  185. package/src/commands/save.ts +47 -10
  186. package/src/commands/validate-args.ts +17 -13
  187. package/src/commands/validate-driver.ts +2 -1
  188. package/src/commands/validate.ts +1 -1
  189. package/src/commands/watch-args.ts +6 -3
  190. package/src/commands/watch.ts +28 -7
  191. package/src/driver-heap.ts +65 -0
  192. package/src/index.ts +1 -0
  193. package/src/log-level.ts +42 -14
  194. package/src/spawn-data-server.ts +14 -2
  195. package/src/stderr-connection-logger.ts +18 -0
  196. package/src/testing/echo-server.ts +11 -2
@@ -6,30 +6,7 @@
6
6
  *
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
- /**
10
- * The argv machinery the subcommands share, and the error vocabulary they all
11
- * speak.
12
- *
13
- * Its own module rather than functions in the CLI entry point, because the entry
14
- * point runs `main()` on import: a test that wants to read an argv the way a
15
- * command does would otherwise have to spawn the whole binary, so flag handling
16
- * and exit codes could only be covered through a subprocess.
17
- *
18
- * The messages here are a contract — scripts and CI steps match on them — so
19
- * changing one is a breaking change for a caller nobody in this repo can see.
20
- *
21
- * Every parser takes an `onError` defaulting to report-and-exit, which is what a
22
- * command line wants; a caller that would rather handle the problem passes its
23
- * own and the parser hands control to it instead of ending the process.
24
- *
25
- * Each subcommand lives in a sibling `<name>-args` module exporting three things
26
- * a test can hold against each other: its flag list, its `--help` text as data,
27
- * and the parser that turns an argv into the runner's options. Help that drifts
28
- * from the parser is worse than none — it reads as authoritative, so a flag
29
- * missing from it is a capability nobody finds, and one it describes but the
30
- * parser rejects is an invocation that fails for no visible reason.
31
- */
32
- import type { LogThreshold } from '@hydranium/protocol';
9
+ import { type LogOptions } from '../log-level.js';
33
10
  /**
34
11
  * How a parser reports a usage problem. It never returns, so a parser can treat
35
12
  * the call as a dead end and keep narrowing the value it was about to reject.
@@ -44,8 +21,15 @@ export type UsageError = (message: string) => never;
44
21
  * bundled heap analyzer exits with for a usage error.
45
22
  */
46
23
  export declare function exitWithUsage(message: string): never;
47
- /** The value flag {@link parseHarnessArgs} consumes itself, before any the subcommand declares. */
24
+ /** Names the head's services module; every harness subcommand requires it. */
48
25
  export declare const SERVICES_FLAG = "--services";
26
+ /**
27
+ * Registers a loader in the driver child that imports the head. The child is a
28
+ * fresh `node`, so a loader registered on the CLI's own process never reaches it.
29
+ */
30
+ export declare const IMPORT_FLAG = "--import";
31
+ /** The value flags {@link parseHarnessArgs} consumes itself, before any the subcommand declares. */
32
+ export declare const HARNESS_VALUE_FLAGS: readonly ["--services", "--import"];
49
33
  /**
50
34
  * The one spelling of the log threshold, shared by both subcommand families.
51
35
  *
@@ -55,27 +39,37 @@ export declare const SERVICES_FLAG = "--services";
55
39
  * on which command a caller happened to reach for.
56
40
  */
57
41
  export declare const LOG_LEVEL_FLAG = "--log-level";
42
+ export declare const LOG_FILE_FLAG = "--log-file";
43
+ export declare const LOG_FILE_LEVEL_FLAG = "--log-file-level";
44
+ /** The log flags every subcommand takes, read by {@link logOptions}. */
45
+ export declare const LOG_VALUE_FLAGS: readonly ["--log-level", "--log-file", "--log-file-level"];
58
46
  /** The value flags {@link parseServerSpawnOptions} consumes itself. */
59
47
  export declare const SERVER_SPAWN_VALUE_FLAGS: readonly string[];
60
48
  /**
61
- * The `--help` line every subcommand describes {@link LOG_LEVEL_FLAG} with.
49
+ * The `--help` lines every subcommand describes {@link LOG_VALUE_FLAGS} with.
62
50
  *
63
51
  * Shared text, per-command padding: `command-args.test.ts` compares the flags a
64
52
  * help block DESCRIBES against the flags the parser accepts, and it recognises a
65
- * description by the two-space indent — so the line has to be a real option entry
53
+ * description by the two-space indent — so each line has to be a real option entry
66
54
  * in each block, and the column each block aligns its descriptions at is the
67
- * block's own.
55
+ * block's own. A flag too wide for that column takes its description on the
56
+ * next line, at the column.
68
57
  */
69
- export declare function logLevelHelpLine(padTo: number): string;
58
+ export declare function logHelpLines(padTo: number, head?: string): string[];
59
+ /** The `--help` lines every `--services` subcommand describes {@link IMPORT_FLAG} with, aligned as {@link logHelpLines}. */
60
+ export declare function importHelpLines(padTo: number): string[];
70
61
  /**
71
- * Narrow a raw {@link LOG_LEVEL_FLAG} value that {@link parseHarnessArgs}
72
- * collected, leaving an absent flag absent.
62
+ * Narrow the raw {@link LOG_VALUE_FLAGS} values a parser collected, leaving
63
+ * absent flags absent.
64
+ *
65
+ * `--log-file` resolves against the caller's directory: the child may run
66
+ * elsewhere (`--cwd`), and a relative path would land the log there.
73
67
  *
74
68
  * Throws rather than reaching `onError`, matching {@link parseServerSpawnOptions}:
75
69
  * the level vocabulary belongs to the protocol package, which reports it, and the
76
70
  * entry point's catch turns that into the same message-and-exit.
77
71
  */
78
- export declare function logLevelOption(value: string | undefined): LogThreshold | undefined;
72
+ export declare function logOptions(options: Readonly<Record<string, string | undefined>>): LogOptions;
79
73
  /**
80
74
  * Whether the argv asks for the command's help rather than describing a run.
81
75
  *
@@ -95,6 +89,8 @@ export declare function printHelp(lines: readonly string[]): void;
95
89
  /** What {@link parseHarnessArgs} recovered from an argv. */
96
90
  export interface ParsedHarnessArgs {
97
91
  servicesModule: string;
92
+ /** The {@link IMPORT_FLAG} values in the order given, absent when there were none. */
93
+ imports?: string[];
98
94
  /**
99
95
  * An absolute directory path, resolved by {@link resolveWorkspaceArgument} and
100
96
  * checked to exist. `''` when the subcommand declared `requireWorkspace: false`.
@@ -122,12 +118,12 @@ export interface HarnessArgsConfig {
122
118
  }
123
119
  /**
124
120
  * Shared parser for the headless-harness subcommands. Consumes the required
125
- * `--services <module>` value flag and a single positional `<workspace>`, plus
126
- * the `valueFlags` (each takes a value) and `boolFlags` (presence-only, recorded
127
- * as `'true'`) the subcommand recognises. Unknown flags or a missing
128
- * `--services`/`<workspace>` are usage errors, and so is a `<workspace>` that
129
- * reaches no directory — see {@link resolveWorkspaceArgument} for why that cannot
130
- * be left to the run.
121
+ * `--services <module>` value flag, the repeatable `--import <specifier>` and a
122
+ * single positional `<workspace>`, plus the `valueFlags` (each takes a value)
123
+ * and `boolFlags` (presence-only, recorded as `'true'`) the subcommand
124
+ * recognises. Unknown flags or a missing `--services`/`<workspace>` are usage
125
+ * errors, and so is a `<workspace>` that reaches no directory — see
126
+ * {@link resolveWorkspaceArgument} for why that cannot be left to the run.
131
127
  */
132
128
  export declare function parseHarnessArgs(args: string[], commandName: string, valueFlags: readonly string[], boolFlags: readonly string[], config?: HarnessArgsConfig): ParsedHarnessArgs;
133
129
  /**
@@ -167,20 +163,19 @@ export declare function numericOption(value: string | undefined, flag: string, o
167
163
  */
168
164
  export declare function parseFlagOptions(extra: string[], commandName: string, recognised: readonly string[], onError?: UsageError): Record<string, string | undefined>;
169
165
  /** What {@link parseServerSpawnOptions} recovered from an argv. */
170
- export interface SpawnOptions {
166
+ export interface SpawnOptions extends LogOptions {
171
167
  serverCommand: string;
172
168
  serverArgs: string[];
173
169
  cwd?: string;
174
- logLevel?: LogThreshold;
175
170
  /** The tokens this parser did not claim, for the subcommand's own options. */
176
171
  extra: string[];
177
172
  }
178
173
  /**
179
174
  * Shared option parser for subcommands that spawn a data-server child. Consumes
180
- * `--server` / `--cwd` / `--log-level` and returns the surviving tokens as
175
+ * `--server` / `--cwd` / the {@link LOG_VALUE_FLAGS} and returns the surviving tokens as
181
176
  * `extra` for {@link parseFlagOptions} to finish.
182
177
  *
183
- * An unrecognised `--log-level` value throws rather than reaching `onError`: the
178
+ * An unrecognised log level value throws rather than reaching `onError`: the
184
179
  * level vocabulary belongs to the protocol package, which reports it, and the
185
180
  * entry point's catch turns that into the same message-and-exit.
186
181
  *
@@ -1 +1 @@
1
- {"version":3,"file":"harness-args.d.ts","sourceRoot":"","sources":["../../src/commands/harness-args.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAMxD;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,KAAK,CAAC;AAEpD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAGpD;AAED,mGAAmG;AACnG,eAAO,MAAM,aAAa,eAAe,CAAC;AAE1C;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,gBAAgB,CAAC;AAE5C,uEAAuE;AACvE,eAAO,MAAM,wBAAwB,EAAE,SAAS,MAAM,EAA0C,CAAC;AAEjG;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG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,EAAE,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,8EAA8E;IAC9E,KAAK,EAAE,MAAM,EAAE,CAAC;CAClB;AAkBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,GAAE,UAA0B,GAAG,YAAY,CA8C9H"}
@@ -6,6 +6,30 @@
6
6
  *
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
+ /**
10
+ * The argv machinery the subcommands share, and the error vocabulary they all
11
+ * speak.
12
+ *
13
+ * Its own module rather than functions in the CLI entry point, because the entry
14
+ * point runs `main()` on import: a test that wants to read an argv the way a
15
+ * command does would otherwise have to spawn the whole binary, so flag handling
16
+ * and exit codes could only be covered through a subprocess.
17
+ *
18
+ * The messages here are a contract — scripts and CI steps match on them — so
19
+ * changing one is a breaking change for a caller nobody in this repo can see.
20
+ *
21
+ * Every parser takes an `onError` defaulting to report-and-exit, which is what a
22
+ * command line wants; a caller that would rather handle the problem passes its
23
+ * own and the parser hands control to it instead of ending the process.
24
+ *
25
+ * Each subcommand lives in a sibling `<name>-args` module exporting three things
26
+ * a test can hold against each other: its flag list, its `--help` text as data,
27
+ * and the parser that turns an argv into the runner's options. Help that drifts
28
+ * from the parser is worse than none — it reads as authoritative, so a flag
29
+ * missing from it is a capability nobody finds, and one it describes but the
30
+ * parser rejects is an invocation that fails for no visible reason.
31
+ */
32
+ import { describeError } from '@hydranium/protocol';
9
33
  import { statSync } from 'node:fs';
10
34
  import * as path from 'node:path';
11
35
  import { fileURLToPath } from 'node:url';
@@ -22,8 +46,15 @@ export function exitWithUsage(message) {
22
46
  console.error(message);
23
47
  process.exit(2);
24
48
  }
25
- /** The value flag {@link parseHarnessArgs} consumes itself, before any the subcommand declares. */
49
+ /** Names the head's services module; every harness subcommand requires it. */
26
50
  export const SERVICES_FLAG = '--services';
51
+ /**
52
+ * Registers a loader in the driver child that imports the head. The child is a
53
+ * fresh `node`, so a loader registered on the CLI's own process never reaches it.
54
+ */
55
+ export const IMPORT_FLAG = '--import';
56
+ /** The value flags {@link parseHarnessArgs} consumes itself, before any the subcommand declares. */
57
+ export const HARNESS_VALUE_FLAGS = [SERVICES_FLAG, IMPORT_FLAG];
27
58
  /**
28
59
  * The one spelling of the log threshold, shared by both subcommand families.
29
60
  *
@@ -33,30 +64,58 @@ export const SERVICES_FLAG = '--services';
33
64
  * on which command a caller happened to reach for.
34
65
  */
35
66
  export const LOG_LEVEL_FLAG = '--log-level';
67
+ export const LOG_FILE_FLAG = '--log-file';
68
+ export const LOG_FILE_LEVEL_FLAG = '--log-file-level';
69
+ /** The log flags every subcommand takes, read by {@link logOptions}. */
70
+ export const LOG_VALUE_FLAGS = [LOG_LEVEL_FLAG, LOG_FILE_FLAG, LOG_FILE_LEVEL_FLAG];
36
71
  /** The value flags {@link parseServerSpawnOptions} consumes itself. */
37
- export const SERVER_SPAWN_VALUE_FLAGS = ['--server', '--cwd', LOG_LEVEL_FLAG];
72
+ export const SERVER_SPAWN_VALUE_FLAGS = ['--server', '--cwd', ...LOG_VALUE_FLAGS];
38
73
  /**
39
- * The `--help` line every subcommand describes {@link LOG_LEVEL_FLAG} with.
74
+ * The `--help` lines every subcommand describes {@link LOG_VALUE_FLAGS} with.
40
75
  *
41
76
  * Shared text, per-command padding: `command-args.test.ts` compares the flags a
42
77
  * help block DESCRIBES against the flags the parser accepts, and it recognises a
43
- * description by the two-space indent — so the line has to be a real option entry
78
+ * description by the two-space indent — so each line has to be a real option entry
44
79
  * in each block, and the column each block aligns its descriptions at is the
45
- * block's own.
80
+ * block's own. A flag too wide for that column takes its description on the
81
+ * next line, at the column.
46
82
  */
47
- export function logLevelHelpLine(padTo) {
48
- return ` ${`${LOG_LEVEL_FLAG} <lvl>`.padEnd(padTo)}Log threshold for the head this boots (off|error|warn|info|debug|trace).`;
83
+ export function logHelpLines(padTo, head = 'the head this boots') {
84
+ return [
85
+ helpLine(`${LOG_LEVEL_FLAG} <lvl>`, `Log threshold for ${head} (off|error|warn|info|debug|trace).`, padTo),
86
+ helpLine(`${LOG_FILE_FLAG} <file>`, `Also write ${head}'s log to <file>; {workspace} expands to the workspace.`, padTo),
87
+ helpLine(`${LOG_FILE_LEVEL_FLAG} <lvl>`, `Threshold for that file, which the log-level setting does not change.`, padTo)
88
+ ].flat();
89
+ }
90
+ /** The `--help` lines every `--services` subcommand describes {@link IMPORT_FLAG} with, aligned as {@link logHelpLines}. */
91
+ export function importHelpLines(padTo) {
92
+ return helpLine(`${IMPORT_FLAG} <specifier>`, 'Loader to register before importing <module>, e.g. tsx (repeatable).', padTo);
93
+ }
94
+ function helpLine(flag, text, padTo) {
95
+ return flag.length < padTo - 1 ? [` ${flag.padEnd(padTo)}${text}`] : [` ${flag}`, `${' '.repeat(padTo + 2)}${text}`];
49
96
  }
50
97
  /**
51
- * Narrow a raw {@link LOG_LEVEL_FLAG} value that {@link parseHarnessArgs}
52
- * collected, leaving an absent flag absent.
98
+ * Narrow the raw {@link LOG_VALUE_FLAGS} values a parser collected, leaving
99
+ * absent flags absent.
100
+ *
101
+ * `--log-file` resolves against the caller's directory: the child may run
102
+ * elsewhere (`--cwd`), and a relative path would land the log there.
53
103
  *
54
104
  * Throws rather than reaching `onError`, matching {@link parseServerSpawnOptions}:
55
105
  * the level vocabulary belongs to the protocol package, which reports it, and the
56
106
  * entry point's catch turns that into the same message-and-exit.
57
107
  */
58
- export function logLevelOption(value) {
59
- return value === undefined ? undefined : parseLogLevelOption(value);
108
+ export function logOptions(options) {
109
+ const level = (flag) => {
110
+ const value = options[flag];
111
+ return value === undefined ? undefined : parseLogLevelOption(value, flag);
112
+ };
113
+ const logFile = options[LOG_FILE_FLAG];
114
+ return {
115
+ logLevel: level(LOG_LEVEL_FLAG),
116
+ logFile: logFile === undefined ? undefined : path.resolve(logFile),
117
+ logFileLevel: level(LOG_FILE_LEVEL_FLAG)
118
+ };
60
119
  }
61
120
  /**
62
121
  * Whether the argv asks for the command's help rather than describing a run.
@@ -92,12 +151,12 @@ export function printHelp(lines) {
92
151
  }
93
152
  /**
94
153
  * Shared parser for the headless-harness subcommands. Consumes the required
95
- * `--services <module>` value flag and a single positional `<workspace>`, plus
96
- * the `valueFlags` (each takes a value) and `boolFlags` (presence-only, recorded
97
- * as `'true'`) the subcommand recognises. Unknown flags or a missing
98
- * `--services`/`<workspace>` are usage errors, and so is a `<workspace>` that
99
- * reaches no directory — see {@link resolveWorkspaceArgument} for why that cannot
100
- * be left to the run.
154
+ * `--services <module>` value flag, the repeatable `--import <specifier>` and a
155
+ * single positional `<workspace>`, plus the `valueFlags` (each takes a value)
156
+ * and `boolFlags` (presence-only, recorded as `'true'`) the subcommand
157
+ * recognises. Unknown flags or a missing `--services`/`<workspace>` are usage
158
+ * errors, and so is a `<workspace>` that reaches no directory — see
159
+ * {@link resolveWorkspaceArgument} for why that cannot be left to the run.
101
160
  */
102
161
  export function parseHarnessArgs(args, commandName, valueFlags, boolFlags, config = {}) {
103
162
  const requireWorkspace = config.requireWorkspace ?? true;
@@ -108,6 +167,7 @@ export function parseHarnessArgs(args, commandName, valueFlags, boolFlags, confi
108
167
  const options = {};
109
168
  const values = {};
110
169
  let servicesModule;
170
+ let imports;
111
171
  let workspace;
112
172
  for (let index = 0; index < args.length; index += 1) {
113
173
  const flag = args[index];
@@ -119,9 +179,12 @@ export function parseHarnessArgs(args, commandName, valueFlags, boolFlags, confi
119
179
  index += 1;
120
180
  return value;
121
181
  };
122
- if (flag === '--services') {
182
+ if (flag === SERVICES_FLAG) {
123
183
  servicesModule = next();
124
184
  }
185
+ else if (flag === IMPORT_FLAG) {
186
+ (imports ??= []).push(next());
187
+ }
125
188
  else if (boolSet.has(flag)) {
126
189
  options[flag] = 'true';
127
190
  }
@@ -142,7 +205,8 @@ export function parseHarnessArgs(args, commandName, valueFlags, boolFlags, confi
142
205
  }
143
206
  }
144
207
  return {
145
- servicesModule: assertRequired(servicesModule, '--services', commandName, onError),
208
+ servicesModule: assertRequired(servicesModule, SERVICES_FLAG, commandName, onError),
209
+ imports,
146
210
  workspace: requireWorkspace
147
211
  ? resolveWorkspaceArgument(assertRequired(workspace, '<workspace>', commandName, onError), commandName, onError)
148
212
  : (workspace ?? ''),
@@ -186,7 +250,7 @@ export function resolveWorkspaceArgument(workspace, commandName, onError = exitW
186
250
  stats = statSync(resolved, { throwIfNoEntry: false });
187
251
  }
188
252
  catch (err) {
189
- const detail = err instanceof Error ? err.message : String(err);
253
+ const detail = describeError(err);
190
254
  onError(`<workspace> is not reachable: '${workspace}' resolved to ${resolved} (${detail}) ${help}`);
191
255
  }
192
256
  if (stats === undefined) {
@@ -205,7 +269,7 @@ function toWorkspacePath(workspace, commandName, onError) {
205
269
  return fileURLToPath(workspace);
206
270
  }
207
271
  catch (err) {
208
- const detail = err instanceof Error ? err.message : String(err);
272
+ const detail = describeError(err);
209
273
  onError(`<workspace> is not a usable file URI: '${workspace}' (${detail}) (hydranium-cli ${commandName} --help)`);
210
274
  }
211
275
  }
@@ -271,10 +335,10 @@ function isRelativePathToken(token, isCommand) {
271
335
  }
272
336
  /**
273
337
  * Shared option parser for subcommands that spawn a data-server child. Consumes
274
- * `--server` / `--cwd` / `--log-level` and returns the surviving tokens as
338
+ * `--server` / `--cwd` / the {@link LOG_VALUE_FLAGS} and returns the surviving tokens as
275
339
  * `extra` for {@link parseFlagOptions} to finish.
276
340
  *
277
- * An unrecognised `--log-level` value throws rather than reaching `onError`: the
341
+ * An unrecognised log level value throws rather than reaching `onError`: the
278
342
  * level vocabulary belongs to the protocol package, which reports it, and the
279
343
  * entry point's catch turns that into the same message-and-exit.
280
344
  *
@@ -291,7 +355,7 @@ function isRelativePathToken(token, isCommand) {
291
355
  export function parseServerSpawnOptions(args, commandName, onError = exitWithUsage) {
292
356
  let serverSpec;
293
357
  let cwd;
294
- let logLevel;
358
+ const logFlags = {};
295
359
  const extra = [];
296
360
  for (let index = 0; index < args.length; index += 1) {
297
361
  const flag = args[index];
@@ -309,8 +373,8 @@ export function parseServerSpawnOptions(args, commandName, onError = exitWithUsa
309
373
  else if (flag === '--cwd') {
310
374
  cwd = claim();
311
375
  }
312
- else if (flag === LOG_LEVEL_FLAG) {
313
- logLevel = parseLogLevelOption(claim());
376
+ else if (LOG_VALUE_FLAGS.includes(flag)) {
377
+ logFlags[flag] = claim();
314
378
  }
315
379
  else {
316
380
  extra.push(flag);
@@ -334,6 +398,6 @@ export function parseServerSpawnOptions(args, commandName, onError = exitWithUsa
334
398
  `give the workspace to the entry as its own argument (hydranium-cli ${commandName} --help)`);
335
399
  }
336
400
  }
337
- return { serverCommand, serverArgs, cwd, logLevel, extra };
401
+ return { serverCommand, serverArgs, cwd, ...logOptions(logFlags), extra };
338
402
  }
339
403
  //# sourceMappingURL=harness-args.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"harness-args.js","sourceRoot":"","sources":["../../src/commands/harness-args.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AA2BlF,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAQtD;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,OAAe;IAC1C,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACvB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC;AAED,mGAAmG;AACnG,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAC;AAE1C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAC;AAE5C,uEAAuE;AACvE,MAAM,CAAC,MAAM,wBAAwB,GAAsB,CAAC,UAAU,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;AAEjG;;;;;;;;G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AC9F,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC1B,OAAO,CACJ,2DAA2D,QAAQ,kCAAkC;gBAClG,YAAY,GAAG,wFAAwF;gBACvG,sEAAsE,WAAW,UAAU,CAChG,CAAC;QACL,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,UAAU,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC;AAC7E,CAAC"}
@@ -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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