@hydranium/cli 1.0.0-next.28 → 1.0.0-next.280
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.
- package/README.md +75 -204
- package/bin/hydranium-cli.js +13 -0
- package/heap-analysis/heap/core/load.mjs +2 -2
- package/lib/cli-version.js.map +1 -1
- package/lib/cli.js +7 -2
- package/lib/cli.js.map +1 -1
- package/lib/commands/analyze-heap-args.js.map +1 -1
- package/lib/commands/analyze-heap.d.ts +3 -0
- package/lib/commands/analyze-heap.d.ts.map +1 -1
- package/lib/commands/analyze-heap.js +2 -1
- package/lib/commands/analyze-heap.js.map +1 -1
- package/lib/commands/ast-ground-truth-args.d.ts +3 -2
- package/lib/commands/ast-ground-truth-args.d.ts.map +1 -1
- package/lib/commands/ast-ground-truth-args.js +11 -9
- package/lib/commands/ast-ground-truth-args.js.map +1 -1
- package/lib/commands/ast-ground-truth-driver.js +2 -1
- package/lib/commands/ast-ground-truth-driver.js.map +1 -1
- package/lib/commands/ast-ground-truth.js +1 -1
- package/lib/commands/ast-ground-truth.js.map +1 -1
- package/lib/commands/client-session.d.ts +17 -0
- package/lib/commands/client-session.d.ts.map +1 -0
- package/lib/commands/client-session.js +27 -0
- package/lib/commands/client-session.js.map +1 -0
- package/lib/commands/create-args.d.ts +17 -0
- package/lib/commands/create-args.d.ts.map +1 -0
- package/lib/commands/create-args.js +53 -0
- package/lib/commands/create-args.js.map +1 -0
- package/lib/commands/create.d.ts +38 -0
- package/lib/commands/create.d.ts.map +1 -0
- package/lib/commands/create.js +47 -0
- package/lib/commands/create.js.map +1 -0
- package/lib/commands/delete-args.d.ts +17 -0
- package/lib/commands/delete-args.d.ts.map +1 -0
- package/lib/commands/delete-args.js +49 -0
- package/lib/commands/delete-args.js.map +1 -0
- package/lib/commands/delete.d.ts +30 -0
- package/lib/commands/delete.d.ts.map +1 -0
- package/lib/commands/delete.js +32 -0
- package/lib/commands/delete.js.map +1 -0
- package/lib/commands/generate-ast-builder.d.ts +49 -0
- package/lib/commands/generate-ast-builder.d.ts.map +1 -0
- package/lib/commands/generate-ast-builder.js +200 -0
- package/lib/commands/generate-ast-builder.js.map +1 -0
- package/lib/commands/generate-transfer-model-args.d.ts.map +1 -1
- package/lib/commands/generate-transfer-model-args.js +11 -1
- package/lib/commands/generate-transfer-model-args.js.map +1 -1
- package/lib/commands/generate-transfer-model-config.d.ts.map +1 -1
- package/lib/commands/generate-transfer-model-config.js +6 -3
- package/lib/commands/generate-transfer-model-config.js.map +1 -1
- package/lib/commands/generate-transfer-model.d.ts +9 -0
- package/lib/commands/generate-transfer-model.d.ts.map +1 -1
- package/lib/commands/generate-transfer-model.js +18 -4
- package/lib/commands/generate-transfer-model.js.map +1 -1
- package/lib/commands/harness-args.d.ts +44 -42
- package/lib/commands/harness-args.d.ts.map +1 -1
- package/lib/commands/harness-args.js +109 -27
- package/lib/commands/harness-args.js.map +1 -1
- package/lib/commands/headless-harness.d.ts +37 -20
- package/lib/commands/headless-harness.d.ts.map +1 -1
- package/lib/commands/headless-harness.js +68 -17
- package/lib/commands/headless-harness.js.map +1 -1
- package/lib/commands/init-args.js +6 -6
- package/lib/commands/init-args.js.map +1 -1
- package/lib/commands/init-prompt.d.ts.map +1 -1
- package/lib/commands/init-templates.d.ts +8 -10
- package/lib/commands/init-templates.d.ts.map +1 -1
- package/lib/commands/init-templates.js +261 -167
- package/lib/commands/init-templates.js.map +1 -1
- package/lib/commands/init-wizard.js +4 -4
- package/lib/commands/init-wizard.js.map +1 -1
- package/lib/commands/init-workspace.d.ts +13 -3
- package/lib/commands/init-workspace.d.ts.map +1 -1
- package/lib/commands/init-workspace.js +21 -6
- package/lib/commands/init-workspace.js.map +1 -1
- package/lib/commands/init.d.ts +16 -10
- package/lib/commands/init.d.ts.map +1 -1
- package/lib/commands/init.js +17 -15
- package/lib/commands/init.js.map +1 -1
- package/lib/commands/lint-grammar-args.d.ts +3 -2
- package/lib/commands/lint-grammar-args.d.ts.map +1 -1
- package/lib/commands/lint-grammar-args.js +13 -10
- package/lib/commands/lint-grammar-args.js.map +1 -1
- package/lib/commands/lint-grammar-driver.js +2 -1
- package/lib/commands/lint-grammar-driver.js.map +1 -1
- package/lib/commands/lint-grammar-report.js.map +1 -1
- package/lib/commands/lint-grammar.js +1 -1
- package/lib/commands/lint-grammar.js.map +1 -1
- package/lib/commands/measure-memory-args.d.ts +3 -2
- package/lib/commands/measure-memory-args.d.ts.map +1 -1
- package/lib/commands/measure-memory-args.js +22 -11
- package/lib/commands/measure-memory-args.js.map +1 -1
- package/lib/commands/measure-memory-driver.js +5 -3
- package/lib/commands/measure-memory-driver.js.map +1 -1
- package/lib/commands/measure-memory.js +1 -1
- package/lib/commands/measure-memory.js.map +1 -1
- package/lib/commands/model-docs-args.d.ts +4 -3
- package/lib/commands/model-docs-args.d.ts.map +1 -1
- package/lib/commands/model-docs-args.js +12 -10
- package/lib/commands/model-docs-args.js.map +1 -1
- package/lib/commands/model-docs-driver.js +2 -1
- package/lib/commands/model-docs-driver.js.map +1 -1
- package/lib/commands/model-docs.js +1 -1
- package/lib/commands/model-docs.js.map +1 -1
- package/lib/commands/projects-args.d.ts.map +1 -1
- package/lib/commands/projects-args.js +5 -5
- package/lib/commands/projects-args.js.map +1 -1
- package/lib/commands/projects.d.ts +3 -4
- package/lib/commands/projects.d.ts.map +1 -1
- package/lib/commands/projects.js +2 -2
- package/lib/commands/projects.js.map +1 -1
- package/lib/commands/query-args.d.ts.map +1 -1
- package/lib/commands/query-args.js +5 -5
- package/lib/commands/query-args.js.map +1 -1
- package/lib/commands/query.d.ts +3 -4
- package/lib/commands/query.d.ts.map +1 -1
- package/lib/commands/query.js +2 -2
- package/lib/commands/query.js.map +1 -1
- package/lib/commands/reflect-args.d.ts +3 -2
- package/lib/commands/reflect-args.d.ts.map +1 -1
- package/lib/commands/reflect-args.js +13 -10
- package/lib/commands/reflect-args.js.map +1 -1
- package/lib/commands/reflect-driver.js +2 -1
- package/lib/commands/reflect-driver.js.map +1 -1
- package/lib/commands/reflect-report.js.map +1 -1
- package/lib/commands/reflect.js +1 -1
- package/lib/commands/reflect.js.map +1 -1
- package/lib/commands/save-args.d.ts.map +1 -1
- package/lib/commands/save-args.js +7 -4
- package/lib/commands/save-args.js.map +1 -1
- package/lib/commands/save.d.ts +8 -4
- package/lib/commands/save.d.ts.map +1 -1
- package/lib/commands/save.js +12 -23
- package/lib/commands/save.js.map +1 -1
- package/lib/commands/validate-args.d.ts +3 -2
- package/lib/commands/validate-args.d.ts.map +1 -1
- package/lib/commands/validate-args.js +13 -10
- package/lib/commands/validate-args.js.map +1 -1
- package/lib/commands/validate-driver.js +2 -1
- package/lib/commands/validate-driver.js.map +1 -1
- package/lib/commands/validate-report.js.map +1 -1
- package/lib/commands/validate.js +1 -1
- package/lib/commands/validate.js.map +1 -1
- package/lib/commands/watch-args.d.ts.map +1 -1
- package/lib/commands/watch-args.js +6 -4
- package/lib/commands/watch-args.js.map +1 -1
- package/lib/commands/watch.d.ts +3 -4
- package/lib/commands/watch.d.ts.map +1 -1
- package/lib/commands/watch.js +20 -2
- package/lib/commands/watch.js.map +1 -1
- package/lib/driver-heap.d.ts +52 -0
- package/lib/driver-heap.d.ts.map +1 -0
- package/lib/driver-heap.js +51 -0
- package/lib/driver-heap.js.map +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -1
- package/lib/log-level.d.ts +21 -11
- package/lib/log-level.d.ts.map +1 -1
- package/lib/log-level.js +25 -14
- package/lib/log-level.js.map +1 -1
- package/lib/spawn-data-server.d.ts +9 -4
- package/lib/spawn-data-server.d.ts.map +1 -1
- package/lib/spawn-data-server.js +5 -4
- package/lib/spawn-data-server.js.map +1 -1
- package/lib/stderr-connection-logger.d.ts +12 -0
- package/lib/stderr-connection-logger.d.ts.map +1 -0
- package/lib/stderr-connection-logger.js +16 -0
- package/lib/stderr-connection-logger.js.map +1 -0
- package/lib/testing/echo-server.js +9 -1
- package/lib/testing/echo-server.js.map +1 -1
- package/package.json +50 -39
- package/src/cli.ts +7 -2
- package/src/commands/analyze-heap.ts +4 -1
- package/src/commands/ast-ground-truth-args.ts +15 -12
- package/src/commands/ast-ground-truth-driver.ts +2 -1
- package/src/commands/ast-ground-truth.ts +1 -1
- package/src/commands/client-session.ts +33 -0
- package/src/commands/create-args.ts +68 -0
- package/src/commands/create.ts +86 -0
- package/src/commands/delete-args.ts +64 -0
- package/src/commands/delete.ts +61 -0
- package/src/commands/generate-ast-builder.ts +246 -0
- package/src/commands/generate-transfer-model-args.ts +11 -1
- package/src/commands/generate-transfer-model-config.ts +6 -3
- package/src/commands/generate-transfer-model.ts +27 -4
- package/src/commands/harness-args.ts +95 -31
- package/src/commands/headless-harness.ts +86 -26
- package/src/commands/init-args.ts +6 -6
- package/src/commands/init-templates.ts +272 -169
- package/src/commands/init-wizard.ts +4 -4
- package/src/commands/init-workspace.ts +31 -7
- package/src/commands/init.ts +36 -26
- package/src/commands/lint-grammar-args.ts +17 -13
- package/src/commands/lint-grammar-driver.ts +2 -1
- package/src/commands/lint-grammar.ts +1 -1
- package/src/commands/measure-memory-args.ts +27 -14
- package/src/commands/measure-memory-driver.ts +5 -3
- package/src/commands/measure-memory.ts +1 -1
- package/src/commands/model-docs-args.ts +16 -13
- package/src/commands/model-docs-driver.ts +2 -1
- package/src/commands/model-docs.ts +1 -1
- package/src/commands/projects-args.ts +5 -4
- package/src/commands/projects.ts +4 -6
- package/src/commands/query-args.ts +5 -4
- package/src/commands/query.ts +4 -6
- package/src/commands/reflect-args.ts +17 -13
- package/src/commands/reflect-driver.ts +2 -1
- package/src/commands/reflect.ts +1 -1
- package/src/commands/save-args.ts +7 -3
- package/src/commands/save.ts +24 -27
- package/src/commands/validate-args.ts +17 -13
- package/src/commands/validate-driver.ts +2 -1
- package/src/commands/validate.ts +1 -1
- package/src/commands/watch-args.ts +6 -3
- package/src/commands/watch.ts +28 -7
- package/src/driver-heap.ts +65 -0
- package/src/index.ts +3 -0
- package/src/log-level.ts +42 -14
- package/src/spawn-data-server.ts +17 -5
- package/src/stderr-connection-logger.ts +18 -0
- 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
|
-
/**
|
|
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`
|
|
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
|
|
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
|
|
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
|
|
72
|
-
*
|
|
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
|
|
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
|
|
126
|
-
* the `valueFlags` (each takes a value)
|
|
127
|
-
* as `'true'`) the subcommand
|
|
128
|
-
* `--services`/`<workspace>` are usage
|
|
129
|
-
*
|
|
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` /
|
|
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
|
|
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
|
*
|
|
@@ -195,4 +190,11 @@ export interface SpawnOptions {
|
|
|
195
190
|
* the workspace to the entry, both say what they mean.
|
|
196
191
|
*/
|
|
197
192
|
export declare function parseServerSpawnOptions(args: string[], commandName: string, onError?: UsageError): SpawnOptions;
|
|
193
|
+
/**
|
|
194
|
+
* Resolve the `--content` argument to its textual form. The `@<path>`
|
|
195
|
+
* prefix reads from a file (parses as UTF-8); anything else is taken
|
|
196
|
+
* literally. The leading `@` can be escaped as `\@` for content that
|
|
197
|
+
* legitimately starts with `@`.
|
|
198
|
+
*/
|
|
199
|
+
export declare function resolveContent(content: string, readFile?: (path: string) => Promise<string>): Promise<string>;
|
|
198
200
|
//# sourceMappingURL=harness-args.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harness-args.d.ts","sourceRoot":"","sources":["../../src/commands/harness-args.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;
|
|
1
|
+
{"version":3,"file":"harness-args.d.ts","sourceRoot":"","sources":["../../src/commands/harness-args.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AA+BlF,OAAO,EAAE,KAAK,UAAU,EAAuB,MAAM,iBAAiB,CAAC;AAEvE;;;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,8EAA8E;AAC9E,eAAO,MAAM,aAAa,eAAe,CAAC;AAE1C;;;GAGG;AACH,eAAO,MAAM,WAAW,aAAa,CAAC;AAEtC,oGAAoG;AACpG,eAAO,MAAM,mBAAmB,qCAAwC,CAAC;AAEzE;;;;;;;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AM,EAAE,CAAC;CAClB;AAkBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,GAAE,UAA0B,GAAG,YAAY,CA8C9H;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAUnH"}
|
|
@@ -6,7 +6,32 @@
|
|
|
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';
|
|
34
|
+
import * as fs from 'node:fs/promises';
|
|
10
35
|
import * as path from 'node:path';
|
|
11
36
|
import { fileURLToPath } from 'node:url';
|
|
12
37
|
import { parseLogLevelOption } from '../log-level.js';
|
|
@@ -22,8 +47,15 @@ export function exitWithUsage(message) {
|
|
|
22
47
|
console.error(message);
|
|
23
48
|
process.exit(2);
|
|
24
49
|
}
|
|
25
|
-
/**
|
|
50
|
+
/** Names the head's services module; every harness subcommand requires it. */
|
|
26
51
|
export const SERVICES_FLAG = '--services';
|
|
52
|
+
/**
|
|
53
|
+
* Registers a loader in the driver child that imports the head. The child is a
|
|
54
|
+
* fresh `node`, so a loader registered on the CLI's own process never reaches it.
|
|
55
|
+
*/
|
|
56
|
+
export const IMPORT_FLAG = '--import';
|
|
57
|
+
/** The value flags {@link parseHarnessArgs} consumes itself, before any the subcommand declares. */
|
|
58
|
+
export const HARNESS_VALUE_FLAGS = [SERVICES_FLAG, IMPORT_FLAG];
|
|
27
59
|
/**
|
|
28
60
|
* The one spelling of the log threshold, shared by both subcommand families.
|
|
29
61
|
*
|
|
@@ -33,30 +65,58 @@ export const SERVICES_FLAG = '--services';
|
|
|
33
65
|
* on which command a caller happened to reach for.
|
|
34
66
|
*/
|
|
35
67
|
export const LOG_LEVEL_FLAG = '--log-level';
|
|
68
|
+
export const LOG_FILE_FLAG = '--log-file';
|
|
69
|
+
export const LOG_FILE_LEVEL_FLAG = '--log-file-level';
|
|
70
|
+
/** The log flags every subcommand takes, read by {@link logOptions}. */
|
|
71
|
+
export const LOG_VALUE_FLAGS = [LOG_LEVEL_FLAG, LOG_FILE_FLAG, LOG_FILE_LEVEL_FLAG];
|
|
36
72
|
/** The value flags {@link parseServerSpawnOptions} consumes itself. */
|
|
37
|
-
export const SERVER_SPAWN_VALUE_FLAGS = ['--server', '--cwd',
|
|
73
|
+
export const SERVER_SPAWN_VALUE_FLAGS = ['--server', '--cwd', ...LOG_VALUE_FLAGS];
|
|
38
74
|
/**
|
|
39
|
-
* The `--help`
|
|
75
|
+
* The `--help` lines every subcommand describes {@link LOG_VALUE_FLAGS} with.
|
|
40
76
|
*
|
|
41
77
|
* Shared text, per-command padding: `command-args.test.ts` compares the flags a
|
|
42
78
|
* help block DESCRIBES against the flags the parser accepts, and it recognises a
|
|
43
|
-
* description by the two-space indent — so
|
|
79
|
+
* description by the two-space indent — so each line has to be a real option entry
|
|
44
80
|
* in each block, and the column each block aligns its descriptions at is the
|
|
45
|
-
* block's own.
|
|
81
|
+
* block's own. A flag too wide for that column takes its description on the
|
|
82
|
+
* next line, at the column.
|
|
46
83
|
*/
|
|
47
|
-
export function
|
|
48
|
-
return
|
|
84
|
+
export function logHelpLines(padTo, head = 'the head this boots') {
|
|
85
|
+
return [
|
|
86
|
+
helpLine(`${LOG_LEVEL_FLAG} <lvl>`, `Log threshold for ${head} (off|error|warn|info|debug|trace).`, padTo),
|
|
87
|
+
helpLine(`${LOG_FILE_FLAG} <file>`, `Also write ${head}'s log to <file>; {workspace} expands to the workspace.`, padTo),
|
|
88
|
+
helpLine(`${LOG_FILE_LEVEL_FLAG} <lvl>`, `Threshold for that file, which the log-level setting does not change.`, padTo)
|
|
89
|
+
].flat();
|
|
90
|
+
}
|
|
91
|
+
/** The `--help` lines every `--services` subcommand describes {@link IMPORT_FLAG} with, aligned as {@link logHelpLines}. */
|
|
92
|
+
export function importHelpLines(padTo) {
|
|
93
|
+
return helpLine(`${IMPORT_FLAG} <specifier>`, 'Loader to register before importing <module>, e.g. tsx (repeatable).', padTo);
|
|
94
|
+
}
|
|
95
|
+
function helpLine(flag, text, padTo) {
|
|
96
|
+
return flag.length < padTo - 1 ? [` ${flag.padEnd(padTo)}${text}`] : [` ${flag}`, `${' '.repeat(padTo + 2)}${text}`];
|
|
49
97
|
}
|
|
50
98
|
/**
|
|
51
|
-
* Narrow
|
|
52
|
-
*
|
|
99
|
+
* Narrow the raw {@link LOG_VALUE_FLAGS} values a parser collected, leaving
|
|
100
|
+
* absent flags absent.
|
|
101
|
+
*
|
|
102
|
+
* `--log-file` resolves against the caller's directory: the child may run
|
|
103
|
+
* elsewhere (`--cwd`), and a relative path would land the log there.
|
|
53
104
|
*
|
|
54
105
|
* Throws rather than reaching `onError`, matching {@link parseServerSpawnOptions}:
|
|
55
106
|
* the level vocabulary belongs to the protocol package, which reports it, and the
|
|
56
107
|
* entry point's catch turns that into the same message-and-exit.
|
|
57
108
|
*/
|
|
58
|
-
export function
|
|
59
|
-
|
|
109
|
+
export function logOptions(options) {
|
|
110
|
+
const level = (flag) => {
|
|
111
|
+
const value = options[flag];
|
|
112
|
+
return value === undefined ? undefined : parseLogLevelOption(value, flag);
|
|
113
|
+
};
|
|
114
|
+
const logFile = options[LOG_FILE_FLAG];
|
|
115
|
+
return {
|
|
116
|
+
logLevel: level(LOG_LEVEL_FLAG),
|
|
117
|
+
logFile: logFile === undefined ? undefined : path.resolve(logFile),
|
|
118
|
+
logFileLevel: level(LOG_FILE_LEVEL_FLAG)
|
|
119
|
+
};
|
|
60
120
|
}
|
|
61
121
|
/**
|
|
62
122
|
* Whether the argv asks for the command's help rather than describing a run.
|
|
@@ -92,12 +152,12 @@ export function printHelp(lines) {
|
|
|
92
152
|
}
|
|
93
153
|
/**
|
|
94
154
|
* Shared parser for the headless-harness subcommands. Consumes the required
|
|
95
|
-
* `--services <module>` value flag
|
|
96
|
-
* the `valueFlags` (each takes a value)
|
|
97
|
-
* as `'true'`) the subcommand
|
|
98
|
-
* `--services`/`<workspace>` are usage
|
|
99
|
-
*
|
|
100
|
-
* be left to the run.
|
|
155
|
+
* `--services <module>` value flag, the repeatable `--import <specifier>` and a
|
|
156
|
+
* single positional `<workspace>`, plus the `valueFlags` (each takes a value)
|
|
157
|
+
* and `boolFlags` (presence-only, recorded as `'true'`) the subcommand
|
|
158
|
+
* recognises. Unknown flags or a missing `--services`/`<workspace>` are usage
|
|
159
|
+
* errors, and so is a `<workspace>` that reaches no directory — see
|
|
160
|
+
* {@link resolveWorkspaceArgument} for why that cannot be left to the run.
|
|
101
161
|
*/
|
|
102
162
|
export function parseHarnessArgs(args, commandName, valueFlags, boolFlags, config = {}) {
|
|
103
163
|
const requireWorkspace = config.requireWorkspace ?? true;
|
|
@@ -108,6 +168,7 @@ export function parseHarnessArgs(args, commandName, valueFlags, boolFlags, confi
|
|
|
108
168
|
const options = {};
|
|
109
169
|
const values = {};
|
|
110
170
|
let servicesModule;
|
|
171
|
+
let imports;
|
|
111
172
|
let workspace;
|
|
112
173
|
for (let index = 0; index < args.length; index += 1) {
|
|
113
174
|
const flag = args[index];
|
|
@@ -119,9 +180,12 @@ export function parseHarnessArgs(args, commandName, valueFlags, boolFlags, confi
|
|
|
119
180
|
index += 1;
|
|
120
181
|
return value;
|
|
121
182
|
};
|
|
122
|
-
if (flag ===
|
|
183
|
+
if (flag === SERVICES_FLAG) {
|
|
123
184
|
servicesModule = next();
|
|
124
185
|
}
|
|
186
|
+
else if (flag === IMPORT_FLAG) {
|
|
187
|
+
(imports ??= []).push(next());
|
|
188
|
+
}
|
|
125
189
|
else if (boolSet.has(flag)) {
|
|
126
190
|
options[flag] = 'true';
|
|
127
191
|
}
|
|
@@ -142,7 +206,8 @@ export function parseHarnessArgs(args, commandName, valueFlags, boolFlags, confi
|
|
|
142
206
|
}
|
|
143
207
|
}
|
|
144
208
|
return {
|
|
145
|
-
servicesModule: assertRequired(servicesModule,
|
|
209
|
+
servicesModule: assertRequired(servicesModule, SERVICES_FLAG, commandName, onError),
|
|
210
|
+
imports,
|
|
146
211
|
workspace: requireWorkspace
|
|
147
212
|
? resolveWorkspaceArgument(assertRequired(workspace, '<workspace>', commandName, onError), commandName, onError)
|
|
148
213
|
: (workspace ?? ''),
|
|
@@ -186,7 +251,7 @@ export function resolveWorkspaceArgument(workspace, commandName, onError = exitW
|
|
|
186
251
|
stats = statSync(resolved, { throwIfNoEntry: false });
|
|
187
252
|
}
|
|
188
253
|
catch (err) {
|
|
189
|
-
const detail =
|
|
254
|
+
const detail = describeError(err);
|
|
190
255
|
onError(`<workspace> is not reachable: '${workspace}' resolved to ${resolved} (${detail}) ${help}`);
|
|
191
256
|
}
|
|
192
257
|
if (stats === undefined) {
|
|
@@ -205,7 +270,7 @@ function toWorkspacePath(workspace, commandName, onError) {
|
|
|
205
270
|
return fileURLToPath(workspace);
|
|
206
271
|
}
|
|
207
272
|
catch (err) {
|
|
208
|
-
const detail =
|
|
273
|
+
const detail = describeError(err);
|
|
209
274
|
onError(`<workspace> is not a usable file URI: '${workspace}' (${detail}) (hydranium-cli ${commandName} --help)`);
|
|
210
275
|
}
|
|
211
276
|
}
|
|
@@ -271,10 +336,10 @@ function isRelativePathToken(token, isCommand) {
|
|
|
271
336
|
}
|
|
272
337
|
/**
|
|
273
338
|
* Shared option parser for subcommands that spawn a data-server child. Consumes
|
|
274
|
-
* `--server` / `--cwd` /
|
|
339
|
+
* `--server` / `--cwd` / the {@link LOG_VALUE_FLAGS} and returns the surviving tokens as
|
|
275
340
|
* `extra` for {@link parseFlagOptions} to finish.
|
|
276
341
|
*
|
|
277
|
-
* An unrecognised
|
|
342
|
+
* An unrecognised log level value throws rather than reaching `onError`: the
|
|
278
343
|
* level vocabulary belongs to the protocol package, which reports it, and the
|
|
279
344
|
* entry point's catch turns that into the same message-and-exit.
|
|
280
345
|
*
|
|
@@ -291,7 +356,7 @@ function isRelativePathToken(token, isCommand) {
|
|
|
291
356
|
export function parseServerSpawnOptions(args, commandName, onError = exitWithUsage) {
|
|
292
357
|
let serverSpec;
|
|
293
358
|
let cwd;
|
|
294
|
-
|
|
359
|
+
const logFlags = {};
|
|
295
360
|
const extra = [];
|
|
296
361
|
for (let index = 0; index < args.length; index += 1) {
|
|
297
362
|
const flag = args[index];
|
|
@@ -309,8 +374,8 @@ export function parseServerSpawnOptions(args, commandName, onError = exitWithUsa
|
|
|
309
374
|
else if (flag === '--cwd') {
|
|
310
375
|
cwd = claim();
|
|
311
376
|
}
|
|
312
|
-
else if (flag
|
|
313
|
-
|
|
377
|
+
else if (LOG_VALUE_FLAGS.includes(flag)) {
|
|
378
|
+
logFlags[flag] = claim();
|
|
314
379
|
}
|
|
315
380
|
else {
|
|
316
381
|
extra.push(flag);
|
|
@@ -334,6 +399,23 @@ export function parseServerSpawnOptions(args, commandName, onError = exitWithUsa
|
|
|
334
399
|
`give the workspace to the entry as its own argument (hydranium-cli ${commandName} --help)`);
|
|
335
400
|
}
|
|
336
401
|
}
|
|
337
|
-
return { serverCommand, serverArgs, cwd,
|
|
402
|
+
return { serverCommand, serverArgs, cwd, ...logOptions(logFlags), extra };
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Resolve the `--content` argument to its textual form. The `@<path>`
|
|
406
|
+
* prefix reads from a file (parses as UTF-8); anything else is taken
|
|
407
|
+
* literally. The leading `@` can be escaped as `\@` for content that
|
|
408
|
+
* legitimately starts with `@`.
|
|
409
|
+
*/
|
|
410
|
+
export async function resolveContent(content, readFile) {
|
|
411
|
+
if (content.startsWith('@')) {
|
|
412
|
+
const file = content.slice(1);
|
|
413
|
+
const reader = readFile ?? ((target) => fs.readFile(target, 'utf8'));
|
|
414
|
+
return reader(file);
|
|
415
|
+
}
|
|
416
|
+
if (content.startsWith('\\@')) {
|
|
417
|
+
return content.slice(1);
|
|
418
|
+
}
|
|
419
|
+
return content;
|
|
338
420
|
}
|
|
339
421
|
//# 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,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AAC,CAAC;IAC3B,CAAC;IACD,OAAO,OAAO,CAAC;AAClB,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
|
|
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
|
|
34
|
-
*
|
|
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)
|
|
38
|
-
*
|
|
39
|
-
*
|
|
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
|
-
/**
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
|
85
|
-
* head's logger reads `
|
|
86
|
-
* which is inside the driver's dynamic import — a flag the driver
|
|
87
|
-
* arrive after the only moment it can be read. Setting
|
|
88
|
-
* exporting
|
|
89
|
-
*
|
|
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;
|
|
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;AAM/D,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAU,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG1D,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,CA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